Page 1 of 1

Any good method to put image from Internet to RR stack?

Posted: Tue May 29, 2007 8:51 am
by alex298
Hi,

I use the following to load a graph image from my website:

put "http://www.myweb.com/pic/graph.png" into tImageURL
put URL tImageURL into image "Graph"

The graph size is only 13 KB and load very fast in browser, usually within a second. However it always fail to load into my RR project. It seems that RR get the image much much slower than browser.

Any methods to ensure getting the image and faster?

Actually I tried a stupid method to get the image as below:

put "http://www.myweb.com/pic/graph.png" into tImageURL
Repeat for 3 times
put URL tImageURL into image "Graph"
if the size of image "Graph" = 0 then
wait 1.5 seconds
else
exit repeat
end if
End Repeat

However the graph is still always fail to load into image "graph".

Please help.

Thanks and best regards

Posted: Tue May 29, 2007 12:03 pm
by Mark
Hi Alex,

What is the problem? Does the image load slowly, but it appears eventually? Or doesn't it appear at all?

You might want to set the text of the image object to URL <url>. For example:

set the text of img 1 to url "http://forums.runrev.com/phpBB2/templat ... _phpBB.gif"

Best,

Mark

Posted: Tue May 29, 2007 3:05 pm
by alex298
Hi Mark,

Thanks for your help.

The problem is:
If the image does not load in the first second, it never appear. That's why I tried to load the image for three times.

Best regards

Posted: Tue May 29, 2007 8:54 pm
by Mark
Alex,

Are you sure that it is the downloading that takes time? Perhaps you should do it in two steps. First download the picture and then set the text of the image.

Code: Select all

put the millisecs into myTime
repeat 3
  put url "http://forums.runrev.com/phpBB2/templates/subSilver/images/logo_phpBB.gif"  into myImage
  if the result is empty then exit repeat
end repeat
put myTime & cr & (the millisecs - myTime) & cr
put the millisecs into myTime
set the text of img 1 to myImage
put the millisecs - myTime after msg
The message box will show you the time in milliseconds, the time needed to finish the repeat loop and the time to set the imagedata. Which part takes the most time?

Best,

Mark

Posted: Wed May 30, 2007 4:03 am
by alex298
Hi Mark,

It works very fast for thel ogo_phpBB.gif. The times are:
*****************
1180234342763
47
3
*****************

However when I wish to load the .png image from a website. The image sometimes appear and sometimes do not appear. The times when appear are:
*******************
1180234751145
136
18
*******************
and
*******************
1180234897096
231
17
*******************

The time when not appear are:
*******************
1180234503479
172
0
*******************
and
*******************
1180234862061
235
2
*******************

Any idea why this happens? The website is working normally.

Best regards