GithubHelp home page GithubHelp logo

python-pillow / pillow Goto Github PK

View Code? Open in Web Editor NEW
11.7K 11.7K 2.1K 196.58 MB

Python Imaging Library (Fork)

Home Page: https://python-pillow.org

License: Other

Python 62.42% Shell 0.24% HTML 0.49% Gnuplot 0.03% C 36.25% Makefile 0.11% PostScript 0.35% CMake 0.11%
c cross-platform image image-processing pil pillow python python-3

pillow's People

Contributors

aclark4life avatar akx avatar al45tair avatar artscoop avatar cgohlke avatar d-schmidt avatar dwesl avatar homm avatar hugovk avatar irskep avatar jd20 avatar jdufresne avatar joshware avatar kkopachev avatar manisandro avatar matthew-brett avatar mergify[bot] avatar nulano avatar piolie avatar pre-commit-ci[bot] avatar radarhere avatar redxeye avatar renovate[bot] avatar sircinnamon avatar terseus avatar urielmad avatar vashek avatar wiredfool avatar xtsm avatar yay295 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pillow's Issues

adding "provides PIL" to package

any way that pillow package can expose "provides" so that other packages which have PIL as dependency will use pillow instead?
maybe i'm just missing something and this already works?

Can't identify some psd files because of layer mode type number

On many psd i have tested, we have a layerinfo which layer image mode is 3

but code supports now mode type 65535, 0, 1 and 2

    for i in range(i16(read(2))):
        type = i16(read(2))
        if type == 65535:
            m = "A"
        else:
            m = "RGB"[type]

so we finally get a "can't identify image file..." exception

we supposed that mode 3 is "A", so if we write :

    for i in range(i16(read(2))):
        type = i16(read(2))
        if type == 65535:
            m = "A"
        else:
            m = "RGBA"[type]

and then it works very fine

i'll submit a pull request

Can't identify psd with mode, bits = 4, 16

psd with psd_mode, psd_bits: 4, 16

files are actually cmyk with 5 channels

simply adding mode cmyk, 5 (or 4) channels matching with 4, 16 doesn't works (images rendered doesn't match with source)

Error gcc-4.0 exited with status 1

This is a error:
Alisons-MacBook-Pro:Pillow-1.7.8 alisonjonck$ python setup.py install
running install
running bdist_egg
running egg_info
writing Pillow.egg-info/PKG-INFO
writing top-level names to Pillow.egg-info/top_level.txt
writing dependency_links to Pillow.egg-info/dependency_links.txt
reading manifest file 'Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '.hgignore'
warning: no previously-included files found matching '.hgtags'
warning: no previously-included files found matching 'BUILDME.bat'
warning: no previously-included files found matching 'make-manifest.py'
warning: no previously-included files found matching 'SHIP'
warning: no previously-included files found matching 'SHIP.bat'
warning: no previously-included files matching '*' found under directory 'Tests'
writing manifest file 'Pillow.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-fat/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.3-fat-2.7
creating build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/init.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ArgImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/BdfFontFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/BmpImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ContainerIO.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/CurImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/DcxImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/EpsImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ExifTags.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/FliImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/FontFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/FpxImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/GbrImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/GdImageFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/GifImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/GimpGradientFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/GimpPaletteFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/GribStubImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/IcnsImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/IcoImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/Image.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageChops.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageCms.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageColor.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageDraw.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageDraw2.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageEnhance.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageFileIO.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageFilter.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageFont.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageGL.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageGrab.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageMath.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageMode.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageOps.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImagePalette.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImagePath.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageQt.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageSequence.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageShow.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageStat.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageTk.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageTransform.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImageWin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/ImtImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/IptcImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/JpegImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/McIdasImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/MicImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/MpegImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/MspImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/OleFileIO.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PaletteFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PalmImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PcdImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PcfFontFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PcxImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PdfImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PixarImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PngImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PpmImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PsdImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/PSDraw.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/SgiImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/SpiderImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/SunImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/TarIO.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/TgaImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/TiffImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/TiffTags.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/WalImageFile.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/WmfImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/XbmImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/XpmImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.3-fat-2.7/PIL
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build/temp.macosx-10.3-fat-2.7
creating build/temp.macosx-10.3-fat-2.7/libImaging
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/X11/include/freetype2 -IlibImaging -I/usr/X11/include -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1

Which is the "main" pillow?

Perhaps ask @github to detach from Tippr/Pillow, now that it seems the group python-imaging is the central place for Pillow?

Also, what is the relation to the bitbucket Pillow? Automatic-code push from bitbucket to here?

Quant.c ptr or value bug

This commit seems to contain a couple bugs fluggo@4459715

However: (1) I think the bug was already present

(2) I've been wandering around the C code for several hours and I'm not sure whether the bug should be fixed by using a pointer type or by converting from a pointer to an int.

Let me walk you through what I'm seeing and maybe you or fluggo can figure out what needs to be done:

On a 64bit *nix system (Running on x86_64, Fedora Linux):

$ gcc -Wall python2.7-config --includes -Wall -c Quant.c
Quant.c: In function 'rehash_collide':
Quant.c:154:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Quant.c:154:39: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Quant.c:154:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Quant.c: In function 'hash_to_list':
Quant.c:247:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Looking at the code for those we have:

rehash_collide(HashTable h, void **keyp, void **valp, void *newkey, void *newval) {
    *valp = (void *)(((int) *valp) + ((int) newval));
}

and (heavily cut for relevancy):

