scanimage: default buffer size increased to 1MB

Because -B argument was optional and specified 1MB if left out I have
made the argument mandatory now and updated the man page to match.
666-epsonds-has-issues-with-saned
Ralph Little 2022-12-04 10:00:47 -08:00
rodzic fc77717507
commit f15a40c1bb
2 zmienionych plików z 31 dodań i 40 usunięć

Wyświetl plik

@ -4,36 +4,32 @@
scanimage \- scan an image
.SH SYNOPSIS
.B scanimage
.RB [ \-d | \-\-device\-name
.RB [ \-d
.IR dev ]
.RB [ \-\-format
.IR format ]
.RB [ \-i | \-\-icc\-profile
.RB [ \-\-format\fI=output-format ]
.RB [ \-i
.IR profile ]
.RB [ \-L | \-\-list\-devices ]
.RB [ \-f | \-\-formatted\-device\-list
.IR format ]
.RB [ \-b | \-\-batch
.RB [ \-L ]
.RB [ \-f
.IR device-format ]
.RB [ \-b
.RI [ format ]]
.RB [ \-\-batch\-start
.IR start ]
.RB [ \-\-batch\-count
.IR count ]
.RB [ \-\-batch\-increment
.IR increment ]
.RB [ \-\-batch\-start\fI=start ]
.RB [ \-\-batch\-count\fI=count ]
.RB [ \-\-batch\-increment\fI=increment ]
.RB [ \-\-batch\-double ]
.RB [ \-\-accept\-md5\-only ]
.RB [ \-p | \-\-progress ]
.RB [ \-o | \-\-output-file
.RB [ \-p]
.RB [ \-o
.IR path ]
.RB [ \-n | \-\-dont\-scan ]
.RB [ \-T | \-\-test ]
.RB [ \-A | \-\-all-options ]
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-verbose ]
.RB [ \-B | \-\-buffer-size
.RI [= size ]]
.RB [ \-V | \-\-version ]
.RB [ \-n ]
.RB [ \-T ]
.RB [ \-A ]
.RB [ \-h ]
.RB [ \-v ]
.RB [ \-B
.RI size ]
.RB [ \-V ]
.RI [ device\-specific\-options ]
.SH DESCRIPTION
.B scanimage
@ -117,12 +113,12 @@ If this variable is not set,
will attempt to open the first available device.
.TP
.BR \-\-format =\fIformat\fR
.BR \-\-format =\fIoutput-format\fR
selects how image data is written to standard output or the file specified by
the
.B \-\-output\-file
option.
.I format
.I output-format
can be
.BR pnm ,
.BR tiff ,
@ -150,8 +146,8 @@ by its full device name. You may need to consult your system administrator to
find out the names of such devices.
.TP
.BR \-f "\fI format\fR, " \-\-formatted\-device\-list =\fIformat\fR
works similar to
.BR \-f "\fI format\fR, " \-\-formatted\-device\-list =\fIdevice-format\fR
works similarly to
.BR \-\-list\-devices ,
but requires a format string.
.B scanimage
@ -306,12 +302,10 @@ The option may be specified repeatedly, each time increasing the verbosity
level.
.TP
.BR \-B " [\fIsize\fR], " \-\-buffer\-size =[\fIsize\fR]
changes input buffer size from the default of 32KB to
.BR \-B " [\fIsize\fR], " \-\-buffer\-size =\fIsize
changes input buffer size from the default of 1MB to
.I size
KB. If
.I size
is not specified then the buffer is set to 1 MB.
KB.
.TP
.BR \-V ", " \-\-version

Wyświetl plik

@ -107,7 +107,7 @@ static struct option basic_options[] = {
{"test", no_argument, NULL, 'T'},
{"all-options", no_argument, NULL, 'A'},
{"version", no_argument, NULL, 'V'},
{"buffer-size", optional_argument, NULL, 'B'},
{"buffer-size", required_argument, NULL, 'B'},
{"batch", optional_argument, NULL, 'b'},
{"batch-count", required_argument, NULL, OPTION_BATCH_COUNT},
{"batch-start", required_argument, NULL, OPTION_BATCH_START_AT},
@ -129,7 +129,7 @@ static struct option basic_options[] = {
#define OUTPUT_JPEG 4
#define OUTPUT_PDF 5
#define BASE_OPTSTRING "d:hi:Lf:o:B::nvVTAbp"
#define BASE_OPTSTRING "d:hi:Lf:o:B:nvVTAbp"
#define STRIP_HEIGHT 256 /* # lines we increment image height */
static struct option *all_options = NULL;
@ -2085,7 +2085,7 @@ main (int argc, char **argv)
void *pw = NULL;
FILE *ofp = NULL;
buffer_size = (32 * 1024); /* default size */
buffer_size = (1024 * 1024); /* default size */
prog_name = strrchr (argv[0], '/');
if (prog_name)
@ -2132,10 +2132,7 @@ main (int argc, char **argv)
output_file = optarg;
break;
case 'B':
if (optarg)
buffer_size = 1024 * atoi(optarg);
else
buffer_size = (1024 * 1024);
buffer_size = 1024 * atoi(optarg);
break;
case 'T':
test = 1;