Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Problem with load-image

 [1/7] from: jhagman::infa::abo::fi at: 8-Apr-2001 19:45


Hi, I am having a bit problems with load-image. What I am trying to do is to get an image from the web and show it. The way I am trying to do it is following:
>> i: load-image http://www.aug99.com/museum/amiga/bilder/img2.jpg
== ˙Ø˙ā This is not satisfactory as the image cannot be shown with view layout [image i] On the other hand, if I read the image to a temporary file and do the load image after that it works fine.
>> write/binary %/tmp/a.jpg read/binary http://www.aug99.com/museum/amiga/bilder/img1.jpg >> i: load-image %/tmp/a.jpg
== make image! [800x600 #{ 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9...
>>
What am I missing? -- Jussi Hagman CS in Åbo Akademi University Studentbyn 4 D 33 [juhagman--abo--fi] 20540 Åbo [jhagman--infa--abo--fi] Finland

 [2/7] from: carl:rebol at: 8-Apr-2001 19:25


Looks like a bug. Use this instead. img: load read-thru/binary http:....

 [3/7] from: carl:rebol at: 8-Apr-2001 19:46


Actually, add this to your code for now: load-image: func [url] [load-thru/binary url]

 [4/7] from: jhagman:infa:abo:fi at: 9-Apr-2001 13:34


Quoting Carl Sassenrath ([carl--rebol--com]):
> Actually, add this to your code for now: > > load-image: func [url] [load-thru/binary url]
Thanks, this is a lot cleaner approach compared to saving temporary files. And as there must be quite a many of Amiga afficinandos here I'll send also the little script I was working on here. As you must know, the slides from the Amiga Inc. speach at St.Louis are available at http://www.aug99.com/museum/amiga/amigashow2001.html . For me the interface [Thumbnails and popup-windows] was a horror so I made a little script with REBOL to make reading the slides a little more pleasant. Here goes: REBOL [] load-image: func [url] [load-thru/binary url] base-url: http://www.aug99.com/museum/amiga/bilder/img for i 1 32 1 [ img: load-image rejoin [base-url i ".jpg"] view layout [image img [unview] [quit]] ] It is not much but hopefully someone enjoys it. -- Jussi Hagman CS in Åbo Akademi University Studentbyn 4 D 33 [juhagman--abo--fi] 20540 Åbo [jhagman--infa--abo--fi] Finland

 [5/7] from: carl:rebol at: 9-Apr-2001 7:48


Oh, cool. I'll try it right now!

 [6/7] from: carl:rebol at: 9-Apr-2001 7:58


Nice little slide viewer... thanks. Small suggestion for your loop to let the user know something is happening: repeat i 32 [ flash reform ["Loading image" i] img: load-image ... unview view layout [...] ] With a couple changes, you could download the images at the same time they are being displayed.... -Carl

 [7/7] from: jhagman:infa:abo:fi at: 9-Apr-2001 18:51


Quoting Carl Sassenrath ([carl--rebol--com]):
> With a couple changes, you could download the images at the > same time they are being displayed....
Sounds great, I'll look into that a bit later. I can not just play with rebol all the time. :) Thanks for the suggestions. -- Jussi Hagman CS in Åbo Akademi University Studentbyn 4 D 33 [juhagman--abo--fi] 20540 Åbo [jhagman--infa--abo--fi] Finland