[reportlab-users] Image Flowable and Raster Image Dimensions 1pt != 1px?!

Tim Roberts timr at probo.com
Thu Jan 21 12:47:43 EST 2010


Rich Andrews wrote:

> So far so good with ReportLab/PLATYPUS but I've stubbed my toe one

> something and can't find a solution in the doc/forum. And this is no

> doubt obvious.

>

> An image, images/SampleGraph1.gif, is created in the filesystem: 50 by

> 50 pixels; 72 PPI (per GIMP). Both gif's and png's exhibit the

> observed behavior.

>

> A Flowable is subsequently constructed with the image.

> Image('images/SampleGraph1.gif', 50, 50)

>

> The image renders in the PDF larger than 50x50 it renders at about

> 77x77.

>

> So if I construct the Flowable at (50/77) 32.45 x 32.45 things look

> proper in the PDF.

>

> Where I'm stuck is that if my image is 72 pixels per inch and there

> are 72 points per inch, then shouldn't things be 1 pixel per 1 point?

> If so, I should be constructing the Image Flowable with 50x50.


Odd. I just set up an example exactly like this, and the image came out
exactly as expected. It was a 150x144 GIF at 72 dpi, and Acrobat shows
that it measures 2.02" x 2".

Is it possible you have done a transform on your canvas to change the scale?

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list