Jump to content

Automatically resizing an image to any format


vineld

Recommended Posts

What method do you use if you want to automatically resize an uploaded image to any given format (that fits within it of course but isn't necessarily of the same proportions)?

 

What I do right now is that I simply check to see what proportions the original image has compared to the one I want to create. Depending on this I start by shrinking it down along either the x or y axis. I now have an image which is either as high or as wide as the one I want.

 

Next I simply cut the middle part of the image since focus is usually in the center of photos. This seems to work well in most cases for "horizontal" images although not always as well for higher "vertical" ones.

 

Are there any other better methods of doing this?

 

Note: This is not about simply resizing a photo, cropping needs to be done as well, unless the proportions happen to be the same.

Link to comment
Share on other sites

Thanks, at least I'm not way off  :P

 

Yeah, letting the user choose himself is the optimal solution but for some sites I have had thousands of photos that needs to be resized and it's too time consuming to handle them manually.

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.