Support HEIF library imports in production
This commit is contained in:
parent
6657125a1e
commit
6c8092d4ad
@ -19,6 +19,12 @@ COPY . .
|
|||||||
|
|
||||||
FROM workspace-source AS node-runtime
|
FROM workspace-source AS node-runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
libheif1 \
|
||||||
|
libheif-plugin-libde265 \
|
||||||
|
libde265-0 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
FROM workspace-source AS admin-build
|
FROM workspace-source AS admin-build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
|
api:
|
||||||
|
volumes:
|
||||||
|
- ./assets/import-library:/app/assets/import-library:ro
|
||||||
|
|
||||||
admin:
|
admin:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
@ -10,7 +10,7 @@ interface ImportedAssetRecord {
|
|||||||
consent: ContributorConsent;
|
consent: ContributorConsent;
|
||||||
}
|
}
|
||||||
|
|
||||||
const supportedExtensions = new Set([".jpg", ".jpeg", ".png", ".webp"]);
|
const supportedExtensions = new Set([".jpg", ".jpeg", ".png", ".webp", ".heic", ".heif"]);
|
||||||
const repoRoot = path.dirname(config.storageDir);
|
const repoRoot = path.dirname(config.storageDir);
|
||||||
const importLibraryDir = path.join(repoRoot, "assets", "import-library");
|
const importLibraryDir = path.join(repoRoot, "assets", "import-library");
|
||||||
export const libraryWatchDirs = [importLibraryDir];
|
export const libraryWatchDirs = [importLibraryDir];
|
||||||
@ -135,6 +135,7 @@ export const createLibraryAssets = async () => {
|
|||||||
const imported: ImportedAssetRecord[] = [];
|
const imported: ImportedAssetRecord[] = [];
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
try {
|
||||||
const baseName = path.parse(file.relativeName).name;
|
const baseName = path.parse(file.relativeName).name;
|
||||||
const baseId = `library-photo-${toSlug(baseName)}`;
|
const baseId = `library-photo-${toSlug(baseName)}`;
|
||||||
const displayTitle = baseName.replace(/[-_]+/g, " ");
|
const displayTitle = baseName.replace(/[-_]+/g, " ");
|
||||||
@ -192,6 +193,9 @@ export const createLibraryAssets = async () => {
|
|||||||
dominantColor
|
dominantColor
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(`[library-import] Skipping ${file.relativeName}:`, error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return imported;
|
return imported;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user