From 3d29478cc9c32a79293a92fcbf1b88136aad7520 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 6 May 2026 17:03:03 +0200 Subject: [PATCH] conversion from text to image will use only the first 30000 chars --- inc/inc.ClassConversionServiceTextToImage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/inc.ClassConversionServiceTextToImage.php b/inc/inc.ClassConversionServiceTextToImage.php index 6c526c695..56a311ec6 100644 --- a/inc/inc.ClassConversionServiceTextToImage.php +++ b/inc/inc.ClassConversionServiceTextToImage.php @@ -96,7 +96,8 @@ class SeedDMS_ConversionServiceTextToImage extends SeedDMS_ConversionServiceBase $draw->setFontSize($fontSize); $draw->setTextAlignment(Imagick::ALIGN_LEFT); - $content = file_get_contents($infile); + /* Limit the number of characters to 30000 which is roughly 9 pages */ + $content = file_get_contents($infile, false, null, 0, 30000); $lines = preg_split('~\R~',$content); $boxY = $boxTop; $pagecount = 0;