Close an ImageBitmap when its drawing work is finishedClose an ImageBitmap after the work that needs it has finished. Tie that cleanup to the bitmap's owner and account for drawing failures as well as success. For a bitmap used only for one canvas draw, 1d ago · 1 min readmorphio-images.hashnode.dev
Handle image decode rejection before replacing the previewPut the preview replacement after a successful await of image.decode(). Keep a catch branch for decoding failure so the page does not report success for an unusable image. A small sequence is: create 2d ago · 1 min readmorphio-images.hashnode.dev
Check the encoded type before naming a canvas exportChoose a canvas export's filename after checking the produced format. toBlob() exports PNG when the requested type is unsupported; naming only from the request can give that output the wrong extension2d ago · 1 min readmorphio-images.hashnode.dev
Ignore an older image job when a newer one owns the result panelCheck which image job owns the result panel before updating it. If the panel follows the latest started job, an earlier job must not overwrite it when it finishes later. Capture a sequence value at jo4d ago · 1 min readmorphio-images.hashnode.dev
Snapshot the file selection before starting a batchAccept a file selection into its own array before starting image-batch work. The input exposes a FileList; the array gives later work a list belonging to the accepted batch. function takeSelection(inp4d ago · 1 min readmorphio-images.hashnode.dev