Is this ImageMagick or GD library?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Is this ImageMagick or GD library?

Post 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");
	}

?>
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Looks like GD to me. All of the commands (imagecopyresampled, imagejpeg, etc) are all from the GD library.
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Post by tsg »

Thank you :)
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

definitely GD (imagemagick would normally require exec calls to the functions from php and the function naming protocol is very different)
Post Reply