From: Vincent Vanwaelscappel Date: Tue, 19 Sep 2023 14:18:54 +0000 (+0200) Subject: wait #6294 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a36cd31134c54bef966c0169fadb5a26774c9aa9;p=fluidbook-toolbox.git wait #6294 @1 --- diff --git a/app/Fluidbook/Compiler/Cache.php b/app/Fluidbook/Compiler/Cache.php index f877e8492..c4211f1e6 100644 --- a/app/Fluidbook/Compiler/Cache.php +++ b/app/Fluidbook/Compiler/Cache.php @@ -2,6 +2,8 @@ namespace App\Fluidbook\Compiler; +use Cubist\Util\Files\Files; + trait Cache { protected $_compiledCacheDate = null; @@ -73,7 +75,15 @@ trait Cache protected function _cacheKey($key) { - return 'compiler_cached_' . $this->getFluidbook()->id . '_' . $this->getCompositionTimestamp() . '_' . $key; + $res = 'compiler_cached_' . $this->getFluidbook()->id . '_' . $this->getCompositionTimestamp() . '_' . $key; + $fb = $this->getFluidbook(); + if ($fb->pdfThumbnails) { + $thumbPdf = $fb->getAssetDir() . $fb->pdfThumbnails; + if (file_exists($thumbPdf)) { + $res .= '_' . Files::hashFileAttributes($thumbPdf); + } + } + return $res; } diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index e04ffbc85..b03fdc6cb 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -432,8 +432,11 @@ class FluidbookPublication extends ToolboxSettingsModel { if ($this->pdfThumbnails) { $thumbpdf = $this->getAssetDir() . $this->pdfThumbnails; + if (file_exists($thumbpdf)) { - return Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force); + $res = Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force); + return $res; + } else { } } return $this->getFile($page, $format, $resolution, $withText, $withGraphics, $version, $force);