Skip to content
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

Windows installation #87

Closed
simonflick opened this issue May 13, 2016 · 12 comments
Closed

Windows installation #87

simonflick opened this issue May 13, 2016 · 12 comments

Comments

@simonflick
Copy link

Could you add installation instructions for Windows?
I'm new to this and tried installing it like go-sdl2 but I always get ERROR_MISSING_DELEGATE: NoDecodeDelegateForThisImageFormat 'JPEG' when opening images. Here is how I installed it:

  • pacman -S mingw-w64-x86_64-imagemagick using MSYS2 Shell
  • go get gopkg.in/gographics/imagick.v2/imagick using CMD
  • got error that "pkg-config.exe" was not found so I downloaded it and added it to PATH (https://sourceforge.net/projects/pkgconfiglite/files/)
  • tried go get again and it worked

GetVersion() shows ImageMagick 6.9.3-7 Q16 x86_64 2016-04-05 http://www.imagemagick.org and using ImageMagick via CMD like this works perfect: convert test.png test.jpg

@justinfx
Copy link
Member

Are these working instructions? I'm happy to add them if they are. I don't
use Windows so I can't personally confirm a Windows install process. It
would need to be contributed by windows users.

On Sat, 14 May 2016 3:46 AM Dampfnudeln notifications@github.com wrote:

Could you add installation instructions for Windows?
I'm new to this and tried installing it like go-sdl2 but I always get ERROR_MISSING_DELEGATE:
NoDecodeDelegateForThisImageFormat 'JPEG' when opening images. Here is
how I installed it:

  • pacman -S mingw-w64-x86_64-imagemagick using MSYS2 Shell
  • go get gopkg.in/gographics/imagick.v2/imagick using CMD
  • got error that "pkg-config.exe" was not found so I downloaded it and
    added it to PATH (https://sourceforge.net/projects/pkgconfiglite/files/
    )
  • tried go get again and it worked

GetVersion() shows ImageMagick 6.9.3-7 Q16 x86_64 2016-04-05
http://www.imagemagick.org and using ImageMagick via CMD like this works
perfect: convert test.png test.jpg


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#87

@simonflick
Copy link
Author

ImageMagick canot load any images because of ERROR_MISSING_DELEGATE: NoDecodeDelegateForThisImageFormat 'JPEG'. But I'm not sure if this is caused by the way I installed it. I hope someone can contribute clear installation instructions for Windows.

@justinfx
Copy link
Member

As far as I can tell, this wouldn't be related to the imagick bindings. It looks like your install of ImageMagick is missing plugin support for various image formats (jpg in this particular case).

@justinfx
Copy link
Member

Actually I saw that you said convert tool works fine. Do you have multiple installs of ImageMagick? I dont know what might be required in a Windows environment to make Imagemagick find the location of the encoders/decoders

@simonflick
Copy link
Author

I have only one installation. The first command downloads ImageMagick and at the same place you can find the binaries. The convert tool I used was in that folder. My test program also failed to load a PNG image. Here is the source code:

package main

import (
    "gopkg.in/gographics/imagick.v2/imagick"
)

func main() {
    imagick.Initialize()
    defer imagick.Terminate()

    wand := imagick.NewMagickWand()

    err := wand.ReadImage("test.jpg")
    if err != nil {
        panic(err)
    }
}

I don't know anything about building c-projects but maybe cgo is missing some flags that tell it to include all the other third-party libraries?

@justinfx
Copy link
Member

Did you ever figure this out?

@vprus
Copy link

vprus commented Sep 5, 2016

I could get Imagick to build, using the following procedure:

Alternative 1:

  • Open a shell where gcc is available, msys shell is used below, but cmd.exe works too
  • Run this:
$ export CGO_CFLAGS="-I/c/temp/gcc/msys64/mingw64/include/ImageMagick-6/ -D MAGICKCORE_QUANTUM_DEPTH=16 -D MAGICKCORE_HDRI_ENABLE=1 -Wno-deprecated"
$ export CGO_LDFLAGS="-L/c/temp/gcc/msys64/mingw64/lib -lMagickCore-6.Q16HDRI -lMagickWand-6.Q16HDRI"
$ go build -tags "dev no_pkgconfig" gopkg.in/gographics/imagick.v1/imagick

Alternative 2:

  • Get pkg-config-lite from https://sourceforge.net/projects/pkgconfiglite/files
  • Open a shell that has gcc in PATH
  • Set PATH to include pkg-config-lite binaries
  • Set PKG_CONFIG_PATH to /c/temp/gcc/msys64/mingw64/lib/pkgconfig
  • Build with 'go build gopkg.in/gographics/imagick.v2/imagick'

Now, while both alternative appear to work, building code that uses imagick go package makes the go command eventually die with error 0xC0000135, so I must be doing something wrong.

@vprus
Copy link

vprus commented Sep 6, 2016

When using gcc from msys, everything works fine, so the full procedure is:

set PATH=C:/Temp/gcc/msys64/mingw64/bin;%PATH%
set PKG_CONFIG_PATH=C:/Temp/gcc/msys64/mingw64/lib/pkgconfig
go build gopkg.in/gographics/imagick.v2/imagick

@justinfx
Copy link
Member

justinfx commented Sep 6, 2016

Thanks for this info. I can add it to the main README

@itsnotvalid
Copy link

itsnotvalid commented Sep 15, 2016

Just one problem, that MSYS2 is now giving version 7 of imagemagick, so this becomes completely broken.

Instead, one now needs to download v6 packages from msys2 repo manually, and then install it:

wget http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-imagemagick-6.9.3.7-1-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-imagemagick-6.9.3.7-1-any.pkg.tar.xz

@justinfx
Copy link
Member

Well thats a shame. Would you be able to submit a PR with the corrected README for windows instructions?

@vprus
Copy link

vprus commented Sep 16, 2016

That is unfortunate, the instructions worked for me a few days ago, but possibly I had older msys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants