Jump to content

Text area size based on picture size


hdbrandon

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.