'Unable to Parse' error using Freds Pagecurl script

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
lotustwincam
Posts: 2
Joined: 2019-10-08T17:05:08-07:00
Authentication code: 1152

'Unable to Parse' error using Freds Pagecurl script

Post by lotustwincam » 2019-10-08T17:16:41-07:00

I get the following error using Freds Pagecurl script:

$ pagecurl 1.png 2.png
convert.exe: unable to parse expression `os(pi*47.7278/180)' @ error/fx.c/FxGetSymbol/1868.

Other scripts such as Mottle run fine.

Configuration:
Imagemagick 7.0.6-Q16
Cygwin (bc package is installed)
Windows 7

thanks in advance for any help.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 'Unable to Parse' error using Freds Pagecurl script

Post by fmw42 » 2019-10-08T17:41:14-07:00

My scripts do not work on Windows unless you are using Windows 10 Unix or install Cygwin. They are bash unix scripts. So you must make the call from a Cygwin Bash window and use convert, not convert.exe.

The error is from an fx computation. So bc is not involved. I have no idea why the fx computation would fail other than your wrong command.

See
http://im.snibgo.com/cygwin.htm
https://www.imagemagick.org/discourse-s ... 30#p113836

With IM 7 use magick not convert.

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: 'Unable to Parse' error using Freds Pagecurl script

Post by magick » 2019-10-08T17:45:02-07:00

This statement does not grok:

Code: Select all

convert xc: -format "%[fx:($p3x)cos(pi*$angle/180)-($p3y+$len)sin(pi*$angle/180)+$x1]" info:
instead it likely should be

Code: Select all

convert xc: -format "%[fx:($p3x)*cos(pi*$angle/180)-($p3y+$len)*sin(pi*$angle/180)+$x1]" info:
Its possible older versions of the parser assumed an implicit multiply but recent releases have a more pedantic parser.

Fred will likely update the script with this patch within a few days.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 'Unable to Parse' error using Freds Pagecurl script

Post by fmw42 » 2019-10-08T17:50:59-07:00

I found a bug and have fixed it. So download it and try again.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 'Unable to Parse' error using Freds Pagecurl script

Post by fmw42 » 2019-10-08T17:51:57-07:00

Magick pointed it out just as I was posting my last message. That was indeed the bug.

lotustwincam
Posts: 2
Joined: 2019-10-08T17:05:08-07:00
Authentication code: 1152

Re: 'Unable to Parse' error using Freds Pagecurl script

Post by lotustwincam » 2019-10-08T18:21:37-07:00

fmw42:

Thanks for the quick reply. I had included my configuration details to show that I was running the script via Cygwin on a Windows 7 machine. I did mention that one of your other scripts (mottle) was working fine which suggested that my basic setup was ok.

magical:

Thanks also for the quick response. I updated the script as per your suggestion and working fine now.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 'Unable to Parse' error using Freds Pagecurl script

Post by fmw42 » 2019-10-08T18:33:07-07:00

I saw your comment. But I was originally confused by the .exe on convert.exe on the error message. I just wanted to be sure you were actually running it under Cygwin and not Windows.

Post Reply