Module Image
swissup/module-image
Calculates image dimensions (width and height) using PHP. Supports various image formats and falls back to a fast image size library if needed.
Build Tests
Code Quality
Tested on Magento 2.4.8-p3
Recent Test History
Each release is tested against the latest Magento version at that time.
Share This Module's Status
README
Loaded from GitHubswissup/module-image
swissup/module-image - is a Magento module to calculate image dimensions
using PHP. It uses getimagesize function when image is found in filesystem,
otherwise uses fallback to marc1706/fast-image-size
library. Supported formats: bmp, gif, ico, iff, jp2, jpeg, png, psd, svg, tif,
wbmpm, webp.
Installation
composer require swissup/module-image
bin/magento setup:upgrade
Usage
use Swissup\Image\Helper\Dimensions;
$this->dimensions->getWidth($imageUrl); // 600
$this->dimensions->getHeight($imageUrl); // 400
$this->dimensions->getDimensions($imageUrl); // ['width' => 600, 'height' => 400]
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.