diff options
-rwxr-xr-x | mkindex.pl | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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"; |