Support HEIF library imports in production

This commit is contained in:
vance 2026-04-08 10:50:40 -07:00
parent 6657125a1e
commit 6c8092d4ad
3 changed files with 68 additions and 54 deletions

View File

@ -19,6 +19,12 @@ COPY . .
FROM workspace-source AS node-runtime
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
WORKDIR /app

View File

@ -1,4 +1,8 @@
services:
api:
volumes:
- ./assets/import-library:/app/assets/import-library:ro
admin:
build:
context: .

View File

@ -10,7 +10,7 @@ interface ImportedAssetRecord {
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 importLibraryDir = path.join(repoRoot, "assets", "import-library");
export const libraryWatchDirs = [importLibraryDir];
@ -135,6 +135,7 @@ export const createLibraryAssets = async () => {
const imported: ImportedAssetRecord[] = [];
for (const file of files) {
try {
const baseName = path.parse(file.relativeName).name;
const baseId = `library-photo-${toSlug(baseName)}`;
const displayTitle = baseName.replace(/[-_]+/g, " ");
@ -192,6 +193,9 @@ export const createLibraryAssets = async () => {
dominantColor
})
);
} catch (error) {
console.warn(`[library-import] Skipping ${file.relativeName}:`, error);
}
}
return imported;