summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2013-08-13 20:54:19 +0200
committerGuilhem Moulin <guilhem@fripost.org>2013-08-13 20:54:19 +0200
commit61bb681975a271f8fa4008cf6760f321e9c2e881 (patch)
tree8bc8f7b9c69cf446cf4aac2968d4028fa3a56339
parentaa2d91c84d85b6ee9cd450e90614cecb7642c624 (diff)
Suggest to keep the compression algorithm.
-rwxr-xr-xmkindex.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/mkindex.pl b/mkindex.pl
index 50212bc..4d3afa7 100755
--- a/mkindex.pl
+++ b/mkindex.pl
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-our $VERSION = "0.2, August 12, 2013";
+our $VERSION = "0.3, August 13, 2013";
use 5.010_000;
use warnings;
@@ -283,6 +283,9 @@ foreach my $map (@mapset) {
my ($new,$path,$suffix) = fileparse ($name, qr/\.[^.]*$/);
$new = File::Spec->catfile($path,$new.'_new'.$suffix);
my $driver = $ds->GetDriver()->{ShortName};
+ my %opts = %$gdal_opts;
+ my $compress = $ds->GetMetadata('IMAGE_STRUCTURE')->{COMPRESSION};
+ $opts{COMPRESS} = $compress if $compress;
warn "WARN: ".join (' ',
map { my $x = $_;
$x =~ s/"/\\"/;
@@ -290,7 +293,7 @@ foreach my $map (@mapset) {
$x
}
( 'gdal_translate', '-of', $driver
- , (map { ('-co', $_.'='.$gdal_opts->{$_}) } (keys %$gdal_opts))
+ , (map { ('-co', $_.'='.$opts{$_}) } (keys %opts))
, $old, $new
)
). "\n";