I'm sorry this isn't fixed yet. We know what the problem is and how to fix 
it, and hope to have it resolved soon.

In the mean time, this is more fun than sleeping:

Brian Cody is correct in his diagnosis of the problem and recommended fix 
for the short-term.  The bug is that some requests are retrieving a 
full-size thumbnail at index 0 before any of the other correct thumbnails. 
 If you have access to the data, you can use the thumbnail at index 1. 

As an alternative work-around (again, for the short-term until we can get a 
fix pushed out), I've put together this ugly JavaScript function to resize 
the url.  

  /**
   * Fixes the thumbnail size due to an error in PicasaWeb API.
   * TODO: Remove this when the bug in the API is fixed.
  
 * https://groups.google.com/forum/?#!topic/google-picasa-data-api/WGHa8VWg5yU
   * @param {string} url The thumbnail URL to modify.
   * @param {string} [opt_sizeString] Optional size string to specify the 
size.
   * @returns {string} The updated url.
   */
  function fixThumbnailSize(url, opt_sizeString) {
    var pieces = url.split('/');
    // If we are setting the size string, do that now.
    if (opt_sizeString &&
        opt_sizeString != '') {
      // If there is no size bit in the original, add a placeholder.
      if (pieces.length == 8) {
        pieces.splice(7, 0, '');
      }
      
      if (opt_sizeString.indexOf('c') != -1) {
        // Crop is requested.
        pieces[7] = 's' +
            opt_sizeString.substring(0, opt_sizeString.indexOf('c')) +
            '-c';
      } else if (opt_sizeString.indexOf('u') != -1) {
        // No crop is requested and 'u' is set
        pieces[7] = 's' +
            opt_sizeString.substring(0, opt_sizeString.indexOf('u'));
      } else {
        pieces[7] = 's' + opt_sizeString;
      } 
    } else if (pieces.length == 9) {
      pieces.splice(7, 1);
    }
      
    return pieces.join('/');
  }


You can pass it your image url and the appropriate size, as follows
var url = 
https://lh3.googleusercontent.com/-Y-dsDnrmWbs/TbCW9vMY0PI/AAAAAAAACoE/HRy68tKvkzY/d/image004.gif;
// Get the 32px size, uncropped.
var newUrl = fixThumbnailSize(url, '32');
// Get the 32px size, cropped.
newUrl = fixThumbnailSize(url, '32c');
// Get the 32px size, uncropped with the u param.
newUrl = fixThumbnailSize(url, '32u');

These should be the thumbsize=xxx size parameters you used in your query 
(see the thumbsize options after the Query Parameters section of the Atom 
Reference<http://code.google.com/apis/picasaweb/docs/2.0/reference.html#Parameters>
).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To post to this group, send email to google-picasa-data-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-picasa-data-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-picasa-data-api?hl=en.

Reply via email to