Skip to content

Remove all trailing null bytes from ASCII tags - #10755

Open
lazerg wants to merge 1 commit into
python-pillow:mainfrom
lazerg:fix/issue-10752-exif-nul
Open

lazerg wants to merge 1 commit into
python-pillow:mainfrom
lazerg:fix/issue-10752-exif-nul

Conversation

@lazerg

@lazerg lazerg commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Origin: A) Fixes existing issue #10752

My contribution includes AI-generated content, as disclosed below:

  • AI Tools: Claude Code
  • LLMs and versions: Claude Opus 5.5
  • Prompts: Fix the linked issue

Changes proposed in this pull request:

  • ASCII tag values padded with more than one null byte kept every null after the first, since load_string() only removed a single trailing \0. So getexif()[271] gave 'Canon\x00' for Canon\0\0.
  • Strip all trailing null bytes instead.

Fixes #10752

@radarhere radarhere added the 🤖-assisted AI-assisted label Dec 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-assisted AI-assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getexif() keeps extra trailing NULs in ASCII tags padded with more than one NUL

2 participants