]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5991 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Jun 2023 12:35:18 +0000 (14:35 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Jun 2023 12:35:18 +0000 (14:35 +0200)
app/Jobs/FluidbookDocumentFileProcess.php
app/Models/FluidbookDocument.php

index 8f564bfc10162dfd4bcec3239d17d523509660c7..75a2db1c72056318fd174dce8c2eac522ecde8dc 100644 (file)
@@ -11,6 +11,7 @@ class FluidbookDocumentFileProcess extends Base
     protected $page;
     protected $format;
     protected $resolution;
+    protected $quality;
     protected $withText;
     protected $withGraphics;
     protected $version;
index daba021d72cdf713627c447b5d1c78b104fc2c9e..5ed91da817f0e474fce6be8da2bac98a95329966 100644 (file)
@@ -280,11 +280,12 @@ class FluidbookDocument extends ToolboxModel
             }
             $file .= '.svg';
         } else if ($format === 'png' || $format === 'jpg') {
+            $q = ($format === 'jpg' && $quality !== 85) ? '-' . $quality : '';
             $prefix = $withText ? 't' : 'h';
             if ($resolution === 'thumb') {
-                $file = $dir . 'p' . $page . '.' . $format;
+                $file = $dir . 'p' . $page . $q . '.' . $format;
             } else {
-                $file = $dir . $prefix . $page . '-' . $resolution . '.' . $format;
+                $file = $dir . $prefix . $page . '-' . $resolution . $q . '.' . $format;
             }
         } else if ($format === 'swf') {
             $file = $dir . 'p' . $page . '.' . $format;