msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.3k stars 1.22k forks source link

imagemagick : display not working #8994

Closed deb75 closed 2 years ago

deb75 commented 3 years ago

Hello,

On latest msys2/mingw64 system, in a mingw64 shell, when I invoke /mingw64/bin/display.exe image.png, I get the error :

display.exe: delegate library support not built-in '' (X11) @ error/display.c/DisplayImageCommand/1877.

I have downloaded window binaries from imagemagick website which are working.

So, what is the trouble here ? A wrong compilation option ?

Regards

revelator commented 3 years ago

looks like it is trying to use the X11 linux display driver ?. Does imagemagick even have win32 display driver support ?.

Biswa96 commented 3 years ago

@deb75 Which installer did you try from imagemagick website?

deb75 commented 3 years ago

On this page, I retrieved one of the imagemagick x64 portable zip archive, not sure which one, but they should all have the same behavior regarding this issue.

@revelator It seems, the imagemagick mingw64 package is not compiled with win32 support.

revelator commented 3 years ago

hmm if you got the cygwin archive it might have had x11 support but msys2 does not so it would be moot if that was the case. so a configure option might seem like it would do the trick.

revelator commented 3 years ago

wait a sec imagemagicks display is an x11 command -> https://imagemagick.org/script/display.php so it seems i guessed right :S we use an older version so maybe they fixed it in the later versions ? but forgot to update the wiki pages.

EDIT: display.exe does not even exist in the portable archive it seems huh ?!?

revelator commented 3 years ago

imdisplay seems to be an mfc application so not really suited to mingw64 builds which is lacking this sdk. not sure if it can be built using wxwidgets or qt still reading the source code.

revelator commented 3 years ago

Hmm cannot find the source for it in our imagemagick archive so it seems to be a recent addition. It does seem to work in much the same way as display.exe though so the executable could possibly be copied of from the portable version. Getting it to build with our buildchain is a tall order though, so im not sure if it will avaliable from us.

revelator commented 3 years ago

the source code is located here https://github.com/ImageMagick/VisualMagick for imdisplay. unfortunatly it does seem to be msvc only :(

revelator commented 3 years ago

the executable from the portable edition seems to work allright with our version so there is that possibility for people to toy with it ;) otherwise installing an X server like xming might actually let display.exe work ? feel free to test it out.

revelator commented 3 years ago

hmm while imdisplay can be used as a viewer it lacks certain functionality of display.exe antialiasing etc. still it is better than nothing. sadly it does not seem to work with an X server installed as display needs to be linked to the X runtime to take advantage of some of its functionality.

deb75 commented 3 years ago

Hi,

Thanks for digging into this issue.

Probably would it be good to remove display.exe from mingw64 package and replace it by imdisplay.exe ?

By the way, what do you mean by msvc only ? Does it refer to the build chain ? like mingw64 ?

Regards

revelator commented 3 years ago

imdisplay is an optional component which sadly only builds using msvc due to mingw lacking the MFC libraries. MFC could possibly be hacked to work with mingw but as it is licensed code only a user who bought the license for it may build it and he is not allowed to distribute the modified source code.

revelator commented 3 years ago

there is perhaps one thing that might help https://github.com/jtanx/fontforgebuilds though you would need an older version cause he recently shifted from the X mingw build to GTK3. The build script for compiling a mingw* X server should still be there though. This in turn would allow building X based applications that rely on linking to the X runtimes, though it would also make a wholly mess of our own GTK builds.

revelator commented 3 years ago

msvc = microsoft compiler so indeed ;)

revelator commented 3 years ago

using gimp as an image viewer for it might possibly be the best option as it has a lot more options than either the X display.exe or imdisplay.exe

marcelotduarte commented 3 years ago

I don't know if it helps, but apparently they test on MSYS2 because it has a PKGBUILD on https://github.com/ImageMagick/ImageMagick-Windows/blob/main/PKGBUILD (used here https://github.com/ImageMagick/ImageMagick/blob/main/.github/workflows/daily.yml#L123).

Biswa96 commented 2 years ago

The IMDisplay program can not be compiled with mingw toolchain due to absence of MFC support. See https://github.com/msys2/MINGW-packages/issues/8994#issuecomment-880618019