Summary: | Scanned image is bad | ||
---|---|---|---|
Product: | [Applications] Skanlite | Reporter: | Marc <marccollin7379> |
Component: | general | Assignee: | Kåre Särs <kare.sars> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | george.seaton, ilario.gottardello, linuxdavide, marc.collin, metzpinguin |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/libksane/ef39d6cfd6c97880061e6ebb32c9c611e372f920 | Version Fixed In: | KDE Applications 18.12 |
Attachments: |
scanned image with skanlite
scan lite basic option scan like specific option Skanlite window Digikam window Digikam: options and preview Skanlite: options and preview Skanlite: rc file output log (lvel 255) from clean start output log (lvel 255) from clean start but changing gamma value |
Description
Marc
2016-10-16 22:03:57 UTC
Created attachment 101593 [details]
scanned image with skanlite
scanned image with skanlite
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 i use hp scanjet 3300c get same result with grey or color mode 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"? Created attachment 101674 [details]
scan lite basic option
Created attachment 101675 [details]
scan like specific option
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.. forgot to say that I use Ubuntu Neon and skanlite is at version 2.0.1-0neon+16.04+xenial+bu amd64 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 Kåre, unfortunately it doesn't change anything 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 Tried with varing combinations of options, still same result: the image is garbled 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. (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!! Created attachment 113971 [details]
Skanlite window
This is what I get from a preview from the scanner
Created attachment 113972 [details]
Digikam window
This is the digikam window (with no document on the scanner, but it works well)
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 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 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 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 Kåre, Maik, if you need some test with the HP ScanJet I am willing to help. Are the options screenshots still needed? 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 I am currently unable to reproduce problems with Skanlite and my Epson scanner. All scan options work as expected, also line-art. Maik I still have the problem, I can provide you information you will ask tonigh 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 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... Created attachment 114059 [details]
Digikam: options and preview
Created attachment 114060 [details]
Skanlite: options and preview
Created attachment 114061 [details]
Skanlite: rc file
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 :) 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 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 (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 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 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) 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 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. Created attachment 114125 [details]
output log (lvel 255) from clean start
Created attachment 114126 [details]
output log (lvel 255) from clean start but changing gamma value
Kåre, you're right!! Changing gamma value trigger the corruption even starting from a clean state!! What is the status of this bug? It is unclear what additional information is needed. 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... 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... 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 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 *** Bug 356124 has been marked as a duplicate of this bug. *** |