This commit is contained in:
Manav Rathi
2024-04-13 10:14:04 +05:30
parent 02abe24213
commit 75e693186a
2 changed files with 1 additions and 10 deletions

View File

@@ -44,19 +44,11 @@ export async function storeFaceCrop(
blobOptions: BlobOptions,
): Promise<StoredFaceCrop> {
const faceCropBlob = await imageBitmapToBlob(faceCrop.image, blobOptions);
return storeFaceCropForBlob(faceId, faceCrop.imageBox, faceCropBlob);
}
async function storeFaceCropForBlob(
faceId: string,
imageBox: Box,
faceCropBlob: Blob,
) {
const faceCropUrl = `/${faceId}`;
const faceCropCache = await openCache("face-crops");
await faceCropCache.put(faceCropUrl, faceCropBlob);
return {
imageUrl: faceCropUrl,
imageBox: imageBox,
imageBox: faceCrop.imageBox,
};
}

View File

@@ -128,7 +128,6 @@ const openWebCache = async (name: BlobCacheNamespace) => {
return {
get: async (key: string) => {
const res = await cache.match(key);
console.log("found cache hit", key, res);
return await res?.blob();
},
put: (key: string, blob: Blob) => cache.put(key, new Response(blob)),