Slideshow v 2.1.1 plugin only showing first page of thumnails in non-Cooliris slideshows.

Daniel Weeks

Joined: 2012-07-03
Posts: 6
Posted: Tue, 2012-07-03 01:37

I upgraded to suprsidr's slideshow 2.1.1, and while the Cooliris wall/slideshow now works wonderfully, if I try to see a (non-Cooliris) slideshow on my iPad, it only starts with slide 1 and goes through 9, no matter which slide or page of thumbnails I start on. This sounds identical to the problem 'cmjimmy' encountered in 2008:

"In an album with say 70 photos and 50 thumbnails fit on one page (theme setup). So, there are 20 thumbnails on page 2.

Open #1 to #50 in the photo page, then click to start the slideshow, the slideshow will start at current photo.
Goto the 2nd thumbnail page, open #51 to #70, the slideshow will start from photo #1.

In that sense, there will only slideshow for the 1st page of thumbnail. There was no slideshow for subsequent pages."

I searched the forums and couldn't find a solution to this. I also looked at the code, but it wasn't obvious to me where the problem originates. It seems like while the Cooliris is getting a list of all the images in the album, the non-Cooliris slideshow is only getting a list of the 9 images on the first page of thumbnails in the album.

Thank you,
-- Dan --


Gallery URL = http://danieleweeks.com/gallery2/main.php
Gallery version = 2.3.2 core 1.3.0.2
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.17 apache2handler
Webserver =
Database = mysql 5.0.77, lock.system=flock
Toolkits = Exif, Getid3, LinkItemToolkit, Thumbnail, Gd
Acceleration = none, none
Operating system = Linux linux4-whg.secure-wi.com 2.6.32-042stab055.16 #1 SMP Fri Jun 8 19:22:28 MSD 2012 i686
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20100101 Firefox/13.0.1
Rows in GalleryAccessMap table = 60
Rows in GalleryAccessSubscriberMap table = 225
Rows in GalleryUser table = 3
Rows in GalleryItem table = 223
Rows in GalleryAlbumItem table = 7
Rows in GalleryCacheMap table = 0

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-07-03 02:35

Cooliris has the ability to follow the next and previous links in the mediaRss feed <atom:link rel="next" href="..."/> <atom:link rel="previous" href="..."/>
but the cooliris lite version does not.

On your ipad does it default to the lytebox slideshow?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Daniel Weeks

Joined: 2012-07-03
Posts: 6
Posted: Tue, 2012-07-03 10:53

Yes, I think it is defaulting to the lytebox slideshow on my iPad.

When it does, there are two problems:

a) it sets the starting slide to #1, no matter what page of thumbnails I am on.

b) Since my thumbnail pages are currently set to show only 9 thumbnails, it shows only up to slide #9.

While it would be nice if we could solve problem (b) by adjusting it to show slides 1 to K, where K is the number of slides in the album, it would partially suffice to correct problem (a) so that it would show the 9 slides on the current page of thumbnails.

Thank you,
-- Dan --

 
Daniel Weeks

Joined: 2012-07-03
Posts: 6
Posted: Tue, 2012-07-03 11:44

Here's a screenshot of what I see on my iPad (attached). Is this Cooliris lite or is it lytebox?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-07-03 11:56

That would be lytebox.
In all my alterations I've left the original lytebox alone. And I have no interest in troubleshooting it.
All lytebox types can only see the images on the page.

You may want to try my original update that used piclens lite(js) as a fallback instead of the embeddable 3D wall which is also flash.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Daniel Weeks

Joined: 2012-07-03
Posts: 6
Posted: Wed, 2012-07-04 14:24

Thank you for your help.

Here's some additional information:

