dwmkerr / node-imagemagick-cli

Access the ImageMagick CLI tools from Node. No dependencies, cross-platform, with support for ImageMagick 6 and 7.
8 stars 2 forks source link

fix(exec): add support for ImageMagick 7.0.1-Q16 #27

Closed RaschidJFR closed 4 years ago

RaschidJFR commented 5 years ago

Command $ convert conflics with C:\windows\system32\conver.exe so to run image magic you must now use $ magick convert <args>.

dwmkerr commented 5 years ago

Hi @RaschidJFR it looks like the tests fail here. There is actually already a fix in place for the Windows convert issue:

https://github.com/dwmkerr/node-imagemagick-cli/blob/master/src/pick-cli.js#L11

If you see here, what the code will try and do is prefer a convert executable in a folder which has ImageMagick in the name; meaning the System32 one should not be picked. But I guess your convert executable is in a different location.

Can you let me know the full path of your imagemagick binaries?

RaschidJFR commented 5 years ago

Hey @dwmkerr, so I found out that the problem is that version 7.0.1-Q16 no longer includes convert.exe (I don't know if any other executables too, I'm just getting familiar with it) and the default installation path looks like its now C:\\Program Files\\ImageMagick-7.0.9-Q16\\magick.exe (at least that's where it installed on my PC with default settings). Check this out.

So I modified the code to do where magick if the previous where <some-cli> returns a path wihout ImageMagic/ in it.

The code is now working and the tests also work when not using sandbox.stub (it means the tests will work on an actual windows PC with an actual ImageMagic installation). Again, i'm not very familiar with mocha so I just commented one of the tests, maybe you could have a look a it.

RaschidJFR commented 4 years ago

Hey @dwmkerr did you have a chance to look at the new-version problem?

In the newer versions, the executable “convert.exe” is missing. its functionality has been merged into “magick.exe”.

That's what I'm addressing here.

dwmkerr commented 4 years ago

Hey @RaschidJFR, struggling to get this working on my side too! I've pushed the work I've done tonight, will keep on it but might have to wait for another evening to try and get that test working. At least only one fails now, even if they are all enabled

RaschidJFR commented 4 years ago

Ok, great. Sorry I'm not very useful on the mocha tests. Let me know if there's anything else I can help you with.