Skip to content

resize - Cached resized image provided even if it the original changed #177

@helmutkaufmann

Description

@helmutkaufmann
  • Winter CMS Build: 1.1.3
  • PHP Version: 8 (and 7.4)
  • Database Engine: sqlite
  • Plugins Installed:

Description:

When an image that has been resized using Winter's built-in resize Twig function, is replaced, the resize does not identify that and provides the resized version of the ORIGINAL image instead of the NEW image - probably as the modification date of the replaced image is not checked against the creation date of the resized image.

Note that https://github.com/toughdeveloper/oc-imageresizer-plugin provides a resize that actually checks for image file modification time and re-generates the images as needed. Perhaps this would be a solution.

Steps To Reproduce:

  1. Place an image in the media directory and resize it, "image.jpg" | media | resize(200, 200)
  2. Replace image.jpg with another image
  3. Re-run "image.jpg" | media | resize(200, 200) --> the old image is served.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions