[REBOL] Creating thumbnails [view]
From: Steven::White::ci::bloomington::mn::us at: 22-Apr-2004 15:39
Good Day, Fountain of REBOL Knowledge,
The following script reads a big jpeg file and displays it on the
screen as a 96x96 thumbnail. When I hit the button, it saves that image
to disk as a 96x96 png thumbnail. I mention this to show that the idea
can be done (as of course you know).
view layout [
thumbnail: image 96x96 %ships_1024.jpg
button 300x25 "save/png to-image thumbnail"
[save/png %shipspng.png to-image thumbnail alert "done"]
Now, I want to do the same thing, but not in an interactive manner, not
with a screen. I want a script that will automatically make a bunch of
thumbnails for a bunch of pictures without any human intervention. Can
I do that?
It seems I can't use the "image" key word outside of a layout. If I
use "to-image," I don't see how I can specify the size. I know how to
find all the files in a directory, and how to loop through them, etc,
but I am missing that piece to read a jpeg file, turn it into a
thumbnail, and write it, outside of a VIEW layout. I have looked at the
cookbook example "HTML Thumbnail Photo Directory Maker," but that also
uses an image within a layout.
City of Bloomington
1800 W Old Shakopee Rd
Bloomington MN 55431-3096