Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble with PIL python
    text
    copied!<p>Hi I'm trying to use PIL to be able to upload images to my django website through the admin interface. </p> <p>Heres the result of a test that I ran after I installed PIL:</p> <pre><code>cfarm:Imaging-1.1.7 christopherfarm$ python selftest.py -------------------------------------------------------------------- PIL 1.1.7 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from ./PIL Binary modules loaded from /Library/Python/2.6/site-packages/PIL -------------------------------------------------------------------- *** PIL CORE support not installed *** TKINTER support not installed *** JPEG support not installed --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not installed *** LITTLECMS support not installed -------------------------------------------------------------------- Running selftest: ***************************************************************** Failure in example: try: _info(Image.open(os.path.join(ROOT, "Images/lena.jpg"))) except IOError, v: print v from line #24 of selftest.testimage Expected: ('JPEG', 'RGB', (128, 128)) Got: decoder jpeg not available 1 items had failures: 1 of 57 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 57 failed. </code></pre> <p>I'm a bit of a newbie when it comes to this, is there a way to get all the types supported? I also tried to upload a .png file and it still didn't work. I get the error: <code>Upload a valid image. The file you uploaded was either not an image or a corrupted image.</code></p> <p>Also when trying to run <code>sudo python setup.py build</code> I get the following error:</p> <pre><code>cfarm:Imaging-1.1.7 christopherfarm$ sudo python setup.py build running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension creating build/temp.macosx-10.6-universal-2.6 creating build/temp.macosx-10.6-universal-2.6/libImaging gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o _imaging.c:3017: warning: initialization from incompatible pointer type _imaging.c:3077: warning: initialization from incompatible pointer type /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed Installed assemblers are: /usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64 /usr/bin/../libexec/gcc/darwin/i386/as for architecture i386 _imaging.c:3017: warning: initialization from incompatible pointer type _imaging.c:3077: warning: initialization from incompatible pointer type l_imaging.c:3281: fatal error: error writing to -: Broken pipe compilation terminated. _imaging.c:3017: warning: initialization from incompatible pointer type _imaging.c:3077: warning: initialization from incompatible pointer type ^R lipo: can't open input file: /var/tmp//ccuPSrVi.out (No such file or directory) error: command 'gcc-4.2' failed with exit status 1 </code></pre> <p>Seems like something is wrong with the pointer?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload