Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smaller Images from Picasa

Tags:

picasa

Does anyone know if there is a way to get a list of all of the image sizes that picasa is hosting?

I've been using google's gdata java library for picasa, and I'm able to get a list of thumbnails ranging in size (3 in all of the cases that I've seen), and the full, original posted image - all from the PhotoEntry object.

However, I notice that when you browse picasaweb.google.com, it also has a large, but possibly not full size image that's suitable for displaying on screen. For example, an image loaded at 1600x1200 has another image at: 912x684. But this image doesn't appear anywhere PhotoEntry (or in the underlying feed XML - at least for the way I'm querying).

I notice that the url is almost the same (but introduces 's912' indicating the size), e.g.:

http://lh5.ggpht.com/_0WaNZR9hJtU/Sq0P86tsVdI/AAAAAAAAAIo/6fGDYaO--Eg/s912/P1030046.JPG

With enough examples, I could probably guess the generated sizes, and hack the url. But I'm hoping that there are other ideas - or that I'm overlooking something easy. Probably should post to a Google forum, but this site is more fun.

like image 314
Scott A Miller Avatar asked Dec 18 '22 05:12

Scott A Miller


2 Answers

Adding /s734/ which scales either the height or width to the target size. To scale a specific length use /w734/ for width or /h392/ for height in the url before the image filename. This will actually reduce the image to that size before serving the file. Providing a size request larger than the original image's dimensions results in a 404 not found error.

There is also an option for cropping used like this with a -c flag /w990-h600-c/ and it crops from the center of the image, not from (0,0).

Three examples

http://lh5.ggpht.com/-qSvxHEfhPw0/TiCYX-sJn9I/AAAAAAAAIm4/hzzJBdm0sM8/w231/IMG_2058.JPG
http://lh5.ggpht.com/-qSvxHEfhPw0/TiCYX-sJn9I/AAAAAAAAIm4/hzzJBdm0sM8/h300-w300-c/IMG_2058.JPG
http://lh5.ggpht.com/-qSvxHEfhPw0/TiCYX-sJn9I/AAAAAAAAIm4/hzzJBdm0sM8/s231/IMG_2058.JPG
like image 61
Dylan Valade Avatar answered Jan 28 '23 08:01

Dylan Valade


The uncropped generated sizes are:

94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600

More info can be found in the section titled "Picasa Web Albums query parameters reference" at http://code.google.com/apis/picasaweb/docs/2.0/reference.html

like image 32
kcintrab Avatar answered Jan 28 '23 08:01

kcintrab