Bug 370972 - Scanned image is bad
Summary: Scanned image is bad
Status: RESOLVED FIXED
Alias: None
Product: Skanlite
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords:
: 356124 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-10-16 22:03 UTC by Marc
Modified: 2019-04-14 08:56 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: KDE Applications 18.12


Attachments
scanned image with skanlite (357.96 KB, image/png)
2016-10-16 22:04 UTC, Marc
Details
scan lite basic option (32.53 KB, image/png)
2016-10-21 00:31 UTC, Marc
Details
scan like specific option (31.60 KB, image/png)
2016-10-21 00:32 UTC, Marc
Details
Skanlite window (1.18 MB, image/png)
2018-07-16 18:56 UTC, Ilario Gottardello
Details
Digikam window (641.20 KB, image/png)
2018-07-16 18:58 UTC, Ilario Gottardello
Details
Digikam: options and preview (525.64 KB, image/png)
2018-07-21 19:01 UTC, Ilario Gottardello
Details
Skanlite: options and preview (1.19 MB, image/png)
2018-07-21 19:02 UTC, Ilario Gottardello
Details
Skanlite: rc file (467 bytes, text/plain)
2018-07-21 19:03 UTC, Ilario Gottardello
Details
output log (lvel 255) from clean start (88.77 KB, text/x-log)
2018-07-25 20:04 UTC, Ilario Gottardello
Details
output log (lvel 255) from clean start but changing gamma value (89.02 KB, text/x-log)
2018-07-25 20:04 UTC, Ilario Gottardello
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc 2016-10-16 22:03:57 UTC
when i try to scan an image with skanlite, i get a very bad image.

if i pass by digikam or showfoto, image is ok.

Reproducible: Always

Steps to Reproduce:
1. start skanlite
2. scan image
3. save image

Actual Results:  
image is bad

Expected Results:  
scanned image should be ok
Comment 1 Marc 2016-10-16 22:04:28 UTC
Created attachment 101593 [details]
scanned image with skanlite

scanned image with skanlite
Comment 2 Kåre Särs 2016-10-17 10:01:39 UTC
Thanks for the report!

I wonder if you are scanning in 8 or 16 bits per color mode? It looks a bit like it could be a byte order problem.

What scanner are you using and are you using 16 bits / color mode?

Regards,
  Kåre
Comment 3 Marc 2016-10-17 11:19:16 UTC
i use hp scanjet 3300c

get same result with grey or color mode
Comment 4 Kåre Särs 2016-10-17 11:28:38 UTC
The thing is that Digikam and Showfoto use the same library as Skanlite...

Can you attach a screen-shot of the settings? Both "Basic Options" and "Scanner Specific Options"?
Comment 5 Marc 2016-10-21 00:31:36 UTC
Created attachment 101674 [details]
scan lite basic option
Comment 6 Marc 2016-10-21 00:32:14 UTC
Created attachment 101675 [details]
scan like specific option
Comment 7 Ilario Gottardello 2017-09-25 20:47:56 UTC
I have an HP ScanJet 3400C and I have the exact same behaviour!!! I have to use scanimage from command prompt to scan a page properly..
Comment 8 Ilario Gottardello 2017-09-25 20:49:22 UTC
forgot to say that I use Ubuntu Neon and skanlite is at version 2.0.1-0neon+16.04+xenial+bu amd64
Comment 9 Kåre Särs 2017-09-26 05:42:17 UTC
Sorry Marc for not answering earlier.

Could you try resetting the scanner options to their default values?

Go to "Settings" (Configuration) and click on the "Revert scanner options to default values"

/Kåre
Comment 10 Ilario Gottardello 2017-09-26 06:00:24 UTC
Kåre,

unfortunately it doesn't change anything
Comment 11 Kåre Särs 2017-09-26 06:54:58 UTC
Ilario,

Can you try with different settings: color mode, color depth, resolution, gamma,...

This is probably a scanner specific problem with the backend(driver) and how it works with Skanlite.

