Derivatives images not generated

Created on 1 March 2022, over 2 years ago
Updated 28 June 2024, 4 days ago

Problem/Motivation

When an image in a defined style is added to the content of the page, not in background, and the derivatives images are flushed, when we visit the page, the derivatives images are not generated.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France Bessonweb

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.

  • I ran into this same issue. We made updates to the images styles to convert to webp, once the image cache was flushed, all images added through gutenberg show up as broken images. Since we have thousands of pages, we were unable to make this update to improve site performance due to the limitations of gutenberg to handle this update.

    Any help would be greatly appreciated!

  • πŸ‡©πŸ‡ͺGermany szeidler Berlin

    The problem arises with all blocks, that store the full image derivative path including `?itok` parameter in the body text.

    So whenever images style derivatives are not existing (flushed, or not existing because of different environments) they need to be regenerated. This is been done by the `itok` parameter verification for DDOS protection. If your environments have different hashes, the itok will be different and the image generation would fail.

    The same problem arises when you use the `Convert` image style action. If you convert to another file type, the corresponding image URL needs to change (but also the itok, will be different). That's the reason that after enabling the `webp` conversion and flushed image styles, the the image path is wrong in the body text and will result in a 404 (not generated image).

    There are only two workarounds for this problem:
    1. Re-select the image - the image url will be updated
    2. Add a Gutenberg BlockProcessor or Text Filter that takes the file uuid, regenerates the image style URL and replaces it in the text

    This problem might become more prominent, when people start adding `webp` conversion actions after it went into Drupal Core in 10.3

Production build 0.69.0 2024