JuliaIO / ImageMagick.jl

Thin Wrapper for the library ImageMagick
Other
53 stars 37 forks source link

Reading from an IOBuffer broke in 1.11 #231

Open KristofferC opened 4 months ago

KristofferC commented 4 months ago

The implementation of the IOBuffer reading (https://github.com/JuliaIO/ImageMagick.jl/pull/180) uses the internal .data field and no longer works:

Reading from an IOBuffer (issue https://github.com/JuliaIO/FileIO.jl/issues/174): Error During Test at /home/pkgeval/.julia/packages/ImageMagick/iVjQq/test/constructed_images.jl:233
  Got exception outside of a @test
  MethodError: no method matching readimage(::MagickWand, ::Memory{UInt8})
  The function `readimage` exists, but no method is defined for this combination of argument types.

  Closest candidates are:
    readimage(::MagickWand, !Matched::IOBuffer)
     @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/libmagickwand.jl:290
    readimage(::MagickWand, !Matched::Vector{UInt8})
     @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/libmagickwand.jl:284
    readimage(::MagickWand, !Matched::IO)
     @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/libmagickwand.jl:278
    ...

  Stacktrace:
    [1] readimage(wand::MagickWand, stream::IOBuffer)
      @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/libmagickwand.jl:290
    [2] load_(file::IOBuffer, permute_horizontal::Bool; ImageType::Type, extraprop::String, extrapropertynames::Nothing, view::Bool)
      @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/ImageMagick.jl:145
    [3] load_(file::IOBuffer, permute_horizontal::Bool)
      @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/ImageMagick.jl:137
    [4] load(::IOBuffer; key_args::@Kwargs{})
      @ ImageMagick ~/.julia/packages/ImageMagick/iVjQq/src/ImageMagick.jl:130

Also, I think this implementation is buggy since it doesn't consider e.g. the position of the IOBuffer.