- Follow this to install EBImage
- Go here to get GTK+. I used this one.
- Make sure you add the GTK+ “bin” directory to the path.
- If you have zlib1.dll problems, or any problems regarding the specific dll that is being loaded: you can use Process Explorer to find out which dll is being loaded.
- Install ImageMagick from here. I used this one.
To the ones that think that everything is easier on windows, I must strongly disagree. I have some R code that is pretty handy for handling plant image series. As I am a Linux user, I created it and tested it on Linux. I have gotten to a point were I needed to test it in windows. So I got a windows box from a colleague and started what I thought would be an easy installation process. Note that I have not even gotten to testing my code. What is contained in this post is the troubles I went through to install EBImage, an R package that my code needs.
Installing EBImage in R is not very painful. You just need to follow these instructions. But when you try to import EBImage it says that you don’t have GTK+ installed. Logically I go to this site to get me some GTK+. I find that they don’t have a windows installer but they do have a zipped file that you can put on your “Program Files” directory. I download this file and put it on my “Program Files” directory. You can actually put it wherever you want, but I wanted it to go where all the programs where (didn’t want it to feel lonely). But when I tried to import EBImage in the RGui, it didn’t work.
Aha. The path. For the stuff that you have just “installed” to be found by applications, you have to add the installation directory to the path. I have learned that it is a bit different in every windows. I followed this link to change the path. But when I tried to import EBImage in the RGui, it didn’t work. The error message changed (that is always a good sign that you are doing the right thing). The error message read something like “The procedure entry point deflateSetHeader could not be located in the dynamic link zlib1.dll”.
I thought im might be some versioning issue with the zlib1.dll that came with the GTK+ installation, but the GTK+ tests worked just fine. I tried to put the GTK+ directory first in the path, but that did not work either. I turned to google and found that someone had the same issues and ultimately had to hunt for the zlib1.dll that was getting loaded and replace it with the one that GTK+ provided. But how to do this? I downloaded the Process Explorer tool to see if I could use it in an “strace” kinda way. This tool provided a way to debug processes and this is where I got the output of the libraries that EBImage was bringing in. It turned out that there was another zlib1.dll library in c:/WINDOWS/system. After I replaced that it still did not work :)
But it was because I had not installed imageMagick. Once I installed it from this link, the EBImage import finally worked. Yes. I’m no windows expert. But I still it was more painful than I expected.