Commit Graph

273 Commits

Author SHA1 Message Date
Erik Auerswald fe272d21ef bump version number to 2.22.2
This "bug fix" release comprises documentation improvements only.
v2.22.2
2023-04-23 14:45:57 +02:00
Erik Auerswald 61721919cc man page: --ignore-pixels pertains to rows, too 2023-04-23 14:39:24 +02:00
Erik Auerswald d5b6c0852d man page: improve descriptions of -r, -m, -H, -W 2023-04-23 13:44:56 +02:00
Erik Auerswald ea8f724846 update copyright years 2023-04-23 12:53:48 +02:00
Erik Auerswald 320487e300 tweak alignment of some debug output 2023-04-23 12:50:02 +02:00
Erik Auerswald 9386643c60 improve help output
The height/width threshold used for recognizing a 1 did
mention this use.
2023-04-23 12:48:37 +02:00
Erik Auerswald f7098c6ff5 man page: add some information
* a general description of options and commands
* so far only the "crop" command changes image dimensions
2022-12-10 13:38:31 +01:00
Erik Auerswald 3ebd31d09d man page: tweak -s, --print-spaces description 2022-12-10 13:19:47 +01:00
Erik Auerswald 629ecd05f6 bump version number to 2.22.1 v2.22.1 2022-01-25 18:56:14 +01:00
Erik Auerswald 145c9f74cb Makefile: man page depends on defines.h for version number 2022-01-25 18:55:31 +01:00
Erik Auerswald b83610d7d2 update copyright year 2022-01-25 18:38:52 +01:00
Erik Auerswald 9709e55683 Makefile: use pkg-config without imlib2-config
Since I have used imlib2-config since "the beginning," I prefer
to keep it as long as it is available.  But for systems with a
newer Imlib2 version, a fallback to pkg-config is required.
2022-01-24 21:01:37 +01:00
Erik Auerswald bf4bc839f8 INSTALL: mention that pkg-config replaces imlib2-config
At least on still supported Debian and Ubuntu GNU/Linux systems,
both pkg-config and imlib2-config can be used to determine the
LDFLAGS needed to link against Imlib2.  Current upstream Imlib2
no longer provides imlib2-config, but only pkg-config data.
2022-01-24 20:50:29 +01:00
Erik Auerswald 643dbb85b0 INSTALL: remove "rman" from prerequisites
Since commit efded91c1d rman is
no longer used to convert the man page to HTML.
2022-01-24 20:48:47 +01:00
Erik Auerswald aa87a600d8 Merge pull request #16 from alexmyczko/master
fix typos
2021-11-10 19:38:33 +01:00
Alex Myczko 742c6816bf fix typos 2021-11-10 08:21:41 +01:00
Erik Auerswald 3b35bcace6 bump version number to 2.22.0 and make release v2.22.0 2021-11-07 12:29:33 +01:00
Erik Auerswald f2d86220ba remove trailing space from charset help output 2021-11-01 15:16:19 +01:00
Erik Auerswald 2ebe192fb2 add charset "tt_robot"
In 2017, I received a report of ssocr being used to interpret the
status display of some Chinese table tennis robot.  The user had
implemented character recognition in a Perl script that interpreted
the ASCII art segments in ssocr's debug output.

The new ssocr character set "tt_robot" implements the exact same
segment interpretations as found in the Perl script mentioned above.
This even includes two erroneous '7' definitions that work around
recognition problems.
2021-11-01 15:16:06 +01:00
Erik Auerswald c4491d1f98 add a NEWS file
I have taken the contents from the web page, adding dates from
"git log".
2021-11-01 13:51:18 +01:00
Erik Auerswald 0793da7bcb replace strncat() with memcpy()
GCC 10 warns about the use of strncat(), but accepts the equivalent
use of memcpy() without warning.

¯\_(ツ)_/¯
2021-10-26 20:54:14 +02:00
Erik Auerswald 9b227e7d64 update reasons for string.h includes 2021-10-26 20:28:36 +02:00
Erik Auerswald 9b4690e68c help.c: remove unused include of string.h 2021-10-26 20:27:59 +02:00
Erik Auerswald 9b31b50154 guard against potential unsigned integer overflow
If the string length of the value of the environment variable TMP
is too big, adding the length of a slash and the temporary file
name might overflow, which would result in an insufficient memory
allocation for the absolute file name.

