Don't log ignored errors unless debug logging is enabled#115
Conversation
Avoid the dcm_error_newf() and dcm_error_free() if we won't log the message anyway.
|
Even with this fix I think there's an API problem. If the DICOM file is corrupt, causing The but that's an API change and probably adds some duplicated code. What do you think? |
|
I ended up adding an error check to openslide/openslide#648, so this PR is no longer directly relevant to OpenSlide (but still seems like a good idea). |
Avoid the
dcm_error_newf()anddcm_error_free()if we won't log the message anyway.With the current state of openslide/openslide#648, this avoids allocating, string-formatting, and freeing 690,658
dcm_filehandle_get_frame_number()errors when opening 3DHISTECH-2: