Monday, May 11, 2009

Gotcha Of The Day: Adding Image Support To Emacs on Windows

The latest version of Emacs allows you to open up images, just like text. See:

However, when I installed the latest version of GNU emacs, the images just loaded as gibberish.

You can check to see if your emacs has image support by placing the following in the *scratch* buffer and eval'ing it:

 (image-type-available-p 'png)
 (image-type-available-p 'jpeg)

For me, the above returned nil. I knew I needed to install the extra image libraries, but which ones and where to get them?

After a bit of investigation, it turned out to be not all that tricky. I just headed over to the GTK+ download site and grabbed the following packages:

I unpacked these zip files. I then took the .dll files and dropped them into C:\Windows\System32. That's probably not the best place for them, but being a Unix geek stuck on Windows, it worked for me.

Now, there's one more catch - emacs is looking for a particularly named .dll files. So, make sure you name them as:


These names are defined in the varaiable image-library-alist.

I kept putting off setting this up because I kept wondering which files to download and where to stash them. In the end, it was quite easy to do. So do it, and have a more functional emacs. And who doesn't want that?


  1. Where did you get the giflib dll?

  2. Give libungif a shot: