Skip to content

fix(editor): preserve capture size in exported PNGs - #163

Merged
jondkinney merged 1 commit into
omacom:mainfrom
jondkinney:fix/reopen-capture-scale
Sep 22, 2026
Merged

jondkinney merged 1 commit into
omacom:mainfrom
jondkinney:fix/reopen-capture-scale

Conversation

@jondkinney

Copy link
Copy Markdown
Collaborator

Opening a saved screenshot from a 2× monitor through Omaroll's Annotate action or a file browser treated its native pixels as logical dimensions, making it appear twice its original size. Store the rendered capture's logical dimensions in the exported PNG and restore them when reopening the file or clipboard image. Native pixels remain intact, including crops, backdrops, expanded canvases, and scrolling captures.

Editable operation logs retain precedence over the PNG dimensions, and untagged images keep their existing pixel-sized presentation. The fast PNG encoder writes the small size field directly; other metadata continues through Qt's existing fallback.

Validation:

  • make check passed, including scale round trips at 1×, 1.25×, 1.5×, and 2×, Save As and preview exports, invalid metadata, exact pixel preservation, and unchanged compressed image payloads.
  • A 6K PNG encoded in about 170–174 ms both with and without the metadata; the field added 42 bytes.
  • Tested locally through Omaroll. The reopened 2,340 × 2,222 PNG matches the original 1,170 × 1,111 logical selection on a 2× display, and actual-size viewing in imv was confirmed.

@jondkinney
jondkinney merged commit 1ecbe37 into omacom:main Sep 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant