Fallback JPG images are not regenerated when using image_widget_crop

Created on 18 August 2022, almost 2 years ago
Updated 26 January 2023, over 1 year ago

Problem/Motivation

When we apply a new crop to the image that is already cropped by image_widget_crop module, only the image style's original URL is flushed (public://styles/thumbnail/public/2022-08/light-night-streets-1920x1200-wallpaper00_0.jpg.webp), and the JPG fallback doesn't (public://styles/thumbnail/public/2022-08/light-night-streets-1920x1200-wallpaper00_0.jpg.jpg).

Almost the same issue what imageapi_optimize_webp module has πŸ› WebP images are not regenerated when using image_widget_crop RTBC

Steps to reproduce

1. install wpd, image_widget_crop
2. set Convert: WEBP for image styles
3. use Responsive image formatter for an image field
4. Set up crop types for the image styles
5. set crop widget for image field
6. upload an image, apply a crop, save the node
7. open the node, and open the fallback JPG so it will be generated
8. edit that node again, and apply a different crop
9. open the node again, and open the fallback JPG's new URL

Expected:
Fallback JPG image is regenerated again.

Actual:
Fallback JPG image is still the same what was generated in step 7.

Proposed resolution

When deleting a file, the module already does remove the fallback JPG that belongs to that via wpf_file_delete() hook. Run the same logic in new wpf_crop_insert() (runs when an uncropped image is already generated and new crop is applied to it) and wpf_crop_update() (runs when they update the crop on cropped images) hooks.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia kaszarobert

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.

Production build 0.69.0 2024