我有一个问题,变量imagecopy上的某些图像$url不会出现,即使PNG在工作和不工作的例子上都有。$local变量从服务器加载透明图像,从$url远程服务器加载变量。我已经为$local.
在职的:
<?php
header("Content-type: image/png");
$url = imagecreatefrompng("url_removed.png");
$local = imagecreatefrompng("http://url_removed.png");
imagecopy($url, $local, 0, 0, 0, 0, 100, 100);
imagepng($url);
imagedestroy($url);
imagedestroy($local);
?>
不工作:
<?php
header("Content-type: image/png");
$url = imagecreatefrompng("url_removed.png");
$local = imagecreatefrompng("http://url_removed.png");
imagecopy($url, $local, 0, 0, 0, 0, 100, 100);
imagepng($url);
imagedestroy($url);
imagedestroy($local);
?>
我什至尝试过imagecreatestring,file_get_contents它也可以使用,但某些PNG图像不能像使用imagecreatefrompng
在完成所有这些之后,我认为这与imagecopy...有关。我能做些什么来解决这个问题,或者有另一种简单的方法来做到这一点?