Skip to content

Commit

Permalink
Fix buffer type in recode_slow() for better support of 32-bit sys…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
kimikage committed May 30, 2024
1 parent ee4852f commit 933f3cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TiffImages"
uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69"
authors = ["Tamas Nagy <github@tamasnagy.com>"]
version = "0.10.0"
version = "0.10.1"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand Down
4 changes: 2 additions & 2 deletions src/ifds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 933f3cc

Please # to comment.