Webreaper / Damselfly

Damselfly is a server-based Photograph Management app. The goal of Damselfly is to index an extremely large collection of images, and allow easy search and retrieval of those images, using metadata such as the IPTC keyword tags, as well as the folder and file names. Damselfly includes support for object/face detection.
GNU General Public License v3.0
1.45k stars 76 forks source link

ImageMagick not found #502

Closed sreerajp closed 9 months ago

sreerajp commented 10 months ago

ImageMagick not found is being shown while starting Damselfly server in Windows. ImageMagick is already installed. If we run the command "convert --version" the exitcode is 4.

Please fix

Webreaper commented 10 months ago

Hi,

If ImageMagick is in the path, Damselfly will find it. If not, there's nothing I can do.

Sorry I can't be of more help.

sreerajp commented 10 months ago

ImageMagick is in path. But in your code you are checking for exitcode 0. It is returning exit code 4

sreerajp commented 10 months ago

image

image

image

Code for Test.exe namespace Test { class Program { private const string imageMagickExe = "convert"; static void Main(string[] args) {

        var process = new Process();

        process.StartInfo.FileName = imageMagickExe;
        process.StartInfo.Arguments = "-version";
        process.StartInfo.RedirectStandardError = false;
        process.StartInfo.RedirectStandardOutput = true;
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.CreateNoWindow = true;

        var success = process.Start();

        if (success)
        {
            process.WaitForExit();

            Console.WriteLine("Success: " + process.ExitCode);
        }
        else {
            Console.WriteLine("Failure");

        }

    }
}

}

Webreaper commented 10 months ago

According to SO, it looks like error code 4 is happening because a convert.exe command that isn't ImageMagick is being executed.

https://stackoverflow.com/questions/50582885/imagemagick-convert-command-returning-error-code-4-when-used-with-php

So I suspect the answer is to move the PATH entry for ImageMagick nearer to the start of the path. Either that, or copy convert.exe into the folder that Damselfly runs from.

I could add an option to explicitly specify the IM path, but

  1. It's not really high on my list of priorities for Damselfly. I need to get image editing working, and face recognition up and running again.
  2. It would have to be Windows-only, and I don't really want to add OS specific logic.
  3. I only really support docker installations (as specified in the documentation) otherwise I'd spend my life trying to fix people's windows install issues, and I have little enough time to work on Damselfly as it is.

Sorry I can't help more.

If this is for HEIC support, I have a recently opened issue to handle that natively, rather than using ImageMagick. I'm far more likely to work on that. https://github.com/Webreaper/Damselfly/issues/479