Where is the full size image in GData.Photos query?
Asked Answered
E

2

0

I am querying a Picasa gallery and when I dig into the entries that are returned, I can't find the full size image. I can only see a much smaller, re-sized image (data[0].Content.AbsoluteUri). I know Google retains the full size image because I can see it when I view my Picasa gallery online. Where is the full size image?

var picasaService = new PicasaService("Gallery");

var photoQuery = new PhotoQuery(PicasaQuery.CreatePicasaUri("GOOGLEUSERNAME", "GALLERYID"));
var photoFeed = picasaService.Query(photoQuery);

var data = photoFeed.Entries;
Educated answered 30/3, 2012 at 1:21 Comment(0)
R
1

short answer:

media:group/media:content[@url] path in a query to get the gdata photo ENTRY from the picasa GData service contains the link you want.

Longer answer:

  1. interactively query the Gdata api for picasa using oauth playground\
  2. https://code.google.com/oauthplayground and select picasa from the list and get
  3. authorize button ... then allow access button and you can query the api using the form
  4. make a query for the ENTRY URI of desired photo (your ...user/.. /albumid .. /photoid )
  5. inspect the content of media:group/media:content[@url] sample below
  6. The URI to the big photo is valueOf the url attribute in the above expression
  7. sample value for one of my picasa photos
  8. url=https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG

Using the oauth 2.0 playground for a query to get the entry of one of my photos...

Request:
GET /data/entry/api/user/rowntreerob/albumid/5682316071017984417/photoid/5682316083381958690?alt=json

Note: filter response using http://json.parser.online.fr/

Response: 

"media$group":{
"media$content":[
{
"url":"https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG",
"height":512,
"width":341,
"type":"image/jpeg",
"medium":"image"
}

The link to the large photo that you want is in the url attribute above...

Using the "fields=" tag, you can directly get the link as in below req/ resp from gdata...

GET /data/entry/api/user/rowntreerob/albumid/5682316071017984417/photoid/5682316083381958690?alt=json&fields=media%3Agroup%2Fmedia%3Acontent%5B%40url%5D

{
"version":"1.0",
"encoding":"UTF-8",
"entry":{
"xmlns":"http://www.w3.org/2005/Atom",
"xmlns$media":"http://search.yahoo.com/mrss/",
"media$group":{
"media$content":[
{
"url":"https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG",
"height":512,
"width":341,
"type":"image/jpeg",
"medium":"image"
}
]
}
}
}
Reportage answered 5/4, 2012 at 17:16 Comment(0)
L
4

Hidden in the documentation it is possible to specify the size of the images in the feed. This is using the "imgmax" parameter:

https://developers.google.com/picasa-web/docs/2.0/reference#Parameters

Which can have a value set to "d" to request full sized images

This is not supported directly in the c# API, but you can achieve the desired result using the "extraParameters" field on the PhotoQuery object.

Your code then becomes:

var picasaService = new PicasaService("Gallery");

var photoQuery = new PhotoQuery(PicasaQuery.CreatePicasaUri("GOOGLEUSERNAME", "GALLERYID"));
// add the extra parameter to request full size images
photoQuery.ExtraParameters = "imgmax=d";

var photoFeed = picasaService.Query(photoQuery);

var data = photoFeed.Entries;
Lassitude answered 8/7, 2014 at 8:44 Comment(0)
R
1

short answer:

media:group/media:content[@url] path in a query to get the gdata photo ENTRY from the picasa GData service contains the link you want.

Longer answer:

  1. interactively query the Gdata api for picasa using oauth playground\
  2. https://code.google.com/oauthplayground and select picasa from the list and get
  3. authorize button ... then allow access button and you can query the api using the form
  4. make a query for the ENTRY URI of desired photo (your ...user/.. /albumid .. /photoid )
  5. inspect the content of media:group/media:content[@url] sample below
  6. The URI to the big photo is valueOf the url attribute in the above expression
  7. sample value for one of my picasa photos
  8. url=https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG

Using the oauth 2.0 playground for a query to get the entry of one of my photos...

Request:
GET /data/entry/api/user/rowntreerob/albumid/5682316071017984417/photoid/5682316083381958690?alt=json

Note: filter response using http://json.parser.online.fr/

Response: 

"media$group":{
"media$content":[
{
"url":"https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG",
"height":512,
"width":341,
"type":"image/jpeg",
"medium":"image"
}

The link to the large photo that you want is in the url attribute above...

Using the "fields=" tag, you can directly get the link as in below req/ resp from gdata...

GET /data/entry/api/user/rowntreerob/albumid/5682316071017984417/photoid/5682316083381958690?alt=json&fields=media%3Agroup%2Fmedia%3Acontent%5B%40url%5D

{
"version":"1.0",
"encoding":"UTF-8",
"entry":{
"xmlns":"http://www.w3.org/2005/Atom",
"xmlns$media":"http://search.yahoo.com/mrss/",
"media$group":{
"media$content":[
{
"url":"https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG",
"height":512,
"width":341,
"type":"image/jpeg",
"medium":"image"
}
]
}
}
}
Reportage answered 5/4, 2012 at 17:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.