From: Vincent Vanwaelscappel Date: Tue, 16 Jan 2024 18:22:36 +0000 (+0100) Subject: wip #6615 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=08052547e99b32b3a75d5d6fe45c915560259961;p=cubist_pdf.git wip #6615 @0.5 --- diff --git a/src/PDFTools.php b/src/PDFTools.php index 30a90ec..3d63db4 100644 --- a/src/PDFTools.php +++ b/src/PDFTools.php @@ -393,6 +393,20 @@ class PDFTools $pdftoppm->execute(); $tmp .= '.ppm'; + $output = $pdftoppm->getOutput(); + $errors = ['end of file inside dictionary', + 'leftover args in content stream', + 'document stream is empty' + ]; + + foreach ($errors as $error) { + if (stristr($output, $error)) { + unlink($tmp); + $pdftoppm->debug(); + return; + } + } + if (file_exists($tmp)) { if ($format === 'jpg') {