From 7568f280b073f2c6f881f4024c08c0d2c7ae67ee Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 5 Jun 2023 13:45:23 +0200 Subject: [PATCH] wip #5991 @0.25 --- app/src/ProcessFile.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/ProcessFile.php b/app/src/ProcessFile.php index 4f7ddcc..957798f 100644 --- a/app/src/ProcessFile.php +++ b/app/src/ProcessFile.php @@ -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 -- 2.39.5