From 6a6fa875e9e70a62c9f28ead63e5d2e5e41a36a2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 28 Nov 2023 17:38:21 +0100 Subject: [PATCH] wait #6531 @0.5 --- app/Fluidbook/Compiler/Images.php | 12 ++++++++---- app/Jobs/FluidbookCollectionDownload.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Fluidbook/Compiler/Images.php b/app/Fluidbook/Compiler/Images.php index f76c7302c..3eb7cfa6f 100644 --- a/app/Fluidbook/Compiler/Images.php +++ b/app/Fluidbook/Compiler/Images.php @@ -13,7 +13,6 @@ trait Images { $compositionCached = $this->compositionCached(); - set_time_limit(0); switch ($this->fluidbookSettings->mobileVersion) { case 'html5-desktop': @@ -30,8 +29,14 @@ trait Images break; } + $resolutions = $this->getResolutions(); + $cacheKey = 'imagesToCopy_' . $this->imageFormat . '_' . md5(json_encode($resolutions)); + $cacheKey .= '-' . $this->config->JPEGQuality; + $cacheKey .= '//' . md5(json_encode($this->config->rasterizePages)); + $cacheKey .= '||' . md5(json_encode($this->config->vectorPages)); + $cacheKey .= '!!' . $this->fluidbookSettings->mobileNavigationType; - if (!$this->isCached('imagesToCopy')) { + if (!$this->isCached($cacheKey)) { $filesToCopy = []; $rasterizePages = $this->config->rasterizePages; @@ -48,10 +53,9 @@ trait Images $thisimagesvg = !$thisrasterize && $this->svg; $thisbackgroundPrefix = $thisrasterize ? [true] : $this->backgroundsPrefix; - foreach ($this->getResolutions() as $r) { + foreach ($resolutions as $r) { foreach ($thisbackgroundPrefix as $backgroundsPrefix) { $source = $this->getFluidbook()->getFile($page, $this->imageFormat, $r, $backgroundsPrefix, true, $imdir); - $filesToCopy[$source] = 'data/background/' . $r . '/' . ($backgroundsPrefix ? 't' : 'p') . $page . '.' . $this->imageFormat; } } diff --git a/app/Jobs/FluidbookCollectionDownload.php b/app/Jobs/FluidbookCollectionDownload.php index d9536b921..236b67af4 100644 --- a/app/Jobs/FluidbookCollectionDownload.php +++ b/app/Jobs/FluidbookCollectionDownload.php @@ -409,7 +409,7 @@ class FluidbookCollectionDownload extends DownloadBase * @return string * @throws \Exception */ - protected function compileExport($data) + protected function compileExport() { $data = $this->entry->getPageData(); $basePath = Files::mkdir($this->entry->getFinalPath() . $data->type . '/' . $data->version); -- 2.39.5