Skip to content

Fix identify/1 for large images#1

Merged
kwando merged 2 commits into
kwando:mainfrom
JonasGruenwald:patch-1
May 3, 2026
Merged

Fix identify/1 for large images#1
kwando merged 2 commits into
kwando:mainfrom
JonasGruenwald:patch-1

Conversation

@JonasGruenwald

Copy link
Copy Markdown
Contributor

Hello!

Currently, the identify command produced by alakazam, which is magick identify -format "%m %w %h %[colorspace] %[depth] %[opaque] %[size]" has a different output when the image is several MB large, like so:

JPEG 1280 1024 sRGB 8 True 751032B
PNG  2346 1586 sRGB 8 True 4.72356MB

alakazam expects the size value to always be in bytes, and so it will fail to parse the PNG in this case.

This PR adds the -precision 16 option to the identify command, which forces the output to always be in bytes, and therefore resolves the issue.

This is based on the magick docs here: https://imagemagick.org/escape/#gsc.tab=0

file size of image read in (use -precision 16 to force results in B)

@kwando
kwando merged commit 5e4d433 into kwando:main May 3, 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.

2 participants