This commit is contained in:
test
2026-06-03 22:04:44 -05:00
parent cba42b236f
commit 4f82a3618a
7 changed files with 199 additions and 16 deletions
+7 -1
View File
@@ -117,6 +117,10 @@ async function buildThumbnailBytes(bytes: Uint8Array, format: string): Promise<U
return null;
}
if (typeof Bun.Image !== "function") {
return null;
}
const output = await new Bun.Image(bytes, {
autoOrient: true,
maxPixels: THUMBNAIL_WIDTH * THUMBNAIL_HEIGHT * 16,
@@ -160,7 +164,9 @@ export async function generateThumbnail(id: string): Promise<boolean> {
}
return true;
} catch (err) {
console.error(`[thumbnails] Failed to generate thumbnail for client ${id}:`, err);
if (typeof Bun.Image === "function") {
console.error(`[thumbnails] Failed to generate thumbnail for client ${id}:`, err);
}
return false;
}
}