Does JuiceBox solution scale to this level (I see you support unlimited images) and how do you recommend architecting it?
One of the issues of having such a large gallery would be to ensure that not all images are preloaded by the browser at once.
Juicebox caters for this with the imagePreloading option which can be set to preload all images in the current thumbnail page, the next image in the gallery only, all images in the gallery or no images at all.
Is it possible to build something similar to the Flickr connection except to our own API?
Rather than manually create an XML file listing all images to be displayed, it is possible to use PHP to include all images in a specific directory.
You could use the following embedding code:
<!--START JUICEBOX EMBED-->
<script src="jbcore/js/juicebox.js"></script>
<script>
new juicebox({
containerId : "juicebox-container",
configUrl : "config.php"
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
... and use the following code in a file named 'config.php' instead of a traditional static XML file.
<?php
header("Content-Type: application/xhtml xml; charset=UTF-8");
function GetDirArray($folder)
{
$handle=opendir($folder);
while ($file=readdir($handle))
{
if ($file!="." && $file!="..")
{
$ret[count($ret)]=$file;
}
}
closedir($handle);
sort($ret);
return $ret;
}
$gallery=GetDirArray('images');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<juiceboxgallery title="Juicebox Gallery">';
for ($i=0; $i<sizeof($gallery); $i++)
{
echo '<image imageURL="images/'.$gallery[$i].'" thumbURL="images/'.$gallery[$i].'" linkURL="" linkTarget="">';
echo '<title></title>';
echo '<caption></caption>';
echo '</image>';
}
echo '</juiceboxgallery>';
?>
In the above example, all images in a directory named 'images' would be included in the gallery.
You may be able to incorporate Amazon S3 API calls into the code above to fetch your images from Amazon's servers.
Do you have an example of a JuiceBox install with thousands of images?
There are no online examples of such large galleries but it should be very easy to create one yourself using JuiceboxBuilder-Pro. Just drag and drop all your images into the JuiceboxBuilder-Pro interface and save the gallery on the 'Publish' tab.
I have personally created a gallery with over 1000 images in the past and there was no discernible difference between the loading time of this gallery over the loading time of a gallery containing only a few images.