Hello,


Le 17 mars 08 à 18:18, Carlo Scarfoglio a écrit :

Hi all,
I started with fixing a problem with my HP OfficeJet scanner


Which Operating System ?


and now I'm having a look at several issues that I found checking the code of the scanner dialog used in writer and draw. The functionality is there, but it looks like old, unmantained code.


Not exactly. Just resources are missing to rewrite a brand new interface.

FYI, all the relevant code is in extensions/source/scanner, and there is an effort to implement something more usefull on Mac OS X.

There is a Doxygen generated documentation available here : http:// eric.bachard.free.fr/Education/Documentation/AquaScanner/html/


For further information, please look at : http:// wiki.services.openoffice.org/wiki/Education_Project/Effort

More precisely here : http://wiki.services.openoffice.org/wiki/ Education_Project/Effort#Improve_Scanner_Use_.28click_me.29

IMPORTANT:  my mailer adds extra spaces in the URL, please take care.


Bugs fixed so far:
1) The dialog offered two resolution selections for the OfficeJet: 75 and 1200 DPI, the minimum and maximum. The OfficeJet can scan at any DPI value between 75 and 1200, but the edit box was not editable. I inserted some additional DPI values in the listbox and made the edit box editable. This should work for any scanner that can scan at any DPI value between min and max. 2) Tested with a Canon Lide scanner, the listbox offered several DPI values, but again only the min and max values were selectable, The code wrongly set the min and max listbox range: the min DPI value as max and viceversa. This happened because the Lide can scan at fixed DPI values, but the driver returns the values in the opposite order to what the code expected it to be. The resolution edit box is not editable.


...

I reworked the user interface. The changes so far.
3) Moved controls around to make the dialog more compact.
4) Added a listbox to choose the scan mode (Color, Grey and Lineart) directly, without accessing the advanced options treebox. Several mouse clicks saved. And 5) removed the Advanced options checkbox. The treebox is always in advanced mode.
6) Increased the size of the preview rectangle.

The preview rectangle poses a problem. The X and Y sizes are constants set in the .hrc file

Exact. This is awfull and there is work in progress for a new layouting.



. I can turn them into variables, and set them at runtime according to the width and height of the scan area (the OfficeJet has 220x381 mm, the Lide 215x300 mm, for instance) and within the bounds of the dialog box.

Are you sure all scanners have the same values ?  ;-)


But the preview image is always vertically squashed because the screen aspect ratio is not taken into account. Aspect ratio is usually 1,25 (for 1280x1024) or 1,33 (for 1024z768), but new LCD screens can have other ratios.


Looks like a layout side effect. Needs to be discussed.



I couldn't find a way to determine this ratio. There are private variables in the Window class that (my guess) should hold these values. I think that some functions, such as PixelToLogic, etc should provide help, but I couldn't find any documentation.



I'm interested to see the changes you did. Do you have patches ?


Can anybody provide help or a hint?



Yes, sure, but I'd like to understand what you exactly did first. AFAIK, there is a TWAIN Handler on Windows, or a SANE one on Mac OS X, and the values should be correct without modify what you described.



If anybody with a build system and a working scanner is keen to test the beast, I will send another email witih the relevant files attached.


You're welcome !

Looking forward to reading you :)




P.S. : do you use IRC ? you'll see me on Education channel: server: irc.freenode.net channel : #education.openoffice.org
my nickname is ericb2

--
qɔᴉɹə




Reply via email to