Hello list, I've just started attempting to use pyx, and am faced with
an awkward situation when trying to feed it a JPG. A minimalistic example:
import Image
from pyx import *
f="myfile.jpg"
im=Image.open(f)
w,h=im.size
print w,h #gives the correct values for width and height, im.info
has no DPI values in it.
c=canvas.canvas()
i = bitmap.jpegimage(f)
c.insert(bitmap.bitmap(0,0,i,compressmode=None)) #error occurs here
c.writePDFfile("output")
When ran, the following error occurs:
File "/usr/lib/python2.4/site-packages/pyx/bitmap.py", line 179, in
__init__
widthdpi, heightdpi = image.info["dpi"] # XXX fails when no dpi
information available
And sure enough - as noted in the snippet above, the image has no DPI
data. Much the same happens when trying to feed it the *im* image by
the method documented in the examples.
I DO, however, have both width and height for it... if only I could feed
them to pyx somehow. Am I missing a different constructor or some such ?
Or, in a slightly bassackwards manner, is there a way to inject DPI
information into the image with the PIL? Basically any workaround will do.
Thanks for your time. Best regards,
Manuel
begin:vcard
fn:Manuel A. Gomes
n:Gomes;Manuel
org:Segula Tecnologia e Engenharia Portugal, SA;R&D
adr;quoted-printable:;;Lagoas Park, Edif=C3=ADcio 8, Piso 1;Porto Salvo;;2740-265;Portugal
email;internet:[EMAIL PROTECTED]
title:Senior Consultant
tel;work:+351 21 487 61 30
tel;cell:913485087
x-mozilla-html:TRUE
url:http://www.segula.pt
version:2.1
end:vcard
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user