在PHP中旋转png文件时未查看数据

时间:2018-07-06 16:06:07

标签: header

我想在php中旋转png文件,但仍然存在一些错误并查看空数据。错误未查看。谢谢大家代码已关闭:

<?php
    $filename = 'photo_stamp.png';
    $rotang = 90; // Rotation angle
    $source = imagecreatefrompng($filename) or die('Error opening file '.$filename);
    imagealphablending($source, false);
    imagesavealpha($source, true);

    $rotation = imagerotate($source, $rotang, imageColorAllocateAlpha($source, 0, 0, 0, 127));
    imagealphablending($rotation, false);
    imagesavealpha($rotation, true);

    header('Content-type: image/png');
    imagepng($rotation);
    imagedestroy($source);
    imagedestroy($rotation);
?>

0 个答案:

没有答案