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...
How do you suppress TIFFWarnings?
-
- Posts: 22
- Joined: 2017-08-30T12:59:12-07:00
- Authentication code: 1151
Re: How do you suppress TIFFWarnings?
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How do you suppress TIFFWarnings?
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
-
- Posts: 22
- Joined: 2017-08-30T12:59:12-07:00
- Authentication code: 1151
Re: How do you suppress TIFFWarnings?
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...
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...
-
- Posts: 22
- Joined: 2017-08-30T12:59:12-07:00
- Authentication code: 1151
Re: How do you suppress TIFFWarnings?
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...
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?
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.