Wednesday, October 17, 2007

FlickrSave: Upload your photos to Flickr from within GIMP


FlickrSave is a GIMP plugin which adds an option to directly upload a picture to Flickr. It uses Christophe Beauregard's flickr_upload tool as a backend. The plugin supports setting title, description, tags and privacy, and works in both GIMP-2.2 and GIMP-2.4RC under Linux.

More background on the plugin can be found at the end of the post, in the "Motivation" section.

In all honesty, this is more of a ugly hack than a full-fledged plugin, but it works OK. And maybe it will inspire somebody to write a better plugin. In the meantime, please use and enjoy it!

The obligatory screenshot

FlickrSave screenshot
This shows FlickrSave in action. You can see the dialog, allowing you to choose title, description and tags for the image, and the added option in the menu.

Installing the plugin

Here are step by step installation instructions:

What you need

  • Any Unix-based OS. I have used Ubuntu, but any current distro will do. This hack won't work on Windows because there are some hardcoded paths on it (and, also, running scripts is much more awkward).

  • The GIMP (doh), with a working Gimp-Python installation. Your distro has it. I used the 2.4 release candidate, which is current in Gutsy, and have tried it with 2.2 also.

  • flickr_upload, Cristophe Beauregard's tool for uploading photos to Flickr. As of this writing, Version 1.29 is current and works perfectly with FlickrSave. (You don't need to download the file unless you are willing to install it by hand)

  • FlickrSave, the plugin and wrapper script. Grab it from Google Code. The current version is flickrsave-0.1d.

  • Firefox as a web browser and xterm for a terminal. Chances are you already have them installed. You may change the default program choice by editing the wrapper script (see below).

Step 1: Installing flickr_upload

The plugin depends on flickr_upload and, unfortunately, most distros don't package it. There are two possibilities for installing this tool. The recommended one is using CPAN, which only needs running a single command:
  • Open a terminal and run the following command (you'll need root privileges for this, either by using sudo or su:
    $ sudo perl -MCPAN -e 'install Flickr::Upload'

  • If you haven't used CPAN before, Perl will ask you whether you are ready for manual CPAN configuration:
    CPAN is the world-wide archive of perl resources. It consists of about
    100 sites that all replicate the same contents all around the globe.
    Many countries have at least one CPAN site already. The resources
    found on CPAN are easily accessible with the module. If you
    want to use, you have to configure it properly.

    If you do not want to enter a dialog now, you can answer 'no' to this
    question and I'll try to autoconfigure. (Note: you can revisit this
    dialog anytime later by typing 'o conf init' at the cpan prompt.)

    Are you ready for manual configuration? [yes] _

    I recommend typing no and pressing Enter. CPAN will then use its default setup, which is sensible enough for most situations.

  • CPAN will then begin working, downloading files as it goes. If your system lacks a dependency of flickr_upload, it will ask you whether you want to install it. Press Enter to accept:
    ---- Unsatisfied dependencies detected during [C/CP/CPB/Flickr-Upload-1.29.tar.gz] -----
    Shall I follow them and prepend them to the queue
    of modules we are processing right now? [yes]

    You'll probably need XML::Parser::Lite::Tree and Flickr::API. In addition to that, XML::Parser::Lite::Tree depends on XML::Parser::Lite, part of SOAP:Lite. If that happens, press Enter again:
    ---- Unsatisfied dependencies detected during [I/IA/IAMCAL/XML-Parser-Lite-Tree-0.03.tar.gz] -----
    Shall I follow them and prepend them to the queue
    of modules we are processing right now? [yes]

    If you install SOAP::Lite in this way, it may want to ask you some configuration questions. Press Enter three times to accept the defaults.

  • That's it. Once the command returns, flickr_upload will be installed on your system.

If you don't want to use CPAN, you can read the manual installation instructions here. Follow the steps outlined in that post and return here once you are done.

Step 2: Authenticating flickr_upload

  • Once Flickr-Upload has been installed, you need to authenticate it. Type the following command in the terminal:
    $ flickr_upload --auth

  • flickr_upload will respond with a huge URL. You'll need to open it with a web browser. (In gnome-terminal, you can open it by right-clicking, so you can avoid the awkward copy&paste operation). This will take you to a Flickr page, where you will be asked to authorize Flickr::Upload. Accept the authorization; you may then close the browser window.

  • Return to the terminal and press Enter. Then, flickr_upload will give you an "authentication token" (a bunch of hexadecimal digits strung together). Copy the token to the clipboard.

  • Use your favourite editor to create a ~/.flickrrc file (as in gedit ~/.flickrrc, for example). You only need the following line on it:

    If you prefer, you may run the following command from the terminal instead:
    $ echo auth_token=<token> >> ~/.flickrrc
    In both cases, substitute <token> for the authentication token you copied to the clipboard a moment ago.

  • Flickr-Upload should now be correctly configured. You may test it by typing something like flickr_upload somefile.jpg on a terminal (provided that somefile.jpg exists). If everything is working, you should see the file appear on your Flickr photostream.

Step 3: Installing FlickrSave

Once the dependencies have been met, the actual installation of the plugin is the simplest part, so you are almost there.

FlickrSave has two parts. The wrapper, flickr_upload_gimp_helper, is a shell script which does most of the work associated with calling flickr_upload. (Incidentally, editing this script will allow you to change the chosen terminal and browser program). The GIMP plugin, (for GIMP-2.4RC) or (for GIMP-2.2), provides the GIMP interface. You only need to copy the files to their correct places and you'll be good to go.

  • Uncompress the flickrsave-0.1d.tar.gz file you downloaded somewhere and get into the corresponding directory:
    $ tar xvzf flickrsave-0.1d.tar.gz
    $ cd flickrsave-0.1d

  • Ensure that all scripts (, and flickr_upload_gimp_helper) are world executable:
    $ chmod a+rx flickr*

  • Copy flickr_upload_gimp_helper somewhere in your $PATH. The exact point does not matter; I recommend /usr/local/bin. Unless ~/bin is an option, you will need to copy the file with root privileges, either by using sudo or su.
    $ sudo cp flickr_upload_gimp_helper /usr/local/bin

  • Now for the final step (phew!), copying (or to your GIMP plugin directory (note that it's NOT your script directory). There are two options:

    • Local copy (recommended): Install the plugin to your user's private plugin directory. That way you don't need root privileges and you don't mess with your main GIMP installation. For GIMP 2.4RC, the correct command is:
      $ cp ~/.gimp-2.4/plug-ins
      For GIMP-2.2 and earlier, the plugin won't work directly due to some incompatibilities; a working version for GIMP-2.2,, is included in the package. So the correct command would be:
      $ cp ~/.gimp-2.2/plug-ins

    • Global copy: Copy the plugin to your global GIMP plugin directory, which in my case is /usr/lib/gimp/2.0/plug-ins. You'll need root privileges for that. This will make it available by default to every user, although they will still need to have a correct ~/.flickrrc file for it to work (flickr_upload depends on it). For GIMP 2.4, the command is (the following should be all in a single line):
      $ sudo cp /usr/lib/gimp/2.0/plug-ins

      And for GIMP 2.2:
      $ sudo cp /usr/lib/gimp/2.0/plug-ins

  • That's all! The plugin is now fully installed.


Not much to say here. Right click on your image and choose File, or use File from the drop-down menu. The very last option is "Save to Flickr..." Choose it and a dialog will pop up asking you for the image title, description, tags and desired privacy settings. Click Accept and the plugin will do its bidding automatically. A terminal window will pop up briefly as the image is uploaded, and, if everything goes well, the Flickr photo edit page will be opened on Firefox once it is available in your photostream.


I love taking lots of photographs, up to the point that it has become somewhat of an obsession. It's only fitting, then, than from the moment I signed up for a pro Flickr account, I never looked back. In addition to having almost 10,000 pictures uploaded (and counting), I find myself more and more involved in the community. In particular, I'm very active in A3B, a challenge-style group where I am a moderator and enthusiastic participant.

As you can guess from the number of pictures, I use Flickr for archival purposes, not as a showcase. I upload the raw pictures as they come out from the camera. Occasionally, be it as a reply to a challenge or just because I feel like it, I download a picture, retouch it and re-upload it in its newly found glory. (I have a whole bunch of photos I took from the Sears Tower on a very foggy day; they are very bland, but I recently discovered that, with some tricks, you can get gorgeous B&W pictures out of them, and I'm busy with that at the moment).

I love GNU/Linux, so the natural option for photo retouching is GIMP. However, a big pet peeve of mine was the fact that the integration between GIMP and Flickr is nil. At least, you can use the "Open Location..." option on the GIMP File menu (or the corresponding option on your browser) to save yourself the hassle of downloading the image, saving it to disk and hunting for it from within GIMP. However, there is no way you can save your images to Flickr: you have to save the image to disk and use whatever tool rows your boat to upload it. This makes the process cumbersome, to say the least.

I spent some days searching for a plugin that would add an option to GIMP to save to my Flickr account, but couldn't find any. Therefore I concocted my own solution. As I didn't have much of a clue with Python, I wrote a very simple GIMP plugin which presents an interface and invokes an external shell script which does the magic, invoking Christophe Beauregard's flickr_upload to do the hard work.


Thanks to Raphael Quinet for the CPAN suggestion.


You can reach me in andvaranaut AT gmail . com, or just leave a comment in this post. Enjoy!


Unknown said...

Gwenview in KDE can do this right out of the box.

It's probably easier to edit your images in GIMP then use Gwenview to send them to Flikr.

CP said...

Hi Ashay. There are a lot of solutions which can be used once you have saved your images. F-Spot, jUploader and Uploadr come to mind. But I wanted to retouch and upload directly from within GIMP, and that's what the plugin is good for.

Anonymous said...
This comment has been removed by the author.
Anonymous said...
This comment has been removed by a blog administrator.