ExifTool emits error messages and warnings via stderr and we can catch these messages with little effort when using the exiftool.exe from other applications.
Processing these textual messages and find the appropriate actions is more difficult. I currently do string compares / greps to detect certain errors/warnings and handle them. Luckily error messages are not (yet) localized and you don't change them often (or at all).
I have looked at the source code and I know that the error messages are spread all over the code. So this might be a stretch :-[
But would it be thinkable (very low on your list) to append some sort of unique number to each warning/error message?
Like changing
Error opening c:\images\bla.jpg for writing
into
Error opening c:\images\bla.jpg for writing [5]
It would be safer and more reliable to parse for the numerical error code "5" at the end of the message instead of doing text compares.
Thanks for the suggestion.
This feature would be easy to add at the same time as I add support for localized error strings, so I will tie it to this feature request (which is currently number 124 on the to-do list -- still a long, long way off).
- Phil
Ah, well. Localizing the error messages would make it even harder to handle them in an application. So this will fit nicely together.
Quotewhich is currently number 124 on the to-do list
Aaahh, isn't it nice to know
exactly what to do with all these rainy boring evenings without anything on the telly? ::)
(From a programmer spending a large share of
his spare time developing applications and tools for others)
Just a heads up:
I have had a request (https://exiftool.org/forum/index.php/topic,3633) to change one of the warning messages.
- Phil
Oh. What joy awaits when you ever consider localizing all these messages :)
Exactly. Truth be told I had already implemented localized warning/error messages in a test version of ExifTool, but scrapped the feature without releasing it for reasons like this.
- Phil