Closed therealpecus closed 9 months ago
Just added a slightly different implementation of this which should reduce the computations performed and also respect per-transform upscale settings. Will be released today.
Thanks for nudging us to add this in 👍
This code patches the
ImageTransforms
class to respect theupscaleImages
configuration when passing parameters to the CDN for on-the-fly transforms.It ensures that, when both width and height are provided, the desired aspect ratio is mantained, constraining the transform dimensions within the maximum size of the original image.
You might want to review the code style (I am not a versed PHP developer). I tested this in a few use cases and it works as expected.
note/edit:
dpr
parameter does not seem to be supported by the transform service API (assuming it is bunny-cdn), but if it is, it needs to be checked against in the function that calculates the maximum image size.closes #73