diff --git a/src/app/(auth-state)/admin/photos/page.tsx b/src/app/(auth-state)/admin/photos/page.tsx index 05ca0477..02a54941 100644 --- a/src/app/(auth-state)/admin/photos/page.tsx +++ b/src/app/(auth-state)/admin/photos/page.tsx @@ -27,6 +27,7 @@ import AdminGrid from '@/admin/AdminGrid'; import DeleteButton from '@/admin/DeleteButton'; import EditButton from '@/admin/EditButton'; import BlobUrls from '@/admin/BlobUrls'; +import { PRO_MODE_ENABLED } from '@/site/config'; export const runtime = 'edge'; @@ -53,7 +54,7 @@ export default async function AdminTagsPage({ - + {blobPhotoUrls.length > 0 &&
{ if (blob) { - // await sleep(); - const newBlob = await CopyExif(file, blob, imageType); - // await sleep(); - onBlobReady?.(newBlob, extension); + const blobWithExif = await CopyExif(file, blob); + onBlobReady?.(blobWithExif, extension); } }, - imageType, + 'image/jpeg', quality, ); + } else { + // No need to process + onBlobReady?.(file); } } }} diff --git a/src/lib/CopyExif.ts b/src/lib/CopyExif.ts index 268759d1..edb8b4b4 100644 --- a/src/lib/CopyExif.ts +++ b/src/lib/CopyExif.ts @@ -11,7 +11,7 @@ const SOS = 0xffda; const APP1 = 0xffe1; const EXIF = 0x45786966; -const retrieveExif = (blob: Blob): any => +const retrieveExif = (blob: Blob): Promise => new Promise((resolve, reject) => { const reader = new FileReader(); reader.addEventListener('load', e => {