Tareq Alam

i have promises to keep and miles to go before i sleep – Robert Frost

pdflatex running silentmode June 24, 2009

Filed under: 1 — tareqalam @ 10:33 am
Tags: , , , , ,

run this command in terminal to create pdf from the tex file silently

pdflatex -interaction=batchmode texfilename.tex

 

PIL: IOError: encoder jpeg not available June 2, 2009

Filed under: 1 — tareqalam @ 7:07 am
Tags: , , , , ,

I have got this error while doing this
import tempfile
bg_new=Image.new(‘RGB’,(486,236), GREEN)
tmp = tempfile.mktemp(suffix=’.%s’ % ‘jpg’)
bg_new.save(tmp, “JPEG”, quality=95)

I was looking for solution and got this:

in setup.py in Imaging-1.1.6 that is PIL 1.1.6
set this
JPEG_ROOT = “/usr/lib64″, “/usr/include”
then in terminal
python setup.py build –force
this will include libjpeg in PIL. before you may need to install libjpeg in your linux system. I have tried this with python2.4 in ubuntu 8.10
hope this works