-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageMagick_jll v6.9.12-0 is breaking for PNG and TIFF #206
Comments
The current ImageMagick version for Julia >= 1.3 is a bit broken for PNG files because the built ImageMagick_jll is broken. JuliaIO/ImageMagick.jl#206 This commit work arounds this bug by adding ImageIO dependency. Because ImageIO has higher priority in the FileIO registry, it will use the PNGFiles to load the data instead of using the broken ImageMagick.
The current ImageMagick version for Julia >= 1.3 is a bit broken for PNG files because the built ImageMagick_jll is broken. JuliaIO/ImageMagick.jl#206 This commit work arounds this bug by adding ImageIO dependency. Because ImageIO has higher priority in the FileIO registry, it will use the PNGFiles to load the data instead of using the broken ImageMagick.
It turns out this version also breaks TIFF loading: julia> using ImageMagick, TestImages
julia> filepath = testimage("camera", download_only=true)
"/Users/jc/.julia/artifacts/e752bdc739f34d02e79c7fa834bc2f2e0d71c7e0/cameraman.tif"
julia> ImageMagick.load(filepath)
ERROR: /Users/jc/.julia/artifacts/e752bdc739f34d02e79c7fa834bc2f2e0d71c7e0/cameraman.tif: Null count for "Tag 34022" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/540
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] error(wand::MagickWand)
@ ImageMagick ~/.julia/packages/ImageMagick/b8swT/src/libmagickwand.jl:187
[3] readimage
@ ~/.julia/packages/ImageMagick/b8swT/src/libmagickwand.jl:274 [inlined]
[4] load_(file::String, permute_horizontal::Bool; ImageType::Type, extraprop::String, extrapropertynames::Nothing, view::Bool)
@ ImageMagick ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:146
[5] load_ (repeats 2 times)
@ ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:139 [inlined]
[6] #load#30
@ ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:126 [inlined]
[7] load(::String)
@ ImageMagick ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:126
[8] top-level scope
@ REPL[8]:1 @staticfloat if possible, could you help investigate this? |
This work arounds the ImageMagick bug in JuliaIO/ImageMagick.jl#206
This work arounds the ImageMagick bug in JuliaIO/ImageMagick.jl#206
This commit works around the ImageMagick bug JuliaIO/ImageMagick.jl#206
This commit works around the ImageMagick bug JuliaIO/ImageMagick.jl#206
FYI: bisected the test failures to ImageMagick/ImageMagick6@a1a71cb Edit: TIFF loading is a separate issue unfortunately, so simply reverting that commit is not enough |
should also fix JuliaIO#158
should also fix JuliaIO#158
The PNG stuff here seems to work correctly now with ImageMagick 6.9.12. The TIFF stuff still has the same error. There's also 6.9.13 upstream, which perhaps fixes the TIFF issue. Is that worth trying? On M1, the bigger issue is that 6.9.10 is too old and doesn't work at all. |
bump ImageMagick_jll, add test for #206
I simply tried diff --git a/Project.toml b/Project.toml
index 9e47aa8..fb6cacf 100644
--- a/Project.toml
+++ b/Project.toml
@@ -11,7 +11,7 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[compat]
FileIO = "1"
ImageCore = "0.9, 0.10"
-ImageMagick_jll = "= 6.9.11"
+ImageMagick_jll = "= 6.9.13"
julia = "1.6"
[extras] but I still get
For the record, our ImageMagick_jll@6.9.13 currently corresponds to upstream version 6.9.13-6: https://github.com/JuliaPackaging/Yggdrasil/blob/24010c93241559f44b967496e65782a9d18729f0/I/ImageMagick/ImageMagick%406/build_tarballs.jl#L5. I guess someone will have to report the issue upstream with a C reproducer, otherwise no one will look into this. |
Actually, this seems to be ImageMagick/ImageMagick#2015, which is apparently a bug in libtiff, still open: https://gitlab.com/libtiff/libtiff/-/issues/110. ImageMagick/ImageMagick#2015 (comment) suggests
Maybe we can do something similar? What's |
I have the same problem. I decided to upgrade But that had no effect. On an old test server I have |
Is it possible that PNGFiles.jl is doing something that is non-standard or buggy that is leading to this issue? For example: JuliaIO/PNGFiles.jl#48 |
Okay, there are two different issues here. The start of the issue was the PNG file breaking. Then it also moved to include the TIFF file breaking. On the new main version that I updated to ImageMagick 7.1, it fixes the PNG file issue. But leaves the TIFF file issue. |
Notes on the tiff issue: https://imagemagick.org/discourse-server/viewtopic.php?t=36263 https://gitlab.com/libtiff/libtiff/-/issues/532 https://stackoverflow.com/questions/64239390/imagemagick-identify-fails-for-tiff-files So this seems to be a recurring issues for ImageMagick and libtiff. My plan at the moment is to make a list of these tags and just setup the ImageMagick reader to ignore them. This should broadly work. They aren't 'file supported' |
Addressed in 1411a8a |
Closing since we are now on ImageMagick 7 on master. |
using ImageMagick_jll v6.9.12-0 (JuliaPackaging/Yggdrasil#3424):
If reverted to
ImageMagick_jll@6.9.10-12+3
, it is:cc: @staticfloat @timholy
The text was updated successfully, but these errors were encountered: