Skip to content

Keep resolution unit in Imagick CropModifier - #1551

Merged
olivervogel merged 1 commit into
Intervention:developfrom
NotAFlightRisk:bugfix/imagick-crop-resolution-units
Oct 16, 2026
Merged

olivervogel merged 1 commit into
Intervention:developfrom
NotAFlightRisk:bugfix/imagick-crop-resolution-units

Conversation

@NotAFlightRisk

Copy link
Copy Markdown
Contributor

This is the crop() one I mentioned under #1548. The canvas it rebuilds on Imagick gets the resolution numbers but not the unit, so anything that's been through crop() or resizeCanvas() saves with no DPI. 300dpi.png comes out with a pHYs of 299 x 299, unit unknown, and test.jpg (in inches to start with) saves as 72 with no unit either. resolution() still reads 300 afterwards, wich is why the existing test passes.

Each frame's resolution and unit now get copied over as they are, so the saved file matches what you'd get without the crop. I didn't force inches the way #1548 does, since a PNG whose pHYs is only an aspect ratio (unit 0) would then come out claiming 1 DPI.

@olivervogel
olivervogel merged commit 65e4e92 into Intervention:develop Oct 16, 2026
8 checks passed
@olivervogel

Copy link
Copy Markdown
Member

Thank you.

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