Cannot execute commands containing -fx

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
hellocatfood
Posts: 40
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Cannot execute commands containing -fx

Post by hellocatfood » 2018-10-23T17:23:32-07:00

I'm attempting to use the fx command on an image. In particular I'm attempting to run the example from here: http://www.imagemagick.org/Usage/quantize/#diy_symbols

Input images:
[*] eyes.gif http://www.imagemagick.org/Usage/quantize/eyes.gif
[*] dpat_symbols.gif http://www.imagemagick.org/Usage/quanti ... ymbols.gif

Code: Select all

montage dpat_symbols.gif   -geometry +5+0 \
		  -tile x1 -background none -mattecolor blue  -frame 3 \
		  dpat_syms_images.gif
  convert eyes.gif -alpha off -colorspace sRGB -grayscale Average \
		  +matte -scale 1600% -negate  \
		  dpat_symbols.gif -virtual-pixel tile -fx 'u[floor(15.9999*u)+1]' \
		  eyes_syms.gif
When I run it I get the following error

Code: Select all

error: convert: no such image `u[floor(15.9999*u)+1]' @ error/fx.c/FxGetSymbol/1400.
It seems like ImageMagick is replacing the first ' with a ` (backtick) and it's trying to treat it as an image. I've tried this with some other commands using fx and I'm getting the same result.

I'm running ImageMagick 7.0.8-14 on Ubuntu 18.10.
Last edited by hellocatfood on 2018-10-24T02:04:24-07:00, edited 2 times in total.

snibgo
Posts: 10823
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cannot execute commands containing -fx

Post by snibgo » 2018-10-23T18:13:12-07:00

The inputs don't seem to be given on your link, so please post links to the files you are using.
snibgo's IM pages: im.snibgo.com

User avatar
hellocatfood
Posts: 40
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: Cannot execute commands containing -fx

Post by hellocatfood » 2018-10-24T02:04:58-07:00

snibgo wrote:
2018-10-23T18:13:12-07:00
The inputs don't seem to be given on your link, so please post links to the files you are using.
Post has been edited to link to input images.

snibgo
Posts: 10823
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cannot execute commands containing -fx

Post by snibgo » 2018-10-24T04:32:44-07:00

That second command works fine for me with IM v6.9.9-50 with bash on Cygwin under Windows 8.1.

With IM v7.0.7-28, replacing "convert" with "magick convert", it works fine.

With IM v7.0.7-28, replacing "convert" with "magick", it works fine although I get a warning that "+matte" is deprecated.

In "-fx", the expression "u[N]" where N is an integer refers to an image in the sequence, so a problem in there might result in a "no such image" error. But I copy-pasted your command, and used the file you linked to.

Sorry, I can't explain the error you get. Perhaps there is a recent bug in your 7.0.8-14.
snibgo's IM pages: im.snibgo.com

User avatar
hellocatfood
Posts: 40
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: Cannot execute commands containing -fx

Post by hellocatfood » 2018-11-08T15:10:37-07:00

Just tried this on a fresh install of Ubuntu 18.10 and still the problem occurs. I really can't tell where the problem lies.

User avatar
dlemstra
Posts: 1505
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Cannot execute commands containing -fx

Post by dlemstra » 2018-11-08T16:14:08-07:00

I cannot reproduce your issue with the latest version of ImageMagick 7 on Windows. What happens when you use double quotes instead of single quotes?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

User avatar
hellocatfood
Posts: 40
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: Cannot execute commands containing -fx

Post by hellocatfood » 2018-11-08T17:14:14-07:00

dlemstra wrote:
2018-11-08T16:14:08-07:00
I cannot reproduce your issue with the latest version of ImageMagick 7 on Windows. What happens when you use double quotes instead of single quotes?
Still the same error. I'm guessing this error is specific to Linux/Ubuntu Linux but I can't figure out what could be causing it.

User avatar
hellocatfood
Posts: 40
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: Cannot execute commands containing -fx

Post by hellocatfood » 2018-11-10T13:12:24-07:00

I've tried a few things and it seems that, at least on Linux, the issue with that one specific command is the "+1". If I run the following command it seems to work (or at least not crash).

Code: Select all

'u[floor(15.9999*u)]'
Still no idea why this exists on Ubuntu/Linux and not other OS's.

Post Reply