static void
hash_to_list(HashTable h, const void *key, const void *val, void *u) {
   PixelList *p;
   int count=(int) val;
   p->count=count;

On 64 bit Linux where Pointer size is equal to the sizeof Long, those are both wrong as they are trying to fit a pointer into a int sized variable. If that's the extent of the bug, one solution would be to use a typedef that's been sized appropriately for the platform you're on. For instance:

#include<stdint.h>

intptr_t count=(intptr_t) val;

Note that you also have to modify the places where that value is then stored permanently. For instance, PixelList->count needs to change from an (int) to an (intptr_t).

However, I'm not certain that this is the extent of the bug. Looking at more of the code it seems strange to me that PixelList->count is an int type when we seem to be storing the address of the val variable above. I also see in the splitLists() function that we're adding PixelList->counts together which wouldn't make sense if they're all addresses. Perhaps Does there need to be a dereference in there like this?

int count=*( (int *)val );

For rehash_collide(), I couldn't definitely figure out what the code was doing but I vaguely feel that it's making a similar mistake. _valp = (void *)(((int) *valp) + ((int) newval)); seems like it's adding two pointer addresses together which doesn't seem like it would result in anything meaningful. Perhaps the code is supposed to add the values being pointed at together? So dereference valp twice and dereference newval once, add the results and then store them into *_valp:

**(int **)valp = **((int **)valp) + *(int *)(newval);

Anyhow, there's definitely a bug here but since I don't definitely know if we're actually trying to store pointer addresses or integer values, I'm not sure which of these paths is the right one to follow to correct it.

staticforward

I can't compile Pillow with following error:

_imaging.c:3043: ошибка: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘PyTypeObject’

Seems there is no a staticforward defination. I didn't found a staticforward keyword in C++ defination. Could you explaing what does staticforward mean?

Merge pull request from @shuge

When merging @shuge's pull request by hand, I get:


aclark@Alexs-MacBook-Pro-2:/var/folders/vl/vj43x56d67g__xkjy71tfr680000gn/T/tmpKHyS90/Pillow/ > git pull git://github.com/shuge/Pillow.git master
remote: Counting objects: 69, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 68 (delta 25), reused 57 (delta 14)
Unpacking objects: 100% (68/68), done.
From git://github.com/shuge/Pillow
 * branch            master     -> FETCH_HEAD
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.


@shuge can you please fix and resubmit? Note Pillow has moved from the collective to python-imaging organization.

Travis doesn't run all tests

Travis runs selftest.py which is a quick&small testing script; the "real" test suite is in Tests folder.

Maybe re-enabe py32 and add this to .travis.yml: python Tests/run.py --installed?

Assert exception roundtrip PDF fails in Tests/test_imagefile.py


Tests/test_imagefile.py:51: assert_exception(IOError, lambda: roundtrip("PDF")) failed:
- expected 'OSError' exception, got 'ValueError'
Traceback (most recent call last):
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/ImageFile.py", line 447, in _save
    fh = fp.fileno()
io.UnsupportedOperation: fileno

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aclark/Developer/python-imaging/Pillow/Tests/tester.py", line 67, in assert_exception
    func()
  File "Tests/test_imagefile.py", line 51, in <lambda>
    assert_exception(IOError, lambda: roundtrip("PDF"))
  File "Tests/test_imagefile.py", line 20, in roundtrip
    im.save(file, format)
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/Image.py", line 1460, in save
    save_handler(self, fp, filename)
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/PdfImagePlugin.py", line 152, in _save
    ImageFile._save(im, op, [("jpeg", (0,0)+im.size, 0, im.mode)])
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/ImageFile.py", line 451, in _save
    for e, b, o, a in tile:
ValueError: Invalid quantization tables

display.obj fails to link on Windows

On Windows 7 64-bit

>git show --oneline HEAD
a635a1d Merge pull request #36 from d-schmidt/feature

>py -3
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32

>py -3 setup.py build

...

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python33\lib /LIBPATH:C:\Python33\libs /LIBPATH:C:\Python33\PCbuild kernel32.lib user32.lib gdi32.lib /EXPORT:PyInit__imaging build\temp.win32-3.3\Release\_imaging.obj build\temp.win32-3.3\Release\decode.obj build\temp.win32-3.3\Release\encode.obj build\temp.win32-3.3\Release\map.obj build\temp.win32-3.3\Release\display.obj build\temp.win32-3.3\Release\outline.obj build\temp.win32-3.3\Release\path.obj build\temp.win32-3.3\Release\libImaging\Access.obj build\temp.win32-3.3\Release\libImaging\AlphaComposite.obj build\temp.win32-3.3\Release\libImaging\Antialias.obj build\temp.win32-3.3\Release\libImaging\Bands.obj build\temp.win32-3.3\Release\libImaging\BitDecode.obj build\temp.win32-3.3\Release\libImaging\Blend.obj build\temp.win32-3.3\Release\libImaging\Chops.obj build\temp.win32-3.3\Release\libImaging\Convert.obj build\temp.win32-3.3\Release\libImaging\ConvertYCbCr.obj build\temp.win32-3.3\Release\libImaging\Copy.obj build\temp.win32-3.3\Release\libImaging\Crc32.obj build\temp.win32-3.3\Release\libImaging\Crop.obj build\temp.win32-3.3\Release\libImaging\Dib.obj build\temp.win32-3.3\Release\libImaging\Draw.obj build\temp.win32-3.3\Release\libImaging\Effects.obj build\temp.win32-3.3\Release\libImaging\EpsEncode.obj build\temp.win32-3.3\Release\libImaging\File.obj build\temp.win32-3.3\Release\libImaging\Fill.obj build\temp.win32-3.3\Release\libImaging\Filter.obj build\temp.win32-3.3\Release\libImaging\FliDecode.obj build\temp.win32-3.3\Release\libImaging\Geometry.obj build\temp.win32-3.3\Release\libImaging\GetBBox.obj build\temp.win32-3.3\Release\libImaging\GifDecode.obj build\temp.win32-3.3\Release\libImaging\GifEncode.obj build\temp.win32-3.3\Release\libImaging\HexDecode.obj build\temp.win32-3.3\Release\libImaging\Histo.obj build\temp.win32-3.3\Release\libImaging\JpegDecode.obj build\temp.win32-3.3\Release\libImaging\JpegEncode.obj build\temp.win32-3.3\Release\libImaging\LzwDecode.obj build\temp.win32-3.3\Release\libImaging\Matrix.obj build\temp.win32-3.3\Release\libImaging\ModeFilter.obj build\temp.win32-3.3\Release\libImaging\MspDecode.obj build\temp.win32-3.3\Release\libImaging\Negative.obj build\temp.win32-3.3\Release\libImaging\Offset.obj build\temp.win32-3.3\Release\libImaging\Pack.obj build\temp.win32-3.3\Release\libImaging\PackDecode.obj build\temp.win32-3.3\Release\libImaging\Palette.obj build\temp.win32-3.3\Release\libImaging\Paste.obj build\temp.win32-3.3\Release\libImaging\Quant.obj build\temp.win32-3.3\Release\libImaging\QuantHash.obj build\temp.win32-3.3\Release\libImaging\QuantHeap.obj build\temp.win32-3.3\Release\libImaging\PcdDecode.obj build\temp.win32-3.3\Release\libImaging\PcxDecode.obj build\temp.win32-3.3\Release\libImaging\PcxEncode.obj build\temp.win32-3.3\Release\libImaging\Point.obj build\temp.win32-3.3\Release\libImaging\RankFilter.obj build\temp.win32-3.3\Release\libImaging\RawDecode.obj build\temp.win32-3.3\Release\libImaging\RawEncode.obj build\temp.win32-3.3\Release\libImaging\Storage.obj build\temp.win32-3.3\Release\libImaging\SunRleDecode.obj build\temp.win32-3.3\Release\libImaging\TgaRleDecode.obj build\temp.win32-3.3\Release\libImaging\Unpack.obj build\temp.win32-3.3\Release\libImaging\UnpackYCC.obj build\temp.win32-3.3\Release\libImaging\UnsharpMask.obj build\temp.win32-3.3\Release\libImaging\XbmDecode.obj build\temp.win32-3.3\Release\libImaging\XbmEncode.obj build\temp.win32-3.3\Release\libImaging\ZipDecode.obj build\temp.win32-3.3\Release\libImaging\ZipEncode.obj /OUT:build\lib.win32-3.3\_imaging.pyd /IMPLIB:build\temp.win32-3.3\Release\_imaging.lib /MANIFESTFILE:build\temp.win32-3.3\Release\_imaging.pyd.manifest
   Creating library build\temp.win32-3.3\Release\_imaging.lib and object build\temp.win32-3.3\Release\_imaging.exp
display.obj : error LNK2019: unresolved external symbol _PyString_AS_STRING referenced in function _PyImaging_GrabScreenWin32
display.obj : error LNK2019: unresolved external symbol _PyString_FromStringAndSize referenced in function _PyImaging_GrabScreenWin32
display.obj : error LNK2019: unresolved external symbol _PyString_FromString referenced in function _list_windows_callback@8
build\lib.win32-3.3\_imaging.pyd : fatal error LNK1120: 3 unresolved externals
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe"' failed with exit status 1120

Search and replace PyString to PyBytes in display.c makes it at least compile.

Error to install imaging extension (error: command 'clang' failed with exit status 1)

My error to install

Pillow-master rojasmora$ sudo python setup.py install

and

Imaging-1.1.7 rojasmora$ sudo python setup.py install

display the same error

--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build/temp.macosx-10.8-intel-2.7
creating build/temp.macosx-10.8-intel-2.7/libImaging
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-intel-2.7/_imaging.o
unable to execute clang: No such file or directory
error: command 'clang' failed with exit status 1

EpsImagePlugin.Ghostscript doesn't work on Windows

The Ghostscript function in EpsImagePlugin will raise an IOError on Windows. The command it executes is the following:

command = ["gs",
           "-q",                    # quite mode
           "-g%dx%d" % size,        # set output geometry (pixels)
           "-dNOPAUSE -dSAFER",     # don't pause between pages, safe mode
           "-sDEVICE=ppmraw",       # ppm driver
           "-sOutputFile=%s" % file,# output file
           "- >/dev/null 2>/dev/null"]

Ghostscript is actually gswin32c by default on windows (but renaming it to gs isn't too hard). The big problems are the redirects to /dev/null.

A solution from StackOverflow that works is the following:

command = ["gswin32c",
       "-q",                    # quite mode
       "-g%dx%d" % size,        # set output geometry (pixels)
       "-dNOPAUSE -dSAFER",     # don't pause between pages, safe mode
       "-sDEVICE=ppmraw",       # ppm driver
       "-sOutputFile=%s" % file,# output file
       "-"]

It might be better to do - > nul 2> nul to silence Ghostscript and it might be worth trying both gs and gswin32c on Windows.

If this is fixed the docstring about Ghostscript being Unix only should probably also be edited.

Install with Python 3.2

Just trying this out because I would like to move to python 3.2, but I need to be able to use PIL. Using pip install Pillow with python3.2, it fails with:

TypeError: Can't convert 'bytes' object to str implicitly


Command /usr/bin/python3.2 -c "import setuptools;file='/tmp/pip-build/Pillow/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-5ovsco-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/Pillow
Storing complete log in /root/.pip/pip.log

Exception info:

Exception information:
Traceback (most recent call last):
File "/usr/lib64/python3.2/site-packages/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/usr/lib64/python3.2/site-packages/pip/commands/install.py", line 261, in run
requirement_set.install(install_options, global_options)
File "/usr/lib64/python3.2/site-packages/pip/req.py", line 1166, in install
requirement.install(install_options, global_options)
File "/usr/lib64/python3.2/site-packages/pip/req.py", line 589, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib64/python3.2/site-packages/pip/util.py", line 612, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/python3.2 -c "import setuptools;file='/tmp/pip-build/Pillow/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-5ovsco-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/Pillow

Just wondering if this is supposed to work yet ( I read that it did, but can't remeber where) or if there is something I am missing. Thanks!

Officially support only 2.7 and 3.3 in Pillow 2.0.0

Any objections? 2.6 and 3.2 will likely continue to work, but it hurts my head to think about supporting them "officially".

Also for the grant work I'm doing, I'm going to test 2.6 because I said I would :-)

Notify watchers

Sorry all, I had intended to notify all watchers of the old repo (~100) but it looks like APIv3 only gave me 30 of them :-.

python 3.2: ImportError: The _imaging C module is not installed

I could make Pillow work for a few days on my AMD64 Ubuntu machine with python3.2. after the issue #41 was fixed (but commit was not merged).

Now it's merged but unfortunately when I use the last master build an import error is raised complaining about the imaging C module not being installed:

File "/usr/local/lib/python3.2/dist-packages/Pillow-1.7.8-py3.2-linux-x86_64.egg/PIL/Image.py", line 39, in getattr
raise ImportError("The _imaging C module is not installed")

And no python3-imaging package available of course...

Installing on OS X 10.8.1 fails with "'Python.h' file not found"

When trying to install Pillow, I run "sudo easy_install pillow", and receive the below. I ended up installing Pil instead, which gave the same error until I manually specified where to find the libraries (as described here: http://stackoverflow.com/questions/12180225/how-do-i-build-pil-on-os-x-mountain-lion/12180993#comment16321068_12180993 ).

Searching for pillow
Reading http://pypi.python.org/simple/pillow/
Reading http://github.com/collective/Pillow
Reading http://github.com/collective/pillow
Reading http://github.com/Pillow
Reading http://github.com/python-imaging/Pillow
Best match: Pillow 1.7.7
Downloading http://pypi.python.org/packages/source/P/Pillow/Pillow-1.7.7.zip#md5=0617fae88d62422b878906a3c394c687
Processing Pillow-1.7.7.zip
Running Pillow-1.7.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-VYWTNa/Pillow-1.7.7/egg-dist-tmp-fmLDmb
warning: no previously-included files found matching '.hgignore'
warning: no previously-included files found matching '.hgtags'
warning: no previously-included files found matching 'BUILDME.bat'
warning: no previously-included files found matching 'make-manifest.py'
warning: no previously-included files found matching 'SHIP'
warning: no previously-included files found matching 'SHIP.bat'
warning: no previously-included files matching '*' found under directory 'Tests'
--- using frameworks at /System/Library/Frameworks
clang: warning: argument unused during compilation: '-mno-fused-madd'
_imaging.c:75:10: fatal error: 'Python.h' file not found

include "Python.h"

     ^

1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1

fail install pillow on RHEL6

when i try to install pillow on RHEL6 , i get an error :

sh: dpkg-architecture: command not found

building '_imaging' extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBZ -I/usr/include/freetype2 -IlibImaging -I/usr/include -I/usr/local/include -I/usr/include/python2.6 -c _imaging.c -o build/temp.linux-x86_64-2.6/_imaging.o

_imaging.c:75:20: error: Python.h: No such file or directory

In file included from libImaging/Imaging.h:14,

             from _imaging.c:77:

.....
and long error bellow

please help me to fix it

Don't remove tostring() / fromstring() methods in Python 3.x

They are currently conditionally removed for Python 3.x; pattern is:

if bytes is str:
    # Declare fromstring as an alias for frombytes
    def fromstring(*args, **kw):
        warnings.warn(
            'fromstring() is deprecated. Please call frombytes() instead.',
            DeprecationWarning
        )
        return frombytes(*args, **kw)

I think this is a bad decision because "frombytes"/"tobytes" methods are not in PIL and with this change it would be not easy to write code that is compatible with both PIL and Pillow under 2.x and that works without deprecations on Python 3.x.

For example, take a look at http://docs.python.org/3/library/array.html#array.array.fromstring. While "fromstring" is deprecated, it is not removed.

I could submit a pull request if you agree with restoring fromstring/tostring in Python 3.x.

Something with pillow on mountain lion

Hello! I tried to use pillow (from pypi) on mountain lion and everything works ok except image quantification:

Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> Image.open('test.jpg')
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=720x480 at 0x10B013C68>
>>> img = Image.open('test.jpg')
>>> img.convert('P', palette=Image.ADAPTIVE, colors=256)
Abort trap: 6

And this is my dmesg:

CODE SIGNING: cs_invalid_page(0x107afe000): p=40028[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x10ff39000): p=40074[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x105834000): p=40083[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x106868000): p=40084[ReportCrash] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x10f869000): p=40118[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x10206f000): p=40139[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x10b707000): p=40171[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x104be7000): p=40197[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x102c44000): p=40208[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x10abe2000): p=40229[python] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x106c0f000): p=40240[ReportCrash] clearing CS_VALID
CODE SIGNING: cs_invalid_page(0x10c646000): p=40254[python] clearing CS_VALID

Install options:

    --------------------------------------------------------------------
    SETUP SUMMARY (Pillow 1.7.7 / PIL 1.1.7)
    --------------------------------------------------------------------
    version       1.7.7
    platform      darwin 2.7.2 (default, Jun 20 2012, 16:23:33)
                  [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
    --------------------------------------------------------------------
    --- TKINTER support available
    --- JPEG support available
    --- ZLIB (PNG/ZIP) support available
    --- FREETYPE2 support available
    --- LITTLECMS support available
    --------------------------------------------------------------------

Add COPYRIGHT and LICENSE file

I saw a License about PIL in README.rst but no LICENSE for Pillow nor a COPYRIGHT file. Could you add two of them for packager ?

Regards

Adding option to specify/keep quantization tables when saving to JPEG

I'm submitting my patch here because Alex Clark suggested it (many months ago...) and PIL looks definitely stalled.

My motivation was that the libjpeg default quantization are far from ideal in many scenarios. When specifying custom quantization tables it's possible to get better results for the same file size. Another motivation is to save the image with the same compression (quantization tables + subsampling) as the original, loosing less quality as possible.

My fork is here: https://bitbucket.org/etienned/pil-2009-raclette

See here for more info: http://stackoverflow.com/questions/4354543/determining-jpg-quality-in-python-pil/4355281

And here: http://www.reddit.com/r/Python/comments/ox2pc/added_jpeg_feature_to_pil_code_review_needed/

FLI sanity check fails


running test_file_fli ...
Tests/test_file_fli.py:10: im = Image.open(file) failed:
Traceback (most recent call last):
  File "Tests/test_file_fli.py", line 10, in test_sanity
    im = Image.open(file)
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/Image.py", line 2007, in open
    raise IOError("cannot identify image file")

selftest failing with latest patches

With the latest git revision, the selftest fails with these tracebacks:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/doctest.py", line 1289, in __run
    compileflags, 1) in test.globs
  File "<doctest selftest.testimage[34]>", line 1, in <module>
    _info(im.transform((512, 512), Image.EXTENT, (32,32,96,96)))
  File "./PIL/Image.py", line 1624, in transform
    im.__transformer((0, 0)+size, self, method, data, resample, fill)
  File "./PIL/Image.py", line 1667, in __transformer
    image.load()
  File "./PIL/ImageFile.py", line 218, in load
    n, e = d.decode(b)
TypeError: function takes exactly 2 arguments (1 given)

and

Traceback (most recent call last):
  File "/usr/lib64/python2.7/doctest.py", line 1289, in __run
    compileflags, 1) in test.globs
  File "<doctest selftest.testimage[8]>", line 1, in <module>
    _info(im)
  File "./selftest.py", line 22, in _info
    im.load()
  File "./PIL/ImageFile.py", line 167, in load
    self.load_prepare()
  File "./PIL/ImageFile.py", line 251, in load_prepare
    Image.Image.load(self)
  File "./PIL/Image.py", line 612, in load
    self.im.putpalette(*self.palette.getdata())
