From 9292447abd2eaeda9e82457f2d71d6a3caa92314 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 13 Aug 2013 20:24:26 +0200 Subject: wibble --- mkindex.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mkindex.pl b/mkindex.pl index 4f958d8..f56f8e3 100755 --- a/mkindex.pl +++ b/mkindex.pl @@ -185,11 +185,12 @@ use Geo::OSR; use Image::Magick; my %config = ( progress => sub { - open *X, '>&', \*STDOUT or die "Can't dup STDOUT: $!"; + # Geo::GDAL::TermProgress_nocb writes to STDOUT + open my $x, '>&', \*STDOUT or die "Can't dup STDOUT: $!"; open STDOUT, '>&', STDERR or die "Can't dup STDERR: $!"; Geo::GDAL::TermProgress_nocb(@_[0,1]); - open STDOUT, '>&', \*X or die "Can't dup X: $!"; - close *X; + open STDOUT, '>&', $x or die "Can't dup X: $!"; + close $x; } , debug => 0 , rename => 's/\.[^.]+$//' @@ -420,12 +421,13 @@ sub merge { my @src_filenames = map {$_->{filename}} @mapset; { - open *X, '>&', \*STDOUT or die "Can't dup STDOUT: $!"; + # gdalwarp writes to STDOUT; we add >&2 + open my $x, '>&', \*STDOUT or die "Can't dup STDOUT: $!"; open STDOUT, '>&', STDERR or die "Can't dup STDERR: $!"; system 'gdalwarp', @opts, @src_filenames, $dst_filename; $? == 0 or die "gdalwarp failed.\n"; - open STDOUT, '>&', \*X or die "Can't dup X: $!"; - close *X; + open STDOUT, '>&', $x or die "Can't dup X: $!"; + close $x; } return $dst_filename; } @@ -445,12 +447,14 @@ sub annotate { my ($width, $height) = $img->Get(qw/width height/); my @draw = ( fill => 'none' + # list of supported colors: `convert -list color` , stroke => $config{bordercolor} , strokewidth => $config{border} , primitive => 'polygon' ); my @ann = ( fill => $config{fontcolor} // $config{bordercolor} , strokewidth => 0 + # list of supported fonts: `convert -list font` , font => $config{font} , pointsize => $config{fontsize} ); -- cgit v1.2.3