From b8d967e877371f456366762023886def64a62ddf Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 16 Aug 2013 17:22:16 +0200 Subject: Adding gdal*-like verbose messages. --- mkindex.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mkindex.pl b/mkindex.pl index bfb41dd..b787ead 100755 --- a/mkindex.pl +++ b/mkindex.pl @@ -399,6 +399,10 @@ sub expand_rgba { my $src_band = $src_ds->GetRasterBand(1); my $ct = $src_band->GetRasterColorTable() or return; + if ($config{progress}) { + print STDERR "Processing input file $map->{filename}.\n"; + &{$config{progress}}(0.0); + } &debug("Expansion to RGBA required."); my $dst_nb = 4; # RGBA @@ -426,7 +430,6 @@ sub expand_rgba { $dst_ds->SetGCPs( $src_ds->GetGCPs(), $src_ds->GetGCPProjection() ) if $src_ds->GetGCPCount(); - &{$config{progress}}(0.0) if $config{progress}; for (my $y = 0; $y < $ySize; $y++) { my $src_data = $src_band->ReadRaster(0, $y, $xSize, 1); @@ -444,8 +447,7 @@ sub expand_rgba { $dst_ds->Band(1+$b)->WriteRaster(0, $y, $xSize, 1, $_); } - &{$config{progress}}( (1+$y) / $ySize ) - if $config{progress}; + &{$config{progress}}( (1+$y) / $ySize ) if $config{progress}; } # Erase (hence flush and close) the previous dataset -- cgit v1.2.3