/Kåre
Comment 12 Ilario Gottardello 2017-09-26 16:57:12 UTC
Tried with varing combinations of options, still same result: the image is garbled
Comment 13 George Seaton 2018-02-04 04:50:05 UTC
I have seen the same issue on Scientific Linux 7 and Fedora 27.
The strange thing about this issue is that for me it works OK just after a clean install.  If I go back after a few weeks skanlite then gives me the corrupted image.  If I use simple-scan the scanning works as expected.
Comment 14 Ilario Gottardello 2018-07-16 18:46:13 UTC
(In reply to Kåre Särs from comment #11)
> Ilario,
> 
> Can you try with different settings: color mode, color depth, resolution,
> gamma,...
> 
> This is probably a scanner specific problem with the backend(driver) and how
> it works with Skanlite.
> 
> /Kåre

Now I started to use digiKam, and I noticed that digikam seems to open something that is stunningly similar to skanlite.. is it possible that in effect, what we are using in skanlite or digikam is a backend? I ask this because digikam works!!
Comment 15 Ilario Gottardello 2018-07-16 18:56:56 UTC
Created attachment 113971 [details]
Skanlite window

This is what I get from a preview from the scanner
Comment 16 Ilario Gottardello 2018-07-16 18:58:00 UTC
Created attachment 113972 [details]
Digikam window

This is the digikam window (with no document on the scanner, but it works well)
Comment 17 Kåre Särs 2018-07-17 09:21:14 UTC
Thanks for the update and the screen-shots.

Could you also take screen-shots of the "Scanner Specific" options in Skanlite and Digikam?

I suspect that the problem might be that Skanlite uses different default values or has saved some option that breaks the scanning.

Thanks,
  Kåre
Comment 18 Maik Qualmann 2018-07-17 11:53:39 UTC
I think the problem is not due to Skanlite but to libksane. In digiKam, we do not use the function of libksane to convert the scanner raw data to an image because we need a DImg(). I remember that I also fixed the function and extended it to e.g. to support the line mode, before that had digiKam similar problems.

Maik
Comment 19 Kåre Särs 2018-07-17 13:20:58 UTC
Hi Maik,

Do you mean that Digikam just doesn't use the KSaneWidget::toQImage() or that it doesn't use vanilla libksane?


The thing is that the preview window should be identical in both applications if vanilla libksane is used.


If you have fixes for "line mode", I'm interested :)

/Kåre
Comment 20 Maik Qualmann 2018-07-17 14:02:52 UTC
You're right, the preview must come from the KSaneWidget. We use the libksane from the system, if it is not available, we compile an internal one from git/master. I'll check it tonight and see if I can reproduce the problem with Skanlite and my Epson printer/scanner.

Maik
Comment 21 Ilario Gottardello 2018-07-17 14:20:24 UTC
Kåre, Maik,

if you need some test with the HP ScanJet I am willing to help. Are the options screenshots still needed?
Comment 22 Kåre Särs 2018-07-18 06:25:13 UTC
I actually tested the "line-art" option on a HP printer/scanner and yes there is something wrong with converting "line-art" data to a QImage. The preview looks OK tho... Now that I have a HP scanner I can at least check the line-art problem.

But I think Ilario's problem is something different.

Ilario: You don't necessarily need to provide the "Scanner Specific" options, but I would like to know if the options are exactly the same?

One difference between Digikam/Showphoto and Skanlite is that Skanlite saves the current options on exit and restores them on startup. It could be that Skanlite has some old value stored, that with a new version of the sane backend produces the broken image or that there is a rounding error in saving/restoring an option (or that the options are restored in an order that the backend cannot handle)


You could try to attach ~/.config/skanlirerc here and then maybe remove the file  before starting Skanlite and see if that solves the problem. 

/Kåre
Comment 23 Maik Qualmann 2018-07-18 12:25:47 UTC
I am currently unable to reproduce problems with Skanlite and my Epson scanner. All scan options work as expected, also line-art.

Maik
Comment 24 Marc 2018-07-18 12:27:47 UTC
I still have the problem, I can provide you information you will ask tonigh
Comment 25 Kåre Särs 2018-07-19 18:47:20 UTC
I have now investigated my HP Deskjet scanner problem and it turned out to be a bug in the backend. The backend returned bytes_per_line == pixels_per_line even if the image is encoded one bit (not byte) per pixel.

I have added a workaround for it in libksane (18.08 and master)


But I'm afraid that will not fix the problem with the broken image in color mode.


Does it help to remove the ~/.config/skanlirerc file?

/Kåre
Comment 26 Marc Collin 2018-07-20 01:27:28 UTC
I don't have any rc file...
many update was available with tumbleweed

I have skanlite 2.1.0.1 and the problem was not present a few minute ago...
Comment 27 Ilario Gottardello 2018-07-21 19:01:55 UTC
Created attachment 114059 [details]
Digikam: options and preview
Comment 28 Ilario Gottardello 2018-07-21 19:02:27 UTC
Created attachment 114060 [details]
Skanlite: options and preview
Comment 29 Ilario Gottardello 2018-07-21 19:03:11 UTC
Created attachment 114061 [details]
Skanlite: rc file
Comment 30 Ilario Gottardello 2018-07-21 19:09:17 UTC
It works!!!!!!!! Removing the skanliterc file fixed the issue!!!!!! I really don't understand why, it doesn't contain odd things.. but, now it works :)
Comment 31 Kåre Särs 2018-07-21 22:26:10 UTC
Thanks for the update!

