Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open multipage multichannel TIFF #2485

Closed
jakirkham opened this issue Apr 12, 2017 · 2 comments
Closed

Unable to open multipage multichannel TIFF #2485

jakirkham opened this issue Apr 12, 2017 · 2 comments
Labels
Anaconda Issues with Anaconda's Pillow Enhancement TIFF

Comments

@jakirkham
Copy link
Contributor

Using this image (needs to be downloaded) from scikit-image, was unable to open the file with Pillow. The image file is a multipage RGB TIFF containing float64 values. Code snippet and environment details below.

Code sample:

In [1]: from PIL import Image

In [2]: im = Image.open("multipage_rgb.tif")
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-2-14749a0cbf47> in <module>()
----> 1 im = Image.open("multipage_rgb.tif")

/zopt/conda2/envs/pil/lib/python2.7/site-packages/PIL/Image.pyc in open(fp, mode)
   2347 
   2348     raise IOError("cannot identify image file %r"
-> 2349                   % (filename if filename else fp))
   2350 
   2351 #

IOError: cannot identify image file 'multipage_rgb.tif'

Conda environment:

name: pil
channels: !!python/tuple
- !!python/unicode
  'conda-forge'
- !!python/unicode
  'defaults'
dependencies:
- conda-forge::appnope=0.1.0=py27_0
- conda-forge::backports.shutil_get_terminal_size=1.0.0=py27_1
- conda-forge::ca-certificates=2017.1.23=0
- conda-forge::certifi=2017.1.23=py27_0
- conda-forge::decorator=4.0.11=py27_0
- conda-forge::enum34=1.1.6=py27_1
- conda-forge::freetype=2.7=1
- conda-forge::ipython=5.3.0=py27_0
- conda-forge::ipython_genutils=0.2.0=py27_0
- conda-forge::jpeg=9b=0
- conda-forge::libpng=1.6.28=0
- conda-forge::libtiff=4.0.6=7
- conda-forge::ncurses=5.9=10
- conda-forge::olefile=0.44=py27_0
- conda-forge::openssl=1.0.2k=0
- conda-forge::pathlib2=2.2.1=py27_0
- conda-forge::pexpect=4.2.1=py27_0
- conda-forge::pickleshare=0.7.3=py27_0
- conda-forge::pillow=4.0.0=py27_2
- conda-forge::prompt_toolkit=1.0.14=py27_0
- conda-forge::ptyprocess=0.5.1=py27_0
- conda-forge::pygments=2.2.0=py27_0
- conda-forge::python=2.7.13=0
- conda-forge::readline=6.2=0
- conda-forge::scandir=1.5=py27_1
- conda-forge::setuptools=33.1.1=py27_0
- conda-forge::simplegeneric=0.8.1=py27_0
- conda-forge::six=1.10.0=py27_1
- conda-forge::sqlite=3.13.0=1
- conda-forge::tk=8.5.19=1
- conda-forge::traitlets=4.3.2=py27_0
- conda-forge::wcwidth=0.1.7=py27_0
- conda-forge::xz=5.2.2=0
- conda-forge::zlib=1.2.11=0
prefix: /zopt/conda2/envs/pil
@hugovk
Copy link
Member

hugovk commented Apr 12, 2017

64-bit TIFFs aren't supported. See #1888.


Setting DEBUG = True at the top of TiffImagePlugin.py tells us its format key ('II', 2, (3,), 1, (64, 64, 64), ()) is unsupported:

