Re: Finding out DPI using GD

From: Date: Wed, 15 Feb 2006 00:07:58 +0000
Subject: Re: Finding out DPI using GD
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-230401@lists.php.net to get a copy of this message
Thanks. I might give the new versions a try :) IIRC, I think the unix exif function returns dpi as well but I'm working on a windows machine without cygwin, so can't be certain. ""Richard Lynch"" <ceo@l-i-e.com> wrote in message news:60223.67.108.68.36.1139960221.squirrel@www.l-i-e.com... > On Tue, February 14, 2006 2:15 pm, Karuna wrote: >> Hi. Is it possible to find out the dpi of an image (preferably jpeg) >> in php? >> I can't seem to find any function to do this. > > http://php.net/getimagesize > > However, I have found that: > > 1. EXIF data in the JPEG will make it puke. > 2. It doesn't seem to always correctly calculate width/heigh/DPI > independently -- It seems like the numbers get shifted so that the > total: > $WIDTH * $HEIGHT * $DPI is correct, but not the individual numbers... > > This has been my experience with a large variety of images from > disparate sources, many of which are probably badly-formated JPEGs in > the first place, so it may be a non-concern if you have quality > image-editing tools making the JPEGs. > > Note that PDI info is returned only in "recent" versions of PHP / GD. > > -- > Like Music? > http://l-i-e.com/artists.htm

« previous php.general (#230401) next »