• Resolved sebastianroming

    (@sebastianroming)


    I have the following steps to reproduce:

    1. Open a Page
    2. Select an article image
    3. Crop the article image
    4. Now the article image doesn’t refresh on the “edit page”-page, you still see the full-size image
    5. If you save the page, the cropped image will be rendered in the frontend, but in the backend (“edit page”-page), when you re-open for editing, you still see the full-size image and you can’t change the cropped part of the image and you have to re-crop it.

    And: is it possible, that – when finished cropping – the windows closes itself or that there appears a “OK” button?

    Btw: Your CROP_THUMBNAILS_DO_CACHE_BREAK($('#postimagediv img')) resolution from github doesn’t work… ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Hi,
    i think your main problem is that you do not get the correct image-size displayed in your featured image box (in edit view).

    Wordpress will display the “post-thumbnail” image-size in the featured image box by default. But as i learned recently you can adjust, what image is displayed on each post type (a post type may be “post”, “page” or any custom post type).

    Use the following code to adjust the image size that is displayed in your featured image box.

    
    add_filter('admin_post_thumbnail_size','myBackendFeaturedImageSize',10,3);
    function myBackendFeaturedImageSize($size,$thumbnail_id,$post) {
    	if($post->post_type==='post') {
    		$size = 'myImageSize1';//use what ever image size you want to display
    	}
    	if($post->post_type==='page') {
    		$size = 'myImageSize2';//use what ever image size you want to display
    	}
    	return $size;
    }
    

    The image should then be updated after you crop this specific image-size.

    Let me know if it works.

    Thread Starter sebastianroming

    (@sebastianroming)

    and have a look: wow, it works like hell ??

    Thank you for your absolutely fast reply and for this awesome plugin!

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    You may need to add the code from github to.

    The JS-Code adds a cachebreak-parameter to the image url, so the server needs to freshly provide the image. The code on github adds the cache-break also when the user enters the wordpress edit view. The plugin will only add the cache-break only directly after cropping.

    For reference: https://github.com/vollyimnetz/crop-thumbnails/issues/12

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Refresh Article Image after Crop’ is closed to new replies.