Re: How does one obtain the resolution of an image in PHP?
| From: | Simon M. Campden-Main | Date: | Thu, 16 Mar 2006 17:20:45 +0000 |
| Subject: | Re: How does one obtain the resolution of an image in PHP? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232041@lists.php.net to get a copy of this message | ||
Thank you for your response, Tedd.
T> There was a discussion on this a few weeks back -- you might look through
the archives.
I'm reasonably certain I saw the thread but it was no help. I will go back
and review it in case I missed something.
T> However, the bottom line was that images (other than exif notations) do
not
contain any resolution information because the resolution of any image is up
to
the method you wish to view it.
Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes
up
with PPI (Image - Image information). I have several thousand scanned
images
with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint
Shop
Pro) and want to discard, or more likely tag as rejected, any that suffer a
resolution of less than 150 PPI. As you might imagine, I find the thought
of
doing it manually with Paint Shop Pro repugnant.
T> For example, if you take an image that is 1000 x 1000 pixels and wish
to view it at 72 dpi, then the image size will be 13.8 x 13.8 inches.
If you want to view it at 300 dpi, then the image size will be 3.33
by 3.33 inches in size.
Understand?
I think so, but I am a bit dense. I'm not concerned with image size but
rather
native resolution. Thanks again for taking the time.
Simon
simon@freelib.org
"tedd" <tedd@sperling.com> wrote in message
news:p06230909c03f463b860b@[192.168.1.104]...
> >Good morning, folks.
>>
>>Can any one direct me to a snippet or suggest an approach to obtaining the
>>resolution of an image [file] with PHP. exif_read_data() is great if the
>>image
>>was taken with a camera that is exif compliant, but is no help with my
>>scanned
>>images. getimagesize() gives me height and width - not much help that I
>>can
>>see. I want ppi! I've no doubt that this is another case where the answer
>>is
>>painfully obvious and my mind to dull, but I've spent the better part of
>>the
>>day searching usenet groups and the PHP docs and come up with naught.
>>I'm running the current Cent OS distribution of EL, PHP Version 4.3.9
>>with,
>>of
>>course, GD support. Any suggestions would be most appreciated.
>>Thank you.
>>Simon
>
> Simon:
>
> There was a discussion on this a few weeks back -- you might look through
> the archives.
>
> However, the bottom line was that images (other than exif notations) do
> not contain any resolution information because the resolution of any image
> is up to the method you wish to view it.
>
> For example, if you take an image that is 1000 x 1000 pixels and wish to
> view it at 72 dpi, then the image size will be 13.8 x 13.8 inches. If you
> want to view it at 300 dpi, then the image size will be 3.33 by 3.33
> inches in size.
>
> Understand?
>
> tedd
> --
> --------------------------------------------------------------------------------
> http://sperling.com