I am trying to use TestImages.jl to load a .tif image, and running into an issue. The same issue occurs when I download the test image and try to open it with Images.jl and FileIO.jl. Images.jl and TestImages.jl claim that they require the OpenCV package.
With TestImages.jl:
julia> using TestImages
julia> mandril = testimage("mandril_gray.tif")
Errors encountered while load FileIO.File{FileIO.DataFormat{:TIFF}, String}("/home/matthew/.julia/artifacts/0fca6f56665d8dfa11bad924ab67e24e6fdbc0d7/mandril_gray.tif").
All errors:
===========================================
MethodError: no method matching load(::FileIO.File{FileIO.DataFormat{:TIFF}, String})
Closest candidates are:
load(::IO; kwargs...)
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:32
load(::FileIO.Stream{FileIO.DataFormat{:PPMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
load(::FileIO.Stream{FileIO.DataFormat{:PGMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
...
===========================================
/home/matthew/.julia/artifacts/0fca6f56665d8dfa11bad924ab67e24e6fdbc0d7/mandril_gray.tif: Null count for "Tag 34022" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/542
===========================================
ArgumentError: Package OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] is required but does not seem to be installed:
- Run `Pkg.instantiate()` to install all recorded dependencies.
===========================================
Fatal error:
ERROR: MethodError: no method matching load(::FileIO.File{FileIO.DataFormat{:TIFF}, String})
Closest candidates are:
load(::IO; kwargs...)
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:32
load(::FileIO.Stream{FileIO.DataFormat{:PPMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
load(::FileIO.Stream{FileIO.DataFormat{:PGMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
...
With Images.jl and FileIO.jl:
julia> using Images
julia> using FileIO
julia> data = load("/home/matthew/Downloads/mandril_gray.tif")
Errors encountered while load File{DataFormat{:TIFF}, String}("/home/matthew/Downloads/mandril_gray.tif").
All errors:
===========================================
MethodError: no method matching load(::File{DataFormat{:TIFF}, String})
Closest candidates are:
load(::IO; kwargs...)
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:32
load(::Stream{DataFormat{:PPMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
load(::Stream{DataFormat{:PGMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
...
===========================================
/home/matthew/Downloads/mandril_gray.tif: Null count for "Tag 34022" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/542
===========================================
ArgumentError: Package OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] is required but does not seem to be installed:
- Run `Pkg.instantiate()` to install all recorded dependencies.
===========================================
Fatal error:
ERROR: MethodError: no method matching load(::File{DataFormat{:TIFF}, String})
Closest candidates are:
load(::IO; kwargs...)
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:32
load(::Stream{DataFormat{:PPMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
load(::Stream{DataFormat{:PGMText}})
@ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:58
...
Based on a bit of internet research, it seems strange to me that Images.jl would depend on OpenCV just to open an image. What is going on here? I tried to install OpenCV.jl but ran into all kinds of issues with the C++ packages.
I am running Debian 12 on my system.