PHP Help

Regs

Lifer
Aug 9, 2002
16,665
21
81


Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/studiop/public_html/php/modules/coppermine/include/picmgmtbatch.inc.php

with this code:

case "gd1" :
if ($imginfo[2] == GIS_JPG)
line 173----> $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, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
imagedestroy($src_img);
imagedestroy($dst_img);
break;

I know you are going to say php sucks but I needed to start somewhere :/
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
You need GD installed. And, what you pasted looks like it's looking for GD1, which is old. Any recent version of php will use GD2.
 

jonmullen

Platinum Member
Jun 17, 2002
2,517
0
0
just for future reference imagemagik is much better than the GD libraries...IMO