Installing webp-npapi Plugin from source

As I have promissed few days ago, here is a short installation instruction to install webp-npapi from source using Ubuntu 11.10.

To install the webp-npapi Firefox Plugin you have to install libwebp, have to install xulrunner-sdk and of course the source of the plugin itself.

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
    #include "../../include/npapi.h"
    #include "../../include/npfunctions.h"

    to
    #include "../xulrunner-sdk/include/npapi.h"
    #include "../xulrunner-sdk/include/npfunctions.h"
  • Do the same in CPlugin.h
  • Edit webp-npapi.cpp and change (at line 64)
    NP_EXPORT(char*) NP_GetMIMEDescription()
    to
    const char * NP_GetMIMEDescription()
  • do a make and ignore the few warnings
  • Edit the Makefile and  change
    $(LIBRARY): $(OBJECTS)
    $(CC) $(CFLAGS)  $(LDFLAGS) $(OBJECTS) -o $@
    to
    $(LIBRARY): $(OBJECTS)
    $(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.

4 thoughts on “Installing webp-npapi Plugin from source

  1. Hi there just stumbled upon your website from Google after I typed in, “Installing webp-npapi Plugin from source | tuxlogger” or something similar (can’t quite remember exactly). Anyhow, I’m relieved I found it simply
    because your content is exactly what I’m searching for (writing a college paper) and I hope you don’t mind if I collect some material from here
    and I will of course credit you as the source.
    Thanks for your time.

  2. When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever
    a comment is added I receive 4 emails with the exact same
    comment. There has to be a way you can remove me from that service?

    Thanks!

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s