As I have promissed few days ago, here is a short installation instruction to install webp-npapi from source using Ubuntu 11.10.
To have one directory where we install everything, create e.g. /home/users/webp direcotry using mkdir /home/user/webp.
Let’s start with libwebp…
- Fetch it from here.
- Unpack it in /home/user/webp
- do a ./configure
- do a make
- do a sudo make install (this will install the library in /usr/local)
- do a sudo ldconfig (to refresh the dynamic library cache)
…and continue with xulrunner-sdk.
- Fetch xulrunner sdk from here (about 300 MB). Take care of your Firefox Version (I use 11 and took 11.0)
- Unpack the archive in /home/user/webp
Finish with webp-npapi plugin:
- Change directory to /home/user/webp
- Fetch the source from the repository using: svn checkout http://webp-npapi-linux.googlecode.com/svn/trunk/ webp-npapi-linux-read-only
- cd to webp-npapi-linux-read-only
- Edit npapi.h and change
- Do the same in CPlugin.h
- Edit webp-npapi.cpp and change (at line 64)
const char * NP_GetMIMEDescription()
- do a make and ignore the few warnings
- Edit the Makefile and change
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
$(CC) $(CFLAGS) $(OBJECTS) $(LDFLAGS) -o $@
This is only because newer g++ versions require the dynamic libraries after the objects.
To make firefox find the plugin you have to copy to you firefox plugins directory (/usr/lib/mozilla/plugins in my case) and restart firefox. To check if the plugin was loaded correctly you look at Extras / Add ons…/Plugins within firefox.
If all went well go to the Google WebP Gallery and play with the images.
For me it works as expected. Resizing the window scales the images as WebP promisses. A right click gives a little menu for saving the image as PNG or WebP or to call a little about dialog with credits for the authors.
Good Job and keep on the good work. 🙂
Of course it would be great to have this for img-tags too. But as far as I remember plugins can not process and change img tags in firefox only embed and object are open for this.