Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Script-fu thumbnail creation

87 views
Skip to first unread message

Greg Weeks

unread,
Jan 4, 2002, 5:46:38 PM1/4/02
to
I'm a total newcomer to GIMP. If necessary I will learn, but first I will
ask: Is there an automated way to create JPG thumbnails? The inputs would
be a JPG file, the new size dimensions, and some parameter that trades off
the resulting file size and image resolution. The output would be the
resulting JPG file.

Regards,
Greg Weeks

David Hodson

unread,
Jan 5, 2002, 1:52:25 AM1/5/02
to
Greg Weeks wrote:
>
> I'm a total newcomer to GIMP. If necessary I will learn, but first I will
> ask: Is there an automated way to create JPG thumbnails?

If you're on a Unix box and can compile a plugin, head over to:

http://members.ozemail.com.au/~hodsond/dbp.html

It's a simple Gimp-based batch processing system for doing
blur / colour correct / resize / sharpen / rename / save
on multiple files. All gui point-and-click, no scripting.

--
David Hodson -- this night wounds time

Tsu Dho Nimh

unread,
Jan 5, 2002, 8:15:56 AM1/5/02
to
we...@vitus.scs.agilent.com (Greg Weeks) wrote:

If you use Windows, check nonags.com in the graphics section. I
saw one that created thumbnails AND a page in HTML to show them
in, with links to the large version.


Tsu Dho Nimh

It is my job to completely create professional technology
in order that we may seamlessly supply competitive data.

M61MG78

unread,
Jan 6, 2002, 10:20:13 PM1/6/02
to

If you use linux try
www.giwersworld.org/computers/linux/scale-make.phtml which will produce a
webpage in the process for you browser. Thumbnail size is controllable as
described on the page. Nothing fancy. It just works.

--
No hymns, no trees, no joy. It's Christmas time in Israel.
There is less mention of Jesus than by Satan in his hell.
-- The Iron Webmaster, 763

Greg Weeks

unread,
Jan 7, 2002, 11:31:43 PM1/7/02
to
Greg Weeks (we...@vitus.scs.agilent.com) wrote:
: I'm a total newcomer to GIMP. If necessary I will learn, but first I will

Thanks for all the suggestions. I ended up with the following script:

------------------------------------------------------------------------------
#! /bin/bash

sfile=${1} # SOURCE FILENAME
tfile=${2-tmp.JPG} # TARGET FILENAME
tquality=${3-0.5} # TARGET QUALITY (BETWEEN 0 AND 1)
twidth=${4-96} # TARGET WIDTH
theight=${5-96} # TARGET HEIGHT

gimp -i -b '
(begin
(define (make-thumbnail sfile tfile tquality twidth theight)
(let* ((image (car (file-jpeg-load 1 sfile "")))
(drawable (car (gimp-image-active-drawable image)))
(swidth (car (gimp-image-width image)))
(sheight (car (gimp-image-height image))))

(if (> (* theight swidth) (* sheight twidth))
(set! theight (* sheight (/ twidth swidth)))
(set! twidth (* swidth (/ theight sheight))))

(gimp-image-scale image twidth theight)

(file-jpeg-save 1 image drawable tfile ""
tquality 0 1 0 "Made with the GIMP" 0 1 0 0)
))
(make-thumbnail "'$sfile'" "'$tfile'" '$tquality' '$twidth' '$theight')
(gimp-quit 0)
)
'
------------------------------------------------------------------------------

I got this by stripping down a Script-fu script from:

http://fuchur.leute.server.de/gimp/thumbnail.html


Greg

0 new messages