[ale] Bulk jpg Thumbnail production from 137000 jp2 files??

George Allen glallen01 at gmail.com
Wed Feb 20 14:02:31 EST 2013


You can use the perl/python-library for ImageMagic to do all the
functions ImageMagic provides - that way you can perform multiple
operations(such as create jpgs, thumbnails and screen-sized image) or
you can add functions to manipulate yoru EXIF/IPTC data also in the
same script (http://search.cpan.org/~exiftool/Image-ExifTool/).

(I'm not at a linux box, and I haven't done perl in a few years, so
consider the following to be pseudo code)

#!/usr/bin/perl
use Image::Magick;
my $image=Image::Magick->new;
my @src = <*.jp2>;
foreach $src (@src){
 my ($dst) = $src =~/^(.*).jp2$/;
 $image->Read($src)
 my $thumb = $basename . '-t.png';
 my $dst   = $basename . '.jpg';
 $image->Write($dst);
 $image->Scale(geometry=>'1024x768');
 $dst = $basename . '-1027x768.jpg'
 $image->Write($dst);
 $image->Scale(geometry=>'100x100');
 $image->Write($thumb);
 undef @$image;
}

On Wed, Feb 20, 2013 at 12:51 PM, Scott Bragg <walkingbear at gmail.com> wrote:
> *.jpg should be $1.jpg.  (Completely off the top of my head.)
>
>
> Sent from my iPad
>
> On Feb 20, 2013, at 9:31 AM, Wolf Halton <wolf.halton at gmail.com> wrote:
>
> Hi James - Thanks.
> Works, but I am trying to convert files in sub-folders
> find -type f -name "*.jp2" -exec convert {} -resize 14% *.jpg \;
> was doing something, but basically it took each image in order and created a
> file called *.jpg in the parent directory, over and over. Looking at it in
> image-viewer is like watch ing a slow slide show, as the image changes.
>
>
> On Wed, Feb 20, 2013 at 9:24 AM, James Sumners <james.sumners at gmail.com>
> wrote:
>>
>> https://en.wikipedia.org/wiki/ImageMagick
>>
>> On Wed, Feb 20, 2013 at 9:07 AM, Wolf Halton <wolf.halton at gmail.com>
>> wrote:
>> > I have been poking around, and gui-graphics apps will do the job, but I
>> > need
>> > a monastery full of dedicated monks to work on it for a couple of years.
>> > I
>> > had a product on *That other OS*(tm) that could do this, but I am on
>> > Debian
>> > Wheezy and don't want to ship the drives all the way across from this
>> > cubicle to the other, or install samba on the Debian machine to mount
>> > the
>> > drives on the machine with *That other OS*(tm).
>> >
>> > --
>> > Wolf Halton
>> > This Apt Has Super Cow Powers - http://sourcefreedom.com
>> > Open-Source Software in Libraries - http://FOSS4Lib.org
>> > Advancing Libraries Together - http://LYRASIS.org
>> > Apache Open Office Developer wolfhalton at apache.org
>> >
>> > _______________________________________________
>> > Ale mailing list
>> > Ale at ale.org
>> > http://mail.ale.org/mailman/listinfo/ale
>> > See JOBS, ANNOUNCE and SCHOOLS lists at
>> > http://mail.ale.org/mailman/listinfo
>> >
>>
>>
>>
>> --
>> James Sumners
>> http://james.roomfullofmirrors.com/
>>
>> "All governments suffer a recurring problem: Power attracts
>> pathological personalities. It is not that power corrupts but that it
>> is magnetic to the corruptible. Such people have a tendency to become
>> drunk on violence, a condition to which they are quickly addicted."
>>
>> Missionaria Protectiva, Text QIV (decto)
>> CH:D 59
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>
>
>
>
> --
> Wolf Halton
> This Apt Has Super Cow Powers - http://sourcefreedom.com
> Open-Source Software in Libraries - http://FOSS4Lib.org
> Advancing Libraries Together - http://LYRASIS.org
> Apache Open Office Developer wolfhalton at apache.org
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>


More information about the Ale mailing list