Fourth pass at adding key files
This commit is contained in:
30
site/slowtwitch.com/www/tick/scripts/pics.pl
Executable file
30
site/slowtwitch.com/www/tick/scripts/pics.pl
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Image::Magick;
|
||||
|
||||
my ($image);
|
||||
my $filename = shift || exit(0);
|
||||
my $append = shift || "";
|
||||
my $max_height = shift || 200;
|
||||
|
||||
if ($append eq "---") { $append = ""; }
|
||||
|
||||
my $base = '/var/home/slowtwitch/slowtwitch.com/www/tick/images/gallery';
|
||||
my $new_filename = "${base}/${append}${filename}";
|
||||
|
||||
$image = Image::Magick->new;
|
||||
$image->Read("${base}/${filename}");
|
||||
|
||||
$width = $image->Get('columns');
|
||||
$height = $image->Get('rows');
|
||||
|
||||
if (($width > 900) || ($height > $max_height))
|
||||
{
|
||||
$image->Resize(geometry=>"${width}x${max_height}");
|
||||
# $image->Scale(geometry=>"${longest_side}x${longest_side}");
|
||||
# $image->Border(geometry=>'5x5');
|
||||
$image->Write(filename=>"${new_filename}", quality=>'75');
|
||||
}
|
||||
|
||||
undef $image;
|
||||
exit(0);
|
Reference in New Issue
Block a user