Hi Claudio, If you're messing about with TIFF files then you might find the tiffinfo command (which I got from the libtiff-tools debian package) helpful, eg:
jon@vadim1:~$ tiffinfo scan-20051220-211811.tif TIFF Directory at offset 0x3670 (13936) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2236 Resolution: 200, 200 pixels/inch Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white Rows/Strip: 2236 Planar Configuration: single image plane Software: dell1600n-net-scan DateTime: 2005-12-20 21:18:11 Group 4 Options: (0 = 0x0) As for the mismatch in image parameters, I found when working on the Dell 1600n backend that the scanner reported different things at different times during the scanning process which presumably corresponded to the set of user preferences (prior to the scan) and the actual parameters of a scanned image. Also the parameters could change from page to page. This may or may not have any bearing on what you are seeing, but you might doublecheck that you are making the SANE API calls in exactly the same order as scanimage does. cheers, Jon On Wednesday 15 November 2006 09:56, Claudio wrote: > Hello, I'm writing a client in the C language which uses the libsane > library. The basic idea, at the stage i'm in, is to write code to copy > scanimage's behavior. It's supposed to get the scanned data and write it > to stdout in tiff format. > I'm having some troubles with the tiff header: i'm using stiff.c I found > in the backends' package to write the header of the file. The problem > I'm having is that the tiff file is practically malformed (test opening > it with the gimp). So i hijacked the stiff library and put a fprintf and > exit right after the header is created. Here's what i get for the same > page from the original scanimage and my code: > > < scanimage > > > width 5056 height 9000 depth 8 resolution 600 > > < my code > > > width 5399 height 9000 depth 8 resolution 600 > > [...] ====================== Jon Chambers ===================== http://www.jon.demon.co.uk, 020 8575 7097, 07931 961669 =========================================================