Skip to content

Commit a388450

Browse files
committed
Change compression method for png files
1 parent f7f53ca commit a388450

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

imcger/imgupload/event/main_listener.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,8 @@ function set_image_compression($image, $quality = 80)
545545
break;
546546

547547
case 'PNG':
548-
$image->setOption('png:compression-strategy', 1);
549-
$image->setOption('png:compression-filter', 5);
550-
$image->setOption('png:compression-level', 9);
551-
if ($image->getOption('png:bit-depth') == 16)
552-
{
553-
$image->setOption('png:bit-depth', 8);
554-
}
548+
$image->quantizeImage(256, \Imagick::COLORSPACE_SRGB, 16, false, false);
549+
$image->setImageType(\Imagick::IMGTYPE_TRUECOLORMATTE);
555550
break;
556551

557552
case 'WEBP':

0 commit comments

Comments
 (0)