From df0e214d4615c16bf6a2ef334aeec55a612bc7e6 Mon Sep 17 00:00:00 2001 From: Alexey Buzanov Date: Mon, 1 Jul 2013 19:48:21 +0400 Subject: [PATCH] hide tiff warnings --- Tests/test_file_tiff.py | 3 +-- libImaging/TiffDecode.c | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 296125f04..095226f84 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -78,6 +78,5 @@ def test_adobe_deflate_tiff(): assert_equal(im.mode, "RGB") assert_equal(im.size, (278, 374)) - assert_equal(im.tile, [('tiff_adobe_deflate', (0, 0, 278, 374), 0, - ('RGB', 'tiff_adobe_deflate', 4))]) + assert_equal(im.tile[0][:3], ('tiff_adobe_deflate', (0, 0, 278, 374), 0)) assert_no_exception(lambda: im.load()) diff --git a/libImaging/TiffDecode.c b/libImaging/TiffDecode.c index 8acea0317..d535a5033 100644 --- a/libImaging/TiffDecode.c +++ b/libImaging/TiffDecode.c @@ -197,6 +197,10 @@ int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, int clientstate->flrealloc = 0; dump_state(clientstate); + + TIFFSetWarningHandler(NULL); + TIFFSetWarningHandlerExt(NULL); + if (clientstate->fp) { TRACE(("Opening using fd: %d\n",clientstate->fp)); lseek(clientstate->fp,0,SEEK_SET); // Sometimes, I get it set to the end.