Can't read GeoTIFFs with Magick

520 views Asked by At

I'm attempting to use the magick R package to do some image editing. However, I am unable to read in GeoTIFF files. When I try this:

magick::image_read(RGBFile)

I get the following error message:

Error in magick_image_readpath(path, density, depth, strip) : 
  Magick: Unknown field with tag 34737 (0x87b1) encountered. 
`TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912

After doing some research, I've concluded that the GeoTIFF tags are the issue.

I've written to the package maintainer to see if an update to the package might allow GeoTIFFs to be read, but in the meantime, is anyone aware of a way of an way of removing GeoTIFF tags without re-copying the entire file? (Or any other efficient workaround for dealing with large >1 GB images)

Thanks!

1

There are 1 answers

0
Andrew Plowright On

I have contacted the package maintainer and this bug has been fixed! It hasn't made it onto CRAN as of this posting but in the meantime installing magick with devtools::install_github("ropensci/magick") should do the trick.