Topic: Path issue when main images are on another domain/server

When everything is stored at the same domain/server this works fine:

<image imageURL="images/baa_0782.jpg" thumbURL="thumbnails/baa_0782.jpg" linkURL="../../../f.php?nr=baa_0782.jpg&e=20101114-Test-Evenement&r=Archief 2010" linkTarget="main" >
 <caption><![CDATA[<font size="14"><font size="14"><b>Stap 3: </b><U>Bestel <b>deze</b> foto met een klik.</U></font> &#0187;&#0187;&#0187;</font>]]></caption>

When de mainimages are stored on another domain/server this doesn't work:

<image imageURL="http://www.otherdomain.com/dir1/subdir1/subsubdir1/images/baa_0782.jpg" thumbURL="thumbnails/baa_0782.jpg" linkURL="../../../f.php?nr=baa_0782.jpg&e=20101114-Test-Evenement&r=Archief 2010" linkTarget="main" >
 <caption><![CDATA[<font size="14"><font size="14"><b>Stap 3: </b><U>Bestel <b>deze</b> foto met een klik.</U></font> &#0187;&#0187;&#0187;</font>]]></caption> 

I wonder how the pathing has to be in this case. Can absolute pathing and relative pathing be combined? What is the reference root when also relative paths are used?

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

Check here: http://www.simpleviewer.net/simpleviewe … trouble_11

Felix Turner
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

An absolute URL should work fine, but you probably will run into a flash security error: When loading images from a different domain, the images don't load or I see a 'Security Sandbox Violation' error. How do I fix this? Also you should make sure there aren't any hotlinking issue.

Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Felix, Mike,

Both your comments are not the issue.

The problem is that when the SV is called, the mainimage (on the other server/domain) will not load/ show up. You first have to mouse-over the thumnails before the main images show.

This despite I have set imagePreloading="PAGE"

When images are on the same server/domain .... no problem.

Please look at http://fotograaf-evenementen.nl/galerie … ex.html#/1 to see what's happening.

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

You crossdomain.xml is:

<?xml version="1.0"?><!DOCTYPE cross-domain-policySYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="www.fotograaf-evenementen.nl" />
</cross-domain-policy>

It should be:

<?xml version="1.0"?><!DOCTYPE cross-domain-policySYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="www.fotograaf-evenementen.nl" />
<allow-access-from domain="www.hhuisjes.com" />
</cross-domain-policy>

Also with your current setup you do not need the following lines as you are not using the mobile player.

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="simpleviewer.js"></script>

I would suggest you use the following code for direct linking as the example code has issues in IE.

//Called by SWF when user views an image
function svImageChange(index){
    imageID = index + 1
    SWFAddress.setValue("/"+imageID+"/");
}

//Called when browser back button is clicked
SWFAddress.onChange = function(){
    if(svAPI.getImageIndex() != getLocationIndex()) {
        svAPI.showImage(getLocationIndex());
    }
}

function getLocationIndex() {
    var path = SWFAddress.getValue();
    var arr = path.split("/");
    return arr[1] - 1;    
}
Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Mike,

Thanks for looking into the issue. But  sad  unfortunetly it didn't help.

I changed the crossdomain.xml as you suggested and uploaded it to the root and all relevant directories on the remote server (hhuisjes.com). Then tested the index.html and still the same problem. Do I need to upload crossdomain.xml also to the server/domain where teh gallery is stored? I am not that familiar with the 'crossdomainPolicy'. From your support pages I understand that upload only to the server where the main images are stored should be OK!
I believe this cannot be the cause of the problem because moving the mouse over the images will result in loading the images.

I deleted the lines as you suggested and tested index.html. No difference, so it's not an issue of conflicting .js scripts, isn't it.

Finally I replaced the code for direct linking as you suggested and tested index.html. Also no solution for the problem. Although I now get the Javascript error "svAPI not defined" where, before the replacement, I got "svAPI is empty or no object".

When you look carefully you see that index.html is not loading the images from the remote server (per PAGE) and stops loading the NEXT image.
So it must be a bug somewhere in the loading instructions when you have your main images stored on another remote server.
Do you agree?

You have to  wink  because it works great when everything (including the main images) is stored on the same server/ domain; see: http://fotograaf-evenementen.nl/galerie … ex.html#/1 ; although without the suggestions for changes you made.

Last edited by berend (2010-11-15 01:57:23)

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

Your images seems to be loading fine for me now, did you clear your browser's cache after making the change?

Do I need to upload crossdomain.xml also to the server/domain where teh gallery is stored?

As far as I know it should be located where your images are stored.

deleted the lines as you suggested and tested index.html. No difference, so it's not an issue of conflicting .js scripts, isn't it.

This is a separate issue.

Finally I replaced the code for direct linking as you suggested and tested index.html. Also no solution for the problem. Although I now get the Javascript error "svAPI not defined" where, before the replacement, I got "svAPI is empty or no object".

This is also a separate issue. You may have replaced too much, your page would look like this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>20101114-Test-Evenement</title>
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
        <script type="text/javascript" src="swfaddress.js"></script>

            <script type="text/javascript">        

                //SimpleViewer API setup
                var svAPI; //svAPI is the object to call API methods on
        

                //Called by SWF when API becomes available
                function svComplete() {
                    //alert("SimpleViewer API Available");
                    svAPI = document.getElementById('svInstance');        
                }

                //Called by SWF when user views an image
                function svImageChange(index){
                    imageID = index + 1
                    SWFAddress.setValue("/"+imageID+"/");
                }

                //Called when browser back button is clicked
                SWFAddress.onChange = function(){
                    if(svAPI.getImageIndex() != getLocationIndex()) {
                        svAPI.showImage(getLocationIndex());
                    }
                }

                function getLocationIndex() {
                    var path = SWFAddress.getValue();
                    var arr = path.split("/");
                    return arr[1] - 1;    
                }

                var d = new Date();
                //JavaScript Embed
                var flashvars = {};
                flashvars.galleryURL = "galleryprototype.xml?xml=+d";
                flashvars.enableAPI = "true"; //SET THIS FOR JS API TO WORK    

                //Set 'firstImageIndex' based on the 'index' query string parameter
                flashvars.firstImageIndex = getLocationIndex();

                var params = {};            
                params.allowfullscreen = true;
                params.allowscriptaccess = "always";
                params.bgcolor = "ffffff";
                
                var attributes = {};
                //name and id should match getElementById() call above
                attributes.id =  "svInstance"; 
                attributes.name = "svInstance";
                swfobject.embedSWF("simpleviewer.swf", "flashContent", "100%", "600", "9.0.124", false, flashvars, params,attributes);
            </script>    
        <style type="text/css" media="screen">    

            html, body    { height:100%; }
            body {            
                margin:0;
                padding:0;
                overflow:auto;
                background-color: #181818;
                color:#ffffff;
            }

            #flashcontent {
                width: 640px;
                height: 415px;
                z-index: 0;
            }
        </style>
    </head>
    <body>
        <div id="flashContent">SimpleViewer requires JavaScript and the Flash Player. <a href="http://www.adobe.com/go/getflashplayer/">Get Flash.</a>.</div>
    </body>
</html>
Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Images don't load for me! I'm using MS IE8.

Be aware I posted 2 links to you:

OK (images on same server) = http://fotograaf-evenementen.nl/galerie … ex.html#/1

NOT OK (images on remote server) = http://fotograaf-evenementen.nl/galerie … ex.html#/1

Are both links loading the images for you?

In the meantime I stored 'crossdomain.xml' on both servers, but it didn't help.

The other issue "svAPI" : I was already wondering if I had understood you well.
I will correct the replacement as suggested now and see what happens. But as you said: another issue.

Last edited by berend (2010-11-15 02:57:01)

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

Ok, I guess I was looking at the wrong URL, sorry.

var d = new Date();
 flashvars.galleryURL = "gallery.xml?xml=+d";

What is the purpose of ?xml=+d in your galleryURL var?

Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Mike Richards wrote:

What is the purpose of ?xml=+d in your galleryURL var?

XML has the issue that it will stay in the cache of the browser. By giving it a unique parameter (date) I hoped to achieve that each time the .xml is reloaded from the server. If this works (I'm not sure) you don't need to close the browser before you can see the effect of changes made in your .xml file.

Wirh regard to my problem/ issue: Any idee how to solve the problem (where to debug)?

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

XML has the issue that it will stay in the cache of the browser. By giving it a unique parameter (date) I hoped to achieve that each time the .xml is reloaded from the server. If this works (I'm not sure) you don't need to close the browser before you can see the effect of changes made in your .xml file.

Ok that makes sense just making sure I wasn't missing anything.

Every time we have seen an issue like this it is most likey either a cross domain issue or a hot-linking image protection issue. If the crossdomain.xml didn't do it for you, you should double check your servers setting and .htaccess to make sure you are not using image protection options.

Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Mike Richards wrote:

Every time we have seen an issue like this it is most likey either a cross domain issue or a hot-linking image protection issue. If the crossdomain.xml didn't do it for you, you should double check your servers setting and .htaccess to make sure you are not using image protection options.

I will see if this can be the case, but if so: WHY DO THE MAIN IMAGES ON THE REMOTE SERVER THEN LOAD IF I MOVE THE MOUSE OVER THE THUMBNAILS?

Maybe you can show me an example WHERE IT WORKS! I mean a example a a gallery made with the SV Picasa template V2.0.3 and gallery.xml modified with SimpleViewerPRO V2.1.x configuration options.

UPDATE:
1. The remote server is UNIX and there is no .htaccess file on it
2. The server with SV gallery is WINDOWS and I checked with the provider per phone; no hot-linking image protection and no firewall issue. He confirms that image-loading on mouseover cannot be possible when hot-linking image protection is the case on server or by firewall.

Last edited by berend (2010-11-15 15:42:48)

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

If everything else is the same except image location and it works when everything is on the same server and it does not work with the image in a remote location it's still sounds like a flash/server security issue and not a SimpleViewer problem to me.

Try the following since you aren't using the www subdomain in your URLs.

<?xml version="1.0"?><!DOCTYPE cross-domain-policySYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.fotograaf-evenementen.nl" />
<allow-access-from domain="*.hhuisjes.com" />
</cross-domain-policy>

You can see a crossdomain example working here:

Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Mike,

First of all I would like to thank you for helping me to solve this issue. It's very much appreciated!  smile

Mike Richards wrote:

Try the following since you aren't using the www subdomain in your URLs.

I will try that (without any hope, because there are no subdomains on both servers) and report the effect Second reason I have little hope is that everything worked fine when I used SV Picasa template 1.9 (without Pro configuration options and using the original crossdomain.xml and the same 2 servers !!!!)
UPDATE: Please wait with what I ask below; I can't hardly believe my eyes on what I see after replacing www. with *. in crossdomain.xml. Now it's time for more testing; will come later today with an update.

Mike Richards wrote:

You can see a crossdomain example working here:

This is not the example I would like to see, because it is with SVPro and not with SVPicasa template. Furthermore also the thumbimages are on the remote server as I see in the examples gallery.xml

Maybe you can delete the thumbs from the remote server and store them on your mrphotography-server first and see what happens. If test is OK, maybe a second test with the following code in the top line of the .xml to see if that is causing the problem:

    showOpenButton="FALSE"
    showFullscreenButton="FALSE"
    watermarkURL="../../copyright_new.png"
    watermarkHAlign="CENTER"
    watermarkVAlign="CENTER"
    stagePadding="0"
    stageHPadding="0"
    stageVPadding="15"
    frameWidth="0"
    changeImageOnHover="TRUE"
    imageClickMode="OPEN_URL"
    imagePreloading="PAGE"
    imageFrameStyle="ROUNDED"
    imageDropShadow="true"
    dropShadowStrength="2"
    maxImageWidth="640"
    maxImageHeight="640"
    imageQuality="100"
    showImageNumber="TRUE"
    thumbNavStyle="BIG"
    thumbPosition="TOP"
    thumbWidth="75"
    thumbHeight="75"
    thumbRows="1"
    thumbColumns="6"
    thumbQuality="100"
    galleryStyle="CLASSIC"
    enableMouseWheel="FALSE"
    enableAPI="true"
    textColor="FFFFFF"
    frameColor="FFFFFF"
    lockTopStack="true"
    lockBottomStack="false"
    showOverlay="ALWAYS"
    imageNavColor="FFFFFF"

and of course to make it SVPicasa template in the index.html :

    <!--START SIMPLEVIEWER EMBED.-->
    <script type="text/javascript" src="swfaddress.js"></script>
    <script type="text/javascript">
 
    //SimpleViewer API setup
    var svAPI; //svAPI is the object to call API methods on
 
    //Called by SWF when API becomes available
    function svComplete() {
        //alert("SimpleViewer API Available");
        svAPI = document.getElementById('svInstance');        
    }
 
    //Called by SWF when user views an image
    function svImageChange(index){
        imageID = index + 1
        SWFAddress.setValue("/"+imageID+"/");
    }
 
    //Called when browser back button is clicked
    SWFAddress.onChange = function(){
        if(svAPI.getImageIndex() != getLocationIndex()) {
            svAPI.showImage(getLocationIndex());
        }
    }
 
    function getLocationIndex() {
        var path = SWFAddress.getValue();
        var arr = path.split("/");
        return arr[1] - 1;    
    }
 
 
    //JavaScript Embed
    var flashvars = {};
    flashvars.enableAPI = "true";
    flashvars.galleryURL = "gallery.xml";
    flashvars.firstImageIndex = getLocationIndex();
    var params = {};    
    var attributes = {};
    //name and id should match getElementById() call above
    attributes.id =  "svInstance"; 
    attributes.name = "svInstance";
            swfobject.embedSWF("simpleviewer.swf", "sv-container", "100%", "600", "9.0.124", false, flashvars, params,attributes);
 
    </script>

i.s.o. :

    <!--START SIMPLEVIEWER EMBED.-->
    <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
    <script type="text/javascript" src="swfaddress.js"></script>
    <script type="text/javascript">
 
    //SimpleViewer API setup
    var svAPI; //svAPI is the object to call API methods on
 
    //Called by SWF when API becomes available
    function svComplete() {
        //alert("SimpleViewer API Available");
        svAPI = document.getElementById('svInstance');        
    }
 
    //Called by SWF when user views an image
    function svImageChange(index){
        imageID = index + 1
        SWFAddress.setValue("/"+imageID+"/");
    }
 
    //Called when browser back button is clicked
    SWFAddress.onChange = function(){
        if(svAPI.getImageIndex() != getLocationIndex()) {
            svAPI.showImage(getLocationIndex());
        }
    }
 
    function getLocationIndex() {
        var path = SWFAddress.getValue();
        var arr = path.split("/");
        return arr[1] - 1;    
    }
 
 
    //JavaScript Embed
    var flashvars = {};
    flashvars.enableAPI = "true";
    flashvars.galleryURL = "gallery.xml";
    flashvars.firstImageIndex = getLocationIndex();
    var params = {};    
    var attributes = {};
    //name and id should match getElementById() call above
    attributes.id =  "svInstance"; 
    attributes.name = "svInstance";
    $(document).ready(function () {
        SV.simpleviewer.load('sv-container', '100%', '100%', '222222', true, flashvars, params, attributes);
    });
 
    </script>

Last edited by berend (2010-11-15 21:04:34)

met vriendelijke groet,
Berend

Re: Path issue when main images are on another domain/server

I will try that (without any hope, because there are no subdomains on both servers) and report the effect Second reason I have little hope is that everything worked fine when I used SV Picasa template 1.9 (without Pro configuration options and using the original crossdomain.xml and the same 2 servers !!!!)

Yes, but there are major difference between SimpleViewer 1.x and 2.x, One of the bigest is that 1.x is ActionScript 2 and 2.x is ActionScript 3, Adobe made some big changes to how flash works between AS2 and AS3.

Mike Richards
SimpleViewer Support Team.

Re: Path issue when main images are on another domain/server

Mike,

I didn't know about these AS differences; knowing that I should have had more faith.

Any how IT WORKS NOW FINE (your latest example as well as with me). A minor bug-report I get is javascript related:


Errordetails webpage

Usersagent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Mon, 15 Nov 2010 21:17:25 UTC


Message: 'svAPI' isempty or noobject
Line: 30
Character: 21
Code: 0

Maybe you guys can repair this?

Anyhow I am very happy today  smile  smile  smile  and I really thank you for not giving up te help me!

And yeh ... maybe a good idea to elaborate a little bit more on the suppot pages about crossdomain.xml and differences for AS 2 and AS3.

Thanks, thanks and have a good day.

best regards,
Berend

met vriendelijke groet,
Berend