quinnj / JSON3.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when encoding a PNG image as JSON

christopher-dG opened this issue · comments

I'm trying to encode an image as part of a JSON payload, and JSON3 doesn't seem to like it very much. With JSON.jl, it works fine.

julia> using JSON3

julia> s = read("test.png", String);

julia> JSON3.write(s)
ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getindex at ./array.jl:811 [inlined]
 [2] getindex at ./multidimensional.jl:557 [inlined]
 [3] #write#60 at /home/degraafc/.local/share/julia/packages/JSON3/AtAHl/src/write.jl:242 [inlined]
 [4] write at /home/degraafc/.local/share/julia/packages/JSON3/AtAHl/src/write.jl:236 [inlined]
 [5] write(::String; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/degraafc/.local/share/julia/packages/JSON3/AtAHl/src/write.jl:24
 [6] write(::String) at /home/degraafc/.local/share/julia/packages/JSON3/AtAHl/src/write.jl:22
 [7] top-level scope at REPL[3]:1

Here's the image:
test