diff options
Diffstat (limited to 'source/blender/imbuf/intern/tiff.c')
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 2fb14e40d9d..d9e1db27ef0 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -38,6 +38,7 @@ #include "imbuf.h" +#include "BLI_endian_defines.h" #include "BLI_math.h" #include "BLI_utildefines.h" @@ -374,7 +375,7 @@ static void scanline_separate_32bit(float *rectf, const float *fbuf, int scanlin static void imb_read_tiff_resolution(ImBuf *ibuf, TIFF *image) { - uint16 unit; + uint16_t unit; float xres; float yres; @@ -569,18 +570,14 @@ ImBuf *imb_loadtiff(const unsigned char *mem, TIFF *image = NULL; ImBuf *ibuf = NULL, *hbuf; ImbTIFFMemFile memFile; - uint32 width, height; + uint32_t width, height; char *format = NULL; int level; short spp; int ib_depth; int found; - /* check whether or not we have a TIFF file */ - if (size < IMB_TIFF_NCB) { - fprintf(stderr, "imb_loadtiff: size < IMB_TIFF_NCB\n"); - return NULL; - } + /* Check whether or not we have a TIFF file. */ if (imb_is_a_tiff(mem, size) == 0) { return NULL; } @@ -694,7 +691,7 @@ void imb_loadtiletiff( ImBuf *ibuf, const unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect) { TIFF *image = NULL; - uint32 width, height; + uint32_t width, height; ImbTIFFMemFile memFile; image = imb_tiff_client_open(&memFile, mem, size); @@ -765,7 +762,7 @@ void imb_loadtiletiff( bool imb_savetiff(ImBuf *ibuf, const char *filepath, int flags) { TIFF *image = NULL; - uint16 samplesperpixel, bitspersample; + uint16_t samplesperpixel, bitspersample; size_t npixels; unsigned char *pixels = NULL; unsigned char *from = NULL, *to = NULL; @@ -778,7 +775,7 @@ bool imb_savetiff(ImBuf *ibuf, const char *filepath, int flags) /* check for a valid number of bytes per pixel. Like the PNG writer, * the TIFF writer supports 1, 3 or 4 bytes per pixel, corresponding * to gray, RGB, RGBA respectively. */ - samplesperpixel = (uint16)((ibuf->planes + 7) >> 3); + samplesperpixel = (uint16_t)((ibuf->planes + 7) >> 3); if ((samplesperpixel > 4) || (samplesperpixel == 2)) { fprintf(stderr, "imb_savetiff: unsupported number of bytes per " |