Scaling up small images and cropping to specific (exact size)
-
Hi,
I need to be able to scale up a small image to a custom image size so an exact crop can be made. I can’t find a plugin or code example that does this, can anybody help?
Let’s say I upload an image 400×200. I have added
add_image_size('featuredImage', 650, 300, true);
and currently I get a 650×300 image, but it only contains the 400×200 image top left and the rest is black. What I need is the uploaded image upscaled to 650×325 and the crop taken from that. Original should not be altered.It needs to play well with Regenerate Thumbnails and Manual Image Crop.
I think it needs to hook into
wp_generate_attachment_metadata
but I don’t know how to do that.Can somebody help please?
Thanks
- The topic ‘Scaling up small images and cropping to specific (exact size)’ is closed to new replies.