OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
362 stars 111 forks source link

Geo .PDF to .tiff has a transparent background colour #1374

Closed JanC closed 4 years ago

JanC commented 4 years ago

Please answers the following

I've...

Describe the bug Converting a .pdf to .tiff using gdal_translate creates a .tiff with transparent background

To Reproduce

Steps to reproduce the behavior:

  1. Download this 00989I11.PDF
  2. run gdal_translate 00989I11.PDF 00989I11.tiff
  3. Open the resulting 00989I11.tiff

Expected behavior I would expect the .tiff to have a white color as background as the source PDF does not contain any NoData value

Screenshots Source PDF: Screenshot 2020-04-23 at 18 55 44

Generated .tiff

Screenshot 2020-04-23 at 18 59 51

Additional context

gdalinfo --version
GDAL 3.0.4, released 2020/01/28
docker run -ti --rm  osgeo/gdal  gdalinfo --version
GDAL 3.1.0dev-2fde97fd57bbd892781f89323499528c5821dea4, released 2020/04/25

docker run -ti --rm -v $(pwd):/data osgeo/gdal  gdal_translate /data/00989I11.PDF /data/00989I11_linux.tiff

Linux output:

Screenshot 2020-04-26 at 08 54 03

brew doctor output:

brew doctor
Your system is ready to brew.
alazarolop commented 4 years ago

Hi @JanC thank you for thoroughly describing your problem. Within Docker you are using a different GDAL version (3.1.0dev > 3.0.4), could you reproduce the issue using the same GDAL version?

JanC commented 4 years ago

hi, I've just tried with Ubuntu docker where I manually installed the gdal 3.0.4 and the result there is the same (correct white background)

gdalinfo --version
GDAL 3.0.4, released 2020/01/28

gdal_translate 00989I11.PDF 00989I11_linux_3.0.4.tiff

Input file size is 807, 1237
proj_uom_get_info_from_database: unit of measure not found
0...10...20...30...40...50...60...70...80...90...100 - done.

Screenshot 2020-04-27 at 11 03 37

alazarolop commented 4 years ago

@JanC I can't reproduce it at this moment. I think you could get a better support from GDAL repository https://github.com/OSGeo/gdal/issues as it's related to the tool itself.

JanC commented 4 years ago

I can't reproduce it at this moment.

Do you mean that the same input .pdf file produces a .tiff with a white background on your side?

ok, I'll open a ticket in that repo

alazarolop commented 4 years ago

No, unfortunately I can't try the example at this moment because I don't have access to my testing installation. Could you please link the new issue you open, so anyone con follow up the thread?

JanC commented 4 years ago

See link above.

alazarolop commented 4 years ago

Great, thank you. `osgeo-gdal is built with both Pdfium and Poppler, so the behavior would be the expected considering the answer, did you solution fix your issue then?

JanC commented 4 years ago

yeah the GDAL_PDF_BANDS config options works.

gdal_translate 00989I11.PDF 00989I11.tiff --config GDAL_PDF_BANDS 3

👍

So I'm closing the ticket