calculateProportionalThumbnailSize example

if (empty($maxHeight)) {
            $maxHeight = $maxWidth;
        }

        $newSize = [
            'width' => $maxWidth,
            'height' => $maxHeight,
        ];

        if ($keepProportions) {
            $newSize = $this->calculateProportionalThumbnailSize($originalSize$maxWidth$maxHeight);
        }

        $newImage = $this->createNewImage($image$originalSize$newSize$this->getImageExtension($destination));

        if ($this->fixGdImageBlur) {
            $this->fixGdImageBlur($newSize$newImage);
        }

        $this->saveImage($destination$newImage$quality);
        $this->optimizeImage($destination);

        
Home | Imprint | This part of the site doesn't use cookies.