[Image-SIG] DPI

Edward Cannon edward at unicornschool.org
Mon Apr 19 19:02:19 CEST 2010


I find that the info object often does not have the exact key you are
looking for, many different encoders use slightly different variants, or
don't include it at all. My best advice is to print out the info for several
of your files and look for patterns. Also there are some tools for working
more directly with EXIF data, these might also be useful. Unfortunately this
area is not really standard, so every solution is likely to break down
sometimes.
Edward Cannon

On Fri, Apr 16, 2010 at 5:48 AM, Samuel Moore <blindlemonsam at gmail.com>wrote:

>  I am trying to determine DPI from images. Can anyone help?
>
> I tried:
>
>
>
> img = Image.open(“Hamerkop.jpg”)
>
> img.info[“dpi”]
>
>
>
> but it doesn’t work for all jpegs.
>
>
>
> Python 2.5.1
>
> PIL 1.1.7
>
>
>
> Regards,
>
> Sam
>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20100419/110265d7/attachment.html>


More information about the Image-SIG mailing list