Before someone says "sudo apt-get install libjpeg-dev"
or something along those lines, I do not have sudo access. I am on a slice of a server that does NOT allow me to have sudo access. So I've gotta do this entire thing in my local directory. That's the only way I can do it.
I need a python script to resize an image. It works perfectly fine for png files, but it falls apart on jpeg files with the error listed in the title.
Here are the steps I've taken so far:
- Downloaded
libjpeg-dev
and installed it to$HOME/jpegtest
, so inside the jpegtest/ folder is lib/, include/, and so on - I downloaded
Pillow
manually and extracted it out to$HOME/Pillow
- I edited the
setup.py
fild so theJPEG_ROOT
to alibinclude(<absolute path to jpegtest>)
I built and compiled
Pillow
, where it installed to$HOME//.pythonbrew/pythons/Python-2.7.5/lib/python2.7/site-packages/Pillow-2.4.0-py2.7-linux-x86_64.egg
The important part of the output is as follows:*** TKINTER support not available --- JPEG support available *** OPENJPEG (JPEG2000) support not available --- ZLIB (PNG/ZIP) support available *** LIBTIFF support not available *** FREETYPE2 support not available *** LITTLECMS2 support not available *** WEBP support not available *** WEBPMUX support not available
So I would assume that this means JPEG support will function, but when I run my program it says:
IOError: decoder jpeg not available
While typing this I also noticed the question at Pillow recognizes JPEG encoder on install, but not use, which sounded very close to mine, so I tried the solution there:
ln -s /media/sdl1/home/midnight/jpegtest/lib/libjpeg.so /media/sdl1/home/midnight/.pythonbrew/pythons/Python-2.7.5/lib
But I still have the same error.
I've been working on this problem for about two days now, and I'm not entirely sure what to do. If anyone could offer some assistance, that would be very helpful.
ldd
as in this answer stackoverflow.com/a/24397115/162768 and see what path it's looking for.