Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PIL cannot read JPEG comment #4450

@ganego

Description

@ganego

What did you do?

I want PIL to read the JPEG comment (marker: 0xFF 0xFE).

I took an image with an attached JPEG comment - verified with exiftools & IrfanView to exist.

from PIL import Image, JpegImagePlugin
pic = Image.open(<path_to_pic_with_JPEG_comment>)
print(pic.info)

What did you expect to happen?

Show the JPEG comment in the dict.

What actually happened?

{'jfif': 257, 'jfif_version': (1, 1), 'dpi': (96, 96), 'jfif_unit': 1, 'jfif_density': (96, 96), 'exif': b'...'}

What are your OS, Python and Pillow versions?

  • OS: W7x64
  • Python: Python 3.8.1 x64
  • Pillow: Pillow 7.0.0

I cannot attach an image via github ("Something went really wrong, ..."), so here is the file (5.61 KiB) (I downloaded it and verified it's byte-identical to the uploaded one): jpeg-comment-test.jpg

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions