Skip to content

Can't open a tiff with old-style jpeg compressed file #7414

@xiaoyzhou

Description

@xiaoyzhou

What did you do?

I can get the infomation from tiffinfo.

$ tiffinfo 20230822143148.tif 
TIFF Directory at offset 0x8 (8)
  Subfile Type: multi-page document (2 = 0x2)
  Image Width: 2340 Image Length: 1654
  Resolution: 200, 200 pixels/inch
  Bits/Sample: 8
  Compression Scheme: Old-style JPEG
  Photometric Interpretation: min-is-black
  FillOrder: msb-to-lsb
  YCbCr Subsampling: 2, 2
  YCbCr Positioning: centered
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Rows/Strip: 1654
  Planar Configuration: single image plane
  Page Number: 0-0
  Software: Apeos C7070
  JpegInterchangeFormat: 306
  JpegInterchangeFormatLength: 405550
  JpegProc: 1
  JpegRestartInterval: 0

But when i use python, get the under error.
PIL.UnidentifiedImageError: cannot identify image file '20230822143148.tif'

What did you expect to happen?

Pillow will open the file without error.

What actually happened?

I get the under error.
PIL.UnidentifiedImageError: cannot identify image file '20230822143148.tif'

What are your OS, Python and Pillow versions?

  • OS: Windows 10 (22H2)
  • Python: 3.9.13
  • Pillow: 9.5.0
code goes here

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