hpaio: Line-art mode returns wrong bytes_per_line

Bug #1782634 reported by Kåre Särs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
In Progress
Undecided
Unassigned

Bug Description

Hi,

I got a bug report about broken images when scanning with Skanlite/libksane. When I tried to investigate the problem with a HP Deskjet I could reproduce a problem with the line-art mode.

Backend
 hpaio:/usb/Deskjet_1050_J410_series

Ubuntu 16.04 (KDE Neon)
/usr/lib/x86_64-linux-gnu/sane/libsane-hpaio.so.1.0.0

The problem is that in line-art mode sane_get_parameters() returns bytes_per_line == pixels_per_line even if the image is encoded as one bit (not byte) per pixel.

I hope I'm reporting to the right place...

/Kåre

Revision history for this message
srinivas (srinivas5) wrote :

Hi,

Are you seeing this issue when you scan with xsane and hp-scan? Please confirm
If yes, can you also share the input and output images in lineart mode to check furthur.

Regards,
Srinivas Teja.

Changed in hplip:
status: New → In Progress
Revision history for this message
Kåre Särs (kare-sars-iki) wrote :

Hi,

I have not tried, with xsane, I can do that when I get home from work.

It is possible that it is not noticeable in xsane except that that the progress bar is only reaching about 1/8:th of it's length before getting ready.

In libksane the preview scan displays the image correct because the converting of the image is done a bit different from the final scan, but the progress bar only reaches 1/8:th of the way in both cases.

The problem is in the SANE_Parameters returned from the sane_get_parameters() after sane_start(). The SANE_Parameters struct parameter bytes_per_line parameter is equal to pixels_per_line even if it should be ceil((double)pixels_per_line/8) (or a smarter integer-only calculation).

Regards,
  Kåre

Revision history for this message
srinivas (srinivas5) wrote :

Hi,

We do not support Skanlite/libksane. Hence requested for the behaviour in hp-scan.
So please try and confirm.
Also i did not get the problem when you are say "broken images".
So kindly share the screenshots or the input and output scanned images in lineart mode to check and analyse furthur.

Regards,
Srinivas Teja.

Revision history for this message
Kåre Särs (kare-sars-iki) wrote :

Hi,

I forgot to do the scans with hp-scan, but hopefully this helps more ;)

The attached patch fixes the wrong number of bytes per line in line-art mode for me at least. From the code it looks like the ppb->bytes_per_line comes from somewhere else, so it could be that a fix could be applied where that variable is set, but I'm not so familiar with the hpaio backend and I only have one old HP scanner.

I have tested that the same code path also still works for 8-bit/color mode.

If you still want images or debug runs I can provide them too.

Regards,
  Kåre

Revision history for this message
Kåre Särs (kare-sars-iki) wrote :
Revision history for this message
Kåre Särs (kare-sars-iki) wrote :

Now I tried also with hp-scan and noticed that with hp-scan it even did not generate a picture at all.

But the patch fixes it for hp-scan also.

Best Regards,
  Kåre

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.