Hello,
I'm trying to convert a photo's size from bytes to a more understandable
format like KB or MB in PHP but when I try to convert it, it won't use the
right size to begin with. For example my photo's size is 2219070 bytes and
when I try to do anything with it, it treats it as a 1.
So $size/1024 returns 0.0009765625 instead of 2167.06 like it's supposed
to.
any ideas why it treats it as 1 instead of the actual size it's getting
from $photoFeed->getGphotoSize?
Here's the code that I'm using:
1. function outputPhotoFeed($client, $user, $albumId, $photoId)
2. {
3. $photos = new Zend_Gdata_Photos($client);
4. $query = new Zend_Gdata_Photos_PhotoQuery();
5.
6. $query->setUser($user);
7. $query->setAlbumId($albumId);
8. $query->setPhotoId($photoId);
9. $query = $query->getQueryUrl() . "?kind=comment,tag";
10.
11. $photoFeed = $photos->getPhotoFeed($query);
12.
13.
14. $sizeBytes = $photoFeed->getGphotoSize($query);
15.
16. $photoKB = ($sizeBytes/1024);
17.
18. echo "<h2>Photo Name: " . $photoFeed->getTitle() . "</h2>";
19.
20. echo "<h3>Size: [ " . $sizeBytes . " bytes or " . $photoKB .
" KB ]</h3>";
21.
22. $thumbs = $photoFeed->getMediaGroup()->getThumbnail();
23.
24. echo "<img src='" . $thumbs[2]->url . "' />";
25.
26.
27.
28. }
--
You received this message because you are subscribed to the Google Groups
"Google Picasa Web Albums API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-picasa-data-api.
For more options, visit https://groups.google.com/d/optout.