Inline
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user