-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix RefArray issue on julia nightly #73
Conversation
Using
|
src/io.jl
Outdated
@@ -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(pointer, eachcol(reinterpret(UInt8, buffer)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
png_read_image(png_ptr, map(pointer, eachcol(reinterpret(UInt8, buffer)))) | |
png_read_image(png_ptr, map(a -> Ptr(Ptr{UInt8}}(pointer(a)), eachcol(buffer))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correcting what I assume is a {
typo
png_read_image(png_ptr, map(pointer, eachcol(reinterpret(UInt8, buffer)))) | |
png_read_image(png_ptr, map(a -> Ptr{Ptr{UInt8}}(pointer(a)), eachcol(buffer))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hits
OffsetArrays: Error During Test at /home/runner/work/PNGFiles.jl/PNGFiles.jl/test/test_various_array_types.jl:12
Got exception outside of a @test
TypeError: in RefArray, in A, expected A<:(AbstractArray{Ptr{UInt8}}), got Type{Vector{Ptr{Ptr{UInt8}}}}
Stacktrace:
[1] Ref{Ptr{UInt8}}(a::Vector{Ptr{Ptr{UInt8}}})
@ Base ./refpointer.jl:158
[2] cconvert(::Type{Ptr{Ptr{UInt8}}}, a::Vector{Ptr{Ptr{UInt8}}})
@ Base ./refpointer.jl:176
[3] png_read_image(png_ptr::Ptr{Nothing}, image::Vector{Ptr{Ptr{UInt8}}})
@ PNGFiles ~/work/PNGFiles.jl/PNGFiles.jl/gen/libpng/libpng_api.jl:558
[4] _load!(buffer::Matrix{Gray{N0f8}}, png_ptr::Ptr{Nothing}, info_ptr::Ptr{Nothing})
@ PNGFiles ~/work/PNGFiles.jl/PNGFiles.jl/src/io.jl:256
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to just be one too many Ptr
s. Pushed a fix
Thanks for looking into this, @IanButterworth! |
No probs. There are ~200 public dependents of this package now, so it was taking down a large part of pkgeval |
Fixes #74
try fix