Make sure ‘full-size’ image does not exceed certain dimensions
-
Hi.
I am using WordPress as a CMS, and as such people who aren’t skilled at building websites will be editing pages. If possible, I’d like them to be able to insert images in to the pages as long as the image is not bigger than certain dimensions. ie. as well as WordPress creating ‘thumbnail, medium, and large’ images, I’d like it to *resize* the full size image so that it doesn’t exceed my set dimensions.I have searched this quite a bit and found the $GLOBALS[‘content_width’] option, but that doesn’t meet my needs – all that does it limit/crop the size of images as seen in a post/page, it does not *resize* the ‘full-size’ image file that is *uploaded* to the CMS to my dimensions and reduce the file size (and which in my view means that ‘full-size’ is misleadingly named, because you would not be inserting the full size image in to a post anyway – it is more like inserting the ‘maximum’ size image). Not only that, there could be a giant file-sized image uploaded, yet only a portion of it showing (ie. cropped), which is far from optimal in terms of page size and seems pointless – what’s the point in keeping the original image then? Anyway, I digress.
So there’s two ways of looking at what I want:
– a fourth image size in ‘Settings => Media’ eg. an “extra-large” image size, as well as to turn off the ‘full-size’ image size for my users, or;
– an option to ensure that the original image uploaded is resized to my maximum dimensions, and is never bigger (ie. what’s the point of keeping the original sized image if it can never be used in your theme? And if there’s a $GLOBALS[‘content_width’] value set, surely the full-size image should be resized to that size, rather than inserted into a post at full-size file size and then cropped to that size?).Some people may tell me to resize my images to my maximum size before upload – however this goes back to my original need of inexperienced webusers ideally being able to insert images, who may not have access to image editing software nor be competent at resizing images.
If WordPress could take care of this for me, that’d be fantastic. Is there a way to adjust this in WordPress (2.8)?
Cheers
MattPS. FYI I’d prefer to be able to make this change via functions.php rather than by uploading another plugin (until it’s properly built in to WordPress).
- The topic ‘Make sure ‘full-size’ image does not exceed certain dimensions’ is closed to new replies.