How do we display a photo from Picasa java API?

Winston Chen picture Winston Chen · Aug 22, 2009 · Viewed 8k times · Source

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

Answer

Daxon picture Daxon · Sep 21, 2009

Quite Simple

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

You can use this way to get that 400/800px photo.

You only have to change the result URL that is given. Change the s144/s400/s800 value of the URL

BLAH com/_BwderBVv7wg/XXXXXXXXX/AAAAAAAAAME/HdXja0HclK0/s72/DSC09176.JPG
BLAH com/_BwderBVv7wg/XXXXXXXXX/AAAAAAAAAME/HdXja0HclK0/s144/DSC09176.JPG
BLAH com/_BwderBVv7wg/XXXXXXXXX/AAAAAAAAAME/HdXja0HclK0/s288/DSC09176.JPG
BLAH com/_BwderBVv7wg/XXXXXXXXX/AAAAAAAAAME/HdXja0HclK0/s400/DSC09176.JPG
BLAH com/_BwderBVv7wg/XXXXXXXXX/AAAAAAAAAME/HdXja0HclK0/s800/DSC09176.JPG