]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6531 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Nov 2023 16:38:21 +0000 (17:38 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Nov 2023 16:38:21 +0000 (17:38 +0100)
app/Fluidbook/Compiler/Images.php
app/Jobs/FluidbookCollectionDownload.php

index f76c7302c8604c274848146d9c8f898a7521f027..3eb7cfa6fc66b44e0e97db70d3e4026f90dfe0eb 100644 (file)
@@ -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;
                     }
                 }
index d9536b9211b0cbed6c6ac469f846a513c02a2281..236b67af4d66213d750912294b9821add496f18e 100644 (file)
@@ -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);