From: "Daniel P. Stasinski" <[EMAIL PROTECTED]>

> This works for me.
>   djpeg camera.jpg|pnmscale -xysize 100 75|cjpeg>thumbnail.jpg

This is how I do it (based on what daniel gave up there)

There are also variations you can use with the pnmscale line to size it to a
given width or height and not have to specify the other parameter

proc makethumbnail { ofwhat towhat thumbheight thumbwidth} {
    ## requires full path on each image
    if ![catch [file delete -force $towhat] theerror] {
        if  [ catch { exec djpeg $ofwhat | pnmscale -xysize $thumbwidth
$thumbheight | cjpeg > $towhat } theerror ] {
            ns_log Error "Error generating thumbnail : $theerror"
            return 0
        } else {
            return 1
        }
    } else {
        ns_log Error "Error deleting file : $theerror"
        return 0
    }
}


--
 Patrick Spence, MIS
 Mayor Pharmaceutical Labs/Regency Medical Research, Ltd.
 2401 South 24th Street, Phoenix, AZ  85034
 [EMAIL PROTECTED] - http://www.vitamist.com

 *** All contents of this email message are confidential
 and private.  Please do not forward to anyone that this
 message is not intended for without permission.

 If you have received this email in error, please contact
 the sender and then delete all copies of the message
 that you have.  Thank you. ***

----- Original Message -----

Reply via email to