Skip to content

Commit

Permalink
Fix RefArray issue on julia nightly (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Nov 29, 2023
1 parent 0248d70 commit 1f5604b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function _load(png_ptr, info_ptr; gamma::Union{Nothing,Float64}=nothing, expand_
end

function _load!(buffer::Matrix{T}, png_ptr, info_ptr) where T # separate to support precompilation of permutedims
png_read_image(png_ptr, map(pointer, eachcol(buffer)))
png_read_image(png_ptr, map(a -> Ptr{UInt8}(pointer(a)), eachcol(buffer)))
png_read_end(png_ptr, info_ptr)
png_destroy_read_struct(Ref{Ptr{Cvoid}}(png_ptr), Ref{Ptr{Cvoid}}(info_ptr), C_NULL)
return permutedims(buffer, (2, 1))
Expand Down Expand Up @@ -520,9 +520,9 @@ function _write_image(buf::AbstractArray{T,2}, png_ptr::Ptr{Cvoid}, info_ptr::Pt
ccall(
(:png_write_image, libpng),
Cvoid,
(Ptr{Cvoid}, Ptr{Ptr{T}}),
(Ptr{Cvoid}, Ptr{Ptr{UInt8}}),
png_ptr,
map(pointer, eachcol(buf)),
map(a -> Ptr{UInt8}(pointer(a)), eachcol(buf)),
)
end
png_write_end(png_ptr, info_ptr)
Expand Down

0 comments on commit 1f5604b

Please sign in to comment.