Image Resolution

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dead_Ed
Forum Newbie
Posts: 2
Joined: Wed Aug 29, 2007 9:58 am

Image Resolution

Post by Dead_Ed »

I have read a lot about image resolutions and heard that it's not possible to set image resolutions in PHP due to resolution not being too relevant on the net, but my question is:

Is there ANY WAY for me to specify / check image resolution of an image stored on my server so that i can determine whether it's good enough to print / download?

I can work out all the width / height details etc... but resolution seems almost impossible.

I've read everything in the PHP manual that I can think of.

Any suggestions?

Thanks.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

You'll need to be a bit more specific. When you say "an image stored on my server" what exactly are we talking about? A jpeg, a gif, a png, a tiff, a psd? Jpeg files can have DPI and print dimensions specified in the file header but they rarely do. Gif and PNG files never do. I'm not sure about tiff files. PSD files do, but the format is secret so it's virtually impossible to get the information out.

If you're handling images that are going to be uploaded by people who you can train to handle them in a specific manner then you may be able to write something to read the image header and get what you need. If you're handling images uploaded by the public then give up now because you'll never get images with proper headers.
Post Reply