Version check fails on 'modern' ImageMagick versions #204
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Recent ImageMagick versions such as 7.1.1-33 (e.g. as available on Fedora 39) yield a deprecation warning like this, when invoking the
convert
command:Thus, the code in
for prog in ["convert", "compare", "identify"]:
try:
subprocess.check_call([prog] + ["-version"], stderr=subprocess.STDOUT)
globals()[prog.upper()] = [prog]
except subprocess.CalledProcessError:
globals()[prog.upper()] = ["magick", prog]
HAVE_IMAGEMAGICK_MODERN = True
HAVE_EXACT_CMYK8 = True
try:
ver = subprocess.check_output(CONVERT + ["-version"], stderr=subprocess.STDOUT)
m = re.fullmatch(
r"Version: ImageMagick ([0-9.]+-[0-9]+) .*", ver.split(b"\n")[0].decode("utf8")
)
if m is None:
HAVE_IMAGEMAGICK_MODERN = False
HAVE_EXACT_CMYK8 = False
else:
if parse_version(m.group(1)) < parse_version("6.9.10-12"):
HAVE_IMAGEMAGICK_MODERN = False
if parse_version(m.group(1)) < parse_version("7.1.0-48"):
HAVE_EXACT_CMYK8 = False
except FileNotFoundError:
HAVE_IMAGEMAGICK_MODERN = False
HAVE_EXACT_CMYK8 = False
except subprocess.CalledProcessError:
HAVE_IMAGEMAGICK_MODERN = False
HAVE_EXACT_CMYK8 = False
if not HAVE_IMAGEMAGICK_MODERN:
warnings.warn("imagemagick >= 6.9.10-12 not available, skipping certain checks...")
erroneously warns (and misidentifies the version) like this (on such systems, such as recent Fedora versions):
My quick fix for Fedora Rawhide:
Apparently, the whole ImageMagick convert situation is unnecessary complex and utterly confusing, cf. e.g.:
https://github.com/ImageMagick/ImageMagick/discussions/7366
AFAICS, note to myself, stuff like this doesn't qualify ImageMagick for new projects or continued personal usage ...