From f8de8adec71c21a1416439ea8e4d30bbcbabe482 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 18 Dec 2017 19:40:56 +0000 Subject: [PATCH] lib/php/out/png.php --- lib/php/out.php | 1 + lib/php/out/jpg.php | 2 ++ lib/php/out/png.php | 2 ++ 3 files changed, 5 insertions(+) diff --git a/lib/php/out.php b/lib/php/out.php index 3bcaf308..b8e06c21 100644 --- a/lib/php/out.php +++ b/lib/php/out.php @@ -279,6 +279,7 @@ Class Out extends Nb { $count++; self::row($conf,$row); + if (isset($conf['limit']) and $count > $conf['limit']) break; } diff --git a/lib/php/out/jpg.php b/lib/php/out/jpg.php index 5f4d6a21..716dfa20 100644 --- a/lib/php/out/jpg.php +++ b/lib/php/out/jpg.php @@ -14,6 +14,8 @@ return [ if (!empty($o['_jpg'])) return; $o['_jpg'] = true; foreach ($row as $k=>$v) { + if (!is_scalar($v) or !self::is_binary($v)) continue; + $o['limit'] = 0; $img = imagecreatefromstring($v); if ($o['w'] and $o['h']) { diff --git a/lib/php/out/png.php b/lib/php/out/png.php index bf9bd7b0..64f8c85a 100644 --- a/lib/php/out/png.php +++ b/lib/php/out/png.php @@ -14,6 +14,8 @@ return [ if (!empty($o['_png'])) return; $o['_png'] = true; foreach ($row as $k=>$v) { + if (!is_scalar($v) or !self::is_binary($v)) continue; + $o['limit'] = 0; $img = imagecreatefromstring($v); if ($o['w'] and $o['h']) { -- 2.47.3