“There has been an error cropping your image” when cropping image

There is too little information to be completely sure, but usually this error occurs when WordPress cannot find the graphic library which should be installed on your server. So you should check with your provider to see if Imagick and/or GD are installed. You can also add this little snippet of code in your functions.php … Read more

using media uploader to select image of specific size, enforce cropper

It looks like the select and crop functionality is currently only used in the WordPress Customizer. However, after looking over the code in the Admin folder of WordPress I was able to get it working on my themes option page. Here is my setting for a header picture: function setting_heading_picture() { $heading_picture = esc_attr(get_option( ‘heading_picture’ … Read more

Is is possible to crop an image after uploading

Untested, but I believe this should work: jQuery(document).ready(function (){ jQuery(“.select-image”).click(function() { var custom_uploader = wp.media({ title: ‘Selecteer een afbeelding’, button: { text: ‘Selecteer’ }, multiple: false }); custom_uploader.on(‘select’, function() { custom_uploader.Jcrop(); }); custom_uploader.open(); }); });

add_image_size() zoom-crop

Currently, WordPress core image handling/thumbnail creation does not perform zoom-crop. If you need an intermediate image size to be created explicitly, you will need to ensure that you upload an image with equal or larger dimensions as the intermediate image size.