Find item thumbnail, resized photo, and imige size
|
insomnix
Joined: 2009-04-19
Posts: 17 |
Posted: Sun, 2009-10-04 23:16
|
|
I have an AddPhoto.inc that writes to an xml file the data I need for a java applet. There is a link under the photo that runs the below inc file and redirects back to the page I just left. Everything works to write to my file, except I need additional information. I've tried the fetchThumbnailsByItemIds to help me get the thumbnial ID and have tried to use the generate url function, but I can't seem to get any of this to work. I've had fetchThumbnailsByItemIds working on another page, but not here, which makes me wonder if I'm not calling something I should be. Below are my variables I am trying to write. I really could use some help finding the values for these. Quote:
class AddPhotoController extends GalleryController { |
|
| Login or register to post comments |

Posts: 2669
check the functions in my mediaBlock.php or the mediaRss.php contained with my minislideshow
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 17
I've tried mediaBlock.php earlier. I get the below error when I copy the getThumbUrl to my inc file.
Posts: 2669
did you copy the function?
or just the call for the function.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 17
I coppied the entire function and pasted above my function handleRequest($form).
Posts: 2669
so you called it like:
list($ret, $item) = GalleryCoreApi::loadEntitiesById($picture_id, 'GalleryItem'); if ($ret) { print "Error loading item:".$ret->getAsHtml(); } list($thumbUrl, $thumbWidth, $thumbHeight) = AddPhotoController::getThumbUrl($item);-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 17
OK, that helped a lot. I am trying to generate the url for the full sized picture. I am using getView, but all it retrieves is "h".
Posts: 2669
with nearly every function in my script you need to pass an $item object which we loaded here: list($ret, $item) = GalleryCoreApi::loadEntitiesById($picture_id, 'GalleryItem');
you can pass the same object around to retrieve your desired output.
If you're trying to output an xml feed check function displayMediaRss
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 17
Thank you for your help, I've acomplished more in the last few hours than I have all day on this. I was looking through the list and did not find a function to get the file size. If you can point me in the right direction, I think I can write the function.
I also need to get an 800 x 600 view, and I saw the resize function, but I'm not sure how to make it work. Any thoughts?
Thanks again
Posts: 2669
hmmm... size I believe is simply $item->getSize(); from GalleryDataItem.
I don't believe that resize function is actually used, it returns a string of views, not what you want.
but function getBestImageId would.
you'd need to change:
if (isset($_REQUEST['g2_maxImageHeight'])) { $maxImageHeight = $_REQUEST['g2_maxImageHeight']; } if (isset($_REQUEST['g2_maxImageWidth'])) { $maxImageWidth = $_REQUEST['g2_maxImageWidth']; }to:
$maxImageHeight = 600; $maxImageWidth = 800;and:
to:
usort($potentialImages, array('AddPhotoController', 'byWidth')););and you would also need to include
function byWidth as well
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 17
Fantastic, that did it.
Thank you