gscan2pdf distorts image with scanimage.pl frontend, but works with scanadf frontend

Bug #358970 reported by to be removed
2
Affects Status Importance Assigned to Milestone
gscan2pdf (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: gscan2pdf

I have an HP Laserjet 3052 printer/scanner/fax. When scanning with gscan2pdf on jaunty, using default settings, the image is distorted. With the scanadf frontend (see Edit/Preferences) it works. scanadf works on this printer even when not using the ADF, and if that's the case with all devices, it should perhaps be the default.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: gscan2pdf 0.9.27-1
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=fi_FI.UTF-8
 SHELL=/bin/bash
SourcePackage: gscan2pdf
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :

Both the above pages were scanned of the same page, with a huge hand-written A on it. The scan quality is not great, but the shape of the distorted page should be visible anyway.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

This is the first time I have heard of a problem with the scanimage.pl frontend.

Just for your info - the scanimage.pl and scanadf.pl frontends are the scanimage and scanadf frontends, rewritten in Perl, using the libsane-perl Perl bindings.

Please confirm that the scanadf.pl frontend also corrupts the image, and that the scanimage frontend does not.

Please also attach the original PNM files created by the various frontends (perhaps use a very low resolution to keep the file size down).

Obviously, in my tests, all four frontends produce identical results.

Revision history for this message
to be removed (liw) wrote :

I'll do the following:

* start gscan2pdf
* choose frontend
* scan the same piece of paper (at 75 dpi)
* save scan as ppm
* gzip ppm
* attach scan to this bug report

Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :
Revision history for this message
to be removed (liw) wrote :

Summary of results:

- scanadf and scanimage frontends work OK
- scanadf.pl and scanimage.pl frontends don't work

I don't know if this is specific to the model of the scanner.

In case it matters: the scanner is not physically attached to the computer, but to another computer, running Debian lenny, and using the net backend to sane.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

Can you do a quick check on the Lenny machine to see if the problem is related to the net backend?

Revision history for this message
to be removed (liw) wrote :

Works fine with scanadf and scanimage on the command line.

Revision history for this message
to be removed (liw) wrote :

Also works fine with scanadf and scanimage on the command line when scanner is attached directly to machine running jaunty.

Revision history for this message
to be removed (liw) wrote :

The scanimage.pl and scanadf.pl commands also result in good scans from the command line on the jaunty computer with scanner attached directly to it.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

That scanadf and scanimage work fine you demonstrated before, but if you could check the output from scanimage.pl frontend when the scanner is directly attached to the machine running Jaunty, we could see if the problem is related to the net backend.

Revision history for this message
to be removed (liw) wrote :

On closer look, no they don't. scanadf.pl produces a slightly distorted image from the command line when scanner is attached directly. Also over the net.

Summary of results:

Works: scanner is attached to either machine, accessed locally or over the net, using scanadf or scanimage.

Doesn't work: scanner is attached to either machine, accessed locally or over the net, using scanadf.pl or scanimage.pl.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

Thanks for clarifying. I'll try and work out how I can debug the problem - I don't have a second machine.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

According to ImageMagick's identify, the images have been through unpaper. Whilst unpaper almost certainly has nothing to do with the problem, it is an extra variable.

They are 8-bit images. Do you get the same distortion with 1-bit scans?

What about smaller scans? If you scan, say, just a 200x200 pixel area, do you have the same problem?

Revision history for this message
to be removed (liw) wrote :

The images I've uploaded were scanned with gscan2pdf, which I've configured to run unpaper. If I scan things from the command line, there's still distortion, so unpaper is not relevant.

scanadf doesn't give me a setting for bit depth. It gives me --mode, with options color, gray, and lineart. No difference between those.

Revision history for this message
to be removed (liw) wrote :
Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

Grayscale is still 8-bit. Lineart would be 1-bit. Can you confirm that lineart gives you the distortion?

Can you also try color or grayscale for a smaller scan?

Revision history for this message
to be removed (liw) wrote : Re: [Bug 358970] Re: gscan2pdf distorts image with scanimage.pl frontend, but works with scanadf frontend

scanadf.pl with lineart still distorts. A top-left partial scan (lineart
or color) doesn't distort, but since the distortion happens in bands,
that's not really conclusive. Since using scanadf works for me, I'm not
really motivated doing a few more dozen scans and inspecting them for
distortion, sorry. At least not during this stage of the Ubuntu release
cycle.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote : Re: [Bug 358970] Re: gscan2pdf distorts image with scanimage.pl frontend, but works with scanadf frontend

2009/4/17 Lars Wirzenius <email address hidden>:
> scanadf.pl with lineart still distorts. A top-left partial scan (lineart

I can't reproduce this and I therefore don't know how to debug it.

FWIW, I am using Intrepid on i386 with an HP Officejet 5510
all-in-one. I intend to upgrade to Jaunty as soon as I have time, i.e.
in the next couple of weeks. Perhaps something has changed in
sane-backends.

Revision history for this message
to be removed (liw) wrote :

Right. I didn't have this with intrepid, only after I upgraded to jaunty. Since this is unlikely to be fixed for the jaunty release, let's continue after the release, when I will have more time to do test scans. Ping me then, please.

Revision history for this message
George Bourozikas (george-bourozikas) wrote :

I have been using gscan2pdf infrequently for years without any issue. Two
days ago, without any changes in configuration, my scans appear skewed.

This is true for both 0.9.27 from Jaunty and 0.9.29 from the Launchpad.

I narrowed it down to the x-perl frontends.

The following frontends are available to me:

   libsane-perl -- produces skewed output
   scanimage -- works fine
   scanimage-perl -- produces skewed output
   scanadf-perl (did not try)
   scanadf (did not try)

Per Jeff Ratcliffe's suggestion, I tried the "test" backend with libsane-perl and it works fine, both for the grid and colour output.

I am using an HP LaserJet 3330 with HPLIP.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote : Re: [Bug 358970] Re: gscan2pdf distorts image with scanimage.pl frontend, but works with scanadf fro

On Apr 18, 2009 7:45pm, Lars Wirzenius <email address hidden> wrote:
> Ping me then, please.

Lars - I have in the mean time upgraded to Jaunty and still cannot
reproduce this with my HP OfficeJet 5510.

I assume you are also using the HPLIP backend for SANE?

All - as I can't reproduce this, unless one of you has some Perl experience
and is prepared to hack scanimage-perl, the best I can do is trial and
error. I'll have a good look at the scanimage.c code and see what changed
between 1.0.19 and 1.0.20 and post some patches to scanimage-perl here if I
find anything significant.

Revision history for this message
Fixerdave (fixerdave) wrote :

I'm also now getting distortion with gscan2pdf. Not sure about the scanimage.pl front-end bit. Where's the option for this?

Here's what I do know:

Everything worked great with Ubuntu v8.10. Last week, I scanned in a 480 page book and it was great (awesome program by the way). I just upgraded to Ubuntu v9.10 and it stopped working.

Details:
Scanner in question is an HP LaserJet 3200 (all in one), locally attached via USB. Another scanner, an Epson v300 with the extra drivers, did scan in just fine with gscan2pdf, so it's something specific to the HP. (there is another bug with the Epson: Bug #424249, but that's a different story).

The HP scanner works fine with Xsane, so the scanner does actually work.

The distortions are horizontal banding and repeating. The very top of the page is fine, but then bits just get repeated and shuffled horizontally as well. The size of the repeated areas seem to be dependent on resolution; higher res, giving smaller areas repeated more often.

I do have a work-around... I can scan to jpg pages via xsane and then import those images to gscan2pdf, which (despite Bug #424249) I can save as a PDF just fine. (I'll add this part as a comment on the that bug too).

Again, gscan2pdf is a great program. Even without the ability to scan from my particular scanner, I'm still using it to make the PDFs. I hope this information helps you make it even better.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote : Re: [Bug 358970] Re: gscan2pdf distorts image with scanimage.pl frontend, but works with scanadf frontend

On Mon, Nov 02, 2009 at 02:07:58AM -0000, Fixerdave wrote:
> I'm also now getting distortion with gscan2pdf. Not sure about the
> scanimage.pl front-end bit. Where's the option for this?

In Edit/Preferences.

> Scanner in question is an HP LaserJet 3200 (all in one), locally attached via USB. Another scanner, an Epson v300 with the extra drivers, did scan in just fine with gscan2pdf, so it's something specific to the HP. (there is another bug with the Epson: Bug #424249, but that's a different story).

I have an HP OfficeJet, which works fine - so the problem is in
libsane-perl's handling of the LaserJet. Unfortunately, unless
somebody can lend me their LaserJet, this is going to be very
difficult to fix, I can't reproduce the problem.

Revision history for this message
Fixerdave (fixerdave) wrote :

>> Where's the option for this?

> In Edit/Preferences.

Ha... starred right at it and didn't see it. Thanks. And, yes, it worked just fine with scanimage picked.

As far as I'm concerned, it's fixed :) I'm a happy camper... well, make that a happy scanner.
Thanks for the hint.

If you want to pursue this and there's any testing I can do, let me know. Otherwise, good luck with Bug #424249; that's way more important than this.

    David...

P.S. Just to be clear, the HP LaserJet 3200 is an old piece of junk, given to me because the person that bought it could NEVER get it to scan under Windows. I mean, it shipped with a W98 driver CD. Right from the get-go, it worked better with Ubuntu than it ever did under XP. Not great, but better. I wouldn't waste more than a few minutes on this thing; honestly, I'd have already thrown it in the bin if it wasn't so heavy. Kind of glad I didn't now.

Revision history for this message
Tobias Holm (p-launchpad-eftprod-com) wrote :

I got the same problem with skewed scans using libsane-perl when running gscan2pdf directly from source. I couldn't use scanimage with my scanner "Fujitsu fi-4120C2" because the scanner wasn't found. I found a solution to add the scanner to scanimage:

Create the file "40-libsane.rules", put in the text below, restarted the scanner.
$ sane-find-scanner
found USB scanner (vendor=0x04c5, product=0x10ae) at libusb:001:005

$ cat /etc/udev/rules.d/40-libsane.rules
ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ae", ENV{libsane_matched}="yes"

$ scanimage -L
device `fujitsu:fi-4120C2dj:28848' is a FUJITSU fi-4120C2dj scanner

Anyway, to troubleshoot libsane-perl a little more, I got the skewed scans using a modified perl-source for gscan2pdf v1.7.1. If I run a compiled version of gscan2pdf the scans works without skew. If I run the original perl-source for gscan2pdf v1.7.1 it works without skew, so obviously it was my modifications in the source that caused the skewing. After troubleshooting I find this line in the source causing the skewing:

use Encode::Escape qw();

I removed it and now the scanning with libsane-perl works again without skewing.

Changed in gscan2pdf (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.