TypeError: function takes exactly 3 arguments (2 given)

Pillow and PIL coexistance failure: ImportError: No module named PIL-1

I tracked down this problem which prevented Plone start-up on a host which had both local PIL and PIllow installation. The solution was to remove locally installed PIL. Not sure which was the original cause, though.

Getting cryptic error message about PIL-1

  File "/srv/plone/buildout-cache/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 104, in includePluginsDirective
    includeZCMLGroup(_context, info, filename)
  File "/srv/plone/buildout-cache/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
    include(_context, filename, includable_package)
  File "/srv/plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/srv/plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/srv/plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/srv/plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/srv/plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/srv/plone/buildout-cache/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 51, in includeDependenciesDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
  File "/srv/plone/buildout-cache/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/dependency.py", line 24, in includableInfo
    module = resolve(dotted_name)
  File "/srv/plone/buildout-cache/eggs/zope.dottedname-3.4.6-py2.7.egg/zope/dottedname/resolve.py", line 32, in resolve
    found = __import__(used)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/srv/plone/isleofback-2012/parts/instance/etc/site.zcml", line 16.2-16.23
    ZopeXMLConfigurationError: File "/srv/plone/buildout-cache/eggs/Products.CMFPlone-4.1.5-py2.7.egg/Products/CMFPlone/configure.zcml", line 99.4-103.10
    ZopeXMLConfigurationError: File "/srv/plone/buildout-cache/eggs/mfabrik.webandmobile-1.0.12-py2.7.egg/mfabrik/webandmobile/configure.zcml", line 9.2-9.37
    ImportError: No module named PIL-1

