2010年6月6日星期日

Re: [fw-gdata] picasa thumbnail sizes

The others aren't in the feed unless you ask for them.  To ask for them, you need to modify the query URL-- which you can do using the $query instance you have in your code.  Call $query->setThumbsize('32,48,64'); etc before your retrieve the feed if you want to have the MediaThumbnail elements returned for multiple sizes.

The valid list is:
32, 48, 64, 72, 104, 144, 150, 160

If you include more than one, make it comma-delineated. 

Cheers,
-Ryan


On Sun, Jun 6, 2010 at 8:32 AM, Danny Guerrier <dguerrier@gmail.com> wrote:
               $query = new Zend_Gdata_Photos_UserQuery();
               $query->setKind('album');

                $userFeed = $this->photoService->getUserFeed(null, $query);


         foreach ($userFeed as $feed){
              if ($feed instanceof Zend_Gdata_Photos_AlbumEntry){

                   $thumb =  $feed->getMediaGroup()->getThumbNail();
                    $album->thumbnail = $thumb[0]->getUrl();
              }
          }

I have the above code that gets the album thumbnails but it always gives me 160x160
So how would i access the other album thumbnails in code.  I don't see a to set the desired size or get a specific size from the returned feed.

On Sun, Jun 6, 2010 at 11:23 AM, Ryan Boyd <ryanboyd@google.com> wrote:
All thumbnail sizes are created when the photo is uploaded.  

The thumbsize query parameter determines what thumbnails are returned in the feed being fetched:

Cheers,
-Ryan



On Sun, Jun 6, 2010 at 8:00 AM, Danny Guerrier <dguerrier@gmail.com> wrote:
This is a two part question

First when creating a web album in using the web interface at picasaweb how do I specify alternate thumbnail sizes?

secondly how do I specify which thumbnail to retrieve using gdata. 

getThumbNail returns a default 160 x 160 thumbnail image.

Array (     [0] => Zend_Gdata_Media_Extension_MediaThumbnail Object         (             [_rootElement:protected] => thumbnail             [_rootNamespace:protected] => media             [_url:protected] => https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8NrBmk0RPwdpFSJjaD7fWj1bqFcHE4w5BK5KVLwJGYP53_L1JZVM2tJWtS8N0F0Pn9PxH5fLzRjq5g4fyp7G2rLktRY8cUCy8DBdH0-bWsLhNouZU9LEmO6TMFcxwIhpzsveLJSsILojh/s160-c/NothingButTheMostFly.jpg             [_width:protected] => 160             [_height:protected] => 160             [_time:protected] =>              [_rootNamespaceURI:protected] =>              [_extensionElements:protected] => Array                 (                 )              [_extensionAttributes:protected] => Array                 (                 )              [_text:protected] =>              [_namespaces:protected] => Array                 (                     [atom] => Array                         (                             [1] => Array                                 (                                     [0] => http://www.w3.org/2005/Atom                                 )                          )                      [app] => Array                         (                             [1] => Array                                 (                                     [0] => http://purl.org/atom/app#                                 )                              [2] => Array                                 (                                     [0] => http://www.w3.org/2007/app                                 )                          )                      [media] => Array                         (                             [1] => Array                                 (                                     [0] => http://search.yahoo.com/mrss/                                 )                          )                      [gd] => Array                         (                             [1] => Array                                 (                                     [0] => http://schemas.google.com/g/2005                                 )                          )                      [openSearch] => Array                         (                             [1] => Array                                 (                                     [0] => http://a9.com/-/spec/opensearchrss/1.0/                                 )                              [2] => Array                                 (                                     [0] => http://a9.com/-/spec/opensearch/1.1/                                 )                          )                      [rss] => Array                         (                             [1] => Array                                 (                                     [0] => http://blogs.law.harvard.edu/tech/rss                                 )                          )                  )          )  )




没有评论: