2008年12月1日星期一

Re: [fw-gdata] images not loading into website

Hi Peter,

You may have already figured this out, but the maximum size of an embedded image is 800 pixels.  Picasa Web Albums will block any image that's larger than that from being included:
>From the Google FAQ (http://code.google.com/apis/picasaweb/faq.html#embed_image):
Why can't I embed the full-sized image into my webpage?
You can only embed images into a webpage that are 800 pixels or smaller along the largest dimension. Larger images can be downloaded directly in your program. You can use the imgmax parameter to limit the size of the image in the <media:content> tag. For example:
http://picasaweb.google.com/data/feed/projection/user/userID/albumid/albumID?imgmax=800
This is true even though you're shrinking the image to 600 pixels in the web browser (using the img width attribute).

So, everything should work after adding the following line while building your query:
$query->setImgMax("800")

Cheers,
-Ryan


On Tue, Nov 25, 2008 at 12:35 AM, Peter Marino <marino.peter@gmail.com> wrote:
Hi users,
 
All images retrieved by the getThumbnail works 100%
but when I want a full image and try to retrieve it using
the getContent() method then the image is not displayed`
the <img ... /> displays the correct widh and height border
but with no image.
 
the code I use is:
 
$query = $gp->newAlbumQuery();
$query->setUser("default");
$query->setAlbumId( $album );
$albumFeed = $gp->getAlbumFeed($query);
$album_name = $albumFeed->getTitle();
$w = $photoFeed->getGphotoWidth().getText(false);
if ( $w>600 )
{
 $w = 600;
}
echo "<table style='width:100%'>";
echo "<tr><td align='center' ><img width='".$w."' src='".$contentUrl."' alt='' /></td></tr>";
echo "<tr><td align='center'>
<a href='http://picasaweb.google.com/marino.peter/".$album_name."#".$photo_id." '>
Se billede fra Picasa albumet</a>
</td></tr>";
echo "</table>";
just to clarify the album and photo id's are correct, the link I create using
<a href='http://picasaweb.google.com/marino.peter/".$album_name."#".$photo_id." '>
works just fine.
 
this might be more a html/php problem then actually a gdata problem, but I'm kinda stuck
why this doesn't work,.. perhaps someone could show me the way?
 
regards,
Peter Wraae Marino

--
OSG-Help http://osghelp.com

没有评论: