[sane-devel] scanimage fails to scan 16 bit gray image from epson 2450

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 24 Jul 2002 21:40:32 +0200


Hi,

On Wed, Jul 24, 2002 at 04:20:58PM +0100, rob wrote:
> I'm trying to scan 16 bit gray images using scanimage with my epson 2450
> but all I get out of it is a a page of snow with the hint of a pattern
> in it.
> 
> This is my command line:
> 
>  scanimage -d epson:/dev/usbscanner0 --focus-position 'Focus 2.5mm above
> glass' --source 'Transparency Unit' --film-type 'Negative Film'
> --brightness 0 -x 26mm -y 38mm -l 7mm -t 40.5mm --resolution 300 --mode
> Gray --depth 16 --format tiff > bw07.tiff

Good spot.

For everyone who don't have a scanner that can do 16 bit gray, here is
an example for the test backend:

scanimage -d test --mode Gray --depth 16 --test-picture "Color patterns"  --format tiff >test.tiff

I think the fix is simple: Edit frontend/stiff.c, change the line
     add_ifd_entry (ifd, 258, IFDE_TYP_SHORT, 1, 8);

to
     
     add_ifd_entry (ifd, 258, IFDE_TYP_SHORT, 1, depth);
     
Bits per sample were set to 8 which will cause trouble in 16 bit mode.

Please test everyone, I don't know more about Tiffs than their name :-)

Bye,
  Henning