diff --git a/src/tiff_reader.cpp b/src/tiff_reader.cpp index 9c1897b689..6f723ca88c 100644 --- a/src/tiff_reader.cpp +++ b/src/tiff_reader.cpp @@ -118,11 +118,12 @@ void tiff_reader::on_error(const char* /*module*/, const char* fmt, va_list argp void tiff_reader::init() { // TODO: error handling - TIFFSetWarningHandler(0); - TIFFSetErrorHandler(on_error); TIFF* tif = load_if_exists(file_name_); if (!tif) throw image_reader_exception( std::string("Can't load tiff file: '") + file_name_ + "'"); + TIFFSetWarningHandler(0); + TIFFSetErrorHandler(on_error); + char msg[1024]; if (TIFFRGBAImageOK(tif,msg))