I do not know if that can actually happen in any existing operating
system and platform combination where ssocr can be used.
2021-10-26 20:18:11 +02:00
Erik Auerswald 8464c5c2b9 INSTALL: adjust to removed -Werror & -pedantic-errors 2021-10-25 20:11:19 +02:00
Erik Auerswald df0f1e35b7 fix compilation on Debian GNU/Linux Buster (11)
GCC has become too aggressive with its warnings, complaining about more
and more perfectly valid code.

In August 2020 I received a report of GCC 10.1 generating a warning
about strncat:

--------8<--------
cc -D_FORTIFY_SOURCE=2 -Wall -W -Wextra -pedantic -Werror -pedantic-errors -fstack-protector-all  -O3    -c -o ssocr.o ssocr.c
In file included from /usr/include/string.h:495,
                 from ssocr.c:29:
In function ‘strncat’,
    inlined from ‘tmp_imgfile’ at ssocr.c:79:12,
    inlined from ‘main’ at ssocr.c:454:15:
/usr/include/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ssocr.c: In function ‘main’:
ssocr.c:67:19: note: length computed here
   67 |     pattern_len = strlen(dir) + strlen(DIR_SEP TMP_FILE_PATTERN) + 1;
      |                   ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: ssocr.o] Error 1
-------->8--------

Basically the same problem has been reported in GitHub issue #15,
"Fails to build on Arm":

--------8<--------
cc -D_FORTIFY_SOURCE=2 -Wall -W -Wextra -pedantic -Werror -pedantic-errors -fstack-protector-all  -O3   -c -o ssocr.o ssocr.c
In file included from /usr/include/string.h:495,
                 from ssocr.c:29:
In function ‘strncat’,
    inlined from ‘tmp_imgfile’ at ssocr.c:79:12,
    inlined from ‘main’ at ssocr.c:529:15:
/usr/include/arm-linux-gnueabihf/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ssocr.c: In function ‘main’:
ssocr.c:67:19: note: length computed here
   67 |     pattern_len = strlen(dir) + strlen(DIR_SEP TMP_FILE_PATTERN) + 1;
      |                   ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: ssocr.o] Error 1
-------->8--------

As described in a Red Hat blog post[1], this warning cannot be avoided
without rewriting the code to not use strncat.  I do not intend to do so,
instead I just accept that GCC will generate warnings.  Thus this commit
removes -Werror and -pedantic-errors from the CFLAGS.

This fixes compilation on a x86_64 Debian Buster (11) GNU/Linux test
system with gcc (Debian 10.2.1-6) 10.2.1 20210110.

This strncat warning is the only warning generated by that gcc version.

[1] I do not link to that blog post here, because it requires JavaScript
    to display textual information, which I find unacceptable.
2021-10-25 19:40:20 +02:00
Erik Auerswald 5c8fb87549 INSTALL: mention X11 as prerequisite 2021-10-24 15:19:35 +02:00
Erik Auerswald 8dac811924 README: fix a typo 2021-10-24 15:09:43 +02:00
Erik Auerswald 36d314889f add more macOS info to INSTALL
GitHub user "watkit" reported to have needed

    make CPPFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/

to build ssocr on a 2020 m1 Mac mini.
2021-10-24 15:05:39 +02:00
Erik Auerswald 01051e8313 add character 'j' recognition to full charset 2021-07-18 16:58:23 +02:00
Erik Auerswald 3159b4bc28 add character 'y' recognition to full charset 2021-07-17 14:17:14 +02:00
Erik Auerswald cce3f196f8 defines.h: add commented out three segment N
While I know of seven segment displays that use
     _
    | |

as 'N', ssocr detects the size of the individual seven segment
displays and thus always sees this as

     _
    | |
    | |

unless the digit boundary detection fails.

