[sane-devel] Sheet Feed scanner, saving DPI info
Andy Bennett
andyjpb at ashurst.eu.org
Tue Jan 16 16:18:15 GMT 2024
Hi,
> But I need the file to include DPI information for further processing.
>
> The originals could be all different sizes. tiny gas receipts,
> envelopes, super long walgreens receipts. seldom 8.5x11 because
> I use an ADF for that.
>
> My sheet feed scanner is double sided, and I've been calling it thusly:
> scanimage -d 'dsseries:usb:0x04F9:0x60E0' --format=jpeg -p -v
> --mode=Color --resolution=300 --batch=$(date
> +%Y%m%d_%H%M%S)p%d.jpg --batch-count=2 --batch-print
I'm not sure if scanimage puts the data in an exif tag in the JPEG.
I use PNM format, instead of JPEG, and that file is contains just the
dimension of the image and a bag of pixels.
...so as you put "--resolution=300" on the command line, I would get the
information manually from that and record it where you need it.
> And scanimage tells me:
> scanimage: scanning image of size 2548x4199 pixels at 24 bits/pixel
>
> p1 is the front and p2 is the rear. Obviously they scan at the
> same time. The scanimage command "waits" for the first page to
> pull through, and the second page is instant because its
> probably held in a buffer in the scanner.
>
>
> What do I need to add to my commandline to make it scan as long
> as it takes to pull the whole paper through???
> Or to increase that max page length to something large, say 3 feet?
I use the options "--page-height=500.015mm -y 500.015mm" on my Fujitsu
ix500.
At least on the Fujitsu driver, if you use a number that's too big it tells
you what the largest number it supports is, sets it to that and then
carries on. So you can find out the limit by putting in a really large
number.
You might also be able to find it out from "scanimage --help" when the
scanner is attached, as that will show you the driver specific options and
some information about them.
> Before it saves the file it needs to know the dimensions of the
> paper because it has to write the DPI. And I won't know how
> long each sheet is until I scan them through. I need the
> scanner to measure them in effect.
For driving scan image, all the --page-width, --page-height -x and -y
options are all in millimeters, so you don't need to worry about pixels at
all.
After you have acquired the image the JPEG will know how many pixels it has
and the dimension of the image.
You can get the DPI from the command line as mentioned above.
That should give you what you need to process the image.
...but, even on the ix500 with the automatic document feeder, I find that I
need to trim and straighten some documents, especially reciepts. Whilst the
driver only acquires an image as long as the piece of paper inserted (up to
the maximum length specifed with --page-height and -y), it always acquires
the entire specified width, even if there is no paper there. So I need to
straigthen the reciept up and chop the sides off.
Does that help?
Best wishes,
@ndy
--
andyjpb at ashurst.eu.org
http://www.ashurst.eu.org/
0x7EBA75FF
More information about the sane-devel
mailing list