From bfb7d2291f5e32d090c87c68af5f8d4313267fc3 Mon Sep 17 00:00:00 2001
From: Su Laus <[EMAIL REDACTED]>
Date: Sun, 8 May 2022 17:57:40 +0000
Subject: [PATCH] TIFFIsBigTiff() function added.
---
libtiff/libtiff.def | 1 +
libtiff/tif_open.c | 9 +++++++++
libtiff/tiffio.h | 3 ++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/libtiff/libtiff.def b/libtiff/libtiff.def
index 90850fd2..e93bef08 100644
--- a/libtiff/libtiff.def
+++ b/libtiff/libtiff.def
@@ -63,6 +63,7 @@ EXPORTS TIFFAccessTagMethods
TIFFGetVersion
TIFFGetWriteProc
TIFFIsBigEndian
+ TIFFIsBigTIFF
TIFFIsByteSwapped
TIFFIsCODECConfigured
TIFFIsMSB2LSB
diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c
index a94b68e4..9bef1727 100644
--- a/libtiff/tif_open.c
+++ b/libtiff/tif_open.c
@@ -668,6 +668,15 @@ TIFFIsBigEndian(TIFF* tif)
return (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN);
}
+/*
+ * Return nonzero if given file is BigTIFF style.
+ */
+int
+TIFFIsBigTIFF(TIFF *tif)
+{
+ return (tif->tif_header.common.tiff_version == TIFF_VERSION_BIG);
+}
+
/*
* Return pointer to file read method.
*/
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 2ad58503..f8ebdbd8 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -385,9 +385,10 @@ extern int TIFFIsByteSwapped(TIFF*);
extern int TIFFIsUpSampled(TIFF*);
extern int TIFFIsMSB2LSB(TIFF*);
extern int TIFFIsBigEndian(TIFF*);
+extern int TIFFIsBigTIFF(TIFF*);
extern TIFFReadWriteProc TIFFGetReadProc(TIFF*);
extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
-extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
+extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);