From db5cdf8c42fd54fd45a4a2fb56563b09611d28ee Mon Sep 17 00:00:00 2001 From: Gerhard Jaeger Date: Mon, 22 Aug 2005 07:29:45 +0000 Subject: [PATCH] * doc/plustek/Plustek-USB.changes: Update. * backend/plustek.c: Bumped build number. * backend/plustek-usb.c backend/plustek-usbscan.c: Fixed problem, when trying to scan at resolutions beyond the optical one (sensor stops too early). --- backend/plustek-usb.c | 14 ++++++++++++-- backend/plustek-usbscan.c | 8 +++++--- backend/plustek.c | 2 +- doc/plustek/Plustek-USB.changes | 5 +++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/backend/plustek-usb.c b/backend/plustek-usb.c index 2e2162abf..e2a0dc925 100644 --- a/backend/plustek-usb.c +++ b/backend/plustek-usb.c @@ -1127,6 +1127,17 @@ static int usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) usleep( 10 * 1000 ); + /* need to preset that here, as we need it during parameter setting + */ + scan->bLinesToSkip = (u_char)(scan->sParam.PhyDpi.y / 50); + + scan->dwLinesDiscard = 0; + if( scan->sParam.bChannels == 3 ) { + scan->dwLinesDiscard = (u_long)scaps->bSensorDistance * + scan->sParam.PhyDpi.y / scaps->OpticDpi.y; + scan->dwLinesDiscard <<= 1; + } + if( !usb_SetScanParameters( dev, &scan->sParam )) { DBG( _DBG_ERROR, "Setting Scan Parameters failed!\n" ); return 0; @@ -1135,7 +1146,7 @@ static int usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) /* if we bypass the calibration step, we wait on lamp warmup here... */ if( scaps->workaroundFlag & _WAF_BYPASS_CALIBRATION ) { - if( !usb_Wait4Warmup( dev )) { + if( !usb_Wait4Warmup( dev )) { DBG( _DBG_INFO, "usbDev_Prepare() - Cancel detected...\n" ); return 0; } @@ -1256,7 +1267,6 @@ static int usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) /* set a funtion to process the RAW data... */ usb_GetImageProc( dev ); - scan->bLinesToSkip = (u_char)(scan->sParam.PhyDpi.y / 50); if( scan->sParam.bSource == SOURCE_ADF ) scan->dwFlag |= SCANFLAG_StillModule; diff --git a/backend/plustek-usbscan.c b/backend/plustek-usbscan.c index e8d6ade9a..d8fc51add 100644 --- a/backend/plustek-usbscan.c +++ b/backend/plustek-usbscan.c @@ -1250,10 +1250,12 @@ static SANE_Bool usb_SetScanParameters( Plustek_Device *dev, ScanParam *pParam ) */ if(pParam->bCalibration == PARAM_Scan && pParam->bSource != SOURCE_ADF) { - u_short scansteps = (u_short)ceil((double)(pParam->Size.dwPhyLines + 10)* + u_long lines = pParam->Size.dwPhyLines + scan->bLinesToSkip + + scan->dwLinesDiscard + 5; + u_short scansteps = (u_short)ceil((double)lines* hw->wMotorDpi / pParam->PhyDpi.y); - DBG( _DBG_INFO, "* Scansteps=%u (%lu*%u/%u)\n", scansteps, - pParam->Size.dwPhyLines, hw->wMotorDpi, pParam->PhyDpi.y ); + DBG( _DBG_INFO, "* Scansteps=%u (%lu*%u/%u)\n", scansteps, lines, + hw->wMotorDpi, pParam->PhyDpi.y ); regs[0x4c] = _HIBYTE(scansteps); regs[0x4d] = _LOBYTE(scansteps); } diff --git a/backend/plustek.c b/backend/plustek.c index 5a0f16058..06730047d 100644 --- a/backend/plustek.c +++ b/backend/plustek.c @@ -153,7 +153,7 @@ #include "../include/sane/sanei.h" #include "../include/sane/saneopts.h" -#define BACKEND_VERSION "0.50-2" +#define BACKEND_VERSION "0.50-3" #define BACKEND_NAME plustek #include "../include/sane/sanei_access.h" diff --git a/doc/plustek/Plustek-USB.changes b/doc/plustek/Plustek-USB.changes index 6dc481e15..22b340eb1 100644 --- a/doc/plustek/Plustek-USB.changes +++ b/doc/plustek/Plustek-USB.changes @@ -3,6 +3,11 @@ Plustek.changes - Gerhard J Note: All other not mentioned builds have never been released. +V 0.50-3 (2005-08-22) +--------------------- +Fixed problem, when trying to scan at resolutions beyond the +optical one (sensor stops too early) + V 0.50-2 (2005-08-19) --------------------- More cleanup.