]> _ Git - cubist_pdf.git/commitdiff
wip #5991 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Jun 2023 10:42:49 +0000 (12:42 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Jun 2023 10:42:49 +0000 (12:42 +0200)
src/PDFTools.php

index af58cb5463c1bca869c18b6e5b247c9746b74d7a..e43ee8b094cc30dfd26087d30bdeae6fbf060518 100644 (file)
@@ -137,8 +137,8 @@ class PDFTools {
                return trim($path, '/');
        }
 
-       public static function makeMiniShot($in, $out, $page, $format = 'jpg') {
-               self::makeShotFixedWidth($in, $out, $page, 'p', 500, 65, 4, 'PNM', $format);
+       public static function makeMiniShot($in, $out, $page, $format = 'jpg', $quality = 85) {
+               self::makeShotFixedWidth($in, $out, $page, 'p', 500, max(0, min(100, $quality - 15)), 4, 'PNM', $format);
        }
 
        public static function makeShotFixedWidth($in, $out, $page, $prefix = '', $w = 100, $quality = 90, $antialiasing = 4, $method = 'PNM', $format = 'jpg') {