]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5603 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Nov 2022 13:58:01 +0000 (14:58 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 24 Nov 2022 08:43:26 +0000 (09:43 +0100)
app/Jobs/FluidbookCompiler.php
app/Models/FluidbookDocument.php
app/Models/Traits/PublicationSettings.php
config/logging.php

index 02b9b58dcda648fe0db441f3b7f82350fbe3fea0..e5302266bb58dfa58e2996c7187e20ecb469a704 100644 (file)
@@ -334,7 +334,8 @@ class FluidbookCompiler extends Base implements CompilerInterface
         $this->imageFormat = $this->fluidbookSettings->imageFormat;
 
 
-        $imagesize = Image::getimagesize($this->getFluidbook()->getFile(1, $this->imageFormat, 150));
+        $p1 = $this->getFluidbook()->getFile(1, $this->imageFormat, 150);
+        $imagesize = Image::getimagesize($p1);
         $this->pdf2htmlRatio = round(($imagesize[0] * 0.48) / $this->width, 12);
 
         $this->linkScale = $this->cssScale = $this->z * min($this->optimalWidth / $this->width, $this->optimalHeight / $this->height);
index 3e855e5530287615db0e1e31d26472d12d74ce45..442845c0fd1d8addca57d6b1dfcba91c199cab1c 100644 (file)
@@ -17,7 +17,7 @@ use Illuminate\Support\Facades\Cache;
 
 class FluidbookDocument extends ToolboxModel
 {
-    public const WS_DOCS = '/data1/extranet/www/fluidbook/docs/';
+    public const WS_DOCS = '/application/protected/fluidbook/docs/';
     protected $table = 'fluidbook_document';
     protected $_options = ['name' => 'fluidbook-document',
         'singular' => 'document',
@@ -302,9 +302,13 @@ class FluidbookDocument extends ToolboxModel
         }
 
         $doc = $this;
-        return Cache::tags('fluidbook_document_' . $this->id)->rememberForever($this->fileCacheKey($page, $format, $resolution, $withText, $withGraphics, $version), function () use ($doc, $page, $format, $resolution, $withText, $withGraphics, $version) {
+        $res = Cache::tags('fluidbook_document_' . $this->id)->rememberForever($this->fileCacheKey($page, $format, $resolution, $withText, $withGraphics, $version), function () use ($doc, $page, $format, $resolution, $withText, $withGraphics, $version) {
             return $doc->_getFile($page, $format, $resolution, $withText, $withGraphics, $version);
         });
+        if (!$res && !$force) {
+            return $this->getFile($page, $format, $resolution, $withText, $withGraphics, $version, true);
+        }
+        return $res;
     }
 
     public function removeFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html')
index 4193b0140e8efaa2124e194f5dac9dbfa84cc306..277382e28f33a42d226e8c12e06840bfdee9aea9 100644 (file)
@@ -1234,11 +1234,11 @@ trait PublicationSettings
         $this->addField('textExtraction', SelectFromArray::class, $this->__('Méthode d\'extraction des textes'), [
             'v2' => '{"type":"combo","default":"pdfbox","editable":true,"label":"\\u00a7!\\u00a7M\\u00e9thode d\'extraction des textes!\\u00a7!","datas":{"\\u00a7!\\u00a7PDFBox!\\u00a7!":"pdfbox","\\u00a7!\\u00a7Poppler!\\u00a7!":"poppler","\\u00a7!\\u00a7Fluidbook (exp\\u00e9rimentation bas\\u00e9e sur PDFBox)!\\u00a7!":"fluidbook"}}',
             'options' => [
+                'fluidbook' => $this->__('Fluidbook (basée sur PDFBox)'),
                 'pdfbox' => $this->__('PDFBox'),
                 'poppler' => $this->__('Poppler'),
-                'fluidbook' => $this->__('Fluidbook (expérimentation basée sur PDFBox)'),
             ],
-            'default' => 'pdfbox',
+            'default' => 'fluidbook',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
index ddf84c02cd8b2ed98246f2ed9b4aea0d70c78f9d..6ee2f9c54d4899a9447e6d30e71b113741920e48 100644 (file)
@@ -37,7 +37,7 @@ return [
     'channels' => [
         'stack' => [
             'driver' => 'stack',
-            'channels' => ['daily', 'stderr','slack'],
+            'channels' => ['daily', 'stderr', 'slack'],
             'ignore_exceptions' => false,
         ],
 
@@ -59,7 +59,7 @@ return [
             'url' => env('LOG_SLACK_WEBHOOK_URL'),
             'username' => 'Laravel Log',
             'emoji' => ':boom:',
-            'level' => 'critical',
+            'level' => 'debug',
         ],
 
         'papertrail' => [