Bug ID 954370
Summary Pillow: import Image does not work
Classification openSUSE
Product openSUSE Distribution
Version Leap 42.1
Hardware All
OS openSUSE 42.1
Status NEW
Severity Normal
Priority P5 - None
Component Other
Assignee bnc-team-screening@forge.provo.novell.com
Reporter dhall@wustl.edu
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101
Firefox/41.0
Build Identifier: 

The spec file for python-Pillow creates PIL.pth in an effort to have backwards
compatibility with PIL

This does not actually create a backwards-compatible installation; if you run
import Image, no file formats are found that can be used for reading or saving
images.

Reproducible: Always

Steps to Reproduce:
1. run the command below
> python -c 'import Image; print Image.__file__; Image.preinit(); print Image.EXTENSION'



Actual Results:  
/usr/lib64/python2.7/site-packages/PIL/Image.pyc
{}

Expected Results:  
/usr/lib64/python2.7/site-packages/PIL/Image.pyc
{'.png': 'PNG', '.gif': 'GIF', '.ppm': 'PPM', '.bmp': 'BMP', '.pbm': 'PPM',
'.pgm': 'PPM', '.jpe': 'JPEG', '.jfif': 'JPEG', '.jpg': 'JPEG', '.tif': 'TIFF',
'.jpeg': 'JPEG', '.tiff': 'TIFF'}

running:
> python -c 'from PIL import Image; print Image.__file__; Image.preinit(); print Image.EXTENSION'

gives the expected results. This is no surprise since that is what is supported
by Pillow. "import Image" is not supported by Pillow, but openSUSE feigns
support that doesn't work at all. This breaks certain programs the first
'import Image' and only on ImportError look to 'from PIL import Image'

If you want to support 'import Image', Ubuntu 12.04 appears to have a working
method; creating PILCompat that does this

> cat /usr/lib/python2.7/dist-packages/PILcompat.pth 
PILcompat
> cat /usr/lib/python2.7/dist-packages/PILcompat/Image.py
from PIL.Image import *


You are receiving this mail because: