Monday, October 20, 2014

The Merits of Picasa

I think Picasa is pretty awesome from the perspective of an image manipulation and serving engine. I use it in two basic ways.

Photo Blog

I shoot lots of photos and need a means by which to organize, backup and share them. I use the Picasa desktop application for this.

It's not the greatest product. It has bugs and an angry user community and doesn't get much attention from Google who seems to care more about the online version Google Web Albums.

However, it's free, it does the job, it's backed by google's online service/engine, and I haven't seen an alternative that I prefer.

The Picasa desktop application is best suited to manage images that are already in a reasonable folder structure on disk. Mine are as follows:

Photos/2013/01 - Jamaica
Photos/2013/02 - Family
Photos/2013/03 - Edmonton
Photos/2014/01 - Germany
Photos/2014/02 - Misc
Photos/2014/03 - Odyssey

I've never liked applications that constantly monitor your disk, so I've turned that feature off in my instance. This is achieved with the folder manager. Whenever you want to add new photos, you just open the Folder Manager, select the part of the tree you've modified, select "Remove from Picasa" then "Scan Once" then click "OK". This has the effect of re-scanning the selected folder. It doesn't remove anything from Picasa. It just adds the new folders.

Picasa will display your scanned folders sorted by name, hence 01, 02, etc in my folder naming structure. This keeps alphabetical order and chronological order in sync.

Having told Picasa about your photos, you can create albums from you folders, delete (from the album, not from disk) or flag as "never upload" any photos you don't want to share, then upload the album via sync-to-web or share-on-google-plus, which are basically the same thing.

Be Warned, many of the default settings are a bad idea. You should select "Original size (slowest upload)" to ensure that your online copy can serve as a backup. You must not select "upload previews first" otherwise your album may fail to upload full-size images, and may get into a state were sync won't stay enabled. At one time I found an official google answer stating that as a known bug, but I didn't keep the link.

Furthermore, if you'll be using including non-photo graphics (as I do in the web archive example below), or if you'll want to display non-corrupt files online, you have to disable

Click on your avatar at the top-right of any google service, then click "Account", then under "Google+ settings", click "Edit Settings", then scroll down to "Photos and Videos" and ensure that "Upload my photos at full size." is checked. Ensure that "Auto-enhance" is Off and that "Auto-Awesome" is unchecked.

If these features are enabled then the original quality image won't be available even when accessed by the s0 url (explained below). The problem is that the enhanced/awesomed image is stored with high compression which will be clearly visible graphic art.

Before we get into using the images on a photo blog, I should note that changes you make in Picasa aren't burned into your images but are stored in picasa.ini files (one per folder). So changes like crop, rotate, red-eye are applied on-demand. I tend to manually pre-rotate images in windows explorer prior to importing them to picasa. Also note that the data that defines your local picasa albums and connections to web albums is stored in the picasa database in your c:/user folder, so even though you can consider the online copy as a backup of your image data, you should still use the desktop picasa backup feature to create a local usb drive backup of your picasa desktop environment.

On to the good stuff... After all of the above you might be convinced that Picasa isn't worth the trouble. Aside from being free and offering expanded online storage at a fair price, the engine that serves the online image is extremely powerful.

First note that you can access your albums through the old picasa web interface where you'll get urls like this one:

Or through the new google+ interface where you'll get urls like this one:

I've never seen a formal spec for the url arguments but it's something like this:

 w400 = the width  will be 400 up to max native size, the height will be to scale
 h400 = the height will be 400 up to max native size, the width will be to scale
 s0 = native size
 s200 = the longest dimension will be 400, the other dimension will be to scale

 s0 = native size
 s200 = the longest dimension will be 400, the other dimension will be to scale
 w400 = the width  will be 400 up to max native size, the height will be to scale
 h400 = the height will be 400 up to max native size, the width will be to scale
 -p = if both width and height are specified or an s value, the image is cropped to those values 

Once you start using this you'll realize how powerful it is. Your images are being served by a high-speed on demand caching content delivery network that will scale and crop your data on demand simply with url arguments.

This lets you easily write javascript gallery widgets like the following:

I write my blog in raw html, but it wouldn't be much extra work to support drag and drop directly from a google album, or to pre-build a blog post from a google album where you fill in text around the images.

Web Archive

The Picasa Web Albums Data API lets you do basically anything with a picasa account. The old 1.0 version matches the old picasa web interface and the 2.0 version matches the google+ interface although there are some features lacking, like knowledge of the auto-awesome settings which can appear to corrupt your uploads.

Using a client library you can relatively quickly get your web-app talking to a picasa account.

On my site, I built an Image Archive which is basically like my own Pinterest or Tumblr or Ffffound!, minus the social aspect and the loss of data control. Specifically, I have a bookmarklet that identifies an image on any page, asks my server to fetch it, then my server gets an oauth token from google (by displaying an authorization popup) and my server pushes the image to google, where I archive it along with its source page, url and title/author metadata.

I also use my image archive as the source of the image-of-the-day that I display on my (private) homepage which acts as a portal for the web services I frequent.

Another worthwhile application (in my opinion) is the photo widget on my blog which you'll see at the bottom of the right-hand sidebar. Every so often my website fetches album data from picasa, and on each blog page served it randomly selects a sequence from an album. This way whenever I look up something on my blog, I get to see some pleasant memories, which perhaps justifies the existence of all those photos.

As another application, my photos page is a grouped list of all my albums. It's built by using the API to fetch any new albums and display them to me for categorization. The unauthenticated user just sees the grouped ordering.

{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "", "page": { "blogIds": [ 515 ] }, "domain": "", "base": "\/michael", "url": "https:\/\/\/michael\/", "frameworkFiles": "https:\/\/\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/\/", "tmdbPoster": "http:\/\/\/t\/p\/w342" }