Check if we have PIL by system:

  [~]# apt-cache show python-imaging
  Package: python-imaging
  Priority: optional
  Section: python
  Installed-Size: 969
  Maintainer: Ubuntu Developers <[email protected]>
  Original-Maintainer: Matthias Klose <[email protected]>
  Architecture: amd64
  Version: 1.1.7-4
  Provides: python2.7-imaging
  Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8), mime-support | python-imaging-tk, libc6 (>= 2.11), libfreetype6 (>= 2.2.1), libjpeg8 (>= 8c), liblcms1 (>= 1.15-1), zlib1g (>= 1:1.1.4)
  Suggests: python-imaging-doc, python-imaging-dbg
  Filename: pool/main/p/python-imaging/python-imaging_1.1.7-4_amd64.deb
  Size: 293840
  MD5sum: 4e8a67e97932495475d45c3e97fd7be5
  SHA1: f3be419953ad3d5def5d9313bcb0bb58cf0adf8a
  SHA256: fd0907a3ffc1542ec43f442b5fcd8669b652d7c08bd28d54f8d3fcd6d316d59e
  Description-en: Python Imaging Library
   The Python Imaging Library (PIL) adds an image object to your Python
   interpreter. You can load images from a variety of file formats, and
   apply a rich set of image operations to them.
   .
   Image Objects:
    o Bilevel, greyscale, palette, true colour (RGB), true colour with
      transparency (RGBA).
    o colour separation (CMYK).
    o Copy, cut, paste operations.
    o Flip, transpose, resize, rotate, and arbitrary affine transforms.
    o Transparency operations.
    o Channel and point operations.
    o Colour transforms, including matrix operations.
    o Image enhancement, including convolution filters.
   .
   File Formats:
    o Full (Open/Load/Save): BMP, EPS (with ghostscript), GIF, IM, JPEG,
      MSP, PDF, PNG, PPM, TIFF, XBM.
    o Read only (Open/Load): ARG, CUR, DCX, FLI, FPX, GBR, GD, ICO, IMT, IPTC,
      MCIDAS, MPEG, PhotoCD, PCX, PIXAR, PSD, TGA, SGI, SUN, TGA, WMF, XPM.
    o Save only: PDF, EPS (without ghostscript).
  Python-Version: 2.7
  Description-md5: b1ff3530f934831953fcad400af8d5d6
  Bugs: https://bugs.launchpad.net/ubuntu/+filebug
  Origin: Ubuntu
  Supported: 5y
  Task: ubuntu-desktop, ubuntu-usb, kubuntu-desktop, kubuntu-active-desktop, kubuntu-active, edubuntu-desktop, edubuntu-usb, xubuntu-desktop, mythbuntu-frontend, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, lubuntu-core, ubuntustudio-desktop
  en][13:19]

Get rid of it:

  [~]# apt-get remove python-imaging

