diff options
author | Yorhel <git@yorhel.nl> | 2010-11-02 16:43:56 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2010-11-02 16:43:56 +0100 |
commit | ce23a80fa7332c9b17682044a58b9dd06a9c2bdc (patch) | |
tree | d6494ca4208c434077110467c48f40a70ddbcd8e | |
parent | 71dae2e9fc7582559ff19d3a8eb84f7081dc7612 (diff) |
Multi::Image: Moved image size configuration to global.pl
As those may also be useful for other scripts.
-rw-r--r-- | data/global.pl | 2 | ||||
-rw-r--r-- | lib/Multi/Image.pm | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/data/global.pl b/data/global.pl index 7bda8db8..45c8f6b5 100644 --- a/data/global.pl +++ b/data/global.pl @@ -23,6 +23,8 @@ our %S = (%S, global_salt => 'any-private-string-here', source_url => 'http://git.blicky.net/vndb.git/?h=master', admin_email => 'contact@vndb.org', + scr_size => [ 136, 102 ], # w*h of screenshot thumbnails + cv_size => [ 256, 400 ], # max. w*h of cover images user_ranks => [ # allowed actions # DB number [qw| hist |], # 0 diff --git a/lib/Multi/Image.pm b/lib/Multi/Image.pm index f947bf7d..0ddb1853 100644 --- a/lib/Multi/Image.pm +++ b/lib/Multi/Image.pm @@ -21,8 +21,6 @@ sub spawn { |], ], heap => { - cvsize => [ 256, 400 ], - scrsize => [ 136, 102 ], cvpath => $VNDB::ROOT.'/static/cv', sfpath => $VNDB::ROOT.'/static/sf', stpath => $VNDB::ROOT.'/static/st', @@ -67,7 +65,7 @@ sub cv_process { # num, res my $im = Image::Magick->new; $im->Read($img); $im->Set(magick => 'JPEG'); - my($old, $new) = do_resize($im, $_[HEAP]{cvsize}); + my($old, $new) = do_resize($im, $VNDB::S{cv_size}); $im->Set(quality => 80); $im->Write($img); @@ -102,7 +100,7 @@ sub scr_process { # num, res $im->Write($sf); # create thumbnail - my($old, $new) = do_resize($im, $_[HEAP]{scrsize}); + my($old, $new) = do_resize($im, $VNDB::S{scr_size}); $im->Set(quality => 90); $im->Write($st); |