Skip to content

JPEG comments are from the COM marker#8788

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:jpeg_comment
Mar 3, 2025
Merged

JPEG comments are from the COM marker#8788
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:jpeg_comment

Conversation

@radarhere
Copy link
Copy Markdown
Member

Requested in #8787 (comment) - a note in the documentation that JpegImagePlugin's info["comment"] is from the COM marker

def COM(self: JpegImageFile, marker: int) -> None:
#
# Comment marker. Store these in the APP dictionary.
n = i16(self.fp.read(2)) - 2
s = ImageFile._safe_read(self.fp, n)
self.info["comment"] = s

and that this is distinct from the UserComment EXIF tag.

UserComment = 0x9286

@radarhere radarhere added the JPEG label Mar 2, 2025
@hugovk hugovk merged commit 4efc096 into python-pillow:main Mar 3, 2025
5 checks passed
@radarhere radarhere deleted the jpeg_comment branch March 3, 2025 20:45
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.

2 participants