hdbrandon Posted July 27, 2011 Share Posted July 27, 2011 I'm looking for the best way to approach this-my idea isn't formatting nicely. (visit http://qa.theapron.com/index2.php and click either the 2nd or 12th photo....they have test content) Basically, a user uploads a photo. I'm threading a html form with <text area and comments below it. I'm using getimagesize() to get the heightXwidth of the photo, and setting text area cols= 7/8 or 1/2 the width of the photo. But, that doesnt translate well in all instances. So, what's the best was, knowing that the users can upload a variety of photo sizes, to keep the comment thread and form clean? The other idea I had was to resize the photo on upload to a specifc size. If the photo was smaller than that pre-dermined size, someone mat and center it. Are there scripts around that do that? Quote Link to comment https://forums.phpfreaks.com/topic/242896-text-area-size-based-on-picture-size/ Share on other sites More sharing options...
braunshedd Posted July 27, 2011 Share Posted July 27, 2011 Making the text area scale to the size of an image is not a good idea. If the user uploads a 100000000x1000000000 picture, their browser window will be HUGE If the user uploads a 1x1 picture, you wont be able to read the bottom text It would be better if you set the image and text to a fixed height and width If you set the height and width of an image in css (or html), it will resize the image to fit, whether it is smaller or bigger hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/242896-text-area-size-based-on-picture-size/#findComment-1247674 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.