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.
No errors foundPHPStan level 1Build passingSemVer compliant
- Supported Magento versions
- 2.4.9
- License
- MIT
- Categories
- Images & Media, Performance & Optimization
165,150 installs★ 2 stars2,812 downloads/monthLatest: v1.0.7Released 2023-04-21
composer require swissup/module-imageREADME
Reproduced from the package’s own README, under its own license, as of 2026-10-31. Links and images point back at the source repository.
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.
composer require swissup/module-image bin/magento setup:upgrade
use Swissup\Image\Helper\Dimensions; $this->dimensions->getWidth($imageUrl); // 600 $this->dimensions->getHeight($imageUrl); // 400 $this->dimensions->getDimensions($imageUrl); // ['width' => 600, 'height' => 400]
Links
- Packagist
- PackageMaven (source of the quality data)
- Repository
- Issues