Web: fix GD detection

This broke when 2.1.0 was released.
This commit is contained in:
Christian Beer 2016-05-09 09:33:06 +00:00
parent 94b7591d4b
commit 8c325112f0
1 changed files with 3 additions and 1 deletions

View File

@ -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) {