From 6d46ed36bcad62db89af29512b4ca5f4fa7c423a Mon Sep 17 00:00:00 2001 From: Christian C Date: Thu, 6 Mar 2025 15:56:06 -0800 Subject: Suppress TIFF Metadata warnings --- src/lib/seg/util.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lib/seg') diff --git a/src/lib/seg/util.c b/src/lib/seg/util.c index a45f6c8..238fa1c 100644 --- a/src/lib/seg/util.c +++ b/src/lib/seg/util.c @@ -7,6 +7,12 @@ #include #include +// Suppress Tiff Warnings +void TiffDummyHandler(const char* module, const char* fmt, va_list ap) +{ + // ignore errors and warnings (or handle them your own way) +} + // Convert x,y coords to linear coordinate size_t xy_to_coord(size_t x, size_t y, uint32_t width, uint32_t height) { @@ -221,6 +227,7 @@ uint16_t* combine_masks(uint16_t *destination, uint16_t *extra_labels, uint32_t // starting_label_p will be incremented for each label found in the image uint16_t* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, uint16_t *starting_label_p) { + TIFFSetWarningHandler(TiffDummyHandler); //-TIFF-IMAGE-OPEN------------------------------- TIFF *tif = TIFFOpen(tif_file_name, "r"); if (!tif) { -- cgit v1.2.1