Hi all, first time user here, need a bit of help. I installed imagemagick in Linux using "sudo apt-get install imagemagick". I'm trying to follow the basic examples listed at
http://www.php.net/manual/en/imagick.examples-1.php
The first sample script is:
Code: Select all
<?php
header('Content-type: image/jpeg');
$image = new Imagick('image.jpg');
// If 0 is provided as a width or height parameter,
// aspect ratio is maintained
$image->thumbnailImage(100, 0);
echo $image;
?>
So I save this script in my web folder, and put a test image called "image.jpg" there (image.jpg is visible when accessed in the browser). But when I open the script in the browser, I get a broken image icon.
Then I tried to follow the second example script:
Code: Select all
<?php
$images = new Imagick(glob('images/*.JPG'));
foreach($images as $image) {
// Providing 0 forces thumbnailImage to maintain aspect ratio
$image->thumbnailImage(1024,0);
}
$images->writeImages();
?>
I changed the path accordingly (from glob('images/*.JPG') to glob('*.jpg') but when I open the script, I get a server error (HTTP error 500). I restarted the apache2 service but it didn't help. What am I missing?