I might have missed something during the installation, I've tried to install this two times but I get this same error anyhow.
What could I be doing wrong?
$src_file = escapeshellarg($src_file); $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file)); } $output = array(); /* * Hack for working with ImageMagick on WIndows even if IM is installed in C:\Program Files. * By Aditya Mooley */ if ($sharpen==1 && $CONFIG['enable_unsharp']==1) { $unsharp_mask = " -unsharp ".$CONFIG['unsharp_radius']."x".sqrt($CONFIG['unsharp_radius'])."+".($CONFIG['unsharp_amount']/100)."+".($CONFIG['unsharp_threshold']/100)." "; } else $unsharp_mask = ""; if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."convert\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." ".str_replace("\\","/" ,$src_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." $src_file $im_dest_file"; exec ($cmd, $output, $retval); } if ($media_type != "false"){ //if a manual thumb gets generated we watermark the thumb with the media type //we now need to get the absolute path to the thumb watermark files $path_parts = pathinfo($CONFIG['watermark_file']); $CONFIG['watermark_file'] = $path_parts["dirname"]."/wm_".$media_type.".png"; } if ($watermark == "true" || $media_type != "false"){ if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."composite\" -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} \"{$CONFIG['watermark_file']}\" ".str_replace("\\","/" ,$im_dest_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}composite -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} {$CONFIG['watermark_file']} $im_dest_file $im_dest_file"; exec ($cmd, $output, $retval); } } if ($retval) { $ERROR = "Error executing ImageMagick - Return value: $retval"; if ($CONFIG['debug_mode']) { // Re-execute the command with the backtick operator in order to get all outputs // will not work is safe mode is enabled $output = `$cmd 2>&1`; $ERROR .= "
Cmd line :
" . nl2br(htmlspecialchars($cmd)) . "
"; $ERROR .= "
The convert program said:
"; $ERROR .= nl2br(htmlspecialchars($output)); $ERROR .= "
"; } @unlink($dest_file); return false; } break; case "gd1" : if (!function_exists('imagecreatefromjpeg')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__); } if ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } $dst_img = imagecreate($destWidth, $destHeight); imagecopyresized($dst_img, $src_img, 0, 0, $xOffset, $yOffset, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight); imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']); imagedestroy($src_img); imagedestroy($dst_img); break; case "gd2" : if (!function_exists('imagecreatefromjpeg')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__); } if (!function_exists('imagecreatetruecolor')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page', __FILE__, __LINE__); } if ($imginfo[2] == GIS_GIF && $CONFIG['GIF_support'] == 1) $src_img = imagecreatefromgif($src_file); elseif ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } if ($imginfo[2] == GIS_GIF) $dst_img = imagecreate($destWidth, $destHeight); else $dst_img = imagecreatetruecolor($destWidth, $destHeight); imagecopyresampled($dst_img, $src_img, 0, 0, $xOffset, $yOffset, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight); if ($sharpen==1 && $CONFIG['enable_unsharp']==1) { UnsharpMask($dst_img, $CONFIG['unsharp_amount'], $CONFIG['unsharp_radius'], $CONFIG['unsharp_threshold']); } if ($media_type != "false"){ //if a manual thumb gets generated we watermark the thumb with the media type //we now need to get the absolute path to the thumb watermark files $path_parts = pathinfo($CONFIG['watermark_file']); $CONFIG['watermark_file'] = $path_parts["dirname"]."/wm_".$media_type.".png"; } if ($watermark == "true" || $media_type != "false"){ $logoImage = ImageCreateFromPNG($CONFIG['watermark_file']); $logoW = ImageSX($logoImage); $logoH = ImageSY($logoImage); //where is the watermark displayed... $pos = $CONFIG['where_put_watermark']; if ($pos == "northwest") { $src_x = 5; $src_y = 5; } else if ($pos == "northeast") { $src_x = $destWidth - ($logoW + 5); $src_y = 5; } else if ($pos == "southwest") { $src_x = 5; $src_y = $destHeight - ($logoH + 5); } else if ($pos == "southeast") { $src_x = $destWidth - ($logoW + 5); $src_y = $destHeight - ($logoH + 5); } else if ($pos == "center") { $src_x = ($destWidth/2) - ($logoW/2); $src_y = ($destHeight/2) - ($logoH/2); } imagealphablending($dst_img, TRUE); imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery'])); //ImageCopyMerge($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH,$CONFIG['watermark_transparency']); //$dst_x,$dst_y,0,0,$logoW,$logoH); ImageCopy($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH); //$dst_x,$dst_y,0,0,$logoW,$logoH); } imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']); imagedestroy($src_img); imagedestroy($dst_img); break; } // Set mode of uploaded picture @chmod($dest_file, octdec($CONFIG['default_file_mode'])); //silence the output in case chmod is disabled // We check that the image is valid $imginfo = getimagesize($dest_file); if ($imginfo == null) { $ERROR = $lang_errors['resize_failed']; @unlink($dest_file); return false; } else { return true; } } function UnsharpMask($img, $amount, $radius, $threshold) { //////////////////////////////////////////////////////////////////////////////////////////////// //// //// p h p U n s h a r p M a s k //// //// Unsharp mask algorithm by Torstein H�nsi 2003. //// thoensi_at_netcom_dot_no. //// Please leave this notice. //// /////////////////////////////////////////////////////////////////////////////////////////////// if ($amount > 500) $amount = 500; $amount = $amount * 0.016; if ($radius > 50) $radius = 50; $radius = $radius * 2; if ($threshold > 255) $threshold = 255; $radius = abs(round($radius)); // Only integers make sense. if ($radius == 0) { return $img; imagedestroy($img); break; } $w = imagesx($img); $h = imagesy($img); $imgCanvas = imagecreatetruecolor($w, $h); $imgCanvas2 = imagecreatetruecolor($w, $h); $imgBlur = imagecreatetruecolor($w, $h); $imgBlur2 = imagecreatetruecolor($w, $h); imagecopy ($imgCanvas, $img, 0, 0, 0, 0, $w, $h); imagecopy ($imgCanvas2, $img, 0, 0, 0, 0, $w, $h); for ($i = 0; $i < $radius; $i++) { imagecopy ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); //center imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); } for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgCanvas, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } imagedestroy($imgCanvas); imagedestroy($imgCanvas2); imagedestroy($imgBlur); imagedestroy($imgBlur2); return $img; } ?>, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); } for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgCanvas, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } imagedestroy($imgCanvas); imagedestroy($imgCanvas2); imagedestroy($imgBlur); imagedestroy($imgBlur2); return $img; } ?> * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } } else{ for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($img, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgBlur, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); $rNew = ($amount * ($rOrig - $rBlur)) + $rOrig; if($rNew>255){$rNew=255;} elseif($rNew<0){$rNew=0;} $gNew = ($amount * ($gOrig - $gBlur)) + $gOrig; if($gNew>255){$gNew=255;} elseif($gNew<0){$gNew=0;} $bNew = ($amount * ($bOrig - $bBlur)) + $bOrig; if($bNew>255){$bNew=255;} elseif($bNew<0){$bNew=0;} $rgbNew = ($rNew << 16) + ($gNew <<8) + $bNew; ImageSetPixel($img, $x, $y, $rgbNew); } } } imagedestroy($imgCanvas); imagedestroy($imgBlur); return $img; } //used for custom thumbs function crop_image($src_file, $dest_file, $new_size_w, $new_size_h, $xOffset, $yOffset) { global $CONFIG, $ERROR; global $lang_errors; $imginfo = getimagesize($src_file); if ($imginfo == null) return false; // GD can only handle JPG & PNG images if ($imginfo[2] != GIS_JPG && $imageinfo[2] != GIS_PNG && $CONFIG['GIF_support'] == 0) { $ERROR = $lang_errors['gd_file_type_err']; return false; } switch ($CONFIG['thumb_method']) { case "im" : if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) { // get the basedir, remove '/include' $cur_dir = substr(dirname(__FILE__), 0, -8); $src_file = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"'; $im_dest_file = str_replace('%', '%%', ('"' . $cur_dir . '\\' . strtr($dest_file, '/', '\\') . '"')); } else { $src_file = escapeshellarg($src_file); $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file)); } $output = array(); /* * Hack for working with ImageMagick on WIndows even if IM is installed in C:\Program Files. * By Aditya Mooley */ $resize_commands = $new_size_w . "x" . $new_size_h . "+" . $xOffset . "+" . $yOffset; if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."convert\" -quality 100 -crop ".$resize_commands." ".str_replace("\\","/" ,$src_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}convert -quality 100 -crop ".$resize_commands." $src_file $im_dest_file"; exec ($cmd, $output, $retval); } if ($retval) { $ERROR = "Error executing ImageMagick - Return value: $retval"; if ($CONFIG['debug_mode']) { // Re-execute the command with the backtick operator in order to get all outputs // will not work is safe mode is enabled $output = `$cmd 2>&1`; $ERROR .= "
Cmd line :
" . nl2br(htmlspecialchars($cmd)) . "
"; $ERROR .= "
The convert program said:
"; $ERROR .= nl2br(htmlspecialchars($output)); $ERROR .= "
"; } @unlink($dest_file); return false; } else { return true; } break; case "gd2" : if ($imginfo[2] == GIS_GIF && $CONFIG['GIF_support'] == 1) $src_img = imagecreatefromgif($src_file); elseif ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } if ($imginfo[2] == GIS_GIF) $dst_img = imagecreate($new_size_w, $new_size_h); else $dst_img = imagecreatetruecolor($new_size_w, $new_size_h); imagecopyresampled($dst_img, $src_img, 0, 0, $xOffset, $yOffset, $new_size_w+$xOffset, $new_size_h+$yOffset, $new_size_w+$xOffset, $new_size_h+$yOffset); imagejpeg($dst_img, $dest_file, 100); imagedestroy($src_img); imagedestroy($dst_img); // Set mode of uploaded picture @chmod($dest_file, octdec($CONFIG['default_file_mode'])); //silence the output in case chmod is disabled // We check that the image is valid $imginfo = getimagesize($dest_file); if ($imginfo == null) { $ERROR = $lang_errors['resize_failed']; @unlink($dest_file); return false; } else { return true; } break; }// end switch } ?>