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

Error reading input image: ERROR_MISSING_DELEGATE: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/746 exit status 1 #330

Closed
nonesubham opened this issue Dec 19, 2024 · 4 comments

Comments

@nonesubham
Copy link

nonesubham commented Dec 19, 2024

I am trying to setup for Windows & followed each step as mentioned but still getting error :
Error reading input image: ERROR_MISSING_DELEGATE: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/746
exit status 1
here's go code

`package main

import (
"fmt"
"os"
"gopkg.in/gographics/imagick.v3/imagick"
)

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

// Create a new MagickWand
mw := imagick.NewMagickWand()

// Read the input JPG image
err := mw.ReadImage("C:\\Users\\mysel\\OneDrive\\Desktop\\test\\input.jpeg")
if err != nil {
    fmt.Println("Error reading input image:", err)
    os.Exit(1)
}

// Set the output format to PNG
err = mw.SetImageFormat("png")
if err != nil {
    fmt.Println("Error setting image format:", err)
    os.Exit(1)
}

// Write the output PNG image
err = mw.WriteImage("output.png")
if err != nil {
    fmt.Println("Error writing output image:", err)
    os.Exit(1)
}

fmt.Println("Image converted successfully!")

}`

@nonesubham nonesubham changed the title Getting Error gopkg.in/gographics/imagick.v3/imagick: exec: "pkg-config": executable file not found in %PATH% Error reading input image: ERROR_MISSING_DELEGATE: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/746 exit status 1 Dec 19, 2024
@justinfx
Copy link
Member

Seems like your build of ImageMagick is missing the libjpeg delegate.

@nonesubham
Copy link
Author

Seems like your build of ImageMagick is missing the libjpeg delegate.

If you have some spare time, could you please provide detailed instructions for setting up ImageMagick for Go on Windows? I followed every step outlined in the README but am still encountering an error. Additionally, I have another question: After building my Go project, will ImageMagick still need to be installed on the machine where I want to run the project, or will it be included in the build?

@justinfx
Copy link
Member

@nonesubham im not a windows user but I set up the CI pipeline based on original instructions provided by another windows user. So the steps in the readme and the ones in the github CI pipeline are the best current knowledge I have.
Yes, you will need to have ImageMagick installed on the target machine if you use dynamic linking. The Go binary will need to find those dll libraries. If you figure out how to static link, then you would not need to have to provide the external ImageMagick.

@justinfx
Copy link
Member

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

2 participants