Convert png file to ico with PHP

后端 未结 6 1886
忘掉有多难
忘掉有多难 2020-12-09 21:37

I would like to create a PHP script that convert a png file to an ico file. Is it possible to do it just with PHP ? How ?

Thanks !!!

6条回答
  •  天涯浪人
    2020-12-09 21:54

    For my WP plugin: http://wordpress.org/extend/plugins/wp-favicons/ I am using this ico lib: http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-14883 here is the code : http://plugins.trac.wordpress.org/browser/wp-favicons/trunk/plugins/filters/convert_to_png.php

    It works with almost all icons but some like an icon found here: http://www.slatch.com/ give me : Notice: Uninitialized string offset: 64 etc... on line 296.

    So... if you have found a better .ico php lib than I can replace that one with another one :)

提交回复
热议问题