Skip to content

Regression from PIL when importing PIL.Image -- Pillow fails hard, PIL let you use a subset #951

@benhoyt

Description

@benhoyt

We've just switched from PIL to Pillow. The transition was mostly seamless, so thanks for the great library!

One thing that was a bit frustrating was what I consider a bug/regression :-). With PIL we could merrily use much of the stuff we needed for development without the C binaries. For example, we used to open images with PIL.Image.open() and then get the size or other image metadata.

This used to work fine with PIL without the .pyd or .so files, and you just couldn't access the image processing features unless you had the C modules installed. This seems like a good thing. However, Pillow fails hard on import when it can't import _imaging -- see here

This 1) breaks compatibility with PIL uncessarily, and 2) seems a bit drastic, because allowing you to look at metadata without the C libraries was a useful feature. What about just a warning "C libraries not installed; only a subset of features will be available"?

We've worked around this just by removing the final raise, which seems to work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions