courtneypattison / gulp-jpeg-2000

A gulp plugin for converting images to JPEG 2000 (JP2) using ImageMagick
https://www.npmjs.com/package/gulp-jpeg-2000
MIT License
4 stars 2 forks source link

ImageMagick is not installed or an incompatible version is installed! #8

Open TiredFingers opened 3 years ago

TiredFingers commented 3 years ago

Hello, have following message when trying to convert images with gulp

ImageMagick is not installed or an incompatible version is installed!

Environment is: windows 10x64

I have version 7.1.0-2 Q16 x64 2021-06-25 installed Have 'convert' command in my cmd Installed IM with legacy tools

What can I do to fix this problem? Thanks

my gulp tusk is

function images() {
    return gulp
        .src('src/assets/images/**/*')
        .pipe(jp2())
        .pipe(
            $.if(
                PRODUCTION,
                $.imagemin([$.imagemin.jpegtran({ progressive: true })])
            )
        )
        .pipe(gulp.dest(PATHS.dist + '/assets/images'));
}

and error message

[15:40:07] 'images' errored after 1.29 s [15:40:07] Error in plugin "gulp-jpeg-2000" Message: ImageMagick is not installed or an incompatible version is installed! Installation instructions: https://git hub.com/courtneypattison/gulp-jpeg-2000 [15:40:07] 'build' errored after 1.3 s error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

courtneypattison commented 3 years ago

@TiredFingers Thank you so much for bringing this issue to my attention! Unfortunately, I don't have a Windows machine to debug the issue. If you look at the gulp-jpeg-2000 code, you can see that the error message you received happens when the result of $ convert -version is (error || !stdout || stdout.toString().toLowerCase().indexOf('imagemagick') === -1) i.e. there's an error, no standard output, or the standard output does not include the word imagemagick. What is the output you get when running $ convert -version in the same environment you're running your gulp task?

If you're comfortable with messing with node modules, you can go into your /node_modules and remove the error check here, then run the task again to see what error message you get. That condition check is really just to send people to the documentation to help troubleshoot ImageMagick installation problems if they have them.

If you look at the code, you'll probably notice that gulp-jpeg-2000 is just a thin wrapper on gulp-gm, so you could run your task using gulp-gm if you need a quick fix!

Thank you again for spending the time to create this issue!

TiredFingers commented 3 years ago

Thanks for the answer. Will try to fix it

courtneypattison commented 3 years ago

@TiredFingers Great! Please let me know how it goes :)

courtneypattison commented 3 years ago

Hey @TiredFingers! Did you manage to fix the issue?

TiredFingers commented 3 years ago

No sorry. A lot of work now

courtneypattison commented 3 years ago

No need to apologize! Thank you for letting me know :)