From 5f0d5eba66f0e5021b5d0c545d98ed3ce528d0ae Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 22 Feb 2023 10:23:11 +0100 Subject: [PATCH] wip #5524 @0.5 --- app/process.php | 6 ++++-- app/src/Document.php | 21 +++++++++++++++++++++ app/src/ProcessToolboxDocumentFile.php | 4 ++-- app/src/ProcessToolboxPDFFile.php | 5 +++-- update | 1 + 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 app/src/Document.php diff --git a/app/process.php b/app/process.php index 0dcc04e..5c7c02a 100644 --- a/app/process.php +++ b/app/process.php @@ -15,6 +15,8 @@ if (!isset($_POST['pdf'])) { } $p = new $class($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); } else { - $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_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['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); } -die($p->process()); \ No newline at end of file +$res = $p->process(); +error_log($res); +die($res); \ No newline at end of file diff --git a/app/src/Document.php b/app/src/Document.php new file mode 100644 index 0000000..4c33350 --- /dev/null +++ b/app/src/Document.php @@ -0,0 +1,21 @@ +_out = $out; + parent::__construct($in); + } + + public function getConvertPath(): string { + return Files::mkdir($this->_out); + } +} \ No newline at end of file diff --git a/app/src/ProcessToolboxDocumentFile.php b/app/src/ProcessToolboxDocumentFile.php index 4476313..5ef2aff 100644 --- a/app/src/ProcessToolboxDocumentFile.php +++ b/app/src/ProcessToolboxDocumentFile.php @@ -5,10 +5,10 @@ namespace Fluidbook\Farmer; class ProcessToolboxDocumentFile extends ProcessFile{ public function getOut() { - $this->getDistantOut(); + return $this->getDistantOut(); } public function process() { - $this->getPath($this->isForce()); + return $this->getPath($this->isForce()); } } \ No newline at end of file diff --git a/app/src/ProcessToolboxPDFFile.php b/app/src/ProcessToolboxPDFFile.php index baa8fd1..99ed688 100644 --- a/app/src/ProcessToolboxPDFFile.php +++ b/app/src/ProcessToolboxPDFFile.php @@ -10,9 +10,10 @@ class ProcessToolboxPDFFile extends ProcessToolboxDocumentFile { */ protected $_pdf; - public function __construct($pdf, $out, $page, $resolutionRatio, $mobileRatio, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { + public function __construct($pdf, $out, $page, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { $this->setPdf($pdf); - parent::__construct($out, $page, $resolutionRatio, $mobileRatio, $format, $resolution, $withGraphics, $withTexts, $version, $force); + $document = new Document($pdf, $out); + parent::__construct($out, $page, $document->getResolutionRatio(), $document->getMobileFirstRatio(), $format, $resolution, $withGraphics, $withTexts, $version, $force); } /** diff --git a/update b/update index c2b29c1..695faa0 100755 --- a/update +++ b/update @@ -7,6 +7,7 @@ git reset --hard origin/master git stash git pull origin master chmod 755 /docker/fluidbook-processfarm/app/bin/* +chmod 755 /docker/fluidbook-processfarm/app/vendor/cubist/pdf/resources/tools/fwstk.sh chmod 755 /docker/fluidbook-processfarm/ssh chmod 600 /docker/fluidbook-processfarm/ssh/id_rsa DOCKER_BUILDKIT=1 docker compose build -- 2.39.5