[Eug-lug] batch convert

Bob Miller kbob at jogger-egg.com
Sun Aug 22 21:14:09 PDT 2004


Allen Brown wrote:

> mogrify is a cool command.  I've been using it for many years to
> make thumbnails automagically.  But there is one thing that
> annoys me.  There is no way to tell it to make the output filename
> different from the input file.  So to make a thumbnail I have to
>   cp ${fullsize}.jpg ${thumbnail}.jpg
>   mogrify -options ${thumbnail}.jpg
> 
> Do you know of a more efficient way to do this?

FWIW, I rescaled some images last night and today.  I did it the same
way I've been doing it for the last 10+ years using pbmplus.

    $ jpegtopnm input.jpg | pnmscale -xsize=512 | ppmtojpeg > output.jpg
    jpegtopnm: WRITING PPM FILE
    pnmscale: Scaling by 0.320000 horizontally to 512 columns.
    pnmscale: Scaling by 0.320000 vertically to 384 rows.
    pnmscale: 0.000011 of right column stretched due to arithmetic imprecision
    pnmscale: 0.000009 of bottom row stretched due to arithmetic imprecision

You can obviously embed that line in scripts in myriad ways.

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     kbob at jogger-egg.com


More information about the EUGLUG mailing list