textdeskew: 190: syntax error

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
chouchou_u
Posts: 3
Joined: 2018-03-27T09:30:59-07:00
Authentication code: 1152

textdeskew: 190: syntax error

Post by chouchou_u » 2018-03-27T09:37:48-07:00

Hello. I have gotten textdeskew script and can't run it because of the following error:

Code: Select all

textdeskew: 190: textdeskew: Syntax error: "(" unexpected (expecting "}")
Changing the internal argument

Code: Select all

debug="true"
doesn't tell more about the problem.
Cheers.

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

Re: textdeskew: 190: syntax error

Post by fmw42 » 2018-03-27T10:11:07-07:00

Please post your input image, and tell us your version of Imagemagick and your OS.

Have you installed FFTW delegate?

Do you have AWK installed on your system?

chouchou_u
Posts: 3
Joined: 2018-03-27T09:30:59-07:00
Authentication code: 1152

Re: textdeskew: 190: syntax error

Post by chouchou_u » 2018-03-28T05:31:17-07:00

Hello. The sample image is here: https://postimg.org/image/ti3gc8c2l/.
My version of Imagemagick is

Code: Select all

~$ convert -version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
It seems FFTW delegate is mentioned here.
My OS is

Code: Select all

~$ uname -m && uname -r && cat /etc/*release 
x86_64
4.13.0-37-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
AWK is also present

Code: Select all

~$ gawk --version
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)
Copyright (C) 1989, 1991-2015 Free Software Foundation.
I have installed FFTW 3.3.7 through their official installation guide and on

Code: Select all

make check
along the lines I have received

Code: Select all

--------------------------------------------------------------
         FFTW transforms passed basic tests!
--------------------------------------------------------------

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

Re: textdeskew: 190: syntax error

Post by fmw42 » 2018-03-28T09:52:57-07:00

Your image works fine for me with no errors. However, please note that curved text will not be straightened. Have you tried one of my examples? Does it fail? Try https://betanews.com/wp-content/uploads ... 7x1024.png

I can only think that your version of AWK behaves differently to mine, since that is the line you reference. I am testing on a Mac. If one of my test images fails for you, I can try including some debugging code and send you the special version. You can run it and then tell me what messages you get. Perhaps I can track it down.

Let me know. Email me to fmw at alink dot net

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

Re: textdeskew: 190: syntax error

Post by snibgo » 2018-03-28T11:15:54-07:00

chouchou_u wrote:gawk
I suppose Fred's script calls "awk", not "gawk".
snibgo's IM pages: im.snibgo.com

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

Re: textdeskew: 190: syntax error

Post by fmw42 » 2018-03-28T12:20:55-07:00

snibgo wrote:
2018-03-28T11:15:54-07:00
chouchou_u wrote:gawk
I suppose Fred's script calls "awk", not "gawk".
Good point, snibgo. I overlooked that. Thanks. Yes, my scripts use AWK not GAWK. I do not know how different they are. Though a Google search indicates that GAWK should be compatible with AWK. But I have no experience with GAWK.

chouchou_u
Posts: 3
Joined: 2018-03-27T09:30:59-07:00
Authentication code: 1152

Re: textdeskew: 190: syntax error

Post by chouchou_u » 2018-03-29T02:13:59-07:00

The compatibility of AWK/GAWK is up to the point that

Code: Select all

~$ awk -V
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)
Copyright (C) 1989, 1991-2015 Free Software Foundation.
It's the same output as from GAWK.
And I seem to be able to call awk:

Code: Select all

~$ awk
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
Thank you all for the answers. I'll write to the email mentioned.

shafiq4apps
Posts: 1
Joined: 2018-07-19T08:52:32-07:00
Authentication code: 1152

Re: textdeskew: 190: syntax error

Post by shafiq4apps » 2018-07-19T09:00:34-07:00

i had the same issue while running it as "sh ./textcleaner" removing the sh fixed it just run ./textcleaner

Post Reply