[sane-devel] problems with scanimage to pdf

Carsten Jensen tomse at tomse.dk
Tue Feb 3 20:21:43 UTC 2015


I'm wondering why your converted image is in little-endian and the rest
are big-endian.

you might want to provide wich kind of computer you're using, whats the OS.
and how did you install Imagemagick, as it seems that is the reason for
the problem.

Try using other programs to manipulate your image to eliminate thich
application causes the problem.
i.e. use gimp to rotate and save again.



On 03-02-2015 20:45, ken wrote:
> Using scanimage seems to produce faulty tiff files.  When I then try
> to create a pdf out of those, the pdf isn't even readable (by xpdf).
>
> Here's the script output.  Lines beginning with '+' are the commands
> which are run:
>
> -----------------------------------
> $ scan
> + scanimage -x 215 -y 279 -l 0 -t 0 --batch=file%02d.tif --format=tiff
> --mode Color --resolution 300 --source Duplex
> Scanning -1 pages, incrementing by 1, numbering from 1
> Scanning page 1
> Scanned page 1. (scanner status = 5)
> Scanning page 2
> Scanned page 2. (scanner status = 5)
> Scanning page 3
> Scanned page 3. (scanner status = 5)
> Scanning page 4
> Scanned page 4. (scanner status = 5)
> Scanning page 5
> scanimage: sane_start: Document feeder out of documents
> + mv file02.tif tmp.tif
> + convert tmp.tif -rotate 180 file02.tif
> convert: tmp.tif: Bogus "StripByteCounts" field, ignoring and
> calculating from imagelength. `TIFFReadDirectory'.
> convert: tmp.tif: Read error on strip 204; got 0 bytes, expected 7608.
> `TIFFFillStrip'.
> + rm tmp.tif
> + mv file02.tif tmp.tif
> + convert tmp.tif -rotate 180 file02.tif
> + tiffcp file01.tif file02.tif file03.tif file04.tif file.tif
> TIFFReadDirectory: Warning, file01.tif: Bogus "StripByteCounts" field,
> ignoring and calculating from imagelength.
> TIFFFillStrip: file01.tif: Read error on strip 204; got 0 bytes,
> expected 7608.
> file01.tif: Error, can't read strip 204.
> + tiff2pdf file.tif
> file.tif: 0: Invalid strip byte count, strip 204.
> tiff2pdf: Error on decoding strip 204 of file.tif.
> tiff2pdf: An error occurred in converting TIFF file.tif to PDF -.
> + xpdf file.pdf
> Syntax Error: Couldn't read xref table
> Syntax Warning: PDF file is damaged - attempting to reconstruct xref
> table...
> Syntax Error: Couldn't find trailer dictionary
> Syntax Error: Couldn't read xref table
> + ls -l file01.tif file02.tif file03.tif file04.tif file.pdf file.tif
> -rw-rw-r-- 1 zl zl 1552272 Feb  3 14:35 file01.tif
> -rw-rw-r-- 1 zl zl 3134320 Feb  3 14:36 file02.tif
> -rw-rw-r-- 1 zl zl 1552272 Feb  3 14:36 file03.tif
> -rw-rw-r-- 1 zl zl 1552272 Feb  3 14:36 file04.tif
> -rw-rw-r-- 1 zl zl     726 Feb  3 14:36 file.pdf
> -rw-rw-r-- 1 zl zl 1553932 Feb  3 14:36 file.tif
> + file file01.tif file02.tif file03.tif file04.tif file.pdf file.tif
> file01.tif: TIFF image data, big-endian
> file02.tif: TIFF image data, little-endian
> file03.tif: TIFF image data, big-endian
> file04.tif: TIFF image data, big-endian
> file.pdf:   PDF document, version 1.1
> file.tif:   TIFF image data, little-endian
> -----------------------------------
>
> So what's the problem?
> tnx
>




More information about the sane-devel mailing list