From: Vincent Vanwaelscappel Date: Mon, 5 Jun 2023 10:45:33 +0000 (+0200) Subject: wip #5991 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fe3365c553133e1316a35616faeb2c242ac47530;p=fluidbook_processfarm.git wip #5991 @0.25 --- diff --git a/app/process.php b/app/process.php index 7b84cc6..8ba2aa0 100644 --- a/app/process.php +++ b/app/process.php @@ -6,15 +6,19 @@ use Fluidbook\Farmer\ProcessToolboxPDFFile; require_once __DIR__ . "/vendor/autoload.php"; +if (!isset($_POST['quality'])) { + $_POST['quality'] = 85; +} + if (!isset($_POST['pdf'])) { if (isset($_POST['toolbox'])) { $class = ProcessToolboxDocumentFile::class; } else { $class = ProcessFile::class; } - $p = new $class($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); + $p = new $class($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], $_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); } else { - $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['format'], $_POST['resolution'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); + $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['format'], $_POST['resolution'], $_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); } $res = $p->process(); die($res); \ No newline at end of file diff --git a/app/src/ProcessFile.php b/app/src/ProcessFile.php index 424737a..4f7ddcc 100644 --- a/app/src/ProcessFile.php +++ b/app/src/ProcessFile.php @@ -25,7 +25,7 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile { protected $filespath; protected $_job = null; - public function __construct($out, $page, $resolutionRatio, $mobileRatio, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { + public function __construct($out, $page, $resolutionRatio, $mobileRatio, $format = 'jpg', $resolution = 150, $quality = 85, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { if (stristr($out, 'usstorage')) { $this->setRegion('US'); diff --git a/app/src/ProcessToolboxPDFFile.php b/app/src/ProcessToolboxPDFFile.php index 99ed688..42540dc 100644 --- a/app/src/ProcessToolboxPDFFile.php +++ b/app/src/ProcessToolboxPDFFile.php @@ -10,10 +10,10 @@ class ProcessToolboxPDFFile extends ProcessToolboxDocumentFile { */ protected $_pdf; - public function __construct($pdf, $out, $page, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { + public function __construct($pdf, $out, $page, $format = 'jpg', $resolution = 150, $quality = 85, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { $this->setPdf($pdf); $document = new Document($pdf, $out); - parent::__construct($out, $page, $document->getResolutionRatio(), $document->getMobileFirstRatio(), $format, $resolution, $withGraphics, $withTexts, $version, $force); + parent::__construct($out, $page, $document->getResolutionRatio(), $document->getMobileFirstRatio(), $format, $resolution, $quality, $withGraphics, $withTexts, $version, $force); } /**