Custom TIFF error and warning handlers to avoid console output
| 290 | |
| 291 | // Custom TIFF error and warning handlers to avoid console output |
| 292 | static void tiffErrorHandler(const char* module, const char* fmt, va_list args) { |
| 293 | char buf[1024]; |
| 294 | const int res = vsnprintf(buf, sizeof(buf), fmt, args); |
| 295 | tlog::warning( |
| 296 | "TIFF error ({}): {}", |
| 297 | module ? module : "unknown", |
| 298 | res > 0 ? string_view{buf, std::min((size_t)res, sizeof(buf))} : fmt::format("format error {}", res) |
| 299 | ); |
| 300 | } |
| 301 | |
| 302 | static void tiffWarningHandler(const char* module, const char* fmt, va_list args) { |
| 303 | char buf[1024]; |