*** TiffImageFile._open ***
- __first: 8
- ifh:  II*
Seeking to frame 0, on frame -1, __next 8, location: 8
Loading tags, location: 8
tag: NewSubfileType (254) - type: long (4) - value: 2
tag: ImageWidth (256) - type: long (4) - value: 10
tag: ImageLength (257) - type: long (4) - value: 10
tag: BitsPerSample (258) - type: short (3) Tag Location: 58 - Data Location: 206 - value: (64, 64, 64)
tag: Compression (259) - type: short (3) - value: 1
tag: PhotometricInterpretation (262) - type: short (3) - value: 2
tag: ImageDescription (270) - type: string (2) Tag Location: 94 - Data Location: 212 - value: shape=(2,3,10,10)
tag: StripOffsets (273) - type: long (4) Tag Location: 106 - Data Location: 230 - value: (286, 1086, 1886)
tag: Orientation (274) - type: short (3) - value: 1
tag: SamplesPerPixel (277) - type: short (3) - value: 3
tag: RowsPerStrip (278) - type: long (4) - value: 10
tag: StripByteCounts (279) - type: long (4) Tag Location: 154 - Data Location: 242 - value: (800, 800, 800)
tag: PlanarConfiguration (284) - type: short (3) - value: 2
tag: Software (305) - type: string (2) Tag Location: 178 - Data Location: 254 - value: tifffile.py
tag: DateTime (306) - type: string (2) Tag Location: 190 - Data Location: 266 - value: 2015:05:09 09:08:29
tag: SampleFormat (339) - type: short (3) - value: (3,)
tag: NewSubfileType (254) - type: long (4) - value: 2
tag: ImageWidth (256) - type: long (4) - value: 10
tag: ImageLength (257) - type: long (4) - value: 10
tag: BitsPerSample (258) - type: short (3) Tag Location: 58 - Data Location: 206 - value: (64, 64, 64)
tag: Compression (259) - type: short (3) - value: 1
tag: PhotometricInterpretation (262) - type: short (3) - value: 2
tag: ImageDescription (270) - type: string (2) Tag Location: 94 - Data Location: 212 - value: shape=(2,3,10,10)
tag: StripOffsets (273) - type: long (4) Tag Location: 106 - Data Location: 230 - value: (286, 1086, 1886)
tag: Orientation (274) - type: short (3) - value: 1
tag: SamplesPerPixel (277) - type: short (3) - value: 3
tag: RowsPerStrip (278) - type: long (4) - value: 10
tag: StripByteCounts (279) - type: long (4) Tag Location: 154 - Data Location: 242 - value: (800, 800, 800)
tag: PlanarConfiguration (284) - type: short (3) - value: 2
tag: Software (305) - type: string (2) Tag Location: 178 - Data Location: 254 - value: tifffile.py
tag: DateTime (306) - type: string (2) Tag Location: 190 - Data Location: 266 - value: 2015:05:09 09:08:29
tag: SampleFormat (339) - type: short (3) - value: (3,)
*** Summary ***
- compression: raw
- photometric_interpretation: 2
- planar_configuration: 2
- fill_order: 1
- size: (10, 10)
format key: ('II', 2, (3,), 1, (64, 64, 64), ())
- unsupported format
*** TiffImageFile._open ***
- __first: 8
- ifh:  II*
Seeking to frame 0, on frame -1, __next 8, location: 8
Loading tags, location: 8
tag: NewSubfileType (254) - type: long (4) - value: 2
tag: ImageWidth (256) - type: long (4) - value: 10
tag: ImageLength (257) - type: long (4) - value: 10
tag: BitsPerSample (258) - type: short (3) Tag Location: 58 - Data Location: 206 - value: (64, 64, 64)
tag: Compression (259) - type: short (3) - value: 1
tag: PhotometricInterpretation (262) - type: short (3) - value: 2
tag: ImageDescription (270) - type: string (2) Tag Location: 94 - Data Location: 212 - value: shape=(2,3,10,10)
tag: StripOffsets (273) - type: long (4) Tag Location: 106 - Data Location: 230 - value: (286, 1086, 1886)
tag: Orientation (274) - type: short (3) - value: 1
tag: SamplesPerPixel (277) - type: short (3) - value: 3
tag: RowsPerStrip (278) - type: long (4) - value: 10
tag: StripByteCounts (279) - type: long (4) Tag Location: 154 - Data Location: 242 - value: (800, 800, 800)
tag: PlanarConfiguration (284) - type: short (3) - value: 2
tag: Software (305) - type: string (2) Tag Location: 178 - Data Location: 254 - value: tifffile.py
tag: DateTime (306) - type: string (2) Tag Location: 190 - Data Location: 266 - value: 2015:05:09 09:08:29
tag: SampleFormat (339) - type: short (3) - value: (3,)
tag: NewSubfileType (254) - type: long (4) - value: 2
tag: ImageWidth (256) - type: long (4) - value: 10
tag: ImageLength (257) - type: long (4) - value: 10
tag: BitsPerSample (258) - type: short (3) Tag Location: 58 - Data Location: 206 - value: (64, 64, 64)
tag: Compression (259) - type: short (3) - value: 1
tag: PhotometricInterpretation (262) - type: short (3) - value: 2
tag: ImageDescription (270) - type: string (2) Tag Location: 94 - Data Location: 212 - value: shape=(2,3,10,10)
tag: StripOffsets (273) - type: long (4) Tag Location: 106 - Data Location: 230 - value: (286, 1086, 1886)
tag: Orientation (274) - type: short (3) - value: 1
tag: SamplesPerPixel (277) - type: short (3) - value: 3
tag: RowsPerStrip (278) - type: long (4) - value: 10
tag: StripByteCounts (279) - type: long (4) Tag Location: 154 - Data Location: 242 - value: (800, 800, 800)
tag: PlanarConfiguration (284) - type: short (3) - value: 2
tag: Software (305) - type: string (2) Tag Location: 178 - Data Location: 254 - value: tifffile.py
tag: DateTime (306) - type: string (2) Tag Location: 190 - Data Location: 266 - value: 2015:05:09 09:08:29
tag: SampleFormat (339) - type: short (3) - value: (3,)
*** Summary ***
- compression: raw
- photometric_interpretation: 2
- planar_configuration: 2
- fill_order: 1
- size: (10, 10)
format key: ('II', 2, (3,), 1, (64, 64, 64), ())
- unsupported format
Traceback (most recent call last):
  File "2485.py", line 3, in <module>
    im = Image.open('multipage_rgb.tif')
  File "/Users/hugo/github/Pillow/PIL/Image.py", line 2452, in open
    % (filename if filename else fp))
IOError: cannot identify image file 'multipage_rgb.tif'

@hugovk
Copy link
Member

hugovk commented Feb 17, 2019

I'll add the info to #1888 and close this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anaconda Issues with Anaconda's Pillow Enhancement TIFF
Projects
None yet
Development

No branches or pull requests

3 participants