MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / formatFileSize

Function formatFileSize

apps/web/src/hooks/useImageUpload.ts:127–131  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

125 canvas.height = dimensions.height;
126 const context = canvas.getContext('2d');
127 if (!context) {
128 throw new Error('Could not resize image');
129 }
130
131 context.drawImage(bitmap, 0, 0, dimensions.width, dimensions.height);
132 const blob = await blobFromCanvas(canvas, file.type, resizeImages.quality);
133 return new File([blob], file.name, { type: file.type, lastModified: file.lastModified });
134 } finally {

Callers 1

validateImageFileSizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected