Skip to content

module 'PIL._imaging' has no attribute 'tiff_lzw_decoder' #3195

Closed

Description

@YubinXie

What did you do?

I tried to use PIL to open tiled TIFF image, compressed in tiff lzw format. Then I got the error:
module 'PIL._imaging' has no attribute 'tiff_lzw_decoder'

I did not find any helpful information yet.

What versions of Pillow and Python are you using?

Python 3.6 (and 2.7), PILLOW 5.1.0

Code:

import PIL
from PIL import Image, TiffImagePlugin
TiffImagePlugin.READ_LIBTIFF=True
dir(PIL._imaging)
[‘DEFAULT_STRATEGY’, ‘FILTERED’, ‘FIXED’, ‘HUFFMAN_ONLY’,
 ‘PILLOW_VERSION’, ‘RLE’, ‘__doc__‘, ‘__file__‘, ‘__loader__‘, ‘__name__‘, ‘__package__‘, ‘__spec__‘, 
‘alpha_composite’, ‘bcn_decoder’, ‘bit_decoder’, ‘blend’, ‘convert’, ‘copy’, ‘crc32’, ‘draw’, 
‘effect_mandelbrot’, ‘effect_noise’, ‘eps_encoder’, ‘fill’, ‘fli_decoder’, ‘font’, ‘getcodecstatus’, 
‘getcount’, ‘gif_decoder’, ‘gif_encoder’, ‘hex_decoder’, ‘hex_encoder’, ‘jpeg_decoder’, 
‘jpeg_encoder’, ‘jpeglib_version’, ‘libtiff_decoder’, ‘libtiff_encoder’, ‘linear_gradient’, ‘map_buffer’, 
‘new’, ‘outline’, ‘packbits_decoder’, ‘path’, ‘pcd_decoder’, ‘pcx_decoder’, ‘pcx_encoder’, 
‘radial_gradient’, ‘raw_decoder’, ‘raw_encoder’, ‘sun_rle_decoder’, ‘tga_rle_decoder’, 
‘tiff_lzw_decoder’, ‘wedge’, ‘xbm_decoder’, ‘xbm_encoder’, ‘zip_decoder’, ‘zip_encoder’, 
‘zlib_version’]

Update:

Only when I down-grade to Pillow 4.2.1, tiff_lzw_decoder appears in my dir(PIL._imaging)

Activity

  1. added
    Bug
    on Jun 30, 2018
  2. radarhere commented on Jul 28, 2018

    @radarhere
    Member

    As a minor point, you say that only when you downgrade does tiff_lzw_decoder appear, but it is listed in the code output above?

    Investigating, I find tiff_lzw_decoder was removed in #2899.

    Are you able to upload an image that you're experiencing this problem with?

  3. YubinXie commented on Jul 28, 2018

    @YubinXie
    Author

    I did not mention the PIL version in my question, it is 4.2.1. The point of that codes is to show 'how I identify library'. But it is true that PIL version above 4.2 does not contain tiff_lzw_decoder, as you found that it was removed.

    So this is not a bug, it is function removal. The image I am using is medical data. It can not go public yet. Sorry. But it has nothing special. You can find any tiff image with lzw encoding.

  4. kkopachev commented on Jul 30, 2018

    @kkopachev
    Contributor

    @YubinXie I suspect you are using tiled tiff image, which currently only supported without compression. #3227 should fix that.

  5. hugovk commented on Sep 29, 2018

    @hugovk
    Member

    Probably fixed by #3227.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugTIFF

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions