]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6296 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 20 Sep 2023 09:00:47 +0000 (11:00 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 20 Sep 2023 09:00:47 +0000 (11:00 +0200)
app/Fluidbook/Farm.php
app/Models/FluidbookPublication.php

index b281e7bfe15f9dd096bae57e9c6285b2fd5a5147..77297099bfd91dc7697aabc4a593a81f4f927fca 100644 (file)
@@ -150,7 +150,7 @@ class Farm
             if (file_exists($path)) {
                 return $path;
             }
-            return self::_getFile($params);
+            return self::_getFile($params, 0);
         });
 
         if ((!$res || !file_exists($res)) && $attempts > 0) {
@@ -193,10 +193,10 @@ class Farm
 
         if (!$res) {
             if ($attempts > 0) {
-                Log::warning('Farm failure : ' . $log);
+                Log::warning('Farm failure : ' . $output);
                 return static::_getFile($params, $attempts - 1);
             }
-            throw new \Exception('Farm failure : ' . $log);
+            throw new \Exception('Farm failure : ' . $output);
         }
 
         return $res;
index b03fdc6cb1483793f106cfb03c24fa05735713d8..aff48a0849220f97f172b055ae5403a878f7b270 100644 (file)
@@ -53,7 +53,6 @@ use Cubist\Util\Json;
 use Cubist\Util\Str;
 use Datetime;
 use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Support\Facades\Artisan;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
@@ -434,8 +433,11 @@ class FluidbookPublication extends ToolboxSettingsModel
             $thumbpdf = $this->getAssetDir() . $this->pdfThumbnails;
 
             if (file_exists($thumbpdf)) {
-                $res = Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force);
-                return $res;
+                try {
+                    return Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force, 1);
+                } catch (\Exception $e) {
+                    throw new \Exception('Unable to generate thumbnails file from custom PDF "' . $this->pdfThumbnails . '" (original message : ' . $e->getMessage().')');
+                }
             } else {
             }
         }