If I uninstall Cooliris, then on both my desktop Mac and on my iPad, the lytebox slideshow now correctly shows all the slides in the album (e.g., slides 1 to 54). And if on the iPad, I start the slide show from a photo page (say photo #10), the lytebox slide show starts at slide #10 (and shows slides 10 to 54). This is the desired behavior.

But if Cooliris is installed, then while on my desktop, I get the nice 3D wall with access to a slideshow of all 54 items, on the iPad, it will only show slides 1 to 9, no matter which page of the album I am on. But if I start the Cooliris 3D wall slideshow from a photo page (say photo #10), the Cooliris slideshow does not start at slide #10, but rather starts at slide #1, showing the first 'page' of photos from the album.

So I don't think the lytebox code itself needs to be debugged. Rather I think the problem lies in how these items are being set up in Slideshow.inc, before calling lytebox:

$Slideshow['items'] = $items;
$Slideshow['count'] = count($items);
$Slideshow['start'] = $start;

When Cooliris is installed, $start is always set to 0 [the first slide], even if lytebox is going to be called, and items set to a list of the first page of slides. This works OK for Cooliris, as the 3D wall can follow the rss feeds to load additional pages of the albums, but does not work correctly when lytebox is called, as now it only always only shows slides 1 to 9.

There is a comment in SlideshowHelper.class that alludes to this behavior:

/** @todo Make sure startId is in the first page we serve */

Looks like $items and $start are built here:

list ($ret, $items, $start) = SlideshowHelper::buildItemsSlideshow($childIds, $startId);

If $startId is not set, then the slide show will start at the first slide in the album, so I suspect that when Cooliris is installed, $startId is not being set even if lytebox is going to be called.

Here's where $startId is set:

if (!$item->getCanContainChildren()) {
/* Photo: do slideshow of parent album, start at this photo */
$startId = $item->getId();

I'm having a hard time finding where the Slideshow code decides whether it is setting up for a Cooliris slideshow or for a lytebox slideshow.

In module.inc, it looks like it is just checking to see if Cooliris is installed:

list ($ret, $picLensVersion) = $this->getParameter('piclens.version');
...
if ($picLensVersion) {

and it is not additionally checking if the client target browser is going to use lytebox instead.

There is similar code in Slideshow.inc:

list ($ret, $picLensVersion) = $module->getParameter('piclens.version');
if ($ret) {
return array ($ret, null);
}

if ($picLensVersion) {
$Slideshow['piclensVersion'] = $picLensVersion;

Seems like this test here should instead be something like:

if ($picLensVersion & $targetIsCooliris) {

where $targetIsCooliris is true only if the client browser supports Flash.

How do you figure out if the client browser supports Flash?

Thanks,
Dan

 
Daniel Weeks

Joined: 2012-07-03
Posts: 6
Posted: Fri, 2012-07-06 02:57

Further investigation reveals that in the Slideshow template, there is code/logic for testing for Flash and falling back to lytebox if Flash is not found.

The logic in the template is like this:

if (Cooliris not installed)
lytebox
else
{ if (Flash available)
Cooliris
else
Lytebox }

But when the slideshow is initialized (which happens before the template code is called), the initialization code only tests whether or not Cooliris is installed (on the web server). If Cooliris is installed, the starting slide is set to the first slide in the album and the slideshow length is set to the number of photos on the first page of the album.

This generates the problem I described that, when Cooliris is installed on my web server, then if I try to see a slideshow on my iPad, the lytebox slideshow only starts with slide 1 and goes through 9, no matter which slide or page of thumbnails I start on.

Solution:
The code that initializes the slideshow should only set up for a Cooliris slideshow if Cooliris is installed AND Flash is available.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-07-06 03:03

fix it and post your solution
the beauty of open source software.

-s

 
Daniel Weeks

Joined: 2012-07-03
Posts: 6
Posted: Wed, 2012-08-01 03:37

Re: "The code that initializes the slideshow should only set up for a Cooliris slideshow if Cooliris is installed AND Flash is available."

Finally had a bit more time to look further into this - if I am understanding the code correctly, it looks like fixing this would require detecting if Flash is available early on, before the slideshow is set up. But it looks like detecting whether or not Flash is available, while easily done with Java script on the client side, can not be done with PHP alone on the server side.

There is a description of how to do this here that sounds like it might work:

http://stackoverflow.com/questions/2515453/php-detecting-if-flash-is-installed

This involves setting a cookie in Java script and reloading your page, and then reading the cookie within PHP.

But it isn't clear to me how to do this within the Gallery2 Slideshow code...