• Hello, thank you for the great plugin.
    I am missing 1 last thing though, wich would make it useable for all our (400+) sites.

    We want our clients to be able to reuse already cropped images. I saw in the other tickets other people are looking for this too.

    Often certain blocks in the site use the same image over and over and to not have a new / different crop everytime we need to be able to reuse already cropped images.

    With the following code I could show the cropped images in the media, but that would do a recrop of the image. Wich is kinda OK, ubt it would mean it would resave the image double and tripple etc. This is because I can’t press “Cancel” when I select the image, it will than clear the field again, cause it’s not cropped.

    add_filter('ajax_query_attachments_args', function ($args) {
    	if (empty($args['post__in'])) {
    		unset($args['meta_query']);
    	}
    	return $args;
    });

    Seems to me that somehow we need to be able to select previous cropped images, without needing to recrop again.

    Hope to hear from you. Maybe we can come up with a solution together.

    Kind regards
    A fellow WP developer.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author joppuyo

    (@joppuyo)

    Hey,

    Glad you like the plugin.

    Unfortunately, the plugin is not currently designed in a way that allows re-using cropped images. There is an assumption that a cropped image belongs to a parent image, and that a cropped image belongs to a single post.

    This functionality was left out because I think it’s hard for content editors to deal with various crops, and they may accidentally crop an already cropped image. This is why right now there is one master image that has various crops.

    If I understand properly, you would like the plugin to “remember” the previously cropped image sizes.

    So, for example, if I have a field with a 16:9 aspect ratio and I select “Image A” and crop it, the plugin would remember that there is a crop for that aspect ratio.

    If I then have another 16:9 field where I select “Image A” again, the plugin would by default offer that same crop (the same coordinates) and if I press crop, it would re-use the already cropped image?

    I’m just trying to figure out a way to implement such functionality in a smart way.

    I think showing the cropped images in the media gallery and having some way to detect if the image

    1. Is a cropped image
    2. Has the same aspect ratio

    And in that case, automatically selecting the image without showing the cropper would be a kind of workaround to accomplish the same functionality.

    Thanks!

    Thread Starter R3dRidl3

    (@r3dridl3)

    If I understand properly, you would like the plugin to “remember” the previously cropped image sizes.

    Kinda yes, but it allso has to work with various ratio’s. When you have multiple blocks with different ratio.

    Unfortunately, the plugin is not currently designed in a way that allows re-using cropped images. There is an assumption that a cropped image belongs to a parent image, and that a cropped image belongs to a single post.

    Not always. We make complete websites and allso make use of pages with let’s say CTA blocks. These blocks often have the same image.

    So, for example, if I have a field with a 16:9 aspect ratio and I select “Image A” and crop it, the plugin would remember that there is a crop for that aspect ratio.

    What if you have several different ratio crops with the same image?

    If I then have another 16:9 field where I select “Image A” again, the plugin would by default offer that same crop (the same coordinates) and if I press crop, it would re-use the already cropped image?

    How would you be able to crop a different portion of the image? Just use the recrop?

    I’m just trying to figure out a way to implement such functionality in a smart way.

    That’s a must of course.

    I think showing the cropped images in the media gallery and having some way to detect if the image

    1. Is a cropped image
    2. Has the same aspect ratio

    And in that case, automatically selecting the image without showing the cropper would be a kind of workaround to accomplish the same functionality.

    That would be a nice starting point.

    Maye we can do something like an extra tab on the media select page:
    https://i.ibb.co/8bR6h6j/here.png

    Where it says “Previously cropped images” wich would filter out the correct sizes?
    This way you can detect if it is previously cropped and skip the crop function.
    This would be the best of 2 worlds I think. You still get to choose wich image manually, without the need to crop.

    Thread Starter R3dRidl3

    (@r3dridl3)

    Wich would be possible with something like this:
    https://www.ibenic.com/extending-wordpress-media-uploader-custom-tab/

    Thread Starter R3dRidl3

    (@r3dridl3)

    @joppuyo What do you think of the solution i came with?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Reuse previously cropped images’ is closed to new replies.