gdlib fixes
Dieser Commit ist enthalten in:
Ursprung
2c999a7048
Commit
71e13f626e
|
@ -149,25 +149,23 @@ function capiImgScaleLQ($img, $maxX, $maxY, $crop = false, $expand = false, $cac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get out which file we have */
|
$imageHandle = null;
|
||||||
|
|
||||||
switch (strtolower($filetype)) {
|
switch (strtolower($filetype)) {
|
||||||
case ".gif": $function = "imagecreatefromgif";
|
case ".gif":
|
||||||
|
$imageHandle = imagecreatefromgif($filename);
|
||||||
break;
|
break;
|
||||||
case ".png": $function = "imagecreatefrompng";
|
case ".png":
|
||||||
|
$imageHandle = imagecreatefrompng($filename);
|
||||||
break;
|
break;
|
||||||
case ".jpg": $function = "imagecreatefromjpeg";
|
case ".jpeg":
|
||||||
break;
|
case "jpg":
|
||||||
case "jpeg": $function = "imagecreatefromjpeg";
|
$imageHandle = imagecreatefromjpeg($filename);
|
||||||
break;
|
break;
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists($function)) {
|
if((gettype($imageHandle) == "object" && get_class($imageHandle) == "GdImage") !== true) {
|
||||||
$imageHandle = @$function($filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we can't open the image, return false */
|
|
||||||
if (!$imageHandle) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +694,7 @@ function checkImageEditingPosibility() {
|
||||||
if (function_exists('gd_info')) {
|
if (function_exists('gd_info')) {
|
||||||
$arrGDInformations = gd_info();
|
$arrGDInformations = gd_info();
|
||||||
|
|
||||||
if (preg_match('#([0-9\.])+#', $arrGDInformations['GD Version'], $strGDVersion)) {
|
if (preg_match('#([0-9.])+#', $arrGDInformations['GD Version'], $strGDVersion)) {
|
||||||
if ($strGDVersion[0] >= '2') {
|
if ($strGDVersion[0] >= '2') {
|
||||||
return '2';
|
return '2';
|
||||||
}
|
}
|
||||||
|
@ -708,6 +706,4 @@ function checkImageEditingPosibility() {
|
||||||
}
|
}
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
Laden…
In neuem Issue referenzieren