tlnagy / OMETIFF.jl

I/O operations for OME-TIFF files in Julia
Other
24 stars 7 forks source link

Error in loading some images from TestImages.jl #91

Closed a-r-n-o-l-d closed 2 years ago

a-r-n-o-l-d commented 2 years ago

I have some errors when I try to load some images from package TestImages.jl (I have the same output with ImageMagick.jl). It works with TiffImages.jl. Any idea why this happens?

julia> using TestImages

julia> using OMETIFF

julia> testimage("cameraman.tif")
Error encountered while loading "/home/afertin/.julia/artifacts/e752bdc739f34d02e79c7fa834bc2f2e0d71c7e0/cameraman.tif".

Fatal error:
ERROR: /home/afertin/.julia/artifacts/e752bdc739f34d02e79c7fa834bc2f2e0d71c7e0/cameraman.tif: Null count for "Tag 34022" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/540
Stacktrace:
 [1] handle_error(e::ErrorException, q::FileIO.File{FileIO.DataFormat{:TIFF}})
   @ FileIO ~/.julia/packages/FileIO/ZknoK/src/error_handling.jl:82
 [2] handle_exceptions(exceptions::Vector{Any}, action::String)
   @ FileIO ~/.julia/packages/FileIO/ZknoK/src/error_handling.jl:77
 [3] load(::FileIO.Formatted; options::Any)
   @ FileIO ~/.julia/packages/FileIO/ZknoK/src/loadsave.jl:186
 [4] load
   @ ~/.julia/packages/FileIO/ZknoK/src/loadsave.jl:166 [inlined]
 [5] #load#13
   @ ~/.julia/packages/FileIO/ZknoK/src/loadsave.jl:118 [inlined]
 [6] load
   @ ~/.julia/packages/FileIO/ZknoK/src/loadsave.jl:118 [inlined]
 [7] testimage(filename::String; download_only::Bool, ops::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ TestImages ~/.julia/packages/TestImages/C9XQF/src/TestImages.jl:100
 [8] testimage(filename::String)
   @ TestImages ~/.julia/packages/TestImages/C9XQF/src/TestImages.jl:92
 [9] top-level scope
   @ REPL[3]:1
tlnagy commented 2 years ago

I can't reproduce the problem. I made a new environment with OMETIFF and TestImages

(@v1.6) pkg> activate .                                                                                                                                       
  Activating new environment at `~/Downloads/211019_test/Project.toml`                                                                                        

(211019_test) pkg> add OMETIFF TestImages
~~~output snipped~~~

julia> using TestImages, OMETIFF

julia> testimage("cameraman.tif")
  Downloaded artifact: images
[ Info: Precompiling TiffImages [731e570b-9d59-4bfa-96dc-6df516fadf69]
512×512 Array{Gray{N0f8},2} with eltype ColorTypes.Gray{FixedPointNumbers.N0f8}:
~~~output snipped~~~

Everything seems to work as expected (Julia v1.6.3 on Ubuntu 21.04). Your error seems to suggest a broken install. Have you tried to make a new environment and install only OMETIFF and TestImages?

a-r-n-o-l-d commented 2 years ago

Thank you, it works in a new environment (Julia 16.3, Ubuntu 20.0 ). It seems, I have broken something in my main environment.

tlnagy commented 2 years ago

Cool! Glad you got it figured out.