Page 1 of 1
How do you suppress TIFFWarnings?
Posted: 2018-05-08T09:38:43-07:00
by Keith.Vinson
Hi All,
Is it possible to suppress TIFFWarnings being bubbling up from inside ImageMagick as Exceptions?
Specifically the following "error" is occuring from inside Magick.Net:
"tiff.c/TIFFWarnings/999/Exception ASCII value for tag "Software" does not end in null byte. `TIFFFetchNormalTag'"
Thanks for any guidance you can provide...
Re: How do you suppress TIFFWarnings?
Posted: 2018-05-08T14:13:18-07:00
by dlemstra
Which version are you using and can you provide a link to your file and a small sample that I can use to reproduce the issue? A warning should normally be ignored so I don't understand why you are getting that exception.
Re: How do you suppress TIFFWarnings?
Posted: 2018-05-08T14:25:57-07:00
by fmw42
In command line mode, you need -quiet to suppress unknown TIFF meta field warnings. I am not sure what the equivalent is in Magick.NET
Re: How do you suppress TIFFWarnings?
Posted: 2018-05-08T16:37:13-07:00
by Keith.Vinson
Hi All,
I'm using 7.4.3 Q8 anyCPU. The warnings are bubbling up from Magick.NET and are being labeled as Exceptions in the delegate chain.
Here is my handler:
private void MagickNET_Log (object sender, LogEventArgs e)
{
// write to a single log file...
if ((RemoteImageMagickEventLogging & e.EventType) != LogEvents.None)
{
switch (e.EventType)
{
case LogEvents.Exception:
if (!e.Message.Contains ("TIFFWarnings"))
TriggerRemoteLoggingEvent (e.EventType, EZLogger.LoggingLevel.Note1, e.Message);
break;
}
}
}
What you can see is that the EventType is being flagged as an Exception, even though it is only a warning.
I had to add a filter to srtip all TIFFWarnings out of the event chain as a quick patch. I was hoping there might be a way to suppress the warnings or to at least have them be flagged only as warnings...
I will try and post an image file for you once I identify a good candidate...
Re: How do you suppress TIFFWarnings?
Posted: 2018-05-08T16:50:34-07:00
by Keith.Vinson
HI All, Just a quick check I have updated to version 7.4.5 Q8 AnyCPU and the issue is still occuring.
The message field now contains the string""2018-05-08T18:51:07-05:00 7:58.951 17.813u 7.0.7 Exception ImageProcessingServer.exe[26024]: tiff.c/TIFFWarnings/1000/Exception\n ASCII value for tag "Software" does not end in null byte. `TIFFFetchNormalTag'""
Here is a sample file:
http://dlsg.com/downloads/Samples/00000193_000004.tif
Thanks for the previous replies...
Re: How do you suppress TIFFWarnings?
Posted: 2018-05-13T05:49:49-07:00
by dlemstra
When an exception is thrown in the C# code there is a check to determine if warnings should be raised as an exception or should be ignored. But when an exception is created this will always be logged and that is why the message ends up in the log. You will need to add your own filter as you did.