Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings when opening TIFF files #530

Open
mauroc opened this issue May 26, 2021 · 3 comments
Open

Warnings when opening TIFF files #530

mauroc opened this issue May 26, 2021 · 3 comments

Comments

@mauroc
Copy link

mauroc commented May 26, 2021

I am working with a lot of geotiffs and getting a huge stream of warnings in my rails server (puma) whenever I open one of them (which I do tens of times in loops )
tif_img = Image.open("sample_geotiff.tif")

irb(main):029:0> tif_img = Image.open("#{ml_tile.source_path}.tif")
identify-im6.q16: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
identify-im6.q16: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
identify-im6.q16: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
identify-im6.q16: Unknown field with tag 34736 (0x87b0) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
identify-im6.q16: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
identify-im6.q16: Unknown field with tag 42112 (0xa480) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.

The fields are typical geotiff tags, and I understand the warnings are harmless, but how can I get rid of them? It makes debugging really cumbersome. I tried changing logging level from DEBUG to INFO, to no avail.
I understand there is a -quiet option in imagemagick but how would I use that in the context of the .open method?
Thank you!
+1 for a great gem!

@mauroc
Copy link
Author

mauroc commented May 26, 2021

fixed using MiniMagick.configure {|config| config.validate_on_create = false}

@mauroc mauroc closed this as completed May 26, 2021
@mauroc mauroc reopened this May 26, 2021
@mauroc
Copy link
Author

mauroc commented May 26, 2021

I now get more tiff-related warnings when running

tif_img.format 'png'

convert-im6.q16: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
convert-im6.q16: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.
convert-im6.q16: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.

I changed the command to:

tif_img.format('png', nil, read_opts={quiet: nil})

but that causes error:

MiniMagick::Error (`convert -quiet  /tmp/mini_magick20210526-12695-s5figb.tif[0] /tmp/mini_magick20210526-12695-1u1fh3z.png` failed with error:
convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/504.
):

@mauroc mauroc closed this as completed May 26, 2021
@mauroc mauroc reopened this May 26, 2021
@jklemon17
Copy link

jklemon17 commented May 16, 2024

@mauroc I realize this is old and you may not remember, but were you able to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants