imagerotate因小图片而失败

时间:2016-05-18 18:36:35

标签: php image-rotation php-gd

我有1x2px图像,当我使用imagerotate时出现此错误

Warning: imagerotate(): gd warning:
one parameter to a memory allocation multiplication is negative or zero,
failing operation gracefully in file#line

示例代码 标题('内容类型:image / png');

$angle = 320;

$image = imagecreatefrompng('small.png');
$bg_color = imagecolorallocatealpha($image, 0, 0, 0, 127);
$temp_image = imagerotate($image, -$angle, $bg_color);
imagesavealpha($image, 1);

imagepng($image);

此问题是否有解决方法?

PHP 5.5.12 WAMP

0 个答案:

没有答案