images not loading into website

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

images not loading into website

Peter Marino-2
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
Reply | Threaded
Open this post in threaded view
|

Re: images not loading into website

kwylez
You should be able to get the full URL to the full size image by using something like:

$photoFeed->mediaGroup->content[0]->url


On Tue, Nov 25, 2008 at 2:35 AM, Peter Marino <[hidden email]> 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



--
Cory Wiles
[hidden email]
http://www.corywiles.com
http://www.400mtogo.com
Reply | Threaded
Open this post in threaded view
|

Re: images not loading into website

Michael Crumm
From the code you provided, I am not sure if this is the problem or not, but it sounds like you are using getContent() to return the actual image data and then attempting to render it somewhere on the page.

I had an issue a while back where i was attempting to pull image data from the filesystem and display it back through an img tag that point at one of my controller actions.

My issue ended up being whitespace trailing the closing ?> tag in my controller file.

It may seem like a long shot, but check your controller files (or anywhere you might be changing headers or outputting something other than html) and make sure either a) There is no closing tag on the file, or b) there is no trailing whitespace (or newlines) following the closing tag. The former is a much safer option.

Hope this helps!


-Mike


On Tue, Nov 25, 2008 at 9:41 AM, Cory D. Wiles <[hidden email]> wrote:
You should be able to get the full URL to the full size image by using something like:

$photoFeed->mediaGroup->content[0]->url



On Tue, Nov 25, 2008 at 2:35 AM, Peter Marino <[hidden email]> 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



--
Cory Wiles
[hidden email]
http://www.corywiles.com
http://www.400mtogo.com

Reply | Threaded
Open this post in threaded view
|

Re: images not loading into website

Ryan Boyd (Google)
In reply to this post by Peter Marino-2
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 <[hidden email]> 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