Monday, February 09, 2004

some code, just so I dont have to write it again, again

foreach (@ARGV)
{
#P15='154 230'
#P25='256 384 '
#P50='512 768'
print "resize image $_ \n";
##get info
my $info= `../bin/imgcon -info $_`;
#Image Size: 1536 x 1024 x 1
my ($width, $height)=$info=~ /Image Size: (\d+) x (\d+) / ;
print "$width, $height\n";
my $new_width=sprintf("%.0f", $percentage/100 * $width);
my $new_height=sprintf("%.0f", $percentage/100 * $height);
print "$new_width, $new_height\n";
print `../bin/imgcon -scale $new_width $new_height $_`;

}

No comments: