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

index 7b84cc6b4dc367ab0461578d6305f0cda515ae64..8ba2aa0830af02c771820a1dc5c0b14e424efa34 100644 (file)
@@ -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
index 424737a790f701a63ec3007f3f89533c560b394d..4f7ddcc8b338c9052b4f17da131758895f5ad697 100644 (file)
@@ -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');
index 99ed688901337e175289afb75c7cf9aada2edb8a..42540dc5563b65850382bffa622e7f3d254194fd 100644 (file)
@@ -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);
        }
 
        /**