statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

glide.generated event emitted even when image has already been generated #2466

Open hannahwoodward opened 4 years ago

hannahwoodward commented 4 years ago

Describe the bug The 'glide.generated' event is called on every reference to a glide transformed image (not just on a 'fresh' generation of a transformed image).

To Reproduce Steps to reproduce the behavior:

  1. Add an image to a page with an assets field.
  2. Create an addon that listens for the glide.generated event
  3. Call a glide transform on the image in the templates, e.g.
    {{ asset:some_image }}
    <img src="{{ glide:id width='500' height='500' }}">
    {{ /asset:some_image }}

Expected behavior I would expect glide.generated to only be emitted when a fresh glide image has been generated.

Environment details (please complete the following information):