IM7 "label:" and FX expressions with Windows 10

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
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

IM7 "label:" and FX expressions with Windows 10

Post by GeeMack »

Using IM 7.0.7-30 Q16 x64 HDRI from Windows 10 command line, this command...

Code: Select all

magick label:"%[fx:1]" test1.png
... produces this error message and no image...

Code: Select all

magick: no images for write '-write' 'test1.png' at CLI arg 2 @ error/operation.c/CLINoImageOperator/4792.


This command...

Code: Select all

magick -pointsize 50 -background pink label:"ABC %[fx:1] 123" test2.png
... produces this image...

Image

It seems to just stop creating the label when it hits the FX expression.

As described at THIS link, I've always understood FX expressions are supposed to be parsed when creating a "label:".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7 "label:" and FX expressions with Windows 10

Post by fmw42 »

fx expression work with -label. -label is not the same as label:. I am not sure label: allows direct fx expression evaluation. The developers will need to provide a definitive answer.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: IM7 "label:" and FX expressions with Windows 10

Post by snibgo »

GeeMack's examples work fine for me with IM v7.0.7-28 on Windows 8.1. The %[fx:] expression can be more than a simple number:

Code: Select all

magick -pointsize 50 -background pink label:"ABC%[fx:1/7]DEF" fxlabel.png
Image

EDIT to add: it also works on v6.9.5-3 and v6.9.9.40.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7 "label:" and FX expressions with Windows 10

Post by fmw42 »

This fails for me on IM 7.0.7.29 Q16 Mac OSX

Code: Select all

magick -size 100x -background white label:"%[fx:1]" test1.png
magick: no images for write '-write' 'test1.png' at CLI arg 6 @ error/operation.c/CLINoImageOperator/4792.

Snibgo's command

Code: Select all

magick -pointsize 50 -background pink label:"ABC%[fx:1/7]DEF" fxlabel.png
just shows the image, ABC
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM7 "label:" and FX expressions with Windows 10

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: IM7 "label:" and FX expressions with Windows 10

Post by GeeMack »

This issue appears to be resolved in IM 7.0.7-32. Thanks!
Post Reply