This commit is intended as a reminder for me that I have already
thought about this issue.
2021-07-11 17:56:42 +02:00
Erik Auerswald 00846d5dd3 Makefile: use man to convert man page to HTML 2021-06-29 20:01:29 +02:00
Erik Auerswald efded91c1d replace "rman" with "mandoc" for man->html conversion
"rman" does not support the URL macros ".UR" and ".UE", but I use
those already.  "mandoc" does support these macros.
2021-06-24 20:33:51 +02:00
Erik Auerswald 24b4d7ab7c INSTALL: use current Homebrew URL 2021-06-24 20:25:59 +02:00
Erik Auerswald ea9e2996cc escape hyphens that shall be minus characters in the man page 2021-06-24 20:23:58 +02:00
Erik Auerswald 3c80d6a935 use URL macros for URLs in man page 2021-06-24 20:16:36 +02:00
Erik Auerswald 6204e113ab update a forgotten copyright info 2021-06-24 20:14:14 +02:00
Erik Auerswald 60735c3ff6 replace http URLs with https 2021-06-24 20:13:10 +02:00
Erik Auerswald 42e35b4c63 add more Google email madness to the README
I have encountered problems sending email to users of GMail, to
users of Google email services using domain names different from
gmail.com, and to Google employees using their corporate email
account.

Google is the only email provider that does not accept my emails,
as far as I know.
2021-05-08 13:35:20 +02:00
Erik Auerswald 3699b42d2a add a copyright section to the man page 2021-05-01 19:11:48 +02:00
Erik Auerswald ab6dab59ad two small corrections in help output 2021-04-27 19:18:02 +02:00
Erik Auerswald 113d665135 add ability to detect and print white space
This adds an option to enable white spece detection, and two
further options to control the operation of white space detection.

White space detection (--print-spaces) is intended for use cases
where digit (resp. character) grouping is important for correct
interpretation.  One use case is the recognition of superimposed
dates in photographic images.

This commit also increases the version number to 2.21.0 and tweaks
some debug output.
v2.21.0
2021-04-25 14:05:51 +02:00
Erik Auerswald 161778751c show default values for decimal separator ratios v2.20.0 2021-04-19 19:37:39 +02:00
Erik Auerswald dc463a5529 options to control decimal separator recognition
Additionally, bump copyright dates and version number.
2021-04-19 19:27:52 +02:00
Erik Auerswald 159f9c1809 INSTALL: fix typo 2021-04-11 18:44:59 +02:00
Erik Auerswald 08a628ff04 how to work around some compilation failures
C compilers are getting more aggressive with warnings and are producing
more false positives.  While I intend to keep ssocr compiling without
warnings (as in the last 15 years), I do not use the newest C compilers,
but rather the GCC version included in a stable GNU/Linux distribution,
it may take some time for me to encounter those problems myself, and thus
it may take some time for me to work around them.

A user reported a compilation failure due to new warnings in GCC 10.1.
Since I currently use GCC 7.5.0 from Ubuntu 18.04 LTS, I do not see
those warnings yet, and thus cannot test any workarounds yet.

A first investigation into the issue hints at a need to replace valid code
with code invalid for GCC's default C standard version (necessitating
the specification of a newer C standard in the CFLAGS) to work around
said problem.  I have no idea if there are additional warnings with GCC
10.1 after working around that one.  Since Google blocks my emails to
the reporting user, I cannot even communicate to find this out.  Thus any
code changes will have to wait for either a GCC version with additional
warnings arriving in my GNU/Linux distribution, or establishment of a
different communication channel, e.g., a GitHub issue.
2020-08-03 23:12:08 +02:00
Erik Auerswald 3a08177381 INSTALL: reword some platform specific advise 2020-08-02 23:51:47 +02:00
Erik Auerswald ddeeaffff7 INSTALL: inform about C compiler security features
There have been issues with the basic security features a modern C
compiler should provide, hindering compilation of ssocr. One way to work
around those is to disable use of the broken features.  Another way is
to use a quality C compiler, e.g., a stable GCC release.
2020-08-02 23:39:07 +02:00
Erik Auerswald bbdc4a179f README: warn against use of @gmail.com addresses
Google is blocking my answer emails to @gmail.com addresses.  So I
can only advise to use a real email provider, not Google.  If one
cannot do that, or does not want to, one can open a GitHub issue
instead.
2020-08-02 23:28:32 +02:00