Skip to content

Do not set TIFF dpi when resolution tags are missing - #10339

Merged
radarhere merged 2 commits into
python-pillow:mainfrom
brettdavies:tiff-no-resolution
Oct 29, 2026
Merged

radarhere merged 2 commits into
python-pillow:mainfrom
brettdavies:tiff-no-resolution

Conversation

@brettdavies

Copy link
Copy Markdown
Contributor

Fixes #10332.

Changes proposed in this pull request:

  • A TIFF frame with neither XResolution nor YResolution no longer reports dpi == (1, 1) and resolution == (1, 1). It reports neither key, as a PNG or JPEG saved without a resolution does, and as BMP does since Ignore (0, 0) BMP DPI #10187.
  • _setup() clears dpi and resolution before reading each frame, so a frame without resolution tags does not keep the previous frame's values.
  • A frame with only one of the two tags keeps the existing fallback of 1 for the other.

@radarhere radarhere added the TIFF label Oct 27, 2026
@radarhere
radarhere enabled auto-merge (squash) October 29, 2026 06:38
@radarhere
radarhere merged commit 3272c29 into python-pillow:main Oct 29, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TIFF without XResolution/YResolution reports dpi (1, 1)

2 participants