diff --git a/.travis.yml b/.travis.yml index 7ebe8e7..f36310c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ sudo: true language: ruby rvm: - - 2.4.3 + - 2.4.5 addons: apt: packages: - - libgdal1h + - libgdal1i - libgdal-dev - gdal-bin - libcairo2-dev diff --git a/lib/geo_works/derivatives/processors/gdal.rb b/lib/geo_works/derivatives/processors/gdal.rb index a98ce69..027edde 100644 --- a/lib/geo_works/derivatives/processors/gdal.rb +++ b/lib/geo_works/derivatives/processors/gdal.rb @@ -14,6 +14,9 @@ module Gdal # @param out_path [String] processor output file path # @param options [Hash] creation options def self.translate(in_path, out_path, _options) + execute "gdal_translate -q -ot Byte -of GTiff -co TILED=YES -expand rgb -co COMPRESS=DEFLATE \"#{in_path}\" #{out_path}" + rescue StandardError + # Try without expanding rgb execute "gdal_translate -q -ot Byte -of GTiff -co TILED=YES -co COMPRESS=DEFLATE \"#{in_path}\" #{out_path}" end diff --git a/spec/geo_works/derivatives/processors/gdal_spec.rb b/spec/geo_works/derivatives/processors/gdal_spec.rb index 613c12b..c4c5301 100644 --- a/spec/geo_works/derivatives/processors/gdal_spec.rb +++ b/spec/geo_works/derivatives/processors/gdal_spec.rb @@ -27,7 +27,7 @@ def source_path; end describe '#translate' do it 'executes a gdal_translate command' do - command = "gdal_translate -q -ot Byte -of GTiff -co TILED=YES -co COMPRESS=DEFLATE \"files/geo.tif\" output/geo.png" + command = "gdal_translate -q -ot Byte -of GTiff -co TILED=YES -expand rgb -co COMPRESS=DEFLATE \"files/geo.tif\" output/geo.png" processor.class.translate(file_name, output_file, options) expect(processor.class).to have_received(:execute).with command end