diff options
Diffstat (limited to 'ipl/gprogs/gallery.icn')
-rw-r--r-- | ipl/gprogs/gallery.icn | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/ipl/gprogs/gallery.icn b/ipl/gprogs/gallery.icn index 4dcd0a7..2379f99 100644 --- a/ipl/gprogs/gallery.icn +++ b/ipl/gprogs/gallery.icn @@ -6,7 +6,7 @@ # # Author: Gregg M. Townsend # -# Date: August 3, 2005 +# Date: May 27, 2008 # ############################################################################ # @@ -35,11 +35,10 @@ # The right mouse button activates the same popup momentarily until # the button is released. # -# -wnnn sets the maximum width for displaying an image; -# -hnnn sets the maximum height. -snnn sets both. -# By default, sizes are chosen automatically, subject to a minimum -# size of 32x32, to allow all images to fit in a single window. -# +# -wnnn sets the minimum thumbnail width. The default is 32. +# -hnnn sets the minimum thumbnail height. The default is 32. +# -snnn sets the minimum height and width together. +# # -r arranges images in rows instead of columns. # -m maximizes the window size before displaying images. # -t trims file names of leading path components and extensions. @@ -124,13 +123,11 @@ procedure main(args) else fh := WAttrib("fheight") fw := WAttrib("fwidth") - maxw := \opts["w"] | \opts["s"] | 2 * \opts["h"] - maxh := \opts["h"] | \opts["s"] | 2 * \opts["w"] - - # If no image size specified, try to guess to fill the window - if /maxw then - layout(*args) + # Determine thumbnail sizes. + layout(*args) + maxw <:= \opts["w"] | \opts["s"] | 2 * \opts["h"] + maxh <:= \opts["h"] | \opts["s"] | 2 * \opts["w"] aspmax := real(maxw) / real(maxh) # Display the files. @@ -149,7 +146,7 @@ procedure main(args) return # Get the next file and translate its image. - f := open(fname) | + f := open(fname, "ru") | { write(&errout, fname, ": can't open"); next } # Read the image, full sized, into a scratch canvas @@ -345,7 +342,7 @@ end procedure popinfo(a, e, w, h) local f, i, n, x, y - f := open(a.fname) + f := open(a.fname, "ru") seek(f, 0) n := where(f) seek(f, 1) @@ -445,7 +442,7 @@ procedure mkgif(cmd, fname) if \opts["d"] then write(&errout, "+ ", cmd) system(cmd) - f := open(tempname) | fail + f := open(tempname, "ru") | fail win := load(tempname) close(f) remove(tempname) @@ -486,7 +483,7 @@ procedure jsize(irec, fname) local s, p, line, w, h s := "" - p := open("rdjpgcom -verbose " || fname, "p") | fail + p := open("rdjpgcom -verbose \"" || fname || "\"", "p") | fail while line := read(p) do line ? { ="JPEG image is " | next w := tab(many(&digits)) | next |