diff options
author | Matt Ebb <matt@mke3.net> | 2010-06-01 05:01:25 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-06-01 05:01:25 +0400 |
commit | 80a89d2de50e46d65940864d18ced946eec29ba7 (patch) | |
tree | 756b0289fe23deebe7ec9f71a5f2f1259d772b1f /source/blender/imbuf/intern/tiff.c | |
parent | ccda04131a7e1a8d6d011e6d3453979b540f5d52 (diff) |
* Only print libtiff debug messages to the console when in debug mode
* Allow loading non 3/4 channel TIFFs (eg. greyscale). This was already
working, but disabled out of caution. Seems to work fine in my recent tests though.
Diffstat (limited to 'source/blender/imbuf/intern/tiff.c')
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 488340aec88..99f74fea640 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -356,6 +356,7 @@ static void scanline_separate_32bit(float *rectf, float *fbuf, int scanline_w, i } +#if 0 /* * Use the libTIFF RGBAImage API to read a TIFF image. * This function uses the "RGBA Image" support from libtiff, which enables @@ -387,6 +388,7 @@ static int imb_read_tiff_pixels_rgba(ImBuf *ibuf, TIFF *image, int premul) return success; } +#endif /* * Use the libTIFF scanline API to read a TIFF image. @@ -409,12 +411,6 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) TIFFGetField(image, TIFFTAG_PLANARCONFIG, &config); scanline = TIFFScanlineSize(image); - /* if file has an unsupported channel count, use libTIFF to - * convert to an 8 bit RGBA image */ - if (!ELEM(spp, 3, 4)) - return imb_read_tiff_pixels_rgba(ibuf, image, premul); - - if (bitspersample == 32) { ib_flag = IB_rectfloat; fbuf = (float *)_TIFFmalloc(scanline); @@ -427,7 +423,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) } tmpibuf= IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->depth, ib_flag, 0); - + /* contiguous channels: RGBRGBRGB */ if (config == PLANARCONFIG_CONTIG) { for (row = 0; row < ibuf->y; row++) { @@ -512,6 +508,12 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) return success; } +void imb_inittiff(void) +{ + if (!(G.f & G_DEBUG)) + TIFFSetErrorHandler(NULL); +} + /** * Loads a TIFF file. * |