So if you now close Skanlite and start again does it still work or do you have to remove the rc file every time for it to work?

And if it continues to work how does the rc file look now?

Regards,
  Kåre
Comment 32 George Seaton 2018-07-22 03:23:42 UTC
Removing the Skanliterc in SL7 fixes the broken colour image for me in SL7 (RHEL7).
If I then restart skanlite then I get the broken colour image preview again.
Looks like it has to be deleted every time.
The skanlite rpm packages are being supplied by the epel repository 
skanlite.x86_64                        1.1-8.el7                   @epel

Regards,
George
Comment 33 Ilario Gottardello 2018-07-23 21:58:42 UTC
(In reply to George Seaton from comment #32)
> Removing the Skanliterc in SL7 fixes the broken colour image for me in SL7
> (RHEL7).
> If I then restart skanlite then I get the broken colour image preview again.
> Looks like it has to be deleted every time.
> The skanlite rpm packages are being supplied by the epel repository 
> skanlite.x86_64                        1.1-8.el7                   @epel
> 
> Regards,
> George

I confirm this behaviour in KDE NEON, skanlite version 2.1.0.1-1+16.04+xenial+build9
Comment 34 Kåre Särs 2018-07-24 07:03:57 UTC
Thanks for the updates!

So basically it seems that when Skanlite tries to restore the previous settings, it restores them in an order that the backend does not like and something breaks in the backend.

It seems you both have the sane-niash backend. Can you run Skanlite from the command line with the following command (without deleting the rc file):

SANE_DEBUG_NIASH=16 skanlite

And then attach the output here? Can you also try with different values for the debug level (255 is the maximum). Does it contain any data that indicates errors?

After that we could file a bug-report to the niash backend developers.

Thanks,
   Kåre
Comment 35 Marc Collin 2018-07-24 21:20:15 UTC
with tumbleweed I get

SANE_DEBUG_NIASH=16 skanlite
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-postgres'
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-postgres'
error: XDG_RUNTIME_DIR not set in the environment.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)
Comment 36 Ilario Gottardello 2018-07-24 22:13:27 UTC
These are two executions of skanlite, the first with the rc file and the second one without it:


[niash] sane_get_option_descriptor 6
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 150
[niash] sane_get_option_descriptor 8
[niash] sane_control_option: option 6, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 6 = 600
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 600
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 4 = 220
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 5 = 296
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 8, action 1
[niash] Writing gamma table
[niash] Gamma table summary:
[niash]  0000 0040 0080 00C0
[niash]  0100 0140 0180 01C0
[niash]  0200 0240 0280 02C0
[niash]  0300 0340 0380 03C0
[niash]  0400 0440 0480 04C0
[niash]  0500 0540 0580 05C0
[niash]  0600 0640 0680 06C0
[niash]  0700 0740 0780 07C0
[niash]  0800 0840 0880 08C0
[niash]  0900 0940 0980 09C0
[niash]  0A00 0A40 0A80 0AC0
[niash]  0B00 0B40 0B80 0BC0
[niash]  0C00 0C40 0C80 0CC0
[niash]  0D00 0D40 0D80 0DC0
[niash]  0E00 0E40 0E80 0EC0
[niash]  0F00 0F40 0F80 0FC0
"niash:libusb:002:010"
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 600
[niash] sane_control_option: option 10, action 0
[niash] Reading scan mode Color
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 600
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 6, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 6 = 75
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 75
[niash] sane_get_parameters
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 75
[niash] sane_control_option: option 10, action 0
[niash] Reading scan mode Color



[niash] sane_get_option_descriptor 0
[niash] sane_control_option: option 0, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 0 = 13
[niash] sane_get_option_descriptor 1
[niash] sane_get_option_descriptor 1
[niash] sane_get_option_descriptor 2
[niash] sane_get_option_descriptor 2
[niash] sane_get_option_descriptor 3
[niash] sane_get_option_descriptor 3
[niash] sane_get_option_descriptor 4
[niash] sane_get_option_descriptor 4
[niash] sane_get_option_descriptor 5
[niash] sane_get_option_descriptor 5
[niash] sane_get_option_descriptor 6
[niash] sane_get_option_descriptor 6
[niash] sane_get_option_descriptor 7
[niash] sane_get_option_descriptor 7
[niash] sane_get_option_descriptor 8
[niash] sane_get_option_descriptor 8
[niash] sane_get_option_descriptor 9
[niash] sane_get_option_descriptor 9
[niash] sane_get_option_descriptor 10
[niash] sane_get_option_descriptor 10
[niash] sane_get_option_descriptor 11
[niash] sane_get_option_descriptor 11
[niash] sane_get_option_descriptor 12
[niash] sane_get_option_descriptor 12
[niash] sane_get_option_descriptor 10
[niash] sane_control_option: option 10, action 0
[niash] Reading scan mode Color
[niash] sane_get_option_descriptor 12
"1 instead of 0 arguments to message { %} supplied before conversion."
[niash] sane_get_option_descriptor 6
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 150
[niash] sane_get_option_descriptor 8
[niash] sane_control_option: option 6, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 6 = 600
[niash] sane_get_option_descriptor 1
[niash] sane_get_option_descriptor 2
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_get_option_descriptor 3
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_get_option_descriptor 4
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 210
[niash] sane_get_option_descriptor 5
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 290
[niash] sane_get_option_descriptor 6
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 600
[niash] sane_get_option_descriptor 7
[niash] sane_get_option_descriptor 8
[niash] sane_get_option_descriptor 9
[niash] sane_get_option_descriptor 10
[niash] sane_control_option: option 10, action 0
[niash] Reading scan mode Color
[niash] sane_get_option_descriptor 11
[niash] sane_get_option_descriptor 12
"1 instead of 0 arguments to message { %} supplied before conversion."
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 4 = 220
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 5 = 296
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 600
"niash:libusb:002:010"
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 600
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_control_option: option 6, action 1
[niash] sane_control_option: SANE_ACTION_SET_VALUE 6 = 75
[niash] sane_get_option_descriptor 1
[niash] sane_get_option_descriptor 2
[niash] sane_control_option: option 2, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 2 = 0
[niash] sane_get_option_descriptor 3
[niash] sane_control_option: option 3, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 3 = 0
[niash] sane_get_option_descriptor 4
[niash] sane_control_option: option 4, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 4 = 220
[niash] sane_get_option_descriptor 5
[niash] sane_control_option: option 5, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 5 = 296
[niash] sane_get_option_descriptor 6
[niash] sane_control_option: option 6, action 0
[niash] sane_control_option: SANE_ACTION_GET_VALUE 6 = 75
[niash] sane_get_option_descriptor 7
[niash] sane_get_option_descriptor 8
[niash] sane_get_option_descriptor 9
[niash] sane_get_option_descriptor 10
[niash] sane_control_option: option 10, action 0
[niash] Reading scan mode Color
Comment 37 Kåre Särs 2018-07-25 06:42:26 UTC
Thanks for the logs.

