JuliaIO / ImageMagick.jl

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

UndefVarError: libwand not defined on Julia 1.7 macOS ARM (M-series Processor) but not earlier Intel versions #209

Closed disleyland closed 8 months ago

disleyland commented 2 years ago

I'm getting this undefvarerror on using ImageMagick, and it is only happening on Julia 1.7 ARM version, not the Julia 1.6.3 Intel version also running on the same computer.

InitError: UndefVarError: libwand not defined Stacktrace: [1] magickgenesis   @ ~/.julia/packages/ImageMagick/Fh2BX/src/libmagickwand.jl:21 [inlined] [2] init()   @ ImageMagick ~/.julia/packages/ImageMagick/Fh2BX/src/libmagickwand.jl:27 [3] _include_from_serialized(path::String, depmods::Vector{Any}) @ Base ./loading.jl:768   [4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String) @ Base ./loading.jl:854 [5] _require(pkg::Base.PkgId) @ Base ./loading.jl:1097 [6] require(uuidkey::Base.PkgId) @ Base ./loading.jl:1013 [7] require(into::Module, mod::Symbol)   @ Base ./loading.jl:997 during initialization of module ImageMagic 

delnatan commented 2 years ago

I had the same issue on a Macbook air M1 using Julia 1.7.1 (installed via homebrew). I checked the version of ImageMagick_jll and it was 6.9.10. I checked

https://github.com/JuliaBinaryWrappers/ImageMagick_jll.jl/tree/main/src/wrappers

and it seems that the latest version has wrapped 'aarch64-apple-darwin'. Maybe 6.9.10 didn't have this?

Updating the ImageMagick_jll seems to solve the problem for me. In package mode I ran add ImageMagick_jll@6.9.12.

tpolakovic commented 2 years ago

Updating the ImageMagick_jll seems to solve the problem for me. In package mode I ran add ImageMagick_jll@6.9.12.

Unfortunately, the problem resurfaced and now it fails also with 6.9.12.

fonsp commented 2 years ago

I had this problem on:

ImageMagick_jll v6.9.10-12+3
ImageMagick v1.2.2
---
julia> versioninfo()
Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.2.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)

julia> Sys.ARCH
:aarch64
johnnychen94 commented 2 years ago

There are still a few cases that we need ImageMagick.jl, but we might eventually sunset this package in favor of ImageIO; if everything moves smoothly we'll have a GSoC project adding three more formats to ImageIO: https://github.com/JuliaImages/Images.jl/discussions/1000

disleyland commented 2 years ago

is a "readblob" implementation one of those few cases where ImageMagick.jl is needed? Or is there an alternative route for saving a blob (in the form of a Vector{UInt8}) as a file via FileIO?

fonsp commented 1 year ago

Here is a notebook file to reproduce the problem:

https://github.com/mitmath/18S191/blob/0fa05bea7acb616c85547be24e3292afe8ed4097/src/week1/abstraction.jl

casasgomezuribarri commented 9 months ago

I see this issue is closed, but I'm confused about how to solve this problem. I need ImageMagick to save a vector of plots as a GIF (FileIO asked for QuartzImageIO, which asked for ImageMagick). Is there any way of saving as .gif without having to use ImageMagick?

NB: The error only appears the first time I run using ImageMagick. If I run it again the issue does not appear and everything works... It's just a bit annoying

ViralBShah commented 9 months ago

Let's leave it open until fully resolved.

ViralBShah commented 8 months ago

Fixed in 1.3.1