Wykres commitów

96 Commity (779d09a0b56c65cfdd776c16b46d4efec0fe256b)

Autor SHA1 Wiadomość Data
Olaf Meeuwissen e42e3bc849 scanimage: Fix misleading fall through annotation
The `scanimage_exit()` call exits the program.
2019-08-11 10:23:29 +09:00
Povilas Kanapickas e40596c2a5 Fix -Wimplicit-fallthrough warnings by adding standard annotations 2019-06-30 11:58:32 +03:00
Olaf Meeuwissen 7af0d47e29 Keep warning out of redirected image data. Fixes testsuite 2019-06-30 12:45:03 +09:00
Povilas Kanapickas 728de89d71 scanimage: Guess --format from --output-file if possible 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 86e917b04b scanimage: Prevent --output-file and --batch to be used together 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 7f4944f0a7 scanimage: Warn when output format is not set 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 877cc29d88 scanimage: Raise an error if --format option is an unknown format 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 5dbd51d1ec scanimage: Allow specification of the output path via option 2019-04-28 23:27:59 +03:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
Aaron Muir Hamilton 801558f959 Write density (resolution) JFIF header information with JPEG files. 2017-05-04 18:35:05 +09:00
Olaf Meeuwissen b219bc2c73 Merge branch 'icc-profiles' 2017-05-04 18:26:55 +09:00
Olaf Meeuwissen adebd37b5c Fix [-Wpointer-arith] compiler warnings 2017-04-30 20:00:28 +09:00
Aaron Muir Hamilton c3903cc476 Avoid attaching grayscale ICC profiles to rgb images, or vice-versa.
If the ICC profile added does not match the colour format of the
  image, libpng will abort. This can leave the scanner motors in an
  incorrect state and possibly cause permanent damage.
2017-04-30 18:54:39 +09:00
Aaron Muir Hamilton a907b61bd5 Add ICC profile embedding for PNG output. 2017-04-30 18:54:28 +09:00
Aaron Muir Hamilton a0321d2a92 Include physical resolution (pHYs section) in PNG output. 2017-04-27 21:39:29 +09:00
Olaf Meeuwissen 469dc738aa Only swap 16-bit PNG bytes on machines that are not big-endian
The SANE API specifies that image bytes are in machine native order.
2017-04-27 21:17:34 +09:00
Aaron Muir Hamilton 28eb09eec4 Swap bytes in 16-bit PNGs, because PNG is big-endian. 2017-04-27 20:50:18 +09:00
Ruslan Nabioullin be7af68357 Fixed scanning status messages. Fixes 313411 2016-07-06 20:39:09 +09:00
Olaf Meeuwissen d3d5dc3da0 Update to autoconf-2.69
This gets rid of a number of obsoleted macros and replaces RETSIGTYPE
with a void literal which can be assumed for C89 and later.

This changeset was prepared using autoupdate and modified to get rid of
whitespace and doubled [] changes.  Changes to acinclude.m4 were added
by hand.
2016-06-13 22:05:34 +09:00
Olaf Meeuwissen 4b825b7d87 Fix scanimage pixel bit depth reporting
The bytes_per_line value may include padding bytes which leads to
incorrect results for small values of pixels_per_line.
2015-09-19 13:39:37 -04:00
Olaf Meeuwissen 002fea134a Align JPEG format command-line option behaviour with TIFF 2015-09-19 12:02:57 -04:00
Matteo Croce bc698d4329 add JPEG support to scanimage 2015-09-19 12:02:57 -04:00
Matteo Croce c83123ee46 add PNG format to scanimage 2015-09-19 12:02:57 -04:00
Rolf Bensch 4a6d0be34e remove atexit() function
- in some cases atexit() doesn't work with libusb-compat
  - all exit() functions are replaced by scanimage_exit()
  - scanimage_exit() has a new parameter (exit status)
