Styles not regenerated after upgrading to 2.1

Created on 28 October 2021, almost 3 years ago
Updated 9 July 2023, about 1 year ago

Problem/Motivation

Now that Drupal 8 is approaching end of life I really need to upgrade to Drupal 9. Crop API as one of the two modules preventing me from doing this. I am currently using Crop API 1.2 which works fine with Drupal 8.9.19. However when I upgrade to 2.1 (or 1.5) images crops are not being regenerated after being flushed or created for new users.

Steps to reproduce

On Crop API 1.2:

Goto Configuration | Media | Image styles and flush an image style that is correctly cropping images and showing them on the site. Then visit a page showing a cropped image of this style and refresh the page. The image is correctly regenerated.

Doing the same with Crop API 2.1 does not regenerate the image.

Please can someone suggest what I can do to correct this? Thanks for any help!

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

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.

  • 🇩🇪Germany Philipp jor

    I have the Same Problem in Drupal 8.9.1 after updating from Drupal 8.7

    Did you find a way to solve the problem?

    I get this error-message by using a form with the cropping-funktion:

    The file "public://filename.jpg" is not valid on element field_imagename[0][image_crop].

  • 🇨🇦Canada Nathan Tsai

    For some reason, I'm also getting this issue.

    The cropping is not being applied for the image styles, even after flushing the caches.

  • I found a workaround. The problem is that the crop module adds unnecessary "&" characters to the URL of a cropped image, this can be corrected using a TWIG replace filter eg:

    <img src="{{ image_filename|replace({'&amp;' : '&'}) }}">
    

    Just be careful that the filenames don't contain the "&" character!

Production build 0.71.5 2024