<?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;
?>
正在提供错误图像“ http://localhost/test/into.php”因为包含错误而无法显示。请解决此问题?
您的图片是在0像素高度创建的,并且格式可能无效。尝试查看docs。
$image->thumbnailImage(100, 100);
请阅读注释行中的详细信息
<?php
//drawing stuff that creates $image
ob_get_clean(); //this statement is what mine was lacking before I could get it to work properly
header("Content-type: image/png");
echo $image;