StarOffice: Slide sorter slow
Alan Jackson
ajackson
Mon May 17 12:00:53 PDT 2004
On Wed, 24 Mar 2004 07:07:31 -0500
Joel Hammer <joel at hammershome.com> wrote:
> I just take a picture without resizing it with a
> digital photomicroscope. This gives images in the 2-3 meg
> range. Clearly more than I need, but, I don't know how to
> reduce the size automatically. I have several users taking
> pictures, and they want the easiest method possible. I
> work for them, they don't work for me.
>
Remember that picture size in bytes goes like the square of the
size, so shrinking the picture to a pixel height and width appropriate
for your presentation could save lots of disk, I/O, and memory.
I use Imagemagick convert to automatically scale pictures, for example :
$ more makethumb
#!/bin/sh
convert -geometry 227x170 $1 `echo $1 | sed 's/\.j/_th.j/'`
or a bit more sophisticated :
#!/usr/bin/perl -w
use strict;
opendir(DIR, ".") ;
my @files = readdir(DIR);
close DIR;
my @datafiles = grep (/jpe?g$|gif$/, at files);
@datafiles = grep (!/_th\./, at datafiles);
foreach (@datafiles) {
my $thumb = $_;
$thumb =~ s/\.(jpg|gif|jpeg)/_th.$1/;
if (! -e $thumb) {
`convert -size 150x150 $_ -resize 150 +profile "*" $thumb`;
}
}
--
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| alan at ajackson.org | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
More information about the Linux-users
mailing list