Skip to content
Advertisement

The image contain error with imagick

<?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;

?>

is giving error The image “http://localhost/test/into.php” cannot be displayed because it contains errors.Solve this please?

Advertisement

Answer

Your image is created at 0 px height and probably invalid format. Try and see docs.

$image->thumbnailImage(100, 100);
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement