]> _ Git - fluidbook_processfarm.git/commitdiff
wip #5991 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Jun 2023 11:45:23 +0000 (13:45 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Jun 2023 11:45:23 +0000 (13:45 +0200)
app/src/ProcessFile.php

index 4f7ddcc8b338c9052b4f17da131758895f5ad697..957798f15c8d740136da6472460d27de01d6ad47 100644 (file)
@@ -22,6 +22,8 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
        protected $force = false;
        protected $mobileRatio = 1;
        protected $resolutionRatio = 1;
+
+       protected $quality = 85;
        protected $filespath;
        protected $_job = null;
 
@@ -35,7 +37,8 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
                $this->setForce(!!$force);
                $this->setResolutionRatio($resolutionRatio);
                $this->setMobileRatio($mobileRatio);
-               parent::__construct($format, $resolution, $withGraphics, $withTexts, $version);
+               $this->setQuality($quality);
+               parent::__construct($format, $resolution, $quality, $withGraphics, $withTexts, $version);
        }
 
        /**
@@ -143,4 +146,15 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
                return $res;
        }
 
+       /**
+        * @return int
+        */
+       public function getQuality(): int {
+               return $this->quality;
+       }
+
+       public function setQuality(int $quality): void {
+               parent::setQuality(min(100, max(0, $quality))); // TODO: Change the autogenerated stub
+       }
+
 }
\ No newline at end of file