Summary: | scan size incorrect if no preview done first (overallHeight and overallWidth hardcoded in class Previewer) | ||
---|---|---|---|
Product: | [Applications] kooka | Reporter: | Alex Kempshall <mcmurchy1917-kooka> |
Component: | libkscan | Assignee: | Jonathan Marten <jjm> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Slackware | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Alex Kempshall
2008-03-31 10:30:06 UTC
The comment may be misleading, but I'm not sure that the hardcoded values are a problem regardless of the scanner bed size. The preview scan is always done at the maximum scan area (ScanParams::slAcquirePreview() calling ScanParams::slMaximalScanSize()). When the preview scan completes, Previewer::newImage() calls Previewer::setScanSize() which sets overallHeight/overallWidth to the size of the preview result image - i.e. the scanner bed size. These values are then used in all subsequent size calculations. So if a preview scan is done first, the scaling should be correct. This may possibly not happen, though, if a final scan is started immediately without a preview scan first. Leaving this bug open for further investigation. Confirmed. If no preview scan is done, Previewer::setScanSize() is never called so the values stay as their hardcoded default. (Which, to add insult to injury, are wrong - A4 is 297mm high not 295). Letter paper, BTW, is 216mm x 279mm. Did you mean to write '279' instead of '297', or is your scanner bed a very odd size? Must have had a funny five minutes. The Maximum Supported Media Size of my Canon n670u is 216 x 297 mm. Probably got confused with the imperial measurements! I normally go straight, or like to, a final scan. If the settings are remain the same from previous scans I see little point in doing a preview first when starting kooka. So. If the hardcoded values were correctly set to A4 those users with an A4 scanner can go straight to a final scan assuming they've changed the dropdown menu, under Preview, from Custom to A4. For those users with say an A3 scanner, are there any, would have to do a preview first. Noticed that the before mentioned dropdown menu doesn't contain a setting for A3. Getting back to the initial point the hardcoded values should therefore be 297 x 216 reflecting maximum height A4 and maximum width - Letter. 1. A preview using an A4 scanner will change them to A4 values. 2. A preview using a Letter scanner would change them to Letter values. 3. No preview would leave them as hardcoded. SVN commit 806900 by marten: Scan size selection control moved from the previewer to the scan parameters. A more logical place for it, and makes it possible to scan a preset area without having to do a preview first. Much simplified the signal/slot communications between the scan parameters, previewer and preview image. Kooka: "About" shows new home page at http://techbase.kde.org/Projects/Kooka libkscan: Show previewer file size in the standard localised format, using KIO::convertSize() Take account of colour mode and bit depth when calculating that size Properly handle scanner bed size, bug 160148 Show selection area in pixels as well as millimetres Fix occasional crash when using KScanOption::get() on a SANE_TYPE_STRING value CCBUG:160148 M +2 -0 kooka/kookagallery.cpp M +37 -68 kooka/kookaview.cpp M +1 -1 kooka/kookaview.h M +1 -1 kooka/main.cpp M +5 -6 kooka/scanpackager.cpp M +2 -2 libkscan/Makefile.am M +201 -255 libkscan/img_canvas.cpp M +15 -31 libkscan/img_canvas.h M +1 -0 libkscan/kscancontrols.cpp M +19 -7 libkscan/kscandevice.cpp M +2 -0 libkscan/kscandevice.h M +18 -9 libkscan/kscanoption.cpp M +2 -2 libkscan/kscanoption.h M +189 -335 libkscan/previewer.cpp M +31 -46 libkscan/previewer.h M +2 -1 libkscan/scandialog.cpp M +200 -94 libkscan/scanparams.cpp M +17 -12 libkscan/scanparams.h A libkscan/scansizeselector.cpp [License: LGPL (v2+)] A libkscan/scansizeselector.h [License: LGPL (v2+)] M +14 -30 libkscan/sizeindicator.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=806900 Fixed by that commit - area is properly initialised to scanner bed size as reported by SANE. That's fixed the problem whereby I was seeing a slightly different size of image when I went straight to a final scan. |