Black God

How to upload pictures to Picasa from Ubuntu in simple right-click

GoogleCL is a project intended to access Google services from Linux command line. Uploading the pictures to Picasa Web Album is one such service. Though the intention of this project is to make the services easily accessible from command line, I have written a simple GUI wrapper script to make this service available from GUI also. Here is how to get it installed.

Step-1. Installing the GoogleCL

Visit GoogleCL Download and download the latest .deb package file.

Install the package by double clicking the downloaded file or through command line (sudo dpkg -i googlecl_*.deb).

Step-2. One time Authentication of desktop

Now your desktop machine needs to get authenticated by Google (one time process) as part of initial configuration. To do this I am trying to list down my photos in Picasa. Then googlecl asks for my Picasa user name and provides a URL. Next I have to visit this URL in browser (by copying the link in GNOME Terminal) and Grant Access to this desktop. That is it. I have given below these steps in my machine.

(a) Enter “google picasa list” command and entering the user name

$ google picasa list
Did not find config / preferences file at /home/blackgod/.googlecl/config
… making new one.
Please specify user: <your-picasa-user-name>
(b) Google creates a authentication page and provides URL for the same.
(Hint: You can automatically launch your browser by adding “auth_browser = <browser>” to your config file under the GENERAL section, or define the BROWSER environment variable.)
Please log in and/or grant access via your browser at https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2F4buv14DLANINMkldfsLDHW then hit enter.
(c) Visiting the URL in browser and click “Grant Access”

Grant Access to your desktop from Browser

(d) Back to Terminal and hit enter to get the list of photos in your Picasa.
IMG_0268.JPG,http://picasaweb.google.com/xxxxxxxxx/DropBox?authkey=sdkfsdfkshfksfzNifdgMA#538656249534598422435
lego_robot.JPG,http://picasaweb.google.com/xxxxxxxxx/DropBox?authkey=KDHefjjfoeDKHSKSsjndsf#39849343983785875
- – - – - – - – - – - – - -
- – - – - – - – - – - – - -
- – - – - – - – - – - – - -

Now we are ready to access Picasa from Command line.

Step-3. Creating album and uploading files from command line

Here is how to create a album called “Web Cam” using the Pictures in “Web Cam” directory.

google picasa create –title “Web Cam” “Web Cam/*.jpg”

Step-4. Uploading the album from File manager

The same can be done through File manager in Ubuntu (Nautilus). I have written a simple nautilus script to do this task. Download the below script and copy this to .gnome2/nautilus-scripts directory in your home directory. Ensure that the script has executable permission (chmod +x “Upload to Picasa”)

  Upload_to_Picasa (801 bytes, 1,071 hits)

Now go to File manager and select directory which you want to upload -> Scripts -> Upload to Picasa. Another way is to right click the file manager pan within the directory which you want to upload.

Selecting a dictionary -> Scripts -> Upload to Picasa (Click to enlarge)

 

Right click within folder -> Scripts -> Upload to Picasa (Click to enlarge)

Once selected “Upload to Picasa”, you will get Desktop notification bubble saying that your album is being uploaded in background.

Album is being uploaded notification

Once album upload is successful or failure, again you will get notification.

Album upload status update notification

I believe this script will be very useful. You are welcome to enhance this script for other tasks in Picasa and other services in Google.

12 comments for “How to upload pictures to Picasa from Ubuntu in simple right-click

  1. Archu
    April 8, 2013 at 4:26 am

    I get this error when giving the command.
    i am using ubuntu 12

    arch@archbox:~$ google picasa list
    Traceback (most recent call last):
    File “/usr/bin/google”, line 991, in
    main()
    File “/usr/bin/google”, line 977, in main
    run_once(options, args)
    File “/usr/bin/google”, line 667, in run_once
    options.config)
    File “/usr/bin/google”, line 430, in import_service
    service_module = import_at_runtime(‘googlecl.’ + service + ‘.service’)
    File “/usr/bin/google”, line 388, in import_at_runtime
    return __import__(module, globals(), fromlist=['0'])
    File “/usr/lib/pymodules/python2.7/googlecl/picasa/service.py”, line 27, in
    import gdata.photos
    ImportError: No module named gdata.photos
    arch@archbox:~$

    • maz-1
      June 10, 2013 at 9:43 am

      You need to install python-gdata to get it work

  2. jazzman
    January 14, 2011 at 7:04 pm

    Thanks! this is just what i have been looking for!

  3. Paul
    January 10, 2011 at 8:12 pm

    Hey, it’d be cool if there was a way to downsize the photo’s automatically whensending- I have many photo’s but not much space… Picasa does it when sending, down to 640 by 480? and that is just dandy. But the sync thing in picasa is poor- have to switch it on for every single album. Any ideas?
    Thanks

  4. Ben
    December 23, 2010 at 7:51 am

    This script is great! However, the desktop notifications you have coded for will not work unless libnotify-bin is installed. This package is not installed by default in ubuntu 10.10. Thanks for writing this great script.
    Users may enter

  5. Aurimas
    December 1, 2010 at 5:43 pm

    Hey there,

    The script works on 10.10, but it doesn’t show any notifications for me. Also would be nice to be able to upload photos in reduced quality, but I guess that’s too advanced

    • Aaron Zhou
      October 8, 2011 at 1:26 pm

      i want to reduce the size of the pics,too. can the author try to add this feature in later release?

  6. stomp_stompclap
    July 11, 2010 at 9:55 pm

    hello, excellent hack you created. I love this idea and how it simplifies the process.

    However, step 3
    google picasa create –title “Web Cam” “Web Cam/*.jpg”

    kept giving me the following error:
    Loading file 1000words/*.jpg to album 1000words
    Failed to upload 1000words/*.jpg. (601: Found , not path name or object with a .read() method)

    until I removed the quotation marks on the last argument. After that, it worked.

    thanks for this tutorial!

    • July 11, 2010 at 10:17 pm

      Hi stomp_stompclap,

      Thanks for the comment. I have corrected the quotation marks issue. It seems to be I have to use proper quotation mark html notation to publish in blog.

  7. July 10, 2010 at 10:21 pm

    Hi tropicflite,

    Argument “title” should be prefixed with two hyphens. Can you try it out?

  8. LouisJ
    December 1, 2011 at 11:49 pm

    doesn’t work in 11.10, any help?

Leave a Reply

Your email address will not be published. Required fields are marked *