summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2013-08-13 20:24:26 +0200
committerGuilhem Moulin <guilhem@fripost.org>2013-08-13 20:24:26 +0200
commit9292447abd2eaeda9e82457f2d71d6a3caa92314 (patch)
tree1831bcdd70a0f30b97f974a80db8e6f52f7cebc2
parent753a836d31a1fafeea55c4c6d74a0496551efb61 (diff)
wibble
-rwxr-xr-xmkindex.pl16
1 files 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}
);