Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Created October 2, 2013 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Greg-Boggs/6801988 to your computer and use it in GitHub Desktop.
Save Greg-Boggs/6801988 to your computer and use it in GitHub Desktop.
gd test script
<?php
//Report all errors
ini_set("display_errors", "1");
error_reporting(E_ALL);
$image = 'cat.jpg';
//Load image from source provided
$image = imagecreatefromjpeg($image);
//Set content type
header('content-type: image/jpeg');
//Save image with 90 percent quality
imagejpeg($image, '', 90);
//clear up memory
imagedestroy($image);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment