From 44b8aab4f72c6da2912ef06b092c097a5bf01a98 Mon Sep 17 00:00:00 2001 From: kimikage Date: Thu, 30 May 2024 11:41:21 +0900 Subject: [PATCH] Fix `buffer` type in `recode_slow()` for better support of 32-bit systems --- Project.toml | 2 +- src/ifds.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 7761113..b59796c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TiffImages" uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69" authors = ["Tamas Nagy "] -version = "0.10.0" +version = "0.10.1" [deps] ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" diff --git a/src/ifds.jl b/src/ifds.jl index c142a29..d669173 100644 --- a/src/ifds.jl +++ b/src/ifds.jl @@ -569,14 +569,14 @@ function recode_slow(v::AbstractVector{T}, rows::Integer, columns::Integer, n::I j = 0 # output index # encoding is done per row, so decoding is also done per row for _ in 1:rows - buffer::Int = 0 + buffer::UInt64 = 0 available = 0 # number of valid bits available in buffer for _ in 1:columns while available < n buffer = (buffer << 8) | vb[i+=1] available += 8 end - val = (buffer >> (available - n)) & ((1 << n) - 1) + val = (buffer >> (available - n)) & ((UInt64(1) << n) - 1) out[j+=1] = T(val) available -= n end