Make a Thumbnail
thumbnail.ts
processImage is exported from both entries, /react and /standalone. It resolves to { dest, state }: the File it made, and an edit state ready for the editor’s state prop.
Options
src takes everything the editor’s src takes. Every option is optional.
Without
crop or aspectRatio, it keeps the whole image. Output never goes past 16.7 MP, whatever targetSize asks for.
Given both crop and aspectRatio, the returned state keeps aspectRatio only when crop already has that ratio. Otherwise the state is free, so reopening it never refits the crop.
Units over 16.7 MP
A photo over 16.7 MP is worked at a smaller copy (see Large photos). Mind the units:cropis in the file’s own px, and lands on the same region of the copy.- The returned
stateis in the copy’s px, ready for the editor’sstateprop.
Errors
processImage rejects with an EmbedEditorError.
processImage
The full signature.
Watermark & Signature
Draw the host’s marks on the result.