ImageMagick.jl icon indicating copy to clipboard operation
ImageMagick.jl copied to clipboard

Reading from an IOBuffer broke in 1.11

Open KristofferC opened this issue 1 year ago • 0 comments

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.

KristofferC avatar Apr 22 '24 08:04 KristofferC