functions.api.images.php etwas angesehen...
wirklich ein sehr brauchbares grundgerüst
jedoch bei
function capiImgScaleLQ
findet sich
Code: Alles auswählen
$imageHandle = @$function($filename); break;
Code: Alles auswählen
$imageHandle = @$function($filename); break;
Code: Alles auswählen
switch (strtolower($filetype))
{
case ".gif": $function = "imagecreatefromgif"; break;
case ".png": $function = "imagecreatefrompng"; break;
case ".jpg": $function = "imagecreatefromjpeg"; break;
case "jpeg": $function = "imagecreatefromjpeg"; break;
default: return false;
}
if (function_exists($function))
{
$imageHandle = @$function($filename);
}
Code: Alles auswählen
if (!is_file($img))
{
/* Try with upload string */
if (is_file($cfgClient[$client]["upl"]["path"].$img))
{
$img = $cfgClient[$client]["upl"]["path"].$img;
} else {
/* DBFS-Based file */
if (is_dbfs($img))
{
$dbfs = new DBFSCollection;
$file = basename($img);
//echo "write to file from $img to ".$cfgClient[$client]["path"]["frontend"]."cache/".$file;
$dbfs->writeToFile($img, $cfgClient[$client]["path"]["frontend"]."cache/".$file);
$img = $cfgClient[$client]["path"]["frontend"]."cache/".$file;
$deleteAfter = true;
} else {
/* No, it's neither in the upload directory nor in the dbfs. return. */
return;
}
}
}
Code: Alles auswählen
switch ($mxdAvImgEditingPosibility)
{
case '1': // gd1
$method = 'gd1';
if (!function_exists('imagecreatefromgif') && $filetype == '.gif')
{
$method = 'failure';
}
break;
case '2': //gd2
$method = 'gd2';
if ($filetype == '.gif')
{
$arrGDInformations = gd_info();
if (!$arrGDInformations['GIF Create Support'])
{
$method = 'failure';
}
}
break;
case 'im': //imagemagick
$method = 'im';
break;
case '0':
$method = 'failure';
break;
default:
$method = 'failure';
break;
}
Code: Alles auswählen
/**
* check image editing method
*
* return string $method
*/
function checkImageEditingMethod($filetype) {
$mxdAvImgEditingPosibility= checkImageEditingPosibility();
switch ($mxdAvImgEditingPosibility)
{
case '1': // gd1
$method = 'gd1';
if (!function_exists('imagecreatefromgif') && $filetype == '.gif')
{
$method = 'failure';
}
break;
case '2': //gd2
$method = 'gd2';
if ($filetype == '.gif')
{
$arrGDInformations = gd_info();
if (!$arrGDInformations['GIF Create Support'])
{
$method = 'failure';
}
}
break;
case 'im': //imagemagick
$method = 'im';
break;
case '0':
$method = 'failure';
break;
default:
$method = 'failure';
break;
}
return $method;
}
Code: Alles auswählen
$method = checkImageEditingMethod($filetype);
Code: Alles auswählen
function capiImgScale ($img, $maxX, $maxY, $crop = false, $expand = false, $cacheTime = 10, $wantHQ = false)