From: Vincent Vanwaelscappel Date: Mon, 15 Jul 2024 13:40:24 +0000 (+0200) Subject: wip #7005 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4fd8740a82122ba8a74d77d8acdbc2a3ac377bc3;p=fluidbook_tools.git wip #7005 @1 --- diff --git a/src/Jobs/ProcessFile.php b/src/Jobs/ProcessFile.php index 4bd729a..fe036b6 100644 --- a/src/Jobs/ProcessFile.php +++ b/src/Jobs/ProcessFile.php @@ -9,6 +9,8 @@ use Fluidbook\Tools\SVG\SVGTools; class ProcessFile { + const EMPTY_SVG = ''; + protected $format = 'jpg'; /** * @var int|string @@ -267,11 +269,17 @@ class ProcessFile return $svgFile; } PDFTools::makeBaseSVGFile($this->getSplittedPDFPage(), $svgFile, 1); + if (file_exists($svgFile) && filesize($svgFile) == 0) { + file_put_contents($svgFile, static::EMPTY_SVG); + } return $svgFile; } protected function _isSVGValid($file) { + if (!file_exists($file) || filesize($file) === 0) { + return false; + } $svg = new DOMDocument(); $svg->preserveWhiteSpace = false; $svg->load($file, LIBXML_PARSEHUGE);