Closed apocelipes closed 4 months ago
convert is marked as deprecated since ImageMagick7, and now calling "convert" will get a noisy warning message:
WARNING: The convert command is deprecated in IMv7, use "magick"
My version of ImageMagick: ImageMagick 7.1.1-33 Q16-HDRI x86_64 22263 https://imagemagick.org
ImageMagick 7.1.1-33 Q16-HDRI x86_64 22263 https://imagemagick.org
This warning can be avoided by using magick whenever possible.
On Windows, CImg will use magick firstly:
if (win_searchpath("magick.exe",s_path,s_path._width)) path_found = true;
I think the same strategy should be used on Linux as well.
I'd like to add a helper function to find if a command is in the $PATH and use magick whenever possible, the code looks like this:
$PATH
std::strcpy(s_path,"./magick"); if ((file=cimg::std_fopen(s_path,"r"))!=0) { cimg::fclose(file); path_found = true; } if (!path_found) { std::strcpy(s_path,"./convert"); if ((file=cimg::std_fopen(s_path,"r"))!=0) { cimg::fclose(file); path_found = true; } } + if (!path_found) { + std::strcpy(s_path, "magick"); + if (posix_searchpath("magick")) path_found = true; + } if (!path_found) std::strcpy(s_path,"convert");
If we cannot find "magick", we will fall back to "convert". The full code can be seen in the associated PR.
convert is marked as deprecated since ImageMagick7, and now calling "convert" will get a noisy warning message:
My version of ImageMagick:
ImageMagick 7.1.1-33 Q16-HDRI x86_64 22263 https://imagemagick.org
This warning can be avoided by using magick whenever possible.
On Windows, CImg will use magick firstly:
I think the same strategy should be used on Linux as well.
I'd like to add a helper function to find if a command is in the
$PATH
and use magick whenever possible, the code looks like this:If we cannot find "magick", we will fall back to "convert". The full code can be seen in the associated PR.