[sane-devel] How to combine scanned images together and print them as a file

Henning Meier-Geinitz henning@meier-geinitz.de
Mon, 3 Mar 2003 10:22:35 +0100


Hi,

On Mon, Mar 03, 2003 at 04:01:01PM +0800, Stephen Liu wrote:
> I performed following tests as 'user' in the directory /home/satimis/
> where the .jpg files are kept
> 
> linux-1.jpg
> linux-2.jpg
> linux-3.jpg
> linux-4.jpg
> 
> are 4 .jpg files scanned witn Xsane

Which version of xsane? Which version of sane-backends?

> # ls -l linux-1.jpg
> -rw-r-----    1 satimis  satimis    125631 Mar  2 22:54 linux-1.jpg
> 
> # chmod -c 0666 linux-*.jpg
> mode of `linux-1.jpg' changed to 0666 (rw-rw-rw-)
> mode of `linux-2.jpg' changed to 0666 (rw-rw-rw-)
> mode of `linux-3.jpg' changed to 0666 (rw-rw-rw-)
> mode of `linux-4.jpg' changed to 0666 (rw-rw-rw-)
> 
> # convert linux-1.jpg linux-2.jpg linux-3.jpg linux-4.jpg book.pdf
> 
> # convert linux-1.jpg linux-2.jpg linux-3.jpg linux-4.jpg book.pdf
> convert: Corrupt JPEG data: premature end of data segment (linux-3.jpg)
> [No such file or directory].
> convert: Corrupt JPEG data: premature end of data segment (linux-3.jpg)
> [No such file or directory].

For some reason convert doesn't like the 3rd jpg file. Maybe something
went wrong when you saved it? Try other programs that can handle jpeg
files (e.g. gimp, display, qiv). If they also complain about a broken
file, well, the file is broken :-)

I would assume that this is an xsane bug but saving jpgs with xsane
works pretty fine here.

You can try other file formats in xsane. jpg makes only sense if you
scan color images like photos.

> I has viewed each original file separately and they are OK

With which program have you viewed them? Does it also happen when you
just convert them to a different file type?
E.g. convert linux-3.jpg linux-3.tiff

> Besides if there are hundred pages can I perform follow;
> 
> # convert linux-*.*.jpg book.pdf

Basically yes. You may want to make sure that they are included in the
right order, however. Have a look at the manpage of convert. I'm by no
means a convert expert.

Bye,
  Henning