diff options
Diffstat (limited to 'src/3rdparty/libtiff/libtiff/tif_jpeg_12.c')
-rw-r--r-- | src/3rdparty/libtiff/libtiff/tif_jpeg_12.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/src/3rdparty/libtiff/libtiff/tif_jpeg_12.c b/src/3rdparty/libtiff/libtiff/tif_jpeg_12.c index bec5fb9..406e1cf 100644 --- a/src/3rdparty/libtiff/libtiff/tif_jpeg_12.c +++ b/src/3rdparty/libtiff/libtiff/tif_jpeg_12.c @@ -1,6 +1,10 @@ #include "tiffiop.h" +#if defined(HAVE_JPEGTURBO_DUAL_MODE_8_12) +#define JPEG_DUAL_MODE_8_12 +#endif + #if defined(JPEG_DUAL_MODE_8_12) #define FROM_TIF_JPEG_12 @@ -17,46 +21,43 @@ int TIFFInitJPEG_12(TIFF *tif, int scheme); +#if !defined(HAVE_JPEGTURBO_DUAL_MODE_8_12) #include LIBJPEG_12_PATH +#endif #include "tif_jpeg.c" int TIFFReInitJPEG_12(TIFF *tif, const JPEGOtherSettings *otherSettings, - int scheme, int is_encode) { - JPEGState *sp; - uint8_t *new_tif_data; + int scheme, int is_encode) +{ + JPEGState *sp; + uint8_t *new_tif_data; - (void)scheme; - assert(scheme == COMPRESSION_JPEG); + (void)scheme; + assert(scheme == COMPRESSION_JPEG); - new_tif_data = (uint8_t *)_TIFFrealloc(tif->tif_data, sizeof(JPEGState)); + new_tif_data = + (uint8_t *)_TIFFreallocExt(tif, tif->tif_data, sizeof(JPEGState)); - if (new_tif_data == NULL) { - TIFFErrorExt(tif->tif_clientdata, "TIFFReInitJPEG_12", - "No space for JPEG state block"); - return 0; - } + if (new_tif_data == NULL) + { + TIFFErrorExtR(tif, "TIFFReInitJPEG_12", + "No space for JPEG state block"); + return 0; + } - tif->tif_data = new_tif_data; - _TIFFmemset(tif->tif_data, 0, sizeof(JPEGState)); + tif->tif_data = new_tif_data; + _TIFFmemset(tif->tif_data, 0, sizeof(JPEGState)); - TIFFInitJPEGCommon(tif); + TIFFInitJPEGCommon(tif); - sp = JState(tif); - sp->otherSettings = *otherSettings; + sp = JState(tif); + sp->otherSettings = *otherSettings; - if (is_encode) - return JPEGSetupEncode(tif); - else - return JPEGSetupDecode(tif); + if (is_encode) + return JPEGSetupEncode(tif); + else + return JPEGSetupDecode(tif); } #endif /* defined(JPEG_DUAL_MODE_8_12) */ - -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ |