Skip to main content
Store the edits with the photo, then reopen them later with the state prop.

What Save Gives Back

onProcess receives two things: Without onProcess, Save downloads the file.

Store It

The state is plain JSON. Keep it next to the original photo.

Reopen It

Pass the original photo as src and the stored state as state. The photo reopens exactly as it was saved.
Every edit stays editable: the crop, rotation and flips, adjustments, Auto, filter, frame, obfuscated areas, annotations, the person’s watermark and signature changes, and the output size.
src and state are read when the editor opens. To load another photo, give EmbedEditor a new key, or destroy and mount again.

What to Know

  • Never an image. The state holds no pixels. Watermarks and signatures come back from your props.
  • Every field is written, defaults included. A state you write by hand may leave any field out; a missing field reads as its default.
  • Screen units. Adjustments run −100 to 100, rotation is in degrees, geometry is in px of the size the editor works the photo at.
  • version is 3. A wrong version, a value out of range or more than 64 areas is an INVALID_STATE error. The editor never opens a state half-applied.
  • processImage resolves to a state too, ready for the state prop.
Every field is documented in the state reference.

State Reference

Every field of EditState.

Migrating from Pintura

Open states saved by Pintura.