Styled images should only be flushed when cropping data is actually changed.

Created on 19 April 2013, over 11 years ago
Updated 31 May 2023, over 1 year ago

In our setup we use remote storage and file_entity module so we have a lot of metadata fields on the image files.

But the default behavior is that whenever a file entity with cropping widget is saved, all generated images are flushed - this causes the saving process to be slower than it should because of the remote storage, and we waste resources on regenerating the same images again.

Manualcrop should only flush the image style cache for a specific image when the cropping has been changed.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡°Denmark esbenvb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States laryn

    I've merged a fix for this into the Backdrop version, based on the work here. Thank you to whthat, Aaron Wolfe (awolfey), Tess Bakker, candelas, Thomas Slott (bigslott), and Esben von Buchwald (esbenvb)!

    I made a few additional tweaks to the latest MR from whthat for more performance gains:

    - Don't use `image_path_flush` but break out a piece of that function so we can target the specific image and a specific style in the path.
    - Unset the styles that have no changes along the way so that `manualcrop_save_crop_data` is only called on the styles that need it.

    You can see that commit here if interested:

    - https://github.com/backdrop-contrib/manualcrop/commit/8d71b5ddf45b2ad1be...

Production build 0.71.5 2024