来自 Picasa 的较小图像
有谁知道是否有办法获取 picasa 托管的所有图像尺寸列表?
我一直在为 picasa 使用 google 的 gdata java 库,并且我能够获得大小不等的缩略图列表(在我见过的所有情况下都是 3),以及完整的原始发布图像 - 全部来自PhotoEntry 对象。
但是,我注意到,当您浏览 picasaweb.google.com 时,它还有一个适合在屏幕上显示的大但可能不是全尺寸的图像。例如,加载的图像分辨率为 1600x1200,而另一图像的分辨率为:912x684。但该图像不会出现在 PhotoEntry 的任何位置(或在底层提要 XML 中 - 至少对于我查询的方式而言)。
我注意到网址几乎相同(但引入了“s912”表示大小),例如:
http://lh5.ggpht.com/_0WaNZR9hJtU/Sq0P86tsVdI/AAAAAAAAAIo/6fGDYaO--Eg/s912/P1030046.JPG
有了足够的例子,我可能会猜到生成的尺寸,并破解 url。但我希望还有其他想法——或者我忽略了一些简单的事情。也许应该发布到谷歌论坛,但这个网站更有趣。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加
/s734/
将高度或宽度缩放到目标尺寸。要缩放特定长度,请在图像文件名之前的 URL 中使用/w734/
表示宽度,或使用/h392/
表示高度。这实际上会在提供文件之前将图像减小到该大小。提供大于原始图像尺寸的尺寸请求会导致 404 未找到错误。还有一个与
-c
标志/w990-h600-c/
一起使用的裁剪选项,它从图像的中心裁剪,而不是从 (0 ,0)。三个例子
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
未裁剪的生成尺寸为:
94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
更多信息可以在标题为“Picasa 网络相册查询参数参考”的部分,位于 http://code。 google.com/apis/picasaweb/docs/2.0/reference.html
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