Closed marios88 closed 5 months ago
You can use Intervention\Image\Geometry\Tools\RectangleResizer::class
to calculate size without actual images. You have to use version 3 of Intervention Image though.
$targetWidth = 60;
$targetHeight = 60;
$size = new Rectangle(300, 200); // original 300 x 200
$resized = $size->scaleDown($targetWidth, $targetHeight); // result: 60 x 40
Hello, in my use case i want to know the resulting image dimensions without generating them ahead of time.
I believe "getSize()" should be documented as an API function as its provides valuable information
Here is a example for anyone interested in calculating output dimensions without actually resizing the image