Sie sind nicht angemeldet.

1

Montag, 5. Oktober 2009, 22:22

Character encoding in paths

I'm trying to embed KRPano using SWFObject, and passing the Sphere and Preview filename via a JS parameter.

I'm trying to generate correctly sized images and previews using phpThumb, but it uses some URL parameters to pass details to the resizing script, e.g.

Quellcode

1
phpThumb.php?src=/assets/images/equi/towers-03.jpg&w=1000&h=500&q=15&fltr[]=gray&fltr[]=blur|10


However when I try and pass this in via SWFObject, some of the parameters seem to be stripped off. Is there any documentation about what characters KRPano doesn't like? I think the equal sign is being removed. Even URL encoding the params don't seem to work. Any ideas?

2

Montag, 5. Oktober 2009, 22:38

Hi,

how do you pass this string to the swfobject?
via addVariable?

I'm not sure yet, but maybe the '%', '&' and '=' characters needed to be escaped:
'%' = %25
'&' = %26
'=' = %3D

best regards,
Klaus

3

Montag, 5. Oktober 2009, 23:11

Here's the code:

Quellcode

1
2
3
4
        swfobject.embedSWF("krpano.swf", "pano",  "960", "480", "9.0.28",  "swfobject/expressInstall.swf", 
                            {pano:"krpano.xml", sphere:"/assets/util/phpThumb/phpThumb.php/4000x2000;/assets/images/equi/towers-10.jpg", "preview.url":"/assets/util/phpThumb/phpThumb.php/q=25;fltr[]=gray;fltr[]=blur|10;1000x500;/assets/images/equi/towers-10.jpg"}, 
                            {allowfullscreen:true, bgcolor:"#ffffff", allowscriptaccess: 'sameDomain'}, 
                            {id:'pano', name:'pano'});


The default format for passing params to PHP thumb (standard GET params) doesn't work - this alternative format does work for the sphere, but it is the = character that is causing problems. KRPano seems to truncate the preview URL at the first = so it actually tries to call:

Quellcode

1
/assets/util/phpThumb/phpThumb.php/q


Encoding the = doesn't seem to help.

4

Montag, 5. Oktober 2009, 23:39

Hi,

interessting, but it's not krpano that truncates the string, I think the way how the parameters will be passed to the flash is the problem,

the swfobject script generates finally something like that to pass the variables to flash:

Quellcode

1
<param name="flashvars" value="sphere=...&preview.url=...">


and there a '=' will cause a problem,
a way of encoding should help, but I don't know yet, what way... (I will try to find out)

best regards,
Klaus

5

Dienstag, 6. Oktober 2009, 08:37

Ah, thanks Klaus - I'll continue trying to solve it too, sorry for jumping to the conclusion it was KRPano's fault!! Thanks very much for your help,

6

Dienstag, 6. Oktober 2009, 10:42

Hi,

no, you had right, it was a krpano fault (sorry for the too hasty thought )
the parameter was passed right,

I will try to fix that for the next release,

best regards,
Klaus

7

Dienstag, 6. Oktober 2009, 20:42

great! *g*

do you know of any workaround with the current beta version?

8

Mittwoch, 7. Oktober 2009, 14:00

btw - here is prerelease (not final) of beta 9 where this should be fixed:
krpano 1.0.8 beta 8

best regarsd,
Klaud

Ähnliche Themen