Skip to content

Commit 19f679a

Browse files
committed
Handle libtiff version upgrade (to v4.5.0)
Refactor TIFF_SSIZE_T definition and update data types in IFD class - Added a check to ensure TIFF_SSIZE_T is only defined if not already defined, changing its type to int64_t. - Updated the data types of td_stripoffset_p and td_stripbytecount_p from uint64 to uint64_t for consistency in the IFD class. Signed-off-by: Gigon Bae <[email protected]>
1 parent a7e7beb commit 19f679a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cpp/plugins/cucim.kit.cuslide/src/cuslide/lzw/lzw_libtiff.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ struct TIFF;
4242
#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */
4343

4444
/* Signed size type */
45-
#define TIFF_SSIZE_T signed long
45+
// Check if TIFF_SSIZE_T is already defined before defining it
46+
#ifndef TIFF_SSIZE_T
47+
#define TIFF_SSIZE_T int64_t
48+
#endif
4649
typedef TIFF_SSIZE_T tmsize_t;
4750
typedef tmsize_t tsize_t; /* i/o size in bytes */
4851

cpp/plugins/cucim.kit.cuslide/src/cuslide/tiff/ifd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ IFD::IFD(TIFF* tiff, uint16_t index, ifd_offset_t offset) : tiff_(tiff), ifd_ind
118118
image_piece_count_ = tif_dir.td_stripoffset_entry.tdir_count;
119119

120120
image_piece_offsets_.reserve(image_piece_count_);
121-
uint64* td_stripoffset_p = tif_dir.td_stripoffset_p;
122-
uint64* td_stripbytecount_p = tif_dir.td_stripbytecount_p;
121+
uint64_t* td_stripoffset_p = tif_dir.td_stripoffset_p;
122+
uint64_t* td_stripbytecount_p = tif_dir.td_stripbytecount_p;
123123

124124
// Copy data to vector
125125
image_piece_offsets_.insert(image_piece_offsets_.end(), &td_stripoffset_p[0], &td_stripoffset_p[image_piece_count_]);

0 commit comments

Comments
 (0)