Unfortunately in that log level I could not find anything strange.... except for the gamma table that seems to be 64 16bit entries.

I wonder what happens if you remove the rc file and alter the gamma and then alter it back to the original before scanning. Do you get the same broken result?

It would be good to get the debug output for that too.
Comment 38 Ilario Gottardello 2018-07-25 20:04:27 UTC
Created attachment 114125 [details]
output log (lvel 255) from clean start
Comment 39 Ilario Gottardello 2018-07-25 20:04:55 UTC
Created attachment 114126 [details]
output log (lvel 255) from clean start but changing gamma value
Comment 40 Ilario Gottardello 2018-07-25 20:06:29 UTC
Kåre, you're right!! Changing gamma value trigger the corruption even starting from a clean state!!
Comment 41 Christoph Feck 2018-08-17 21:47:18 UTC
What is the status of this bug? It is unclear what additional information is needed.
Comment 42 Kåre Särs 2018-08-19 08:43:03 UTC
Sorry for not answering earlier!

The issue seems to be that the backend has a broken gammatable property, and that when Skanlite tries to restore the previous settings, it writes a gamma table that does not work with the backend...

With epson scanners, the gammatable is 256 8-bit entries, but this one seems to be 64 16-bit entries and that seems wrong...
Comment 43 Kåre Särs 2018-08-23 16:29:08 UTC
I have now checked the code in niash and found that the gamma-table in niash is 4096 entries with the range 0-255. Libksane has so far expected that the number of entries is the same as the maximum value. This has to be investigated further...
Comment 44 Kåre Särs 2018-08-25 11:22:36 UTC
Git commit ef39d6cfd6c97880061e6ebb32c9c611e372f920 by Kåre Särs.
Committed on 25/08/2018 at 11:20.
Pushed by sars into branch 'master'.

Fix setting gamma-tables that are not symmetrical (items / range)

Libksane expected gamma-tables to have as many entries as the maximum
value in the table. This is not the case for example in the niash
backend. This patch will hopefully fix the setting of gamma-table
for the niash backend.

I do not have a scanner that has an asymmetrical gamma-table, so I
cannot test this fully.
FIXED-IN: KDE Applications 18.12

Also change names of some variables to follow KF5 coding standards

M  +1    -1    src/ksanewidget_p.cpp
M  +4    -2    src/options/ksaneoptgamma.cpp
M  +13   -13   src/widgets/gammadisp.cpp
M  +4    -3    src/widgets/gammadisp.h
M  +75   -69   src/widgets/labeledgamma.cpp
M  +12   -8    src/widgets/labeledgamma.h

https://commits.kde.org/libksane/ef39d6cfd6c97880061e6ebb32c9c611e372f920
Comment 45 Kåre Särs 2018-08-25 11:30:17 UTC
Hi,

At least there was one bug in libksane! This should now be fixed. libksane could not handle asymmetrical gamma-tables. So it looks like the problem was _not_ in the niash backend after all... I'm not able to fully verify the fix as I do not have a scanner that uses the niash backend.

Is there anybody that can verify this fix by compiling libksane and test the gamma setting? I can provide some help if needed.

Regards,
 Kåre
Comment 46 Kåre Särs 2019-04-14 08:56:01 UTC
*** Bug 356124 has been marked as a duplicate of this bug. ***