Topic: x on the first image

Hi,
I just found the Simple Viewer, it just works great but I have allways an x on the first image.
to be able to charge dynamically the images, I remplace the .xml file with a .php one with this script. Is it the cause of the problem ?
Thanks
Eer
<?
            function GetDirArray($repertoire) {
              $handle=opendir($repertoire);
              while ($file = readdir($handle))  {
                  if ($file != "." && $file != ".." && $file != "index.html")  // * 1
                  {
                   $ret[count($ret)] = $file;
                  }
              }
              closedir($handle);
              sort($ret);             // permet de trier les photos
              return $ret;
            }
            $la_galerie = GetDirArray('galerie');
            echo '<?xml version="1.0" encoding="UTF-8"?>';
            echo '<simpleviewerGallery maxImageWidth="800" maxImageHeight="600" textColor="0x000000" frameColor="0xffffff" frameWidth="5" stagePadding="20" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="" enableRightClickOpen="true" backgroundImagePath="" imagePath="galerie/" thumbPath="galerie/">';
            for($i=0;$i<sizeof($la_galerie);$i++) {
                 echo '<image><filename>'.$la_galerie[$i].'</filename><caption></caption></image>';
            }
            echo '</simpleviewerGallery>';

            // * 1 : afin de ne PAS prendre en compte les . et .. ou même
            // encore l'éventuel fichier racine index.html (ou .htm) du
            // répertoire en question lors de la "génération" du XML.

?>

Re: x on the first image

Your script seems to be working OK.
I've uploaded a test gallery using your script instead of a traditional gallery.xml file.
The gallery contains 12 photos and all are displayed correctly with no crosses.
The gallery can be found at:
http://testgallery.110mb.com/gallery/index.html
(The php file is at http://testgallery.110mb.com/gallery/gallery.php)
Post a URL to your site and I'll see if I can help you further.

Steven Speirs
SimpleViewer Support Team.

Re: x on the first image

thanks for helping out monkeyboy!

Felix Turner
SimpleViewer Support Team.

Re: x on the first image

You're very welcome, Felix!

Steven Speirs
SimpleViewer Support Team.

Re: x on the first image

ok it was a   MAMP bug, online it works.
Thanks for the help.
It's really a super gallery!
big_smile

Re: x on the first image

I also got the problem of X in the first image. 

Part of the script as follows,

<?xml version="1.0" encoding="UTF-8"?>
<simpleviewergallery maxImageWidth="640" maxImageHeight="640" textColor="0xFFFFFF" frameColor="0xFFFFFF" frameWidth="20" stagePadding="40" navPadding="40" thumbnailColumns="3" thumbnailRows="6" navPosition="left" vAlign="center" hAlign="center" title="Tailormade Production Gallery" enableRightClickOpen="false" backgroundImagePath="" imagePath="" thumbPath="">
<image>
    <filename>p0001.jpg</filename>
    <caption></caption>   
</image>
<image>
    <filename>p0002.jpg</filename>
    <caption></caption>   
</image>

and I also check that in the images and thumbs folder the name is p0001.jpg but it still show X in the first image.

Can anyone tell me what's wrong with it?

Thanks

Re: x on the first image

Check that the file extension on image #1 is lowercase to match the reference to it in your gallery.xml file (ie p0001.jpg and not p0001.JPG).

Failing that, please post a URL so that I can try to help you further.

Steven Speirs
SimpleViewer Support Team.