spatie / statamic-responsive-images

Responsive images for Statamic 3
MIT License
99 stars 29 forks source link

Crop focus not working if glide image dimensions match the original asset dimensions #210

Closed ncla closed 1 year ago

ncla commented 1 year ago

Bug description

If you have set crop focus and you are not using any ratios, the largest generated image from dimensions calculator (which is equal to the dimensions of the original asset) will have not have crop focus.

This unfortunately is a bug in underlying Glide package, as reported here: https://github.com/thephpleague/glide/issues/362 It affects Statamic too.

Quite niche bug but perhaps it is possible to workaround in this package.

How to reproduce

  1. Set focal point zoomed on an asset
  2. Use responsive tag without any params, ratios defined.
  3. Inspect the largest output image URL to see that it does not have focal point in place, while an image one size lower will have focal point

Logs

No response

Environment

-

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Additional details

No response

ncla commented 1 year ago

Fixed in 2.2.3 in league/glide. Run composer update league/glide and php please glide:clear to fix this.