Compare commits
2 Commits
feat/sync-
...
tmp/lcms
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb72de0c90 | ||
|
|
de57fecb69 |
@@ -920,6 +920,7 @@
|
|||||||
"cant_get_number_of_comments": "Can't get number of comments",
|
"cant_get_number_of_comments": "Can't get number of comments",
|
||||||
"cant_search_people": "Can't search people",
|
"cant_search_people": "Can't search people",
|
||||||
"cant_search_places": "Can't search places",
|
"cant_search_places": "Can't search places",
|
||||||
|
"clipboard_unsupported_mime_type": "The system clipboard does not support copying this type of content: {mimeType}",
|
||||||
"error_adding_assets_to_album": "Error adding assets to album",
|
"error_adding_assets_to_album": "Error adding assets to album",
|
||||||
"error_adding_users_to_album": "Error adding users to album",
|
"error_adding_users_to_album": "Error adding users to album",
|
||||||
"error_deleting_shared_user": "Error deleting shared user",
|
"error_deleting_shared_user": "Error deleting shared user",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM ghcr.io/immich-app/base-server-dev:202509091104@sha256:4f9275330f1e49e7ce9840758ea91839052fe6ed40972d5bb97a9af857fa956a AS builder
|
FROM ghcr.io/immich-app/base-server-dev:pr-272 AS builder
|
||||||
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
||||||
CI=1 \
|
CI=1 \
|
||||||
COREPACK_HOME=/tmp
|
COREPACK_HOME=/tmp
|
||||||
@@ -33,7 +33,7 @@ RUN pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install &&
|
|||||||
pnpm --filter @immich/sdk --filter @immich/cli build && \
|
pnpm --filter @immich/sdk --filter @immich/cli build && \
|
||||||
pnpm --filter @immich/cli --prod --no-optional deploy /output/cli-pruned
|
pnpm --filter @immich/cli --prod --no-optional deploy /output/cli-pruned
|
||||||
|
|
||||||
FROM ghcr.io/immich-app/base-server-prod:202509091104@sha256:d1ccbac24c84f2f8277cf85281edfca62d85d7daed6a62b8efd3a81bcd3c5e0e
|
FROM ghcr.io/immich-app/base-server-prod:pr-272
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
|
|||||||
@@ -97,12 +97,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await copyImageToClipboard($photoViewerImgElement ?? assetFileUrl);
|
const result = await copyImageToClipboard($photoViewerImgElement ?? assetFileUrl);
|
||||||
notificationController.show({
|
if (result.success) {
|
||||||
type: NotificationType.Info,
|
notificationController.show({ type: NotificationType.Info, message: $t('copied_image_to_clipboard') });
|
||||||
message: $t('copied_image_to_clipboard'),
|
} else {
|
||||||
timeout: 3000,
|
notificationController.show({
|
||||||
});
|
type: NotificationType.Error,
|
||||||
|
message: $t('errors.clipboard_unsupported_mime_type', { values: { mimeType: result.mimeType } }),
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, $t('copy_error'));
|
handleError(error, $t('copy_error'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -625,7 +625,21 @@ const urlToBlob = async (imageSource: string) => {
|
|||||||
return await response.blob();
|
return await response.blob();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const copyImageToClipboard = async (source: HTMLImageElement | string) => {
|
export const copyImageToClipboard = async (
|
||||||
const blob = source instanceof HTMLImageElement ? await imgToBlob(source) : await urlToBlob(source);
|
source: HTMLImageElement | string,
|
||||||
|
): Promise<{ success: true } | { success: false; mimeType: string }> => {
|
||||||
|
if (source instanceof HTMLImageElement) {
|
||||||
|
// do not await, so the Safari clipboard write happens in the context of the user gesture
|
||||||
|
await navigator.clipboard.write([new ClipboardItem({ ['image/png']: imgToBlob(source) })]);
|
||||||
|
return { success: true };
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we had a way to get the mime type synchronously, we could do the same thing here
|
||||||
|
const blob = await urlToBlob(source);
|
||||||
|
if (!ClipboardItem.supports(blob.type)) {
|
||||||
|
return { success: false, mimeType: blob.type };
|
||||||
|
}
|
||||||
|
|
||||||
await navigator.clipboard.write([new ClipboardItem({ [blob.type]: blob })]);
|
await navigator.clipboard.write([new ClipboardItem({ [blob.type]: blob })]);
|
||||||
|
return { success: true };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user