2015-08-20 23:34:33 +02:00
m. allan noah b973a9c49f change exit status of scanimage
If we have successfully scanned at least one image
during a batch scan, don't return SANE_STATUS_NO_DOCS.
Code by Jeff Breidenbach jeff@jab.org
2014-07-14 20:09:02 -04:00
m. allan noah 0bb6ae706d add batch-print option to scanimage
Enables better interoperability with tesseract.
Code by Jeff Breidenbach jeff@jab.org
2014-07-14 20:03:36 -04:00
Mark Buda c591d2b7da Correction of some spelling/grammatical errors in source code 2014-05-15 22:04:37 -04:00
Nils Philippsen 8082a42ec4 avoid using string formats insecurely with "-f"
In the process, simplify processing the device list format: don't copy
the format string for writing \0 into it, just iterate over chunks in
the original string.
2013-12-04 15:04:12 +01:00
Stéphane Voltz ce90b61894 add test to protect scanimage from incorrect group options 2013-06-19 17:28:04 +02:00
Chris Bagwell 5061c2d5b2 More mingw portability updates.
Add check for winsock2.h for socket.h replancement. Also, use this
check to add ws2_32 library. Also, switch all winsock.h references
to winsock2.h.

Add check for getuid and getpass; which are not on mingw.

Add a syslog() replacement that is basically a print(). This
is also used by vsyslog() replacement.

Comment out parts of replacement sigprocmask.c on mingw.

To support these configure.in changes, I need to rebuild all
related files with autoconf 2.68 and libtool 2.4. Hand ported
our sane-backend specific changes to newer ltmain.sh.
2011-11-06 12:40:00 -06:00
Chris Bagwell 9bdff1dbdf mingw32 compile fixes
The following updates were made to all directories but backends.
That still needs work. There are also still some pthread issues
and syslog is missing.

 Windows doesn't support SIGHUP or SIGPIPE so make that optional.
 Only include socket header files when sys/socket.h is detected.
 Use winsock.h on windows.
 Only include syslog.h when vsyslog() was detect by configure.
 Skip FD_CLOEXEC when not supported by OS (not defined).
 Only include sys/ioctl.h on platforms that define it.
2011-11-05 11:19:34 -05:00
Olaf Meeuwissen 738b153eb6 Plug a memory in batch mode
scanimage allocates a new buffer for each page scanned without ever
releasing it. Buffer is 32 kiB by default.
2011-06-30 20:56:52 +02:00
Stéphane Voltz 4d0cd3c5b1 add -A/--all-options to scanimage for exposing all control options of a
backend
2010-11-06 08:00:37 +01:00
Stéphane Voltz 27c7eae2b5 don't print readonly controls as valid command line options 2010-10-31 23:01:43 +01:00
m. allan noah e4466b68cc exit with error if stdout isatty() 2010-02-10 20:56:25 -05:00
chris@cnpbagwell.com 4d9e8138af standardize including local sane/ include files.
Source code was inconsistent on how they were referencing
include files in include/sane.  In certain cases, sane/sane.h
and sane/saneopts.h was really including external copies (with
some preprocessor implementations anyways).
2009-05-07 22:06:20 -05:00
m. allan noah 0342a63033 Updates to prepare for 1.0.20 release:
* configure.in: change version to 1.0.20cvs
* configure: rebuild from configure.in
* include/sane/sane.h: hide API changes (minor, frame and status)
* backend/canon_dr.c, backend/fujitsu.c: SANE_FRAME_JPEG
* backend/coolscan3.c: SANE_FRAME_RGBI
* backend/genesys_gl646.c, backend/genesys_gl841.c: STATUS_HW_LOCKED
* backend/rts8891.c, frontend/scanimage.c: STATUS_WARMING_UP
* backend/pixma_io_sanei.c, backend/xerox_mfp.c,
  backend/sane_strstatus.c: STATUS_HW_LOCKED & STATUS_WARMING_UP
