From: Vincent Vanwaelscappel Date: Thu, 15 Jan 2026 14:07:37 +0000 (+0100) Subject: wip #7894 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=eeadecebc7cd21b7d4e592c020ee8b98a6f8bae7;p=cubist_util.git wip #7894 @0.25 --- diff --git a/src/CommandLine/Docling.php b/src/CommandLine/Docling.php index c642749..73bebbc 100644 --- a/src/CommandLine/Docling.php +++ b/src/CommandLine/Docling.php @@ -15,7 +15,7 @@ class Docling extends CommandLine parent::__construct('docling', $output, $error, $outputPrefix); } - public static function OCR($image, $locale = null) + public static function OCR($image, $locale = null, $returnFile = false) { $f = new \SplFileInfo($image); @@ -36,8 +36,11 @@ class Docling extends CommandLine $html = Markdown::toHTML($md, false); file_put_contents($out, $html); - return $html; } - return file_get_contents($out); + if ($returnFile) { + return $out; + } else { + return $html ?? file_get_contents($out); + } } } \ No newline at end of file