Created
June 21, 2013 15:34
-
-
Save apatton-cnet/5832046 to your computer and use it in GitHub Desktop.
image thumbnailer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function create_image_thumbnails($image_filename) { | |
$image = new Imagick("images/original/" . $image_filename); | |
$image->scaleImage(800,0); | |
$image_details = $image->getImageGeometry(); | |
if ($image_details['height'] > 600) { | |
$image->scaleImage(0,600); | |
} | |
$image->writeImage("images/normal/" . $image_filename); | |
$image->scaleImage(400,0); | |
$image->writeImage("images/medium/" . $image_filename); | |
$image->scaleImage(200,0); | |
$image->writeImage("images/small/" . $image_filename); | |
$image->destroy(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment