Version: (using KDE KDE 3.5.0) Installed from: SuSE RPMs OS: Linux I found that all images saved with Kooka (at least JPEG and PNG) miss the resolution information at which they were scanned. This is very annoying when trying to print an image at a later time when the original resolution is not known any more. Both formats are able to hold this information, in PNG the "pHYs"-Block (http://www.w3.org/TR/PNG/#11pHYs) explicitly allows to set the correct resolution for the picture. It seems that other applications in KDE also lack support for these resolution fields in images, as even pictures with correctly set resolution fields print at 72 dpi. (I tested this with CorelDraw, which reads, writes and uses this information correctly.) There are several other bug reports with similar, but not equal, wishes; so this might be a very useful feature.
The Gimp complains about wrong resolution info in files created by Kooka. "Resolution out of bounds"
Hey, I think this is the same bug here: http://bugs.kde.org/show_bug.cgi?id=129645
*** This bug has been confirmed by popular vote. ***
*** Bug 129645 has been marked as a duplicate of this bug. ***
SVN commit 689188 by mkoller: BUG: 119110 Correctly retrieve the x/y scan resolution and store it into the scanned image M +28 -9 kscandevice.cpp --- branches/KDE/3.5/kdegraphics/libkscan/kscandevice.cpp #689187:689188 @@ -60,12 +60,13 @@ { public: KScanDevicePrivate() - : currScanResolution(0) + : currScanResolutionX(0), + currScanResolutionY(0) { } - int currScanResolution; + int currScanResolutionX, currScanResolutionY; }; @@ -788,13 +789,16 @@ } /* Set scan resolution for preview. */ - if( optionExists( SANE_NAME_SCAN_Y_RESOLUTION ) ) + if( !optionExists( SANE_NAME_SCAN_Y_RESOLUTION ) ) + d->currScanResolutionY = 0; + else { KScanOption yres ( SANE_NAME_SCAN_Y_RESOLUTION ); /* if active ? */ storeOptions->backupOption( yres ); yres.set( set_dpi ); apply( &yres ); + yres.get( &d->currScanResolutionY ); /* Resolution bind switch ? */ if( optionExists( SANE_NAME_RESOLUTION_BIND ) ) @@ -811,8 +815,10 @@ apply( &res ); /* Store the resulting preview for additional image information */ - res.get( &d->currScanResolution ); + res.get( &d->currScanResolutionX ); + if ( d->currScanResolutionY == 0 ) + d->currScanResolutionY = d->currScanResolutionX; /* Start scanning */ KScanStat stat = acquire_data( true ); @@ -914,6 +920,18 @@ kdDebug(29000) << "Option <" << so->getName() << "> is not active !" << endl; } } + + /** Scan Resolution should always exist. **/ + KScanOption res( SANE_NAME_SCAN_RESOLUTION ); + res.get( &d->currScanResolutionX ); + if ( !optionExists( SANE_NAME_SCAN_Y_RESOLUTION ) ) + d->currScanResolutionY = d->currScanResolutionX; + else + { + KScanOption yres( SANE_NAME_SCAN_Y_RESOLUTION ); + yres.get( &d->currScanResolutionY ); + } + return( acquire_data( false )); } else @@ -1169,13 +1187,14 @@ if( status == KSCAN_OK && img ) { ImgScanInfo info; - /* FIXME: Both resolutions are equal here but should be - * x and y different - */ - info.setXResolution(d->currScanResolution); - info.setYResolution(d->currScanResolution); + info.setXResolution(d->currScanResolutionX); + info.setYResolution(d->currScanResolutionY); info.setScannerName(shortScannerName()); + // put the resolution also into the image itself + img->setDotsPerMeterX(static_cast<int>(d->currScanResolutionX / 0.0254 + 0.5)); + img->setDotsPerMeterY(static_cast<int>(d->currScanResolutionY / 0.0254 + 0.5)); + if( scanningPreview ) { kdDebug(29000) << "Scanning a preview !" << endl;