From 8c325112f01a93ba43b4f827bcf0befe6ecfc0bd Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Mon, 9 May 2016 09:33:06 +0000 Subject: [PATCH] Web: fix GD detection This broke when 2.1.0 was released. --- html/inc/image.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/inc/image.inc b/html/inc/image.inc index ffe39dc93d..053765c419 100644 --- a/html/inc/image.inc +++ b/html/inc/image.inc @@ -21,7 +21,9 @@ // function intelligently_scale_image($sourcefile, $fw, $fh) { $gd_info = gd_info(); - $newGD = (strstr($gd_info["GD Version"], "2.0")!=""); + // libgd version numbers seem to be always three numbers + preg_match('/(\d).(\d).(\d)/', $gd_info['GD Version'], $match); + $newGD = ($match[1]>=2); list($ow, $oh, $from_type) = getimagesize($sourcefile); switch($from_type) {