Home  >  Article  >  Backend Development  >  怎么使用PHP 在线转换 ico 至 PNG 呢。求高手解答

怎么使用PHP 在线转换 ico 至 PNG 呢。求高手解答

WBOY
WBOYOriginal
2016-06-13 13:20:121050browse

如何使用PHP 在线转换 ico 至 PNG 呢。。求高手解答。
呀。。求高手解答

有方法就行(不要太抽象。。稍微描述下。)。。 如果有源代码就更好啦

------解决方案--------------------
嘿嘿。。坐等源码。
------解决方案--------------------
有一个类,不过...

使用方法

PHP code

require 'class.ico.php';
$o = new Ico("favicon.ico"); //需要转换的图片
$index = "nsize";
foreach ($o->formats as $key => $val) {
    if ($val['header']['Width'] == 32 and $val['header']['Height'] == 64) {
        $index = $key;
        break;
    }
}
if ($index === "nsize") {
    print_r("没有相应的尺寸");
    die;
} else {
    imagegif($o->GetIcon($index), "favicon.png"); 
}
<br><font color="#e78608">------解决方案--------------------</font><br>
探讨

好想给楼上一个板砖。。。 我还以为有人想出来了。。特地兴奋的打开

------解决方案--------------------
给个例子$input='zzz.gif';
$output='zzz.jpg';
$image=imagecreatefromgif($input);
imagejpeg($image,$output);
imagedestroy($image);
unlink($input);
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn