Treat a saved canvas transform as a snapshot
A matrix returned by ctx.getTransform() is a snapshot. Later changes to the context do not update that object, and changing the object does not update the context. Suppose a preview stores its transfo
A matrix returned by ctx.getTransform() is a snapshot. Later changes to the context do not update that object, and changing the object does not update the context. Suppose a preview stores its transfo
Set ctx.imageSmoothingEnabled before you call drawImage(). To compare a different setting, draw the image again; the assignment does not change pixels already drawn. The default is true. For a pixel-a
Make image-upload cancellation belong to one attempt. A new attempt needs a fresh controller and a cancel control that still points to it. Keep the controller with the job identifier. When the user ca
Wait for the server response before displaying image accepted. Upload progress describes the request body transfer, so keep its completion separate from the application result. Use progress informatio
Close 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,
Put 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
Choose 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 extension
Check 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 jo
Accept 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(inp