Enforce compressed image width/height is an integer.

This commit is contained in:
Dave Jansen
2023-08-14 01:44:58 +00:00
parent 902504fbfa
commit ec29d9a118

View File

@@ -32,10 +32,10 @@ $raw_imagey = imagesy($raw_image);
if ($raw_imagex >= $raw_imagey) {
$dest_imagex = 300;
$dest_imagey = ($raw_imagey / $raw_imagex) * $dest_imagex;
$dest_imagey = intval(($raw_imagey / $raw_imagex) * $dest_imagex);
} else {
$dest_imagey = 200;
$dest_imagex = ($raw_imagex / $raw_imagey) * $dest_imagey;
$dest_imagex = intval(($raw_imagex / $raw_imagey) * $dest_imagey);
}
$dest_image = imagecreatetruecolor($dest_imagex, $dest_imagey);