Skip to content

Only replace a maximum of two Exif headers - #10073

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:exif_prefix
Sep 28, 2026
Merged

radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:exif_prefix

Conversation

@radarhere

@radarhere radarhere commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Pillow/src/PIL/Image.py

Lines 4146 to 4147 in 5600015

while data and data.startswith(b"Exif\x00\x00"):
data = data[6:]

could potentially take a long time.

The loop was only introduced to handle 2 instances of the Exif header for #8348, so this PR limits it to that maximum.

@radarhere radarhere added the Exif label Sep 28, 2026
@radarhere
radarhere merged commit 806e383 into python-pillow:main Sep 28, 2026
51 checks passed
@radarhere
radarhere deleted the exif_prefix branch September 28, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant