ThierryHFR / scangearmp2

This project is a sane backend for the canon's scanner, based on the source code of scangearmp2.
Other
78 stars 17 forks source link

Fix size with resolution for libreoffice. #39

Closed ThierryHFR closed 3 years ago

ThierryHFR commented 3 years ago

Fix #35

insomniacno1 commented 3 years ago

Since #35 is closed, we can continue here:

Hi Odissimo, I'm sorry I have not been able or had energy to test, both my girlfriend and I have been in hospital with Dengue hemoradic fever - not fun and she could have died, I'm bigger so it affected me differently. I'm testing now.

It's almost there, but the scan area is still not good, it changes to a "fixed" size Right: 209 mm Bottom: 296 mm - which is not A4, since A4 is Right: 210 mm Bottom: 297 mm.

Even if I manually change the scan area to something smaller, then it jumps back to 209x296 - that takes the option of scanning a particular area out of the equation.

So what need to be fixed is the Scan area, so that "size set by user" stay in place when scanning, and the size is not "fixed".

Request: Is it possible to implement Standard international paper sizes like on the link below, so there is an option is to chose fixed size or set Scan area manually:

https://www.neenahpaper.com/resources/paper-101/international-sizes

Thank you for all your help on this.

Jan

ThierryHFR commented 3 years ago

Hi @insomniacno1 , I'm sorry I can't do better, below is the correspondence table:

    { CIJSC_SIZE_CARD,      1074,  649 },       // Card
    { CIJSC_SIZE_L_L,       1500, 1051 },       // L Landscape
    { CIJSC_SIZE_L_P,       1051, 1500 },       // L Portrait
    { CIJSC_SIZE_4X6_L,     1800, 1200 },       // 4"x6" Landscape
    { CIJSC_SIZE_4X6_P,     1200, 1800 },       // 4"x6" Portrait
    { CIJSC_SIZE_HAGAKI_L,          1748, 1181 },       // Hagaki Landscape
    { CIJSC_SIZE_HAGAKI_P,          1181, 1748 },       // Hagaki Portrait
    { CIJSC_SIZE_2L_L,      2102, 1500 },       // 2L Landscape
    { CIJSC_SIZE_2L_P,      1500, 2102 },       // 2L Portrait
    { CIJSC_SIZE_A5,        1748, 2480 },       // A5
    { CIJSC_SIZE_B5,        2149, 3035 },       // B5
    { CIJSC_SIZE_A4,        2480, 3507 },       // A4 size
    { CIJSC_SIZE_LETTER,            2550, 3300 }

Here is how the calculation is done: V = T * 2.54 / 300 For the A4

29 = 3507 * 2.54 / 300
20 = 2480 * 2.54 / 300

All sizes listed are supported. For the choice of sizes, the method I adopted is : 1 - the requested size exists, I retain it. 2 - If the requested size does not exist, I take the closest value upwards.

One solution would be for LibreOffice to provide you with a list of sizes.

I wish you a good recovery!

Thierry

insomniacno1 commented 3 years ago

Hi Thierry, is it possible to set the manual selection so that dragging with mouse, it stays there and don't jump back to default value - that could be the work around?

With kind regards

Jan