No go, try harder::

  plone@hoegaarden:/srv/plone/isleofback-2012$ ls /usr/local/lib/python2.7/dist-packages/
  duplicity                  easy-install.pth            PIL-1.1.7-py2.7-linux-x86_64.egg     pycrypto-2.6-py2.7-linux-x86_64.egg  setuptools.pth
  duplicity-0.6.19.egg-info  paramiko-1.7.7.2-py2.7.egg  Pillow-1.7.7-py2.7-linux-x86_64.egg  setuptools-0.6c11-py2.7.egg-info

We RM it:

plone@hoegaarden:/srv/plone/isleofback-2012$ rm -rf ls /usr/local/lib/python2.7/dist-packages/PIL-1.1.7-py2.7-linux-x86_64.egg/

RuntimeError: dictionary changed size during iteration

I got this error:

    379         info = TiffImagePlugin.ImageFileDirectory(head)
    380         info.load(file)
--> 381         for key, value in list(info.items()):
    382             exif[key] = fixup(value)
    383         # get exif extension

/home/user/.virtualenvs/myproj/lib/python3.2/_abcoll.py in __iter__(self)
    431 
    432     def **iter**(self):
--> 433         for key in self._mapping:
    434             yield (key, self._mapping[key])
    435 

RuntimeError: dictionary changed size during iteration

When execute this code:
from sorl.thumbnail import get_thumbnail; im = get_thumbnail('/home/user/webapps/myproj/yourpics/media/users/user/images/after rain.jpg', '32x43')

PSF Grant

In order to find some time to finish reviewing and releasing Pillow for Python 3, I'm considering asking the PSF for some grant money to fund my development time. But I want to "do it right" so I'm asking for feedback here. E.g. @fluggo if the PSF approves my request can I forward some of the $$$ to you since you did the majority of the coding? If so, can you estimate how much time you put in, and also specify a conservative hourly rate estimate? E.g. "$50/hour". Would anyone else like to be compensated based on their contributions and pending a grant award from the PSF? Ready… go!

Fix numpy test

Tests/test_numpy.py:43: assert_image(to_image(numpy.int), "I", (10, 10)) failed:
Traceback (most recent call last):
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/Image.py", line 1913, in fromarray
    mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1), '<i8')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Tests/test_numpy.py", line 43, in test_numpy_to_image
    assert_image(to_image(numpy.int), "I", (10, 10))
  File "Tests/test_numpy.py", line 21, in to_image
    i = Image.fromarray(a)
  File "/Users/aclark/Developer/python-imaging/Pillow/PIL/Image.py", line 1916, in fromarray
    raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data type

Python 3.2 Encoder JPEG not available

Looks like this is old-school well known problem, but:

running build_ext
--------------------------------------------------------------------
SETUP SUMMARY (Pillow 1.7.8 / PIL 1.1.7)
--------------------------------------------------------------------
version      1.7.8
platform     linux2 3.2.3 (default, Jun 25 2012, 23:10:56)
             [GCC 4.7.1]
--------------------------------------------------------------------
*** TKINTER support not available

--- JPEG support available      <<<<<<<<<<< WOT? O_o
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available

--------------------------------------------------------------------

I've tried many advices from web like:

sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev

and

# ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
# ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
# ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib

Without any success.

System:
Debian wheezy/sid amd64
Python 3.2.3 in virtualenv

PNG encoder works fine.

Tests:

--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from .
--------------------------------------------------------------------
*** PIL CORE support not installed
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
*** FREETYPE2 support not installed
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
Traceback (most recent call last):
  File "/path/to/venv/lib/python3.2/site-packages/Pillow-1.7.8-py3.2-linux-x86_64.egg/PIL/Image.py", line 381, in _getencoder
    encoder = getattr(core, encoder_name + "_encoder")
AttributeError: 'module' object has no attribute 'jpeg_encoder'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path/to/venv/lib/python3.2/site-packages/tornado-2.4.1-py3.2.egg/tornado/web.py", line 1021, in _stack_context_handle_exception
    raise_exc_info((type, value, traceback))
  File "/path/to/venv/lib/python3.2/site-packages/tornado-2.4.1-py3.2.egg/tornado/util.py", line 90, in raise_exc_info
    raise exc_info[1].with_traceback(exc_info[2])
  File "/path/to/venv/lib/python3.2/site-packages/tornado-2.4.1-py3.2.egg/tornado/web.py", line 1139, in wrapper
    return method(self, *args, **kwargs)
  File "/path/to/venv/project/project/handlers/DevHandlers.py", line 88, in func
    area.save(admin_image, "JPEG")
  File "/path/to/venv/lib/python3.2/site-packages/Pillow-1.7.8-py3.2-linux-x86_64.egg/PIL/Image.py", line 1448, in save
    save_handler(self, fp, filename)
  File "/path/to/venv/lib/python3.2/site-packages/Pillow-1.7.8-py3.2-linux-x86_64.egg/PIL/JpegImagePlugin.py", line 470, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "/path/to/venv/lib/python3.2/site-packages/Pillow-1.7.8-py3.2-linux-x86_64.egg/PIL/ImageFile.py", line 451, in _save
    e = Image._getencoder(im.mode, e, a, im.encoderconfig)
  File "/path/to/venv/lib/python3.2/site-packages/Pillow-1.7.8-py3.2-linux-x86_64.egg/PIL/Image.py", line 385, in _getencoder
    raise IOError("encoder %s not available" % encoder_name)
IOError: encoder jpeg not available

import Image doesn't work in Pillow

I'm not sure if this is a deliberate choice for some reason, but this line works in PIL but not Pillow 1.7.8:

import Image

Pillow seems to require

from PIL import Image

Perplexing issue with Py 2.7 on OS X only

GLOB sdist-make: /Users/aclark/Developer/python-imaging/Pillow/setup.py
py26 inst-nodeps: /Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip
py26 runtests: commands[0]
--------------------------------------------------------------------
PIL (Pillow) TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from /Users/aclark/Developer/python-imaging/Pillow/.tox/py26/lib/python2.6/site-packages
--------------------------------------------------------------------
*** PIL CORE support not installed
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- G4 TIFF support ok
*** FREETYPE2 support not installed
*** LITTLECMS support not installed
*** WEBP support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
py26 runtests: commands[1]
--------------------------------------------------------------------
running test_000_sanity ...
running test_001_archive ...
running test_file_bmp ...
running test_file_fli ...
running test_file_gif ...
running test_file_ico ...
running test_file_jpeg ...
running test_file_msp ...
running test_file_pcx ...
running test_file_png ...
running test_file_ppm ...
running test_file_psd ...
running test_file_tar ...
running test_file_xbm ...
running test_file_xpm ...
running test_font_bdf ...
running test_font_pcf ...
running test_image ...
running test_image_array ...
running test_image_convert ...
running test_image_copy ...
running test_image_crop ...
running test_image_draft ...
running test_image_filter ...
running test_image_frombytes ...
running test_image_getbands ...
running test_image_getbbox ...
running test_image_getcolors ...
running test_image_getdata ...
running test_image_getextrema ...
running test_image_getim ...
running test_image_getpalette ...
running test_image_getpixel ...
running test_image_getprojection ...
running test_image_histogram ...
running test_image_load ...
running test_image_mode ...
running test_image_offset ...
running test_image_paste ...
running test_image_point ...
running test_image_putalpha ...
running test_image_putdata ...
running test_image_putpalette ...
running test_image_putpixel ...
running test_image_quantize ...
running test_image_resize ...
running test_image_rotate ...
running test_image_save ...
running test_image_seek ...
running test_image_show ...
running test_image_split ...
running test_image_tell ...
running test_image_thumbnail ...
running test_image_tobitmap ...
running test_image_tobytes ...
running test_image_transform ...
running test_image_transpose ...
running test_image_verify ...
running test_imagechops ...
running test_imagecms ...
running test_imagecolor ...
running test_imagedraw ...
running test_imageenhance ...
running test_imagefile ...
running test_imagefileio ...
running test_imagefilter ...
running test_imagefont ...
running test_imagegl ...
--- skipped
running test_imagegrab ...
--- skipped
running test_imagemath ...
running test_imagemode ...
running test_imageops ...
running test_imageops_usm ...
running test_imagepalette ...
running test_imagepath ...
running test_imageqt ...
--- skipped
running test_imagesequence ...
running test_imageshow ...
running test_imagestat ...
running test_imagetk ...
running test_imagetransform ...
running test_imagewin ...
running test_lib_image ...
running test_lib_pack ...
running test_mode_i16 ...
running test_numpy ...
--- skipped
--------------------------------------------------------------------
--- 4 tests skipped.
['test_imagegl', 'test_imagegrab', 'test_imageqt', 'test_numpy']
82 tests passed.
py27 inst-nodeps: /Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip
ERROR: invocation failed, logfile: /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/log/py27-2.log
ERROR: actionid=py27
msg=installpkg
cmdargs=[local('/Users/aclark/Developer/python-imaging/Pillow/.tox/py27/bin/pip'), 'install', '--download-cache=/Users/aclark/Developer/download-cache', '/Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip', '-U', '--no-deps']

