photo_markup 1.0.2 copy "photo_markup: ^1.0.2" to clipboard
photo_markup: ^1.0.2 copied to clipboard

Draw boxes, arrows, freehand strokes and text over a photo, read it back as resolution-independent vector data, and flatten it to a JPEG or PNG.

Changelog #

1.0.2 #

Packaging only — no library changes. The public API is byte-for-byte identical to 1.0.1.

  • analysis_options.yaml now spells out the analyzer: exclude: block that flutter pub get (3.45 and later) otherwise writes into it. The tool rewrote the file in place on every fetch, which left the working tree dirty and made pub publish --dry-run fail with checked-in files are modified in git. Listing the entries keeps that migration from re-arming.
  • Releases now publish from GitHub Actions on a v* tag, using pub.dev's OIDC automated publishing rather than a long-lived credential. The tag is verified against the pubspec version and the CHANGELOG before anything is uploaded.

1.0.1 #

Documentation only — no library changes.

  • The README screenshot and its links to example/ and LICENSE now use absolute URLs. pub.dev can only rewrite a relative path once its analysis of a version has run, and until then it drops the image and the links, so 1.0.0 rendered them as bare text.

1.0.0 #

Initial release.

  • PhotoMarkupEditor — full-screen editor with box, ellipse, arrow, freehand and text tools, pinch-zoom and pan, undo/redo, and a color and stroke-width picker.
  • PhotoMarkupViewer — read-only overlay of a MarkupDocument over a photo.
  • MarkupEditorController — widget-free editor state with an in-memory undo/redo history, usable on its own.
  • MarkupPainter — the single CustomPainter shared by the editor, the viewer and the flattener, so all three render identically.
  • MarkupFlattener — composites annotations over the source photo and encodes to JPEG or PNG. Never modifies the original and never upscales. Output is capped at defaultTargetWidth (2048 px) unless a targetWidth is given — pass double.infinity for full source resolution — and JPEG encoding runs on a background isolate so it does not block the UI thread.
  • MarkupCodec — forward-tolerant JSON serialization (v: 1), in both directions. Unknown annotation types, unknown fields and out-of-range values are preserved or clamped instead of throwing, and everything it does not understand is carried through decode (Annotation.extras, MarkupDocument.extras, MarkupDocument.unsupportedItems) and re-emitted in place on encode, so an older build can re-save a newer document losslessly.
  • PhotoMarkupStrings — every user-visible string, overridable for localization.

Annotation coordinates are normalized to 0.0..1.0, and stroke widths and font sizes are fractions of the image's shorter side, so markup is resolution independent. Annotation and MarkupDocument are deeply immutable and compare by value, so hosts can diff them and de-duplicate ValueNotifier updates.

Other correctness notes for this first release:

  • The editor holds a clone of the decoded image and disposes only that clone, so annotating a photo that is also on screen elsewhere cannot break the other widget.
  • Text labels anchored near an edge slide back inside the canvas instead of wrapping one character per line, and are clipped to the photo's bounds.
  • MarkupEditorController caps undo history at 50 steps (maxHistory).
  • PhotoMarkupViewer has no fit parameter: the overlay always covers the photo's box, so any other fit would misregister the markup. Wrap the widget in a FittedBox to scale photo and markup together.

Known limitations #

  • MarkupTool.select is declared but not implemented — individual annotations cannot yet be selected, moved, resized or deleted. The only removal action is Clear all.
  • The web has no isolates, so JPEG encoding runs inline there and a large flatten will still stall the frame.
  • PhotoMarkupEditor takes initialAnnotations rather than a whole document, so a round trip through the editor preserves per-annotation passthrough but not document-level passthrough.
1
likes
160
points
13
downloads

Documentation

API reference

Publisher

verified publishervelzosoft.com

Weekly Downloads

Draw boxes, arrows, freehand strokes and text over a photo, read it back as resolution-independent vector data, and flatten it to a JPEG or PNG.

Repository (GitHub)
View/report issues

Topics

#annotation #markup #drawing #image #canvas

License

BSD-3-Clause (license)

Dependencies

flutter, image

More

Packages that depend on photo_markup