Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2008, 04:49 PM
trace9 trace9 is offline
Junior Member
 
Join Date: May 2008
Posts: 5
Downloads: 0
Uploads: 0
Default using an image handler script - problem

First, thanks for your work on this viewer. It's just what I've been looking for.

I'm using an image handler to request images that are loaded into the pano viewer. My test images load and show correctly, so I know what I have so far works as expected.

What I need to do is request the images dynamically using an image handler script, such as:
Code:
_panoInstance.loadPanorama("panoName=http://myserver.com/imageHandler.aspx?img=pano001");
I know that pano001.jpg exists, and is not a progressive .jpg. If I load the image handler url, with the .jpg extension included the image loads as expected. However, when I attempt to load the image through the pano viewer, I get the 'loading: failed' message.

Looking at my flashlog file, I see that this error is reported:
Error #2124: Loaded file is an unknown type. URL: http://myserver.com/imageHandler.aspx?img=pano001.jpg?1

Where is the "?1" coming from? If I attempt to load the image url reported in the error in a browser with the "?1" at the end, I get nothing. Removing the "?1" will make the image load as expected.

Is the problem with the pano viewer parsing this image url, or is it something I need to address in my image handler script? (I would look there first, but it's actually a script I currently don't have access to and the author is out for the day.)

Thanks in advance.
Reply With Quote
  #2  
Old 05-14-2008, 11:09 PM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

FPP is just a little bit different in how it handles what looks to most of the world like a URL--the panoName. But it is not a URL at all. It is the root of a URL to which is added a suffixes that specifies which cube face it is (_f, etc, or _0, etc), and what sort of image it is (.jpg, .png, etc).

