Any PHP library to create .ico? Or just to convert a PNG to ICO?

Discussion in 'PHP' started by yangyang, Sep 21, 2008.

  1. #1
    Searched google with nothing relevant.
     
    yangyang, Sep 21, 2008 IP
  2. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    A .ico is a just a .bmp with a different file extension.
     
    Shoro, Sep 21, 2008 IP
  3. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Really? I didn't know that. Well, if that's true and you want a way to convert PNGs to it, I have a useful script I got a long time ago that someone made. It provides you with two more GD2 functions; ImageBMP and ImageCreateFromBMP. So you can basically open your PNG file with GD2 and then have it save it as a .ico using the ImageBMP function.

    <?
    $img = ImageCreateFromPNG("your image.png");
    ImageBMP($img, "your image.ico");
    ImageDestroy($img);
    ?>
    PHP:
    Here's the BMP script, just include it: http://pastebin.com/f22234b9b
     
    zerxer, Sep 21, 2008 IP
  4. Revanche

    Revanche Banned

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also use tools.dynamicdrive.com/favicon
     
    Revanche, Sep 21, 2008 IP
  5. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #5
    zerxer, Sep 21, 2008 IP
  6. yangyang

    yangyang Banned

    Messages:
    757
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks for the suggestions. I was going to build a image convert site rather than just convert some icons of my own. =)

    It's done now. http://www.converthub.com

    using ImageMagick.
     
    yangyang, Oct 7, 2008 IP