|
Post by marcioc on Oct 11, 2008 11:18:24 GMT -5
I just converted a Picture-Album application which I developed in PHP to Run Basic, and first of all it was so easy and 80% less code. I am really happy with Run Basic simplicity.
The problem I would like to report is that the download of the pictures is significantly slower than the application in PHP; however, I am using the same directory with the same pictures resolution both for PHP and Run Basic. Any explanation for the performance problem?
Thanks in advance
Marcio.
for j= 1 to nfotos '******* Test if last Picture ********* if #dir hasAnswer() then #dir nextFile$() '***Get the last picture gname$ = gini$ + #dir name$() print gname$ '********* Load the Picture*********** loadgraphic #g, gname$ render #g else Print "Last picture....." exit for end if next j
|
|
|
Post by Carl Gundel - admin on Oct 11, 2008 11:44:50 GMT -5
We plan to have some performance improvements in future releases, but in the meantime you can proxy Run BASIC behind an Apache server which can serve the static content, while Run BASIC serves it's own dynamic content. This is what we do here on our server. Here is a thread that explains how to do this. Read the entire thing. runbasic.proboards82.com/index.cgi?action=display&board=apache&thread=336&page=1-Carl
|
|
|
Post by Carl Gundel - admin on Oct 11, 2008 11:55:12 GMT -5
Looking quickly at your code you may not need Apache to get a boost. Try adding an image tag instead of loading the graphic into memory and rendering it. Your images will need to be in the public folder, or in a subfolder of it for this to work.
'instead of this loadgraphic #g, gname$ render #g
'do this html "<img src=""/"; gname$;"""/>"
The LOADGRAPHIC command is more useful for loading an image that you want to draw on before you render it.
-Carl
|
|
|
Post by marcioc on Oct 12, 2008 21:10:31 GMT -5
Hi Carl,
Thank you for your tip; however the image was not displayed.
Marcio
|
|
|
Post by Carl Gundel - admin on Oct 12, 2008 22:26:40 GMT -5
Hi Carl, Thank you for your tip; however the image was not displayed. Marcio With the code I posted your images need to be in the public folder. For example try this: gname$ = "runbutton.png" html "<img src=""/"; gname$;"""/>" -Carl
|
|
|
Post by marcioc on Oct 13, 2008 11:17:59 GMT -5
Dear Carl,
When I went to the public directory, following your recommendation, I noticed that all images downloaded by the command loadgraphic were there. So, I assumed that the command loadgraphic moves the images to the public directory transforming them from JPG to PNG, and consequently the HTML command saves this step. Is that correct?
Marcio.
|
|
|
Post by kokenge on Oct 13, 2008 11:31:51 GMT -5
I have a photo album working. Maybe you can get some ideas from it. I had to give up dynamic resizing, because when I wrote it there was no way to do it in RB. Instead you need to run a batch program to resize the photos. The resized photos are optional. If you don't resize, the program still works, only slower because it uses the larger photo. It also allows you to put movies, or music into the album. So you can use it as a place to keep your video,photos, or music.. You can also do bulk uploads of entire directories. You can get a copy of it here. www.dkokenge.com/rbpGood luck..
|
|
|
Post by marcioc on Oct 13, 2008 16:29:17 GMT -5
Hi KoKeng,
Thank you very much for sharing those RB codes with me. In reality I learned several other RB techniques from your programs. It was very useful. Marcio.
|
|
|
Post by Carl Gundel - admin on Oct 13, 2008 18:05:17 GMT -5
Dear Carl, When I went to the public directory, following your recommendation, I noticed that all images downloaded by the command loadgraphic were there. So, I assumed that the command loadgraphic moves the images to the public directory transforming them from JPG to PNG, and consequently the HTML command saves this step. Is that correct? The example code that I provided using the HTML statement presumes that the image files are already in the public folder. -Carl
|
|