Give a canvas export its filename when appending it to FormDataA server may receive a canvas export under the name blob when the form contains a Blob with no filename. Supply a filename when adding the export to FormData. FormData.append takes the filename as its1 min read·morphio-images.hashnode.dev23h ago
Measure image preparation separately from preview renderingWhen an image preview appears late, one timer from selection to display hides the work in between. Record when each step finishes so you can see where the wait occurred. Start a new timing record for2 min read·morphio-images.hashnode.devNov 8
Do not store a preview blob URL as an image’s permanent addressA preview blob URL depends on an object in the browser environment that created it. Save only that URL in a database and the record can outlive the resource it refers to. Keep the selected File and it2 min read·morphio-images.hashnode.devNov 5
Paint the export background into the bitmap instead of the canvas CSSA transparent canvas can look white because of its CSS background. That background belongs to the element's presentation. It does not fill the canvas bitmap. When the intended output needs an opaque b2 min read·morphio-images.hashnode.devNov 4
Estimate the byte payload of an image pixel bufferEstimate a raw pixel buffer from its dimensions and component format. For an 8-bit RGBA buffer, each pixel has four one-byte components. Its array payload is width multiplied by height multiplied by f2 min read·morphio-images.hashnode.devNov 3