davidcriniti Posted August 17, 2010 Share Posted August 17, 2010 Hi folks, I'm using this code to display a picture that is uploaded in a form. print "<img src='http://www.coast2kosci.com/mylongrun/test/photo_uploads/$imgx' width='300' height='300' alt='Your photo' />"; At first I tried specifying only the width, without the height. But for tall photos, the display wasn't really what I was after. Then I specified both width and height, which results in a mis-scaled photo. Is there any way that I can specify the height and width atributes as a sort of maximum / or limiter. Ie: If the height is greater than the width, limit the height to 300, and if the width is greater than the height, limit the width to 300? Thanks for your time, Dave Quote Link to comment Share on other sites More sharing options...
helloworld2010 Posted August 17, 2010 Share Posted August 17, 2010 getimagesize function would be useful for your question, check the manual for details... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.