NevadaSam Posted January 15, 2007 Share Posted January 15, 2007 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 More sharing options...
trq Posted January 15, 2007 Share Posted January 15, 2007 Take a look at the functions available in the [url=http://php.net/gd]gd[/url] extension. Link to comment https://forums.phpfreaks.com/topic/34314-auto-sizing-photo-for-display/#findComment-161405 Share on other sites More sharing options...
NevadaSam Posted January 15, 2007 Author Share Posted January 15, 2007 I have found that there are many post about image resizing in forums. Let me do what I should have done before posting. I will research and study a ot and let you all know if I have any problems.thanks,Sam; Link to comment https://forums.phpfreaks.com/topic/34314-auto-sizing-photo-for-display/#findComment-161442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.