[Image-SIG] problems setting DPI in TIFF files
Thomi Richards
thomir at gmail.com
Tue Oct 10 01:35:06 CEST 2006
Hello,
I'm generating some TIFF files using the PIL. These files then get sent to
another applicaion which prints them. I have been told that there is a field
in TIFF files which sets the image resolution. The documentation for
1.1.5states that:
"
The *open* method sets the following *info* properties:
*compression*
Compression mode.
*dpi*
(1.1.5) Image resolution as an (xdpi, ydpi) tuple, where applicable. You can
use the *tag* attribute to get more detailed information about the image
resolution.
"I downloaded and cmpiled 1.1.5, but these attributes do not show up. Here's
an example:
>>> import Image
>>> im = Image.open('Bishop_Bob.tiff')
>>> im.dpi
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: TiffImageFile instance has no attribute 'dpi'
I tried using the "im.tag" attribute, but I cannot work out what tag number
I should be looking at. In any case, none of the tags present contain the
value of 72, which seems to be the default resolution of the image.
I hope someone out there can help, I've been trying to crack this problem
for a few days now.
Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/image-sig/attachments/20061010/377f0f65/attachment.htm
More information about the Image-SIG
mailing list