Chris Jean
Linux, WordPress, programming, anime, and other stuff
  • Home
  • Linux
  • Development
  • Random Ramblings

Archive for favicon

Creating a PHP ICO Creator for Favicons

by Chris Jean
July 21st, 2011

For the past couple of weeks, I have worked on creating a PHP library to create ICO files. This has been difficult as all the documentation for the ICO format is either sparse or not completely documented.

I’m doing this since I have yet to find a way of creating a valid favicon file using just PHP and PHP’s GD library. Sure, I can create a PNG file and change the extension to “.ico”, but that doesn’t work in all browsers, on all operating systems (such as Windows XP), and is more of a hack than a valid method for creating favicon files.

So, it is time to make one. I have a placeholder github repository named php-ico.

The primary goal is to make a robust, reliable library that creates valid ICO files that can be properly rendered on Windows XP+ and all the major browsers. Thus, my initial goal is not to support every format that exists nor is it to support parsing the ICO files. If the project gets enough attention, I’ll look at expanding the scope.

Here are the resources that I’ve found helpful as I’ve worked on this project:

  • ICO (file format) – Wikipedia article about the ICO file format. This has a very comprehensive description of the ICO header. It is sparse on details about the format of the image data.
  • BMP file format – Wikipedia article about the BMP file format. This helped me understand the headers and pixel data format for the BMP image data.
  • Portable Network Graphics – Wikipedia article about the PNG file format. This gave me what I needed to know to identify PNG image data.
  • Windows Bitmap File Format – Very good article that delves into more details about the BMP file format. The extra details about the different types of headers, compression methods, compression encoding, and examples were very helpful.
  • Icons – A Microsoft Developer Network article from 1995 that provides the original ICO file format spec. While this is the most authoritative, I really didn’t find this to be as much help as other sources.
  • Replacing ICON resources in EXE and DLL files – Article from The Code Project that has a breakdown of the format similar to what is found in the MSDN article. Example C code is provided.
  • Support Vista-style ICO files – Mozilla Bugzilla filed bug. The discussion has some great information about methods used to reliably parse varying ICO formats and structures. It also has some good test ICO files to try.
  • Convert HBITMAP to .ICO file – This Chironex Software blog post provided the last piece I needed: how to structure the opacity mask data. Where he found this information (since I didn’t find it in any of the above articles) I haven’t a clue.

If this post gets some traction and interest, I’ll consider putting together a post detailing all the different pieces I’ve found here. I’m not a spec writer, but I’d try my best. Let me know if you’d like to have me work on this.

Categories Development
Comments (0)

Change Google favicon Back

by Chris Jean
January 23rd, 2009

Google’s original capital G favicon was around for, I don’t know, forever. Around June, they changed it to a lowercase g. I know that many people threw up their hands in disgust, but I actually liked it. It looked very clean and neat. However, they recently changed the favicon yet again.

Now Google’s favicon is this very colorful icon with green, blue, yellow, and red colors from their logo. I don’t necessarily dislike this new favicon, but I simply don’t and can’t associate it with Google. Google has always been represented by clean simplicity. They don’t need wizbang fancy images because they are simply good and don’t need to be fancy to attract people.

I think that’s why I liked the simple blue and white icon, even when they changed it. It was simple, to the point, laconic even; It was, in a word: Google.

Now when I have numerous Google tabs open, I look up at my tabs and just can’t help but think, “what is that site and why do I so many tabs of it?” I tried getting used to it, but I simply cannot. So, I decided that I would find a way to do something about it.

Read More→

Categories Tips 'n Tricks
Comments (0)
Chris Jean
Copyright © 2012 All Rights Reserved
iThemes Builder by iThemes
Powered by WordPress