* doc/releases.txt: minor updates for new build system
2009-04-12 19:40:31 +00:00
m. allan noah 1636ba5334 * frontend/scanimage.c, doc/scanimage.man: make -B (buffer-size)
selectable, and make long name consistent. (#309672 by Johannes Berg)
2009-03-14 18:10:38 +00:00
Chris Bagwell 70f3fdfba4 * acinclude.m4, backend/*.[ch], tools/*.[ch], frontend/*.[ch]:
Global replace of u_int??_t with C9x standard based uintxx_t
 in order to remove some tricky and overlapping portability logic
 from acinclude.m4 and leave it in only m4/stdint.m4.
2009-02-26 03:15:43 +00:00
m. allan noah c290bb2e1b * frontend/scanimage.c: improved comments, simplified x/y option code,
removed buggy -1/+1 x/y code (#311172), expose non-settable options,
check for invalid caps on options, handle option descs with \n
* doc/releases.txt: add note about cvs checkout on alioth.
2009-02-25 03:29:14 +00:00
Mattias Ellert 18e9d6c358 Restore alloca include order 2009-02-20 17:56:54 +00:00
Chris Bagwell caba90c552 * configure.in, acinclude.ac: Cleanup autoconf 2.63 warnings.
add cv_ prefix to cached variable.  Remove AC_ARG_PROGRAM as
automake already invokes this. When prefered AC_USE_SYSTEM_EXTENSIONS
exists, use that instead of AC_GNU_SOURCE/AC_AIX/AC_MINUX.
Cleanup socket detection more by creating only a single
SOCKET_LIBS that contains list of all optional libraries
for any socket related funciton.  Make sure that checks
for socket related functions use SOCKET_LIBS when searching.
Check for getopt_long() and getopt.h.  Make OS/2 use
-no-undefined (same as windows).
* ltmain.sh, m4/libtool.m4: Upgrade to libtool 1.5.26.
* Makefile.am: Cleanups to match configure updates.
* frontend/scanimage.c, include/Makefile.in, lib/getopt.c
lib/getopt1.c, toosl/sane-desc.c, include/lgetopt.h:
Rename internal getopt.h to lgetopt.h to allow using
external getopt.h when it exists.  This allows to go
back to optionally compiling getopt()/getopt_long() and its
prototypes and not have conflicts with external headers/symbols.
2009-02-06 03:10:44 +00:00
Chris Bagwell 23ff26f9a5 * acinclude.m4, configure.in: Put all libraries into their
own *_LIB variables instead of $LIB so that we do not have to
link in the world to all executables. Modified SANE_CHECK_U_TYPES
to be a little more portable to platforms that use #define
for u_* types. Create SANE_CHECK_BACKENDS macro so that
PRELOADABLE_BACKENDS can also be valided.  Auto-populated
PRELAODABLE_BACKENDS when detect dlopen() won't work.
Various protability cleanups.
* backend/dll.c: Make dll-preload.c a .h since its an include and
not compilable byitself.
* frontend/Makefile.in, frontend/scanimage.c, include/laaloca.h,
  lib/Makefile.am, lib/alloca.c, strcasestr.c, tools/Makefile.in,
  tools/sane-desc.c: Convert lib/ to automake.  Create a liblib.la
  for everyone to use and a libfelib.la for only frontend programs.
  Make all internal programs be prefixed with sanei_ as not to conflict
  with other programs libsane is linked in with that will also most
  likely create similar internal utils on problem platforms.
  * include/getopt.h, lib/getopt.c, lib/getopt1.c: Always compile
  and link in getopt_long() but prefix it with sanei_.  Its
  easier to always use internal version then try to figure out what
  platforms support getopt_long() and what header files to use.
  * backend/Makefile.am: Convert backend makefile to automake.
  Initial version that is feature parity with original but uses
  specific rules instead of wildcards and only links in libraries/objs
  really required. Room for more cleanup of whats linked in once
  all makefiles have been converted to automake.
2009-01-31 03:12:18 +00:00
Julien BLACHE a42b57186f Make batch mode create output files atomically. 2009-01-17 10:18:40 +00:00
m. allan noah 425a3d034d * backend/fujitsu.[ch]: backend v85
- round pixels_per_line down to arbitrary limits for fi-4990 & fi-4860
 - fi-4860 returns random garbage to serial number queries
 - initialize *info to 0 in sane_control_option()
* doc/descriptions/fujitsu.desc: backend v85, improve status/comments
* frontend/scanimage.c: initialize *info, fix buffer overwalk
2008-12-10 21:32:10 +00:00
m. allan noah ba856d2aec 2008-09-25 m. allan noah <kitno455 a t gmail d o t com>
* include/sane/saneopts.h: underscore not allowed in option names
        * frontend/scanimage.c: fix broken unknown length (-1) binary scans,
          fix invalid tiff height with unknown length scans, fix compiler warn
2008-09-25 02:39:52 +00:00
Julien BLACHE eefb1b1155 Get option descriptor 0 before trying to read the value for option 0. 2008-08-04 20:54:10 +00:00
m. allan noah 0acce974b2 add %n (newline) to -f option 2008-05-28 00:48:21 +00:00
Stéphane Voltz 78fc186543 - handling of SANE_STATUS_WARMING_UP 2008-05-26 04:56:41 +00:00
m. allan noah 09f523defe remove support for SANE_FRAME_JPEG, add other frame types but commented out 2007-12-29 21:36:25 +00:00