You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have an image with a very small and a very large side at the same time (like 1x200px), the Image::calculateMissingDimension() creates a targetWidth of 0 and then the Raster::scaleAndCrop() generates a Division by Zero on line 330 (Craft 4.4.17). The round() function in Image::calculateMissingDimension() produces a 0 and it should always return a minimum of 1.
Steps to reproduce
Upload an image of 1x200px or something like that to a folder and the thumbnail generation produces the error.
Expected behavior
A thumbnail of the image or a fall back image.
Actual behavior
Division by zero.
Craft CMS version
4.4.17
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
What happened?
Description
If you have an image with a very small and a very large side at the same time (like 1x200px), the
Image::calculateMissingDimension()
creates a targetWidth of 0 and then theRaster::scaleAndCrop()
generates a Division by Zero on line 330 (Craft 4.4.17). Theround()
function inImage::calculateMissingDimension()
produces a 0 and it should always return a minimum of 1.Steps to reproduce
Expected behavior
A thumbnail of the image or a fall back image.
Actual behavior
Division by zero.
Craft CMS version
4.4.17
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: