Jump to content

Auto sizing photo for display.


NevadaSam

Recommended Posts

After my PHP script has uploaded a photo I want to display it in a table cell which is 450 wide and 338 tall. This is a proportional reduction for a image that is of normal shape of 800x600. However if the photo was taken with the camera held sideways or has been cropped and does not have proportional sizes, then it will appear stretched and distorted. So I cannot simply code <img src="$PhotoName" width="450" height="338">. I need PHP to determine if the photo is say: 338x450, then only display it with a width of 253 and use the max height of 338 so it want look distorted.

Can this be done with PHP? I know it could not be simple HTML because calculations will have to be made. Sorry I have no code to post on this manner. I wrote the unloader and form, but I have now idea as how to start this. If there are links or code anyone can provide to get me get me started, I will really appreciate it.

Thanks,

Sam
;
Link to comment
https://forums.phpfreaks.com/topic/34314-auto-sizing-photo-for-display/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.