From dbdeb92c257c2fc1c2319849150623fc9baae8fd Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 8 Sep 2021 17:51:22 +0200 Subject: [PATCH] wip #4666 @1 --- app/Jobs/ProcessFluidbook.php | 17 +++++++++++------ composer.lock | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/app/Jobs/ProcessFluidbook.php b/app/Jobs/ProcessFluidbook.php index ce4ed6f..c0dc92e 100644 --- a/app/Jobs/ProcessFluidbook.php +++ b/app/Jobs/ProcessFluidbook.php @@ -3,7 +3,10 @@ namespace App\Jobs; use Cubist\Util\CommandLine; +use Cubist\Util\Files\Files; +use Cubist\Util\PHP; use Fluidbook\Tools\FluidbookTools; +use Fluidbook\Tools\Jobs\ProcessFile; use Fluidbook\Tools\PDF\Document; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldBeUnique; @@ -42,6 +45,9 @@ class ProcessFluidbook implements ShouldQueue, ShouldBeUnique public function handle() { $sync = ($this->job instanceof SyncJob); + if ($sync) { + PHP::neverStop(false); + } start_measure('Process Fluidbook'); $this->resetOutput(); @@ -65,12 +71,11 @@ class ProcessFluidbook implements ShouldQueue, ShouldBeUnique public function processPages($sync = false) { start_measure('Process Pages'); - $out = storage_path('fluidbook/convert/' . $this->in->getHash()); - $this->in->processPages($out, [ - ['format' => 'jpg', 'resolution' => '36', 'withTexts' => true, 'withGraphics' => true], - ['format' => 'jpg', 'resolution' => '150', 'withTexts' => false, 'withGraphics' => true], - // ['format' => 'jpg', 'resolution' => '300', 'withTexts' => false, 'withGraphics' => true], - ['format' => 'svg', 'resolution' => '300', 'withTexts' => true, 'withGraphics' => false], + $out = storage_path('fluidbook/convert/' . $this->in->getHash() . '/'); + Files::mkdir($out); + $this->in->processPages($out, [new ProcessFile('jpg', 'thumb'), + new ProcessFile('jpg', 150, false, true), + new ProcessFile('svg', 300, true, false), ], $sync); stop_measure('Process Pages'); diff --git a/composer.lock b/composer.lock index 47eddfd..d4466e3 100644 --- a/composer.lock +++ b/composer.lock @@ -2612,15 +2612,16 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/fluidbook_tools.git", - "reference": "fbcd179c04e2bd1061307bcabda70a9756b4217b" + "reference": "21176c4e485d13bdb24c43cf3c038539df01e01d" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-d6dc02.tar", - "reference": "fbcd179c04e2bd1061307bcabda70a9756b4217b", - "shasum": "88e7797805be96ed7a2ba0842029d42f1466d5b4" + "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-0bc471.tar", + "reference": "21176c4e485d13bdb24c43cf3c038539df01e01d", + "shasum": "15f3ddd393e9e20dfc589c933b27e8a0e830f788" }, "require": { + "barryvdh/laravel-debugbar": "^3.6", "cubist/util": "dev-master", "ext-dom": "*", "ext-gd": "*", @@ -2649,7 +2650,7 @@ } ], "description": "Fluidbook Tools", - "time": "2021-09-06T17:21:56+00:00" + "time": "2021-09-08T14:14:45+00:00" }, { "name": "fruitcake/laravel-cors", @@ -3362,16 +3363,16 @@ }, { "name": "laravel/framework", - "version": "v8.58.0", + "version": "v8.60.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "1b819bf99d87bd543a4d4895e5b3350f61ea7a23" + "reference": "44f16a31a1d4ac8a51605550d7796e2273984a48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/1b819bf99d87bd543a4d4895e5b3350f61ea7a23", - "reference": "1b819bf99d87bd543a4d4895e5b3350f61ea7a23", + "url": "https://api.github.com/repos/laravel/framework/zipball/44f16a31a1d4ac8a51605550d7796e2273984a48", + "reference": "44f16a31a1d4ac8a51605550d7796e2273984a48", "shasum": "" }, "require": { @@ -3526,7 +3527,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-31T13:55:57+00:00" + "time": "2021-09-08T13:37:21+00:00" }, { "name": "laravel/sanctum", -- 2.39.5