【问题标题】:Making a .ico file using gd and php使用 gd 和 php 制作 .ico 文件
【发布时间】:2010-08-02 14:50:57
【问题描述】:

有谁知道如何制作一个可以在 Internet Explorer 中使用的 .ico 文件? 我似乎无处可去 这是我的gd代码

$im = imagecreatefromjpeg(FAVICONDIR.'normal/'.$filename );
        list($width, $height) = getimagesize(FAVICONDIR.'normal/'.$filename); // get the width and height of the jpg
        $image_p = imagecreatetruecolor("16", "16"); // create a 16x16 canvas to play with
        imagecopyresampled($image_p, $im, 0, 0, 0, 0, "16", "16", $width, $height); // resize jpg to 16x16
        imagepng($image_p,FAVICONDIR.'icons/'.$ico_filename); // make a .png file (icon file) from our data
        imagedestroy ($im); // close gd library

还有一个图像魔术师

/*$cmd = IMAGEMAGIKDIR .''. FAVICONDIR.'normal/'.$filename . ' -transparent white -background white -flatten -resize 16x16   ico:'.FAVICONDIR.'icons/'.$ico_filename;
    exec($cmd);*/

任何想法都会很棒。

【问题讨论】:

    标签: php imagemagick gd ico


    【解决方案1】:

    如果遇到问题,请使用 png2ico 这是一个很棒的教程 http://myutil.com/2007/10/14/favicon-ico-gimp 理查德

    【讨论】:

      猜你喜欢
      • 2017-03-27
      • 2011-02-05
      • 2011-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-25
      • 1970-01-01
      • 2011-09-28
      相关资源
      最近更新 更多