How to use PHP to convert ico to PNG online. Answers from experts

Source: Internet
Author: User
How to use PHP to convert ico to PNG online .. Please give answers. Yes .. You just need a method (not too abstract .. .).. It would be better if the source code is available .. Wait for the source code ., There is a class, but... how to use PHPcoderequire 'class. ico. php'; $ o = newIco (& quot; favi how to use php to convert ico to PNG online .. Please give answers.
Yes .. Answers from experts

Just do it with methods (not too abstract .. .).. It would be better if the source code is available.

------ Solution --------------------
Hey .. Wait for the source code.
------ Solution --------------------
There is a class,...

Usage

PHP code
Require 'class. ico. php '; $ o = new Ico ("favicon. ico "); // the image to be converted $ 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 ("no corresponding size"); die ;} else {imagegif ($ o-> GetIcon ($ index), "favicon.png ");}
------ Solution --------------------
Discussion

I really want to give a brick upstairs... I thought someone came up with it .. Very excited

------ Solution --------------------
Example Using input='zzz.gif ';
Export output+'zzz.jpg ';
$ Image = imagecreatefromgif ($ input );
Imagejpeg ($ image, $ output );
Imagedestroy ($ image );
Unlink ($ input );
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.