sjelfull / craft3-imgix

Use Imgix with Craft
https://superbig.co
MIT License
13 stars 7 forks source link

Transform doesn't crop when configured with "ratio" and "width" #21

Open apt-thomas opened 4 years ago

apt-thomas commented 4 years ago
protected function calculateTargetSizeFromRatio($transform)
    {
        if (!isset($transform['ratio'])) {
            return $transform;
        }

        $ratio = (float)$transform['ratio'];
        $w     = isset($transform['w']) ? $transform['w'] : null;
        $h     = isset($transform['h']) ? $transform['h'] : null;
...

$w and $h must also check for $transform['width'] and $transform['height']

https://github.com/sjelfull/craft3-imgix/blob/master/src/models/ImgixModel.php#L420