From: Vincent Vanwaelscappel Date: Thu, 7 Aug 2025 15:15:43 +0000 (+0200) Subject: wip #7684 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=36cb1856e2ab7448c48ea01d93a34fc7fc42a27c;p=fluidbook-toolbox.git wip #7684 --- diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index 09348129c..49801958d 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -2,6 +2,7 @@ namespace App\Fluidbook; +use Cubist\Util\CommandLine\Poppler; use Cubist\Util\Files\Files; use Fluidbook\Tools\Jobs\ProcessFile; use hollodotme\FastCGI\Client; @@ -419,6 +420,11 @@ class Farm public static function extractPDFArea($file, $page, $rect, $to = null, $options = array(), $cache = null) { + $final = Files::mkdir($cache) . Poppler::extractAreaFilehash($file, $page, $rect, $options) . '.' . $options['format']; + if (file_exists($final)) { + return $final; + } + $lock = 'pdfarea_' . hash('sha256', $file . '_' . $page . '_' . json_encode($rect) . '_' . json_encode($options)); return static::lock($file, $lock, function () use ($file, $page, $rect, $to, $options, $cache) { return self::_getFile(