So something like loadPano(panoName=http://domain.com/mypano) would end up looking for six images with these addresses http://domain.com/mypano_f.jpg
http://domain.com/mypano_d.jpg
http://domain.com/mypano_l.jpg
http://domain.com/mypano_r.jpg
http://domain.com/mypano_u.jpg
http://domain.com/mypano_b.jpg

Note that the _f.jpg series of suffixes is the default. You can change the suffixes by specifying the suffixes to use in the parameters. I believe that the code would be:

<parameters>
...
panoSuffixes=[front]|[left]|[right]|[back]|[up]|[down]
...
</parameters>

I think that is the correct order, and each of the bracketed [...] items has to be replaced with the correct suffix.

So, SOLUTION A: use blank suffixes:

<parameters>
...
panoSuffixes=|||||
...
</parameters>

I have never tried this, but it should work, unless maybe have no text where the suffix belongs cause bad things to happen.

Which brings us to BETTER SOLUTION B: explicitly tell FPP all six URLs

loadPano(image_f=http://myserver.com/imageHandler.aspx?img=pano001&image_l=http://myserver.com/imageHandler.aspx?img=pano002&image_r=http://myserver.com/imageHandler.aspx?img=pano003&image_b=http://myserver.com/imageHandler.aspx?img=pano004
&image_u=http://myserver.com/imageHandler.aspx?img=pano005
&image_d=http://myserver.com/imageHandler.aspx?img=pano006)

Of course that assumes that the image is a cube. If you are loading only one jpeg images as a whole pano, you might be loading an equirectangular. In which case you are probably going to need to use something like this:

loadPano(panoType=cylinder&image_f=http://myserver.com/imageHandler.aspx?img=pano001)

Note, I have never actually tried to load a cylinder instead of a cube this way, but it certainly works with a cube, so I see no reason why it wouldn't work with a cylinder.


Zephyr
__________________
Zephyr Renner - AdvancedVirtualTours.com - zleifr @t yahoo

Improving the panoramic one mighty fine plug-in at a time: http://www.flashpanos.com
Reply With Quote
  #3  
Old 05-14-2008, 11:56 PM
trace9 trace9 is offline
Junior Member
 
Join Date: May 2008
Posts: 5
Downloads: 0
Uploads: 0
Default

Thanks for the detailed response. I should have clarified that indeed I am using a cylinder pano, with a call to a single .jpg image using that image handler.

Here's the contents of my xml file:
Code:
<panorama>
	<parameters>
		panoType=cylinder
		qualityMotion=high
		tiltHome=0
		zoomHome = 1
		disableTilt=0
		behaviour=2
		shrink=1
		layer_1 = swf/pano/cylConverter.swf
		layer_2 = swf/pano/limits.swf
		layer_3 = swf/pano/autorotator.swf
		layer_4 = swf/pano/borders.swf
		layer_5 = swf/pano/fps.swf
	</parameters>
</panorama>
And I'm calling the image like so:
Code:
_panoInstance.loadPanorama("xml_file=xml/pano.xml&panoName=http://myserver.com/imageHandler.aspx?img=pano001");
I tried using "panoSuffixes=|||||" within the xml parameters node, but just came back blank (nothing displays) with no errors. I tried calling the image using both panoName, and image_f.

Somehow, there's a "?1" being appended to the image (and I think it happens in the FPP) and I'm wondering how to get around it. I'll test the image handler tomorrow (when I'll have access to the author) and report back. I can probably post working URLs which may make it easier to track down.

Thanks again
Reply With Quote
  #4  
Old 05-15-2008, 02:19 AM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

There's this post, which didn't solve the issue but had a workaround:
http://flashpanoramas.com/forum/showthread.php?t=1027
__________________
Patrick
http://patrickcheatham.com
Reply With Quote
  #5  
Old 05-15-2008, 02:56 AM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

Humbug! I remember that now.... And the workaround doesn't work in IE. So you must be using IE. ?

Zephyr
__________________
Zephyr Renner - AdvancedVirtualTours.com - zleifr @t yahoo

Improving the panoramic one mighty fine plug-in at a time: http://www.flashpanos.com
Reply With Quote
  #6  
Old 05-15-2008, 03:46 AM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

Alright, I am going to go out, way out on a limb and suggest a really hazy idea of what the problem _might_ be. The "?1" does not at all look like any sort of suffix that FPP would be adding normally (clue that my above incorrect answer is incorrect). But I can tell you what it does look like. It looks like the old trick of adding a query string to an http request to force the server to re-send the file. And we know that FPP supports multiple loading attempts. And we know that adding a query string to a request with a query string cause http 404 failures.

So, here is what I am thinking: Your ASP server is sending the file differently than say Apache would send an image, which is resulting in FPP thinking the image is not loading, or has stopped loading, or is only incompletely loaded, or some such thing, and therefore, it is jumping ahead to the next load attempt and adding ?1 to the URL.

If that is the case, there are a few things we can do:
1: (Diagnostic) post a link to the problematic tour. Then I can watch the load progress in Safari, and I should see multiple load attempts.
2: (Curative) change the loaderAttempts parameter to 1. That _might_ persuade FPP not to make the next, certain-to-fail attempt AND to use the image that it has loaded, if it is actually loaded and for some reason FPP doesn't realize it. Or it might just cause FPP to report loading failed a few seconds sooner.
3: (Curative) change some settings in your server to make ASP deliver the files in a way that more accurately mimics how a normal image would be delivered. I might suggest looking at HTTP compression settings or something like that, which might cause flash not to correctly realize when the file has fully downloaded.

In any case PLEASE POST A LINK to the non-working example so that I (we) can watch it fail. That will hopefully give us some clues.

Zephyr
__________________
Zephyr Renner - AdvancedVirtualTours.com - zleifr @t yahoo

Improving the panoramic one mighty fine plug-in at a time: http://www.flashpanos.com
Reply With Quote
  #7  
Old 05-15-2008, 06:12 PM
trace9 trace9 is offline
Junior Member
 
Join Date: May 2008
Posts: 5
Downloads: 0
Uploads: 0
Default

Thanks again for the helpful replies.

I tried using the "loaderAttempts=1" in my xml, and nothing shows and I'm getting no errors.

I can't post an example to the tour, as it's in development and isn't available yet. FPP will be a potential replacement to an existing 3d pano viewer. However, here's an example URL that I'm using to get a single image:
http://homesite.obeo.com/TourImageHa...edroom_450.jpg

This is how I'm calling the image:
http://homesite.obeo.com/TourImageHa...terbedroom_450
(without the .jpg extension)

Would someone be so kind as to use a cylinder pano and attempt load the image from the above URL?

Currently, I'm testing locally (this is a flex based project, but that shouldn't matter because I'm using flash 9 components all over the place, see: http://www.moock.org/blog/archives/000253.html) so I'm not sure if the standalone flash player that flex uses has the same limitations as the activeX player for IE. Regardless, it will need to work in both ff/ie.

As far as I can tell, the server is returning the image the same way as requesting it directly. Same mime type, etc. (but he's looking at the script now.)

Thanks again for your help.
Reply With Quote
  #8  
Old 05-15-2008, 11:54 PM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

The ASP server is definitely not serving the images exactly as e.g. Apache would. I have noticed two difference. The first may not be the problem, but it might also. When I load:
http://homesite.obeo.com/TourImageHa...edroom_450.jpg

only the image is returned, BUT if I then refresh the page two items are returned, the above image and the content at this URL:

http://homesite.obeo.com/Viewer/defa...edroom_450.jpg

Which is HTML saying the tour id is invalid.

But I don't think that is the problem, since I don't see why it wouldn't work with the first load attempt (but I definitely see why it might not with the second).

This is the other difference that I think is the problem: When I load images from my virtual tour web host's server, which is running Linux/Apache, the server reports the total bytes that it is transferring (x bytes loaded of 192k); HOWEVER, when I load the image from the obeo server, served by ASP, the browser reports x bytes loaded of ?, so maybe your server is not reporting that at all, or maybe it is, but in some non-compatible way.

I am observing this in the activity window in Safari, you should be able to see the same thing in something like Firebug for Firefox I think.

I think this is the problem, because I bet that FPP decides whether to go to the next attempt based on whether Loader.bytesLoaded = Loader.bytesTotal, and bytesTotal is either incorrect or NAN (Not A Number).

And there is one final difference, in Safari, with the debug feature enabled, in the Web Inspector Window, in the error console, when the image is loaded from ASP, I get this "warning" message:
Resource interpreted as document but transferred with MIME type image/jpeg.
I suppose it is good that it was transferred with the right MIME type, but this seems to be indicative of some other difference in what is being served from the ASP server.

Hope that helps.

Zephyr
__________________
Zephyr Renner - AdvancedVirtualTours.com - zleifr @t yahoo

Improving the panoramic one mighty fine plug-in at a time: http://www.flashpanos.com
Reply With Quote
  #9  
Old 05-16-2008, 05:30 PM
trace9 trace9 is offline
Junior Member
 
Join Date: May 2008
Posts: 5
Downloads: 0
Uploads: 0
Default

Zephyr, thank you.

You were correct. The image handler didn't return a Content-Length header, which was the cause of the problem. Now that it's been added, it works beautifully.

Thanks for your help in tracking this down, hopefully this will help someone else out later... cheers!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 10:33 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.