google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

Resize/crop images on upload #530

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What functionality do you want to see?

I would like to be able to set the exact size in pixels for an image upload for 
each image field. 

As it stands, I have to rely on the user to save their images at the right size 
before they upload them and, users being users, they often don't! I would like 
to be able to specify the size of the image that the image field will accept 
and, if the uploaded image is not of the correct size, offer to either 
automatically resize/crop, or offer a cropping tool so that the user can crop 
it as they would wish.

Do you have examples of similar functionality on other sites or in other
plugins? (Please share URLs below)

Only the built-in WP image editor, which is not really suitable as the user 
would have to drop out of the post editing page, go to the Media page, find the 
image they uploaded, etc, etc!

Please provide any additional information below.

Relying on WP's image sizes is not really an option as these are maximum sizes 
and are global, whereas I would like to set exact sizes and to have different 
sizes for each image field.

Original issue reported on code.google.com by pe...@twobytwo.co.uk on 17 Oct 2013 at 10:25

GoogleCodeExporter commented 9 years ago
I think this is tough without rewriting WP's image manipulation functions 
entirely -- WP's image editing stuff is not writing in a way to make it 
reusable in any sense.  But really, you can't enforce image sizes using PHP 
because you don't know the size of the image until after the image is uploaded. 
 Probably better to set the dimensions you require in the templates.  The image 
itself should be "viewless", usually the original size, and then your views can 
specify the size you need to display.  Cropping etc. is a separate issue...

Original comment by ever...@fireproofsocks.com on 17 Oct 2013 at 3:20

GoogleCodeExporter commented 9 years ago
I understand that WP's image uploader is not the most developer-friendly thing, 
but I saw this functionality as being after that has been called. In other 
words - after the image has been uploaded and "Insert into post" is clicked, 
when the user is returned to the post editing screen. Then CCTM can check the 
image dimensions and present a dialog that the image is the wrong size, and ask 
the user to crop it before resizing it.

Original comment by pe...@twobytwo.co.uk on 17 Oct 2013 at 3:28