Search code examples
javapicasa

How do we display a photo from Picasa java API?


Okay, it seems to be a stupid question, since we have this

However, up to the moment, I can only succeed in displaying the thumbnails by using:

PhotoEntry photo = //somehow I get the instance
photo.getMediaThumbnails().get(0).getUrl()

The biggest photo I can display through this method is up to 300 pixel or so[which is photo.getMediaThumbnails().get(3)]. How can I display the a thumbnail up to 400 pixel or even 800 pixel? Or How can I even refer back to the google picasa page that can actually help me display this photo?

Thanks


Solution

  • The following was answered by a community member of google picasa api:

    Take a look at

    http://code.google.com/apis/picasaweb/docs/2.0/reference.html#Parameters

    It explains how you can control the size of the image that the media:content link points to as well as how you can request different thumbsizes for the media:thumbnail links. Also listed are the valid size values available. Note though, that you can only access images up to 800px in size (width or height, whatever is larger) from websites.

    For instance:

    GET /feed/api/user//albumid/? kind=photo&imgmax=800&thumbsize=512,400,160c

    will give you a link to an 800px version in the media:content link, a link to the uncropped 512px and 400px version in the first two media:thumbnail elements and a square-cropped 160x160 thumbnail in the third thumbnail element.

    Cheers, Detlev