[sane-devel] problems with scanimage to pdf

m. allan noah kitno455 at gmail.com
Tue Feb 3 21:58:53 UTC 2015


Most scanners produce big-endian data, which scanimage writes out to
disk when it creates the tiff. Any host-side tools that you use on the
tiffs will probably convert them to little-endian, since that is the
format of your CPU. If you attempt to rotate all of them (some of them
by 360 degrees), such that they all become little endian, and all get
the strip 204 error fixed, does the pdf work better?

allan

On Tue, Feb 3, 2015 at 4:43 PM, ken <gebser at mousecar.com> wrote:
> On 02/03/2015 03:21 PM, Carsten Jensen wrote:
>>
>> I'm wondering why your converted image is in little-endian and the rest
>> are big-endian.
>
>
> If you can read it, then I'd guess that all the apps I used can also read
> it, in which case you'd think they'd have coded in ways to deal with it.  So
> if that's the cause of the problem, shouldn't it be considered a bug?
>
>
>
>> 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.
>
>
> $ uname -r
> 2.6.18-400.1.1.el5.centos.plus
> $ cat /etc/redhat-release
> CentOS release 5.11 (Final)
> $ rpm -qi ImageMagick
> Name        : ImageMagick                  Relocations: (not relocatable)
> Version     : 6.2.8.0                           Vendor: CentOS
> Release     : 15.el5_8                      Build Date: Mon 07 May 2012
> 02:45:36 PM EDT
> Install Date: Tue 05 Jun 2012 12:17:14 PM EDT      Build Host:
> builder10.centos.org
> Group       : Applications/Multimedia       Source RPM:
> ImageMagick-6.2.8.0-15.el5_8.src.rpm
> Size        : 11701413                         License: freeware
> Signature   : DSA/SHA1, Mon 07 May 2012 05:06:55 PM EDT, Key ID
> a8a447dce8562897
> URL         : http://www.imagemagick.org/
> Summary     : An X application for displaying and manipulating images.
> Description : .....
>
> ImageMagick probably came with the standard CentOS install.  Judging by the
> date above, I'd say there was an upgrade back in 2012.  You probably know it
> already, but CentOS is basically a clone of Redhat.
>
> I'm running this on an old Dell laptop.
>
>
>
>>
>> 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
>>>
>>
>>
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>             to sane-devel-request at lists.alioth.debian.org



-- 
"well, I stand up next to a mountain- and I chop it down with the edge
of my hand"



More information about the sane-devel mailing list