Unpacking /Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip
  Running setup.py egg_info for package from file:///Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip

    warning: no previously-included files found matching '.hgignore'
    warning: no previously-included files found matching '.hgtags'
    warning: no previously-included files found matching 'BUILDME.bat'
    warning: no previously-included files found matching 'make-manifest.py'
    warning: no previously-included files found matching 'SHIP'
    warning: no previously-included files found matching 'SHIP.bat'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching 'README' under directory 'docs'
    warning: no files found matching 'CHANGES' under directory 'docs'
    warning: no files found matching 'CONTENTS' under directory 'docs'
Installing collected packages: Pillow
  Running setup.py install for Pillow
    --- using frameworks at /System/Library/Frameworks
    building '_imaging' extension
    xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/Users/aclark/Developer/python-imaging/Pillow/.tox/py27/include -I/usr/local/include -I/usr/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-x86_64-2.7/_imaging.o
    xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/Users/aclark/Developer/python-imaging/Pillow/.tox/py27/include -I/usr/local/include -I/usr/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c decode.c -o build/temp.macosx-10.8-x86_64-2.7/decode.o
    decode.c:417:5: warning: implicit declaration of function 'TRACE' is invalid in C99 [-Wimplicit-function-declaration]
        TRACE(("new tiff decoder %s\n", compname));
        ^
    decode.c:417:12: warning: expression result unused [-Wunused-value]
        TRACE(("new tiff decoder %s\n", compname));
               ^~~~~~~~~~~~~~~~~~~~~~~
    decode.c:441:43: error: use of undeclared identifier 'TIFFSTATE'
        decoder = PyImaging_DecoderNew(sizeof(TIFFSTATE));
                                              ^
    decode.c:448:11: warning: implicit declaration of function 'ImagingLibTiffInit' is invalid in C99 [-Wimplicit-function-declaration]
        if (! ImagingLibTiffInit(&decoder->state, compression, fp)) {
              ^
    3 warnings and 1 error generated.
    error: command 'xcrun' failed with exit status 1
    Complete output from command /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/bin/python -c "import setuptools;__file__='/var/folders/13/tp4qgs6x6fb17xbmf49vrqxc0000gn/T/pip-N0braQ-build/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/13/tp4qgs6x6fb17xbmf49vrqxc0000gn/T/pip-w0_135-record/install-record.txt --single-version-externally-managed --install-headers /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/bin/../include/site/python2.7:
    running install

running build

running build_py

creating build

creating build/lib.macosx-10.8-x86_64-2.7

creating build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/__init__.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/_binary.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ArgImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ExifTags.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/FontFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/Image.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageChops.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageCms.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageColor.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageFileIO.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageFont.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageGL.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageMath.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageMode.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageOps.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImagePath.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageQt.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageShow.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageStat.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageTk.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImageWin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/PSDraw.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/TarIO.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/TiffTags.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.8-x86_64-2.7/PIL

running build_ext

--- using frameworks at /System/Library/Frameworks

building '_imaging' extension

creating build/temp.macosx-10.8-x86_64-2.7

creating build/temp.macosx-10.8-x86_64-2.7/libImaging

xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/Users/aclark/Developer/python-imaging/Pillow/.tox/py27/include -I/usr/local/include -I/usr/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-x86_64-2.7/_imaging.o

xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/Users/aclark/Developer/python-imaging/Pillow/.tox/py27/include -I/usr/local/include -I/usr/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c decode.c -o build/temp.macosx-10.8-x86_64-2.7/decode.o

decode.c:417:5: warning: implicit declaration of function 'TRACE' is invalid in C99 [-Wimplicit-function-declaration]

    TRACE(("new tiff decoder %s\n", compname));

    ^

decode.c:417:12: warning: expression result unused [-Wunused-value]

    TRACE(("new tiff decoder %s\n", compname));

           ^~~~~~~~~~~~~~~~~~~~~~~

decode.c:441:43: error: use of undeclared identifier 'TIFFSTATE'

    decoder = PyImaging_DecoderNew(sizeof(TIFFSTATE));

                                          ^

decode.c:448:11: warning: implicit declaration of function 'ImagingLibTiffInit' is invalid in C99 [-Wimplicit-function-declaration]

    if (! ImagingLibTiffInit(&decoder->state, compression, fp)) {

          ^

3 warnings and 1 error generated.

error: command 'xcrun' failed with exit status 1

----------------------------------------
Command /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/bin/python -c "import setuptools;__file__='/var/folders/13/tp4qgs6x6fb17xbmf49vrqxc0000gn/T/pip-N0braQ-build/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/13/tp4qgs6x6fb17xbmf49vrqxc0000gn/T/pip-w0_135-record/install-record.txt --single-version-externally-managed --install-headers /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/bin/../include/site/python2.7 failed with error code 1 in /var/folders/13/tp4qgs6x6fb17xbmf49vrqxc0000gn/T/pip-N0braQ-build
Storing complete log in /Users/aclark/.pip/pip.log

py32 inst-nodeps: /Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip
py32 runtests: commands[0]
--------------------------------------------------------------------
PIL (Pillow) TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from /Users/aclark/Developer/python-imaging/Pillow/.tox/py32/lib/python3.2/site-packages
--------------------------------------------------------------------
*** PIL CORE support not installed
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- G4 TIFF support ok
*** FREETYPE2 support not installed
*** LITTLECMS support not installed
*** WEBP support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
py32 runtests: commands[1]
--------------------------------------------------------------------
running test_000_sanity ...
running test_001_archive ...
running test_file_bmp ...
running test_file_fli ...
running test_file_gif ...
running test_file_ico ...
running test_file_jpeg ...
running test_file_msp ...
running test_file_pcx ...
running test_file_png ...
running test_file_ppm ...
running test_file_psd ...
running test_file_tar ...
running test_file_xbm ...
running test_file_xpm ...
running test_font_bdf ...
running test_font_pcf ...
running test_image ...
running test_image_array ...
running test_image_convert ...
running test_image_copy ...
running test_image_crop ...
running test_image_draft ...
running test_image_filter ...
running test_image_frombytes ...
running test_image_getbands ...
running test_image_getbbox ...
running test_image_getcolors ...
running test_image_getdata ...
running test_image_getextrema ...
running test_image_getim ...
running test_image_getpalette ...
running test_image_getpixel ...
running test_image_getprojection ...
running test_image_histogram ...
running test_image_load ...
running test_image_mode ...
running test_image_offset ...
running test_image_paste ...
running test_image_point ...
running test_image_putalpha ...
running test_image_putdata ...
running test_image_putpalette ...
running test_image_putpixel ...
running test_image_quantize ...
running test_image_resize ...
running test_image_rotate ...
running test_image_save ...
running test_image_seek ...
running test_image_show ...
running test_image_split ...
running test_image_tell ...
running test_image_thumbnail ...
running test_image_tobitmap ...
running test_image_tobytes ...
running test_image_transform ...
running test_image_transpose ...
running test_image_verify ...
running test_imagechops ...
running test_imagecms ...
running test_imagecolor ...
running test_imagedraw ...
running test_imageenhance ...
running test_imagefile ...
running test_imagefileio ...
running test_imagefilter ...
running test_imagefont ...
running test_imagegl ...
--- skipped
running test_imagegrab ...
--- skipped
running test_imagemath ...
running test_imagemode ...
running test_imageops ...
running test_imageops_usm ...
running test_imagepalette ...
running test_imagepath ...
running test_imageqt ...
--- skipped
running test_imagesequence ...
running test_imageshow ...
running test_imagestat ...
running test_imagetk ...
running test_imagetransform ...
running test_imagewin ...
running test_lib_image ...
running test_lib_pack ...
running test_mode_i16 ...
running test_numpy ...
--- skipped
--------------------------------------------------------------------
--- 4 tests skipped.
['test_imagegl', 'test_imagegrab', 'test_imageqt', 'test_numpy']
82 tests passed.
py33 create: /Users/aclark/Developer/python-imaging/Pillow/.tox/py33
py33 inst: /Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip
py33 runtests: commands[0]
--------------------------------------------------------------------
PIL (Pillow) TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from /Users/aclark/Developer/python-imaging/Pillow/.tox/py33/lib/python3.3/site-packages
--------------------------------------------------------------------
*** PIL CORE support not installed
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- G4 TIFF support ok
*** FREETYPE2 support not installed
*** LITTLECMS support not installed
*** WEBP support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
py33 runtests: commands[1]
--------------------------------------------------------------------
running test_000_sanity ...
running test_001_archive ...
running test_file_bmp ...
running test_file_fli ...
running test_file_gif ...
running test_file_ico ...
running test_file_jpeg ...
running test_file_msp ...
running test_file_pcx ...
running test_file_png ...
running test_file_ppm ...
running test_file_psd ...
running test_file_tar ...
running test_file_xbm ...
running test_file_xpm ...
running test_font_bdf ...
running test_font_pcf ...
running test_image ...
running test_image_array ...
running test_image_convert ...
running test_image_copy ...
running test_image_crop ...
running test_image_draft ...
running test_image_filter ...
running test_image_frombytes ...
running test_image_getbands ...
running test_image_getbbox ...
running test_image_getcolors ...
running test_image_getdata ...
running test_image_getextrema ...
running test_image_getim ...
running test_image_getpalette ...
running test_image_getpixel ...
running test_image_getprojection ...
running test_image_histogram ...
running test_image_load ...
running test_image_mode ...
running test_image_offset ...
running test_image_paste ...
running test_image_point ...
running test_image_putalpha ...
running test_image_putdata ...
running test_image_putpalette ...
running test_image_putpixel ...
running test_image_quantize ...
running test_image_resize ...
running test_image_rotate ...
running test_image_save ...
running test_image_seek ...
running test_image_show ...
running test_image_split ...
running test_image_tell ...
running test_image_thumbnail ...
running test_image_tobitmap ...
running test_image_tobytes ...
running test_image_transform ...
running test_image_transpose ...
running test_image_verify ...
running test_imagechops ...
running test_imagecms ...
running test_imagecolor ...
running test_imagedraw ...
running test_imageenhance ...
running test_imagefile ...
running test_imagefileio ...
running test_imagefilter ...
running test_imagefont ...
running test_imagegl ...
--- skipped
running test_imagegrab ...
--- skipped
running test_imagemath ...
running test_imagemode ...
running test_imageops ...
running test_imageops_usm ...
running test_imagepalette ...
running test_imagepath ...
running test_imageqt ...
--- skipped
running test_imagesequence ...
running test_imageshow ...
running test_imagestat ...
running test_imagetk ...
running test_imagetransform ...
running test_imagewin ...
running test_lib_image ...
running test_lib_pack ...
running test_mode_i16 ...
running test_numpy ...
--- skipped
--------------------------------------------------------------------
--- 4 tests skipped.
['test_imagegl', 'test_imagegrab', 'test_imageqt', 'test_numpy']
82 tests passed.
___________________________________ summary ____________________________________
  py26: commands succeeded
ERROR:   py27: InvocationError: /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/bin/pip install --download-cache=/Users/aclark/Developer/download-cache /Users/aclark/Developer/python-imaging/Pillow/.tox/dist/Pillow-2.0.0.zip -U --no-deps (see /Users/aclark/Developer/python-imaging/Pillow/.tox/py27/log/py27-2.log)
  py32: commands succeeded
  py33: commands succeeded
aclark@Alexs-MacBook-Pro:~/Developer/python-imaging/Pillow/ > 

_imaging C module cannot be found - OSX Mountain Lion

I have verified that libjpeg is installed and that it is on the path at install time. The log after running pip install shows that JPEG support is available, yet when I get the following traceback when saving images.

File "/Users/205250/projects/gonation/gonation/models/shouts.py", line 131, in addimage
    img.convert('RGB').save(output_buffer, format = 'jpeg', quality=100)
  File "/Users/205250/projects/gonation/env/lib/python2.7/site-packages/PIL/Image.py", line 677, in convert
    self.load()
  File "/Users/205250/projects/gonation/env/lib/python2.7/site-packages/PIL/ImageFile.py", line 164, in load
    self.load_prepare()
  File "/Users/205250/projects/gonation/env/lib/python2.7/site-packages/PIL/ImageFile.py", line 231, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
  File "/Users/205250/projects/gonation/env/lib/python2.7/site-packages/PIL/Image.py", line 37, in __getattr__
    raise ImportError("The _imaging C module is not installed")

I have looked at the path and verified that I do not have any brew installed or system versions conflicting. The pillow install is in a virtualenv.

Failures on Python 3.3 for Windows

All tests pass on Python 2.6 to 3.2, 32 and 64 bit.

Tests results for Pillow-2.0.0.win-amd64-py3.3:

--------------------------------------------------------------------
SETUP SUMMARY (Pillow 2.0.0 / PIL 1.1.7)
--------------------------------------------------------------------
version      2.0.0
platform     win32 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17)
             [MSC v.1600 64 bit (AMD64)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
--- LITTLECMS support available
--------------------------------------------------------------------
To check the build, run the selftest.py script.
--------------------------------------------------------------------
PIL (Pillow) TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from .\PIL
Binary modules loaded from .\PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--- LITTLECMS support ok
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
Press any key to continue . . .
--------------------------------------------------------------------
running test_000_sanity ...
running test_001_archive ...
running test_file_bmp ...
running test_file_fli ...
running test_file_gif ...
running test_file_ico ...
running test_file_jpeg ...
running test_file_msp ...
running test_file_pcx ...
running test_file_png ...
running test_file_ppm ...
running test_file_psd ...
running test_file_tar ...
running test_file_tiff ...
running test_file_xbm ...
running test_file_xpm ...
running test_font_bdf ...
running test_font_pcf ...
running test_image ...
running test_image_array ...
running test_image_convert ...
running test_image_copy ...
running test_image_crop ...
running test_image_draft ...
running test_image_filter ...
running test_image_frombytes ...
running test_image_getbands ...
running test_image_getbbox ...
running test_image_getcolors ...
Tests\test_image_getcolors.py:21: assert_equal(getcolors("P"), 54) # fixed palette failed:
- got 85, expected 54
running test_image_getdata ...
running test_image_getextrema ...
Tests\test_image_getextrema.py:14: assert_equal(extrema("P"), (11, 218)) # fixed palette failed:
- got (11, 225), expected (11, 218)
running test_image_getim ...
running test_image_getpalette ...
running test_image_getpixel ...
running test_image_getprojection ...
running test_image_histogram ...
Tests\test_image_histogram.py:11: assert_equal(histogram("1"), (256, 0, 8872)) failed:
- got (256, 0, 8757), expected (256, 0, 8872)
Tests\test_image_histogram.py:15: assert_equal(histogram("P"), (256, 0, 2912)) failed:
- got (256, 0, 2369), expected (256, 0, 2912)
running test_image_load ...
running test_image_mode ...
running test_image_offset ...
running test_image_paste ...
running test_image_point ...
running test_image_putalpha ...
running test_image_putdata ...
running test_image_putpalette ...
running test_image_putpixel ...
running test_image_quantize ...
running test_image_resize ...
running test_image_rotate ...
running test_image_save ...
running test_image_seek ...
running test_image_show ...
running test_image_split ...
running test_image_tell ...
running test_image_thumbnail ...
running test_image_tobitmap ...
running test_image_tobytes ...
running test_image_transform ...
running test_image_transpose ...
running test_image_verify ...
running test_imagechops ...
running test_imagecms ...
running test_imagecolor ...
running test_imagedraw ...
running test_imageenhance ...
running test_imagefile ...
running test_imagefileio ...
running test_imagefilter ...
running test_imagefont ...
running test_imagegl ...
--- skipped
running test_imagegrab ...
running test_imagemath ...
running test_imagemode ...
running test_imageops ...
running test_imageops_usm ...
running test_imagepalette ...
running test_imagepath ...
running test_imageqt ...
--- skipped
running test_imagesequence ...
running test_imageshow ...
running test_imagestat ...
running test_imagetk ...
running test_imagetransform ...
running test_imagewin ...
running test_lib_image ...
running test_lib_pack ...
running test_mode_i16 ...
running test_numpy ...
--- skipped
--------------------------------------------------------------------
--- 3 tests skipped.
['test_imagegl', 'test_imageqt', 'test_numpy']
*** 3 tests of 84 failed.

Pillow breaks doctest and so zope.testrunner

Major issue

We have a doctest.py file in Pillow that override builtin doctest

When i try to run tests i get :

thomasdesvenain@jagulep:~/buildouts/webpro$./bin/test -s webpro.policy
Traceback (most recent call last):
File "./bin/test", line 248, in
'--test-path', '/home/thomasdesvenain/buildouts/webpro/src/webpro.policy',
File "/home/thomasdesvenain/.buildout/eggs/zope.testrunner-4.0.4-py2.7.egg/zope/testrunner/init.py", line 30, in run
failed = run_internal(defaults, args, script_parts=script_parts)
File "/home/thomasdesvenain/.buildout/eggs/zope.testrunner-4.0.4-py2.7.egg/zope/testrunner/init.py", line 41, in run_internal
from zope.testrunner.runner import Runner
File "/home/thomasdesvenain/.buildout/eggs/zope.testrunner-4.0.4-py2.7.egg/zope/testrunner/runner.py", line 35, in
import zope.testrunner._doctest
File "/home/thomasdesvenain/.buildout/eggs/zope.testrunner-4.0.4-py2.7.egg/zope/testrunner/_doctest.py", line 56, in
doctest.DocTestCase.failureException = DocTestFailureException

When I try to pip install pillow, I get an error: ‘JPEG_LIB_VERSION’ undeclared

gcc -pthread -fno-strict-aliasing -fPIC -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/include/freetype2 -IlibImaging -I/opt/ActivePython-2.7/include -I/usr/include/tcl8.5 -I/usr/local/include -I/usr/include -I/opt/ActivePython-2.7/include/python2.7 -I/usr/include/x86_64-linux-gnu -c libImaging/JpegDecode.c -o build/temp.linux-x86_64-2.7/libImaging/JpegDecode.o

libImaging/JpegDecode.c: In function ‘ImagingJpegDecode’:

libImaging/JpegDecode.c:136:2: error: ‘JPEG_LIB_VERSION’ undeclared (first use in this function)

libImaging/JpegDecode.c:136:2: note: each undeclared identifier is reported only once for each function it appears in

error: command 'gcc' failed with exit status 1


Command /opt/ActivePython-2.7/bin/python -c "import setuptools;file='/app/build/pillow/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /tmp/pip-AcU1C_-record/install-record.txt failed with error code 1 in /app/build/pillow
Storing complete log in /app/.pip/pip.log

All the pillow dependencies are install using apt-get:

$ sudo apt-get install libjpeg-dev libfreetype6-dev zlib1g-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libjpeg-dev is already the newest version.
zlib1g-dev is already the newest version.
libfreetype6-dev is already the newest version.
libfreetype6-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

ImageFile.Parser.feed() breaks with some jpeg images: "ValueError: tile cannot extend outside image"

This is a copy from upstream issue: http://hg.effbot.org/pil-2009-raclette/issue/30/imagefileparserfeed-breaks-with-some-jpeg

The attached image is there, @github won't let me upload this 7mb image.


I get this error: "ValueError: tile cannot extend outside image" when trying to feed the Parser small chunks of the attached image.
The code that does this comes from Django: https://github.com/django/django/blob/master/django/core/files/images.py#L58 in order to get the image height and width without loading all the image in memory.

I've tracked this error down to https://bitbucket.org/effbot/pil-117/src/f356a1f64271e9d3206fcf9059492ba1c9e163d6/PIL/ImageFile.py?at=default#cl-420 and later in https://bitbucket.org/effbot/pil-117/src/f356a1f64271e9d3206fcf9059492ba1c9e163d6/decode.c?at=default#cl-159

I don't know why this breaks with this image and not with other images, I haven't found anything wrong with this one.

Pillow-1.7.8 have no selftest.py and run selftest.py that downloaded from github is failed on win32 env.

Pillow-1.7.8 release sdist have no selftest.py. Is this planned? (Release note described 'doctests.py was removed').

I built Pillow-1.7.8 on win32 environment and test by selftests.py that downloaded from https://github.com/python-imaging/Pillow/blob/master/selftest.py is failed.

***Test Failed*** 22 failures.
*** 22 tests of 57 failed.

(all test output is here: https://gist.github.com/3997327)

How do I check my pyd is not broken?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.