Skip to content

Commit d626e2e

Browse files
committed
Change PNG settings for compression
1 parent 9aad947 commit d626e2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

imcger/imgupload/event/main_listener.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,10 @@ function set_image_compression($image, $quality = 80)
548548
$image->setOption('png:compression-strategy', 1);
549549
$image->setOption('png:compression-filter', 5);
550550
$image->setOption('png:compression-level', 9);
551-
$image->setImageType(\Imagick::IMGTYPE_PALETTEMATTE);
551+
if ($image->getOption('png:bit-depth') == 16)
552+
{
553+
$image->setOption('png:bit-depth', 8);
554+
}
552555
break;
553556

554557
case 'WEBP':

0 commit comments

Comments
 (0)