Page 1 of 1

Is this ImageMagick or GD library?

Posted: Wed Oct 08, 2003 2:12 pm
by tsg
Is the follow code snip using a GD library or imagemagick? Can you tell? Whatever it is, I need it installed on a server and don't know which to tell him to install.

Code: Select all

<?php
		if(function_exists("imagecopyresampled")){
      		$newim = imagecreatetruecolor($newwidth, $newheight);
      		imagecopyresampled($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
		}else{
			$newim = imagecreate($newwidth, $newheight);
      		imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
		}
        ImageJpeg ($newim,$user_path . $upload_folder . $name . ".jpg", 93);
		ImageDestroy ($newim);
	}else{
		ImageJpeg ($im,$user_path . $upload_folder . $name . ".jpg");
	}

?>

Posted: Wed Oct 08, 2003 3:55 pm
by Gen-ik
Looks like GD to me. All of the commands (imagecopyresampled, imagejpeg, etc) are all from the GD library.

Posted: Wed Oct 08, 2003 3:56 pm
by tsg
Thank you :)

Posted: Wed Oct 08, 2003 4:42 pm
by pootergeist
definitely GD (imagemagick would normally require exec calls to the functions from php and the function naming protocol is very different)