View previous topic :: View next topic |
Author |
Message |
kortec n00b
Joined: 20 Dec 2004 Posts: 68
|
|
Back to top |
|
|
FishB8 l33t
Joined: 17 Mar 2003 Posts: 820
|
|
Back to top |
|
|
kortec n00b
Joined: 20 Dec 2004 Posts: 68
|
Posted: Thu Aug 09, 2007 12:59 am Post subject: |
|
|
Got it! Thanks. For posterity, here's the source of the perl script. It's more than a bit hackish, but I'm not real worried about it. =)
Code: |
#!/usr/bin/perl -w
use strict;
use Image::Magick;
use File::Basename qw/fileparse/;
die "please pass in the image to splice on cmdline" unless ($ARGV[0] && -e $ARGV[0] && -f $ARGV[0]);
my ($name, $dirs, $suffix) = fileparse($ARGV[0],qr/(\..+)+/);
flex('l', '+0');
flex('r', '+1280');
#sadly, a destructive process
sub flex{
my($side, $dim) = @_;
my $img = Image::Magick->new;
$img->Read("$ARGV[0]");
$img->Set('mattecolor' => 'black');
$img->Scale('geometry' => '2560x1024');
$img->Frame('geometry' => sprintf("%sx0", int((2560-$img->Get('columns')) / 2)));
$img->Crop('geometry' => sprintf("1280x1024%s+0", $dim));
$img->Write(sprintf("%s%s_%shs%s", $dirs, $name, $side, $suffix));
undef($img);
}
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|