If you are a Linuxer who is also a passionate photographer, you will probably have a Flickr account, and want to know about how to manage your photos in your Flickr account on your Linux computer. While any web browser can be used to access your Flicker account on the web, it probably cannot beat a dedicated Flickr client software with streamlined user interface and pre-configured authentication. Here I will focus on how to upload photos to Flickr using dedicated Flickr client for Linux.
One of several available Flickr clients for Linux is flickrfs. Flickrfs is essentially a pseudo filesystem for Flickr which allows you to access your photos in your Flickr account as if you were accessing files in a regular Linux file system. To achieve that, flickrfs uses FUSE (short for "Filesystem in Userspace") which enables one to build a fully functional filesystem in userspace. Using FUSE, flickrfs "mounts" your Flickr account on your Linux machine, and then downloads/uploads/updates your Flickr photos as if you were reading/writing/updating your files in a filesystem.
In order to install flickrfs on Debian/Ubuntu:
While flickrfs is installed, FUSE python bindings (for accessing Flickr in userspace) and Imagemagick (for image manipulations such as resizing, rotating, etc.) will be automatically installed as well.
Once flickrfs is installed, relax the permission of /dev/fuse, and add you to the "fuse" group, so that you (and flickrfs) can access /dev/fuse as non-root user.
$ sudo usermod -a -G fuse alice
Finally, create a Flickr mount point, and run flickrfs pointing to the mount point. When launching flickrfs for the first time, make sure to close all web browser windows before launching flickrfs, so that flickrfs can direct you to Flickr for OAuth authorization properly.
$ flickrfs ~/Flickr
Launching flickrfs for the first time will pop up a new web browser window saying "flickrfs wants to link to your Flickr account" and asking for your permission. Go ahead logging in to your Flickr account, and authorize flickrfs to access your account. You can close the browser window afterward.
If flickrfs dies with the following error:
Can't retrieve token from browser:/usr/bin/x-www-browser
Then, make sure that you have set http_proxy environment variable correctly (if you are behind proxy), and that there was no open browser window before starting flickrfs. If you still have the problem, it means that the default http client used by flickrfs to authorize with Flickr is not functioning as flickrfs expected. Try changing your default web browser.
Once you have successfully mounted your Flickr account, you will see "sets" and "tags" folders under your mount point. You can use ls command to browse a list of sets, tags, and photos in your Flickr account.
myphoto1.jpg myphoto2.jpg myphoto3.jpg
You can simply use cp command to upload locally stored photos to the mounted Flickr account.
To upload a photo to your latest photostream, with tags (e.g., tag1, tag2):
$ cp test.jpg ~/Flickr/stream:tag1:tag2/
To upload a photo to an existing set (e.g., old_set), with tags (e.g., tag1, tag2):
To create a new set (e.g., new_set), and upload a photo to the set:
$ cp test.jpg ~/Flickr/sets/new_set/
To unmount Flickr account:
Given the flickrfs's filesystem-like command line interface, it's straightforward to download/upload/update photos in bulk, and in batch mode.
Besides flickrfs, you can try the following GUI clients to upload photos to Flickr on Linux. As they have intuitive graphical user interfaces, it's relatively easy to upload photos to your Flickr account.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to set up Apt caching server on Ubuntu or Debian - February 7, 2016
- How to monitor OpenFlow messages with packet sniffer - February 2, 2016
- How to search multiple pdf documents for words on Linux - January 13, 2016