kopia lustrzana https://gitlab.com/sane-project/backends
Porównaj commity
801 Commity
Autor | SHA1 | Data |
---|---|---|
ThierryFR | b60e9f742e | |
Ordissimo | 264c59ee8c | |
Ralph Little | 70eff07edc | |
Ralph Little | 3ff55fd8ee | |
Ralph Little | 55ab38e89b | |
Ralph Little | 4a5b17a08f | |
Ralph Little | 285730d569 | |
ThierryFR | 15eb96b7a0 | |
ThierryFR | fbf80b0fc1 | |
ThierryFR | 7aa3d2de06 | |
ThierryFR | 004b79c096 | |
Ralph Little | 0f472aa205 | |
ThierryFR | 728ca40272 | |
ThierryFR | 113be50f6b | |
Ralph Little | bf99345ae2 | |
Cyp | c918dba927 | |
Cyp | bc54b0990f | |
ThierryFR | 7ab85011fc | |
Ordissimo | 219dc45c16 | |
Wolfram Sang | 3e8cd75207 | |
Guillaume Girol | a6d63a72ec | |
Wolfram Sang | 3d6acc98e0 | |
Wolfram Sang | e183e24b2f | |
Wolfram Sang | c87c40a981 | |
Ralph Little | 7088afe04d | |
Ralph Little | e1daaf076b | |
Ralph Little | 2f2394c20c | |
Wolfram Sang | ee5f9a89e1 | |
Alex Belkin | 05c770546f | |
Ralph Little | 490aecbbac | |
Ralph Little | 61f6eae88d | |
Ralph Little | 99f3679b57 | |
ThierryFR | 716e146ffc | |
Tyson Tan | 10b414c7c5 | |
Ralph Little | 37e4e6cabe | |
Ralph Little | 6b080c8c82 | |
Yuri Chornoivan | 6a57a9c308 | |
Ralph Little | b761349240 | |
Ralph Little | c98138f32e | |
Ralph Little | 0fe08c9036 | |
Wolfram Sang | fc6516afc1 | |
Wolfram Sang | f742d591fe | |
Ralph Little | 242562d54e | |
Ralph Little | a08d5bbfac | |
Wolfram Sang | 9266b647c5 | |
Artur Shepilko | 86bb976ad6 | |
Artur Shepilko | 8fe58ab678 | |
Artur Shepilko | 0a9bf84d3c | |
Ralph Little | 22108dca2a | |
Ralph Little | dcf4241470 | |
Ben Olden-Cooligan | ec3eacfbcb | |
Ben Olden-Cooligan | 3f217248f4 | |
Ralph Little | bff8d25007 | |
ThierryFR | 77059fe3d4 | |
Ordissimo | cc13a4986d | |
Tarwirdur Turon | 829b11b72e | |
Ralph Little | aefcb71a23 | |
Benoit JUIN | 1c4058fb7c | |
Ralph Little | 22e3de3642 | |
Ralph Little | 268be2c712 | |
Jonathan Schulz | 8a57a6934f | |
Benoit JUIN | e7040a0b51 | |
Benoit JUIN | f3c3dd0513 | |
Benoit JUIN | 26d6390f92 | |
beeduh | 4750093faa | |
Ralph Little | 32f335d0f1 | |
Dianne Skoll | 3f612c1277 | |
Ralph Little | 8096f84a6f | |
Benoit JUIN | c1e9a341ab | |
Benoit JUIN | 7efa04ff78 | |
Benoit JUIN | daebecd216 | |
Benoit JUIN | 84c94b8368 | |
Benoit JUIN | 068714ef6e | |
Benoit JUIN | f7dd8e224d | |
Benoit JUIN | 7631c15c5e | |
Benoit JUIN | 80478c865b | |
Benoit JUIN | 0255c74669 | |
Ralph Little | 65779d6b59 | |
Benoit JUIN | ec9efba602 | |
Benoit JUIN | 0661fe9d89 | |
Benoit JUIN | 1fb0a78dd8 | |
Benoit JUIN | c9e8d812df | |
Jürg Billeter | 3f727cfb8f | |
Benoit JUIN | d022fa9c1b | |
Benoit JUIN | 1513839238 | |
Benoit JUIN | fc8e03ef69 | |
Benoit JUIN | 6ee3558990 | |
Benoit JUIN | 768fa3bf59 | |
Benoit JUIN | 94b67794a5 | |
Benoit JUIN | 51aaef6d81 | |
Benoit JUIN | 6e9f4b3785 | |
Benoit JUIN | 0a0afc2a71 | |
Benoit JUIN | 5360166729 | |
Benoit JUIN | 35aed3072c | |
Ralph Little | 0098b1c58b | |
Ralph Little | 02f1a624f3 | |
Ralph Little | 15795b8071 | |
Ralph Little | bb8155804c | |
Alex Belkin | 0327a5c954 | |
Alex Belkin | 02a417721f | |
Ralph Little | 5bf66ca4e5 | |
Ralph Little | 651fc3419a | |
Alex Belkin | 2ba7215acf | |
Alex Belkin | 7a18846c60 | |
Ralph Little | 5b067b7cda | |
Ralph Little | 43135ab7ed | |
Ralph Little | 86f41b1360 | |
Ordissimo | 14dbdc759e | |
Alex Belkin | b38e620c23 | |
ValdikSS | 655b9736c5 | |
Ralph Little | fd22c210cf | |
ThierryFR | edc0fd3283 | |
ThierryFR | d8c3848765 | |
Tom Meyer-Mallorie | 7df77203ad | |
Ralph Little | fd7b83c8f7 | |
Ralph Little | a92ffb3d97 | |
Ralph Little | a617461c63 | |
Ralph Little | 6fc47c4c14 | |
Ralph Little | ebb8152058 | |
Ralph Little | 837d1622ea | |
Ralph Little | 3c20a989cf | |
Ralph Little | 41b865e2a5 | |
Ralph Little | b510c87d85 | |
Marc Schink | 3a58649ff1 | |
Marc Schink | 7b0572a180 | |
Marc Schink | 1e1f8affb6 | |
Ralph Little | 2fb8eb90cf | |
ThierryFR | 3094f4a0dc | |
ThierryFR | cd5443eec8 | |
Ordissimo | b1f6bea394 | |
Ordissimo | 766162cad6 | |
ThierryFR | 353e089ff4 | |
Ordissimo | 5978899b54 | |
ThierryFR | 0c1cbc1b6a | |
Sebastian Parborg | ba7d24bf30 | |
ThierryFR | 9bf2415fe6 | |
Ordissimo | f9951e3b31 | |
Antoni Simka | caaf65f1a3 | |
Mikhail Novosyolov | ba3d80949d | |
m. allan noah | 9d721e4610 | |
Ralph Little | 820ce39e94 | |
Mateusz Konieczny | cfb3ab1bbd | |
Ordissimo | b171aa7d87 | |
Ordissimo | aa3fc1cad8 | |
m. allan noah | 90cc6b1fb7 | |
m. allan noah | 44f96adb33 | |
m. allan noah | 9ce70f06c8 | |
m. allan noah | f4fcbb59f2 | |
Ralph Little | 4f9300d1ae | |
Benjamin Gordon | c5c329ce24 | |
Benjamin Gordon | 12ef54b087 | |
Ralph Little | 79962f324d | |
Ralph Little | 59885e039e | |
Ralph Little | 596f708c96 | |
Ralph Little | 3ab4342ce7 | |
Ralph Little | 49943e7e45 | |
Ralph Little | 2b20ad5b12 | |
Ralph Little | 536e486ff7 | |
Ralph Little | dd145a2383 | |
Ralph Little | 5f99edda9f | |
Ralph Little | 06280f15c1 | |
Ralph Little | e584a8c503 | |
Ralph Little | 189c5361b7 | |
Ralph Little | e147d111e3 | |
Warren Mar | 9a190804dd | |
Ralph Little | 10b3345a1c | |
Ralph Little | 30eb01674a | |
Ralph Little | 9d26edac5f | |
Ralph Little | b5058ff5ed | |
Ralph Little | 8ac72560ff | |
Ralph Little | 1eff86953d | |
Ralph Little | 1f22e0dadd | |
Ralph Little | 9387e9b35c | |
Ralph Little | d88920ffb6 | |
Ralph Little | 2e5fffb036 | |
Ralph Little | 660547e33c | |
Ralph Little | bd9771939f | |
Ralph Little | 373dceaa36 | |
Matthew Gilmore | 3222d342eb | |
Matthew Gilmore | 8072c2e895 | |
Ralph Little | 971a5a2e92 | |
NorwayFun | 36d204e3fd | |
NorwayFun | b4ad09be99 | |
Ralph Little | 53e227d171 | |
Ralph Little | 103c2b5d8e | |
Ralph Little | b9fbe0b82e | |
Ralph Little | e3c1c0e000 | |
Ralph Little | 6b588b0d93 | |
Yuri Chornoivan | 6220b21429 | |
m. allan noah | 573ca4b453 | |
Ralph Little | 7ee6327d3c | |
Ralph Little | 370547fc60 | |
Ordissimo | 4033ea23b6 | |
Ordissimo | 109a82f0fe | |
Ralph Little | 7e85f737d0 | |
Mariya Shikunova | e840ad7fa3 | |
Ralph Little | fea8ad2b99 | |
András Wacha | 6352b00d6c | |
Ralph Little | f15a40c1bb | |
Ralph Little | fc77717507 | |
Ralph Little | f9fe6d0ced | |
Giovanni Cappellotto | 506f539eda | |
Ralph Little | 15e1d83b9d | |
Zdenek Dohnal | b3b44f1188 | |
Benoit Juin | 1549f87198 | |
Benoit Juin | 2503ec8497 | |
Benoit Juin | f8bd456aa5 | |
Benoit Juin | 65c341b9d5 | |
Benoit Juin | 6e488f3891 | |
Benoit Juin | d739ffb8f0 | |
Benoit Juin | 185807a335 | |
Benoit Juin | 0f9135def2 | |
Benoit Juin | eec401f5c3 | |
Benoit Juin | 8efa358740 | |
Benoit Juin | 21f163e797 | |
Benoit Juin | 68d6519b6e | |
Benoit Juin | e6cb0cf07e | |
Benoit Juin | a44127d1bc | |
Benoit Juin | d343dc963b | |
Benoit Juin | 315fe1fdf5 | |
Benoit Juin | 51ba313173 | |
Benoit Juin | 175a8b0042 | |
Benoit Juin | a9c3cfa4d7 | |
Benoit Juin | ba3fd1dc4c | |
Benoit Juin | 179257160b | |
Benoit Juin | 8509c9dff4 | |
Benoit Juin | b19b324bf7 | |
Benoit Juin | ccfc476a07 | |
Zdenek Dohnal | ef3e8b06ab | |
thierry1970 | 42d1143c0a | |
m. allan noah | ba1b68e6e9 | |
m. allan noah | bab852c5bb | |
m. allan noah | b9e11b1149 | |
Charles Quarra | 933b53608d | |
m. allan noah | 9144eada44 | |
m. allan noah | 87e9be4be5 | |
m. allan noah | 190fa52619 | |
m. allan noah | 6acd5366cb | |
m. allan noah | eb52b43762 | |
m. allan noah | fa29906201 | |
m. allan noah | 7547ee04e1 | |
m. allan noah | 642160ef97 | |
Sam James | 300b460970 | |
Ralph Little | 436c507ade | |
Ralph Little | 388d75715f | |
Ralph Little | b2a5a41be9 | |
Michał Kopeć | 6740b47bca | |
Povilas Kanapickas | 6b99447f5b | |
Pim van Tend | 9afa6f6e74 | |
Ralph Little | ac11086cec | |
Ralph Little | edfc90450e | |
Ralph Little | 1da0970a7e | |
Zdenek Dohnal | 0d7543ec65 | |
Ralph Little | b5e7e78312 | |
Ralph Little | e0c25d5a67 | |
m. allan noah | 4873304efe | |
m. allan noah | 8467535448 | |
Ralph Little | 693572d616 | |
Ralph Little | 807d13de6d | |
Ralph Little | 9330bfdd83 | |
Ralph Little | 16eed3e526 | |
Ralph Little | 1d2253e21f | |
Ralph Little | cbffffbd7b | |
Povilas Kanapickas | f1413cbc16 | |
Ordissimo | ba463b8966 | |
thierry1970 | 32a86107cd | |
thierry1970 | 7ec4074fbd | |
Ordissimo | 8cd1488e3c | |
thierry1970 | 23c7290931 | |
Ralph Little | b51a2e9cf2 | |
Ralph Little | a417cb8edf | |
Ralph Little | 97a0c90fd1 | |
Ralph Little | c0e966b21e | |
Ralph Little | 409c23a745 | |
Nikolai Kostrigin | 12f91442c0 | |
Ordissimo | 948c1c5a40 | |
Ordissimo | a698f003fe | |
Ralph Little | 3f45d4d19e | |
Ralph Little | 1e68bfc7fe | |
Ralph Little | adcbf249f9 | |
Ralph Little | ba2c1f92f1 | |
Christian Theis | 999a52f691 | |
Christian Theis | 1aead16faf | |
Christian Theis | 39f9083deb | |
David Ward | 6ad2b593fe | |
David Ward | 7ca518027b | |
David Ward | 7467a9da22 | |
David Ward | 4dbfa03ec4 | |
Ralph Little | 1d259c749a | |
David Ward | 108716c840 | |
Ordissimo | 8daae197a0 | |
thierry1970 | df048b16f0 | |
Ordissimo | 6b30245844 | |
Ordissimo | 7431b65974 | |
Ordissimo | 6acddfe7f0 | |
Ordissimo | 024ae3b5fa | |
Ordissimo | f68b57378d | |
thierry1970 | aa032f458d | |
Ralph Little | f012ae84e5 | |
Christian Theis | 1d502a288a | |
Ralph Little | b8722a14ed | |
Ralph Little | f85e2fb9c2 | |
Ralph Little | a45e79bce6 | |
David Ward | a13cc4c1ff | |
David Ward | 9e1819c3f7 | |
David Ward | 4b15f35e75 | |
Ralph Little | e0aad8e814 | |
David Ward | 76aa009316 | |
David Ward | adac4f23e6 | |
David Ward | 28b5aa7dee | |
Ralph Little | ac42d6e684 | |
Ralph Little | e0e9a614be | |
Ralph Little | 5f27cc71c8 | |
Ralph Little | b217e7b002 | |
Ralph Little | dd822eda01 | |
Ralph Little | 137a8f88c7 | |
David Ward | 12560890a6 | |
Ralph Little | 31cefeb659 | |
David Ward | 0286b132b7 | |
Ralph Little | 99dba99442 | |
David Ward | 944bb49e56 | |
Ralph Little | cc0d729e1f | |
Ralph Little | 71152f0171 | |
Ralph Little | 33f0751670 | |
Ralph Little | f1e3a41037 | |
Ordissimo | f71b32c632 | |
David Ward | b2c2b74858 | |
David Ward | 03bfd4232c | |
David Ward | 939d62f836 | |
Ralph Little | 602b4f8d3d | |
David Ward | db25c1e7eb | |
David Ward | db009d158e | |
Aaron Jackson | a1fbbae636 | |
Aaron Jackson | 140100bb23 | |
Ordissimo | 785a935e9e | |
Raphael Isemann | 877871443d | |
Ralph Little | ea8d0eb91e | |
Ralph Little | b3a04eae1a | |
Ralph Little | 54766358b5 | |
Ordissimo | 804e936a65 | |
Ordissimo | b5d5b01886 | |
David Ward | 172e161369 | |
Ralph Little | ab7b3a38e2 | |
Ralph Little | 586ff11af5 | |
David Ward | b458cb14c6 | |
Ralph Little | 49dfefe8c0 | |
David Ward | 732fc8cad7 | |
David Ward | 8bbcdf8de3 | |
David Ward | c7a33643f3 | |
David Ward | 1277612c5b | |
David Ward | bd6ad2e092 | |
Ralph Little | c1c77436f4 | |
Ralph Little | 3513af029e | |
Ralph Little | 27a7c4518e | |
Povilas Kanapickas | e87bd848df | |
Povilas Kanapickas | aba8c30c92 | |
David Ward | 60209994a1 | |
David Ward | 6a14383e84 | |
Ralph Little | 6054620c69 | |
Ralph Little | ad08e768be | |
Ralph Little | 3635176eb9 | |
Ralph Little | 2cf41870b9 | |
Ralph Little | 95e2498fe9 | |
Ralph Little | 7cdd2ad268 | |
Ralph Little | 2d49a2af65 | |
Ordissimo | e5ff5d06e5 | |
thierry1970 | 356f1c9b27 | |
Ralph Little | 84e907f87c | |
David Ward | ff4114a795 | |
David Ward | 9cd0b1809c | |
David Ward | 0c70fd560c | |
David Ward | 2efdd5a334 | |
David Ward | 5576d03afd | |
David Ward | 6048724f22 | |
David Ward | 47fd7538bc | |
David Ward | a82a312d85 | |
David Ward | 0d032cd982 | |
David Ward | b3d105cba5 | |
David Ward | 6a16e78788 | |
David Ward | 3c3a247d25 | |
David Ward | db573b74ed | |
David Ward | 1a933bba7e | |
David Ward | f3162bafa8 | |
David Ward | 6be83f469b | |
David Ward | 6cc15e2b81 | |
David Ward | 2955089cd9 | |
David Ward | 1458d23c42 | |
David Ward | bfa69c26e6 | |
David Ward | 23addf5590 | |
David Ward | 4cf3b09e49 | |
David Ward | e859ea4d89 | |
David Ward | f8785fb6a8 | |
David Ward | f651d6f098 | |
Ordissimo | 9cd8f475eb | |
Ordissimo | 84a39145e4 | |
David Ward | a519a3529a | |
David Ward | e1a319e729 | |
Ralph Little | 41866df6e1 | |
Ralph Little | 4091619e07 | |
Ralph Little | 9512d05fe6 | |
Ralph Little | aa153e52c8 | |
Ralph Little | 047fa8498f | |
Ralph Little | f6594ed040 | |
Ralph Little | a0ca5a4fc4 | |
Ralph Little | 0a3b043e8e | |
Ralph Little | d6419c2490 | |
Ralph Little | 312edd6d5f | |
Ralph Little | b701c499c9 | |
David Ward | 9daadb8512 | |
Ralph Little | 3c3e898c5e | |
David Ward | ba07a8a7f5 | |
Povilas Kanapickas | b68172cbd2 | |
Povilas Kanapickas | e1f1273d23 | |
Povilas Kanapickas | 1a8a86bade | |
Povilas Kanapickas | fb41d3ca04 | |
Zdenek Dohnal | aeb60735c1 | |
Povilas Kanapickas | 2f17613dbb | |
Povilas Kanapickas | 188cf63627 | |
Zdenek Dohnal | d8ebd5a4d7 | |
Povilas Kanapickas | e3b5a9686f | |
Povilas Kanapickas | c46f006209 | |
Povilas Kanapickas | 332edc8b7c | |
Povilas Kanapickas | 1c805281f2 | |
Povilas Kanapickas | 156337e5cd | |
Povilas Kanapickas | 2d75530344 | |
Povilas Kanapickas | 5529eb73d7 | |
Povilas Kanapickas | c2a77be45b | |
Povilas Kanapickas | 2cd4058942 | |
Povilas Kanapickas | 44d0383458 | |
Povilas Kanapickas | a00a5f2f2c | |
Povilas Kanapickas | b18fb290a9 | |
Povilas Kanapickas | b09575f6be | |
Povilas Kanapickas | bb0bee92f6 | |
Povilas Kanapickas | 3738eb9e42 | |
Povilas Kanapickas | 5f08348068 | |
Povilas Kanapickas | 0ac693c2c7 | |
Povilas Kanapickas | e3b847e981 | |
Povilas Kanapickas | 3e1de72bcb | |
Povilas Kanapickas | 3f955dd532 | |
Povilas Kanapickas | 3f62c9132a | |
Povilas Kanapickas | 64bfc68a39 | |
Povilas Kanapickas | 1a66f8c553 | |
Andrew Sayers | a336f5ed2f | |
Povilas Kanapickas | 5e463f4c91 | |
Povilas Kanapickas | a3031367fe | |
Povilas Kanapickas | 773f0e5061 | |
Povilas Kanapickas | fe6fe45098 | |
Povilas Kanapickas | 0dc467a334 | |
Povilas Kanapickas | cf7dde3c4b | |
Povilas Kanapickas | a45a29d948 | |
Povilas Kanapickas | e0425c737d | |
Povilas Kanapickas | 2b6fa1056d | |
Povilas Kanapickas | ef45427c53 | |
Povilas Kanapickas | 4a2ebc7fee | |
Povilas Kanapickas | d1690a044d | |
Povilas Kanapickas | 78c188542a | |
Povilas Kanapickas | 9864172a11 | |
Povilas Kanapickas | c13555df6f | |
Povilas Kanapickas | 53609d6d09 | |
Povilas Kanapickas | c0f0c82467 | |
Povilas Kanapickas | c7b3ffc5bb | |
Povilas Kanapickas | 465e5867cb | |
Povilas Kanapickas | 156eba8dea | |
Povilas Kanapickas | 4931efc5c7 | |
Povilas Kanapickas | edfe281aa7 | |
Povilas Kanapickas | c3d537c586 | |
Povilas Kanapickas | a0fc5c871c | |
Povilas Kanapickas | 68fddf92f3 | |
Povilas Kanapickas | 9bd3d6ddf2 | |
Povilas Kanapickas | 6545aa5ea8 | |
Povilas Kanapickas | dcfbf4f6d5 | |
Povilas Kanapickas | f5ed3eaf71 | |
Povilas Kanapickas | 4634c4bde3 | |
Povilas Kanapickas | 094750b1df | |
Povilas Kanapickas | 506f6f5085 | |
Povilas Kanapickas | 9a06a54452 | |
Povilas Kanapickas | d9b1139927 | |
Povilas Kanapickas | 0a8e8a3d4d | |
Povilas Kanapickas | 6fc8dc5a02 | |
Povilas Kanapickas | 33ec34cfe3 | |
Povilas Kanapickas | 247fc90a39 | |
Povilas Kanapickas | cd0b7ed82f | |
Povilas Kanapickas | c21f16c11a | |
Povilas Kanapickas | 0169fe6f84 | |
Povilas Kanapickas | 8c5ea25efa | |
Povilas Kanapickas | 23fb2a2139 | |
Povilas Kanapickas | 59506f866d | |
Povilas Kanapickas | fec5e8917f | |
Povilas Kanapickas | a27f807608 | |
Povilas Kanapickas | 2f7da02d94 | |
Povilas Kanapickas | 6832c5f399 | |
Povilas Kanapickas | 27598c7889 | |
Povilas Kanapickas | 451761272e | |
Povilas Kanapickas | 86e138bea4 | |
Povilas Kanapickas | ebee3c2970 | |
Povilas Kanapickas | bdb4aa1585 | |
Povilas Kanapickas | b06e024be7 | |
Povilas Kanapickas | 0feacf6f58 | |
Povilas Kanapickas | 6773f79086 | |
Povilas Kanapickas | 2f31fea9d3 | |
Povilas Kanapickas | 9887b162d9 | |
Povilas Kanapickas | 85b6cd3320 | |
Povilas Kanapickas | 77baf258b6 | |
Povilas Kanapickas | 3b91ab76e6 | |
Povilas Kanapickas | 87778eef50 | |
Povilas Kanapickas | 58007470e0 | |
Povilas Kanapickas | 5b1b012047 | |
Povilas Kanapickas | cb6a7d0a90 | |
Povilas Kanapickas | 5695b15dfc | |
Povilas Kanapickas | 3dfaea18bb | |
Povilas Kanapickas | 2dff4aa09a | |
Povilas Kanapickas | 034fa489b6 | |
Povilas Kanapickas | 33b6e0ae47 | |
Povilas Kanapickas | bed836adad | |
Povilas Kanapickas | 39d1f6a80a | |
Povilas Kanapickas | dc3146a31c | |
Povilas Kanapickas | 7cbb3ae1d4 | |
Povilas Kanapickas | e9b3e39536 | |
Povilas Kanapickas | 520a0df0f7 | |
Povilas Kanapickas | d666430f75 | |
Povilas Kanapickas | 94933f881d | |
Povilas Kanapickas | 7e2d4efd55 | |
Povilas Kanapickas | 7c215610c4 | |
Povilas Kanapickas | d9e722af63 | |
Povilas Kanapickas | cc88c73ac9 | |
Povilas Kanapickas | 35de63ca99 | |
Povilas Kanapickas | 5b143760f3 | |
Povilas Kanapickas | c94a331916 | |
Povilas Kanapickas | 141964f652 | |
Povilas Kanapickas | 0b31b2c1ed | |
Povilas Kanapickas | 5591ce7c1b | |
Povilas Kanapickas | eca148dbf4 | |
Povilas Kanapickas | c86564a3e3 | |
Povilas Kanapickas | f5d5928346 | |
Povilas Kanapickas | 87f27311f7 | |
Povilas Kanapickas | 7353cd598b | |
Povilas Kanapickas | 022f631611 | |
Povilas Kanapickas | 374ba39e46 | |
Povilas Kanapickas | 9527a9e623 | |
Povilas Kanapickas | 8eb2c0e404 | |
Povilas Kanapickas | dd1abe9380 | |
Povilas Kanapickas | 9611b9d757 | |
Povilas Kanapickas | b3f6637ae2 | |
Povilas Kanapickas | 4d1246b507 | |
Povilas Kanapickas | 408ee7a770 | |
Povilas Kanapickas | 9669c6c335 | |
Povilas Kanapickas | bafd6e134a | |
Povilas Kanapickas | 4fce71b55b | |
Povilas Kanapickas | cc3bf08055 | |
Povilas Kanapickas | 7dcffcf75f | |
Povilas Kanapickas | 440ec4f80c | |
Povilas Kanapickas | 6bec3fcfa6 | |
Povilas Kanapickas | b7b37b4f45 | |
Povilas Kanapickas | e64aad283f | |
Povilas Kanapickas | 72d0c39656 | |
Povilas Kanapickas | 7b25c36c15 | |
Povilas Kanapickas | 341b2ff6e6 | |
Povilas Kanapickas | df20a7a46e | |
Povilas Kanapickas | 3787dfdb4b | |
Povilas Kanapickas | 491a08ba96 | |
Povilas Kanapickas | c6df5fd69a | |
Povilas Kanapickas | 2cc2f8a26b | |
Povilas Kanapickas | 4d2a6eb513 | |
Povilas Kanapickas | 75ac76f87a | |
Povilas Kanapickas | f06e507de7 | |
Povilas Kanapickas | 334e4bd8d1 | |
Povilas Kanapickas | af175f6d4c | |
Povilas Kanapickas | 3e9431d079 | |
Povilas Kanapickas | c11a0e7ab6 | |
Povilas Kanapickas | d19ccd2fad | |
Povilas Kanapickas | e540778cfa | |
Povilas Kanapickas | c1f731a7e0 | |
Povilas Kanapickas | f1910ae58c | |
Povilas Kanapickas | 86fe51e224 | |
Povilas Kanapickas | 0f341bf5a0 | |
Povilas Kanapickas | 4ee36a2e31 | |
Povilas Kanapickas | bbc1543525 | |
Povilas Kanapickas | 675497fcd8 | |
Povilas Kanapickas | 7bbb6d8fdb | |
Povilas Kanapickas | 2f030f04e2 | |
Povilas Kanapickas | ad84284186 | |
Povilas Kanapickas | bd4f009122 | |
Povilas Kanapickas | 1e75025048 | |
Povilas Kanapickas | 601705fa3a | |
Povilas Kanapickas | 6c0fafac79 | |
Povilas Kanapickas | e27d991fdf | |
Povilas Kanapickas | d4dc13f527 | |
Povilas Kanapickas | 137a2d676f | |
Povilas Kanapickas | f4552acf8d | |
Ordissimo | 584f16e2ee | |
Ordissimo | 8d028fe398 | |
Ordissimo | 020030080c | |
Povilas Kanapickas | 53c1be6ae8 | |
Povilas Kanapickas | b668e92047 | |
Povilas Kanapickas | 7c76892b98 | |
Povilas Kanapickas | 3752d11c34 | |
Povilas Kanapickas | 7bc9983407 | |
Povilas Kanapickas | 80f6d21170 | |
Povilas Kanapickas | bf4614b76e | |
Povilas Kanapickas | a38919bf7f | |
Povilas Kanapickas | eb097b632c | |
Ralph Little | 944183c379 | |
Ralph Little | b83f7d3cad | |
Peter Seiderer | 0114403ac5 | |
Povilas Kanapickas | 63fffd7403 | |
Povilas Kanapickas | cf8835625a | |
Povilas Kanapickas | 3a890c7100 | |
Povilas Kanapickas | b16baa642b | |
Povilas Kanapickas | 8414a1db9b | |
Povilas Kanapickas | bffda89bc7 | |
Wolfram Sang | 1c8bb97b69 | |
Wolfram Sang | d6189aa789 | |
Ordissimo | 5152108769 | |
Jindřich Makovička | 59b669ae3c | |
Povilas Kanapickas | fcda028e4a | |
Povilas Kanapickas | ea0e57a05e | |
Povilas Kanapickas | 8ceb1dde8d | |
Povilas Kanapickas | 711a3c5c14 | |
Povilas Kanapickas | 723eaa5917 | |
Povilas Kanapickas | bd0f15f585 | |
Ordissimo | 4b4cc5d019 | |
thierry1970 | 0a22da26c4 | |
Ordissimo | 98869ebedf | |
Ordissimo | 7394329b69 | |
Povilas Kanapickas | c8f42d6bd5 | |
Povilas Kanapickas | b72ac67a70 | |
Paul Wolneykien | b49deae017 | |
genkn | b8df4a0cf6 | |
Povilas Kanapickas | dd0599ca52 | |
Andrew Sayers | 40f4885ab8 | |
Ralph Little | bfa3e39de2 | |
thierry1970 | d77743b243 | |
Thierry HUCHARD | 4752a9c379 | |
Povilas Kanapickas | db6e4fd77f | |
Povilas Kanapickas | 7b19eb2115 | |
Povilas Kanapickas | dc32df1001 | |
Andrii Pravorskyi | 9ed6873292 | |
Konstantin Tcepliaev | 0a038376a6 | |
Povilas Kanapickas | 75801bffd3 | |
Ralph Little | 8347191b5f | |
Ralph Little | fa414e46b1 | |
Peter Seiderer | 1db13a713f | |
Povilas Kanapickas | 9ad2aa54b9 | |
Mikhail Remnev | d32e6c4115 | |
Povilas Kanapickas | 2e77ac4052 | |
Thierry HUCHARD | 8090d3844b | |
Thierry HUCHARD | c7575b3679 | |
Thierry HUCHARD | 8a2a81a83c | |
Thierry HUCHARD | ab11e42894 | |
Thierry HUCHARD | 7d75dbad0c | |
Thierry HUCHARD | 3e8885f937 | |
Thierry HUCHARD | abbc93df1a | |
Thierry HUCHARD | 79e470cf9a | |
Thierry HUCHARD | db83d55495 | |
Thierry HUCHARD | 7b5386ff6e | |
Thierry HUCHARD | 374521c4b6 | |
Povilas Kanapickas | 7f06490c93 | |
Povilas Kanapickas | ed51223cfb | |
Povilas Kanapickas | 96277ac052 | |
Peter Marschall | d829ff835a | |
Peter Marschall | 79e76258cb | |
Peter Marschall | 1dab1f0121 | |
Peter Marschall | 16cdaf16e5 | |
Peter Marschall | 36b59bd2c1 | |
Wolfram Sang | b183f6a055 | |
Wolfram Sang | 952976c6a6 | |
Ralph Little | 5ecd4a9d3e | |
Ralph Little | 0bbf1155af | |
Wolfram Sang | bb94182982 | |
Wolfram Sang | 91c24b2955 | |
Ordissimo | 3b47d1d26a | |
Ordissimo | 72992f4e25 | |
Ordissimo | 3440ef60b3 | |
Jindřich Makovička | 1b5344ba56 | |
Ralph Little | 0c1faae1de | |
Ralph Little | 3a5f128e8a | |
Ordissimo | 65b6684984 | |
Ordissimo | 88934578ec | |
Ordissimo | 66f2673d71 | |
Ordissimo | d25f5db739 | |
Wolfram Sang | 55ac7b3060 | |
Klaus Kämpf | d12533fced | |
Ralph Little | 8ad3b1127f | |
Ralph Little | c540a3a354 | |
Ralph Little | 66d65ba37d | |
Yuri Chornoivan | 5698be8cce | |
Wolfram Sang | a3558af0fc | |
pimvantend | 54e3fb2094 | |
Ordissimo | 1d191ab801 | |
Ordissimo | e1b5c43b56 | |
Adriaan de Groot | 0400e23d30 | |
Ralph Little | 563afbe0fa | |
Ralph Little | e84dc47f73 | |
Ordissimo | c3cdf4102c | |
Ordissimo | 2ad66b6bec | |
Ordissimo | fc99bbe784 | |
Ordissimo | c798d85eaf | |
thierry1970 | 94f25af5d8 | |
Ordissimo | 26749cee53 | |
Ordissimo | 4929387246 | |
Ordissimo | 1ba63878e4 | |
Ordissimo | 47963e059e | |
Wolfram Sang | f5b4e914c6 | |
John Keeping | 6ea78a79ca | |
Ordissimo | c6fd7de5f1 | |
Ordissimo | 4c99352dda | |
Ralph Little | 9a0fa0da86 | |
Ralph Little | 7b2c4a0bf7 | |
Ralph Little | 1e88e1504e | |
Ralph Little | bb8c0b088c | |
Ralph Little | b74dfb3004 | |
Ralph Little | 9282aac9be | |
Ralph Little | bc6035624d | |
Wolfram Sang | 911be8af68 | |
Wolfram Sang | 1a95dc7cde | |
Ralph Little | 026430c293 | |
Ralph Little | e86175e726 | |
Peter Seiderer | b1021e09e4 | |
Peter Seiderer | 7dafc52dda | |
Peter Seiderer | 145e16008e | |
Zdenek Dohnal | 7a28e66a16 | |
Ordissimo | 980bb29cb8 | |
thierry1970 | 667d8f7acc | |
Wolfram Sang | 63942f7a74 | |
Wolfram Sang | eb42ad08d5 | |
Wolfram Sang | a78abbbdba | |
Wolfram Sang | cadc4de1a7 | |
Wolfram Sang | be5b247180 | |
Wolfram Sang | 65b7e317a6 | |
Wolfram Sang | cd1733c345 | |
Wolfram Sang | 53641f8342 | |
Ralph Little | ffa7a82900 | |
Ralph Little | 19b9b41e4d | |
Ralph Little | 257529d39e | |
Wolfram Sang | db7a285e74 | |
Wolfram Sang | 28176df499 | |
pimvantend | 075bd9b7e9 | |
Tyson Tan | b7055f4859 | |
Tyson Tan | 99f3783608 | |
Ralph Little | 2b0e4bc497 | |
Ralph Little | 28ad82bd42 | |
Ralph Little | 8e85691dd9 | |
Ralph Little | 4fef6d6da1 | |
Ralph Little | e81f6b5a57 | |
Ralph Little | 37fe11acd2 | |
Ralph Little | 7f21e4cac8 | |
Ralph Little | 28f7bbfb87 | |
Rodrigo Osorio | dde45eed5e | |
pimvantend | 3f80ebae93 | |
Wolfram Sang | 0943bf00bd | |
Ralph Little | 75575e0888 | |
Ralph Little | 7b7b36e593 | |
Ralph Little | 730e4ada37 | |
Ralph Little | 5702046a9c | |
Ralph Little | d9412740ac | |
Ralph Little | 7ce23d05e2 | |
Klaus Kämpf | c5d84e5f17 | |
pimvantend | df34fa403a | |
grmpl | 696ccd2d7b | |
Povilas Kanapickas | e16d023b2b | |
Peter Seiderer | 691d774f75 | |
Ordissimo | eb702d33c4 | |
Ordissimo | de5b27c995 | |
thierry1970 | 9539027f24 | |
Thierry HUCHARD | f99687b3cc | |
Povilas Kanapickas | 69df00d00c | |
Andrew Sayers | a6ffa6c8f8 | |
Ralph Little | 0bbbf85528 | |
pimvantend | 0ef485d189 | |
Ralph Little | 1d30150c3c | |
Ralph Little | 82117153f5 | |
Ralph Little | bb90aa9d95 | |
Ralph Little | acc5ca499f | |
Wolfram Sang | 39ced55454 | |
Wolfram Sang | 6e85a57e64 | |
Wolfram Sang | a696443555 | |
Wolfram Sang | 85d8047601 | |
Wolfram Sang | c70426fde2 | |
Wolfram Sang | 580c278dca | |
m. allan noah | 5819a79ab0 | |
m. allan noah | 6d990e73e9 | |
pimvantend | e55ea7c06d | |
Ralph Little | dd9d90223e | |
Ralph Little | b9edb46542 | |
Ralph Little | 44a085d685 | |
pimvantend | 12c81e2f19 | |
Giovanni Cappellotto | 325c775036 | |
Ralph Little | 7413e3131b | |
Olaf Meeuwissen | 13d1cb694e | |
Olaf Meeuwissen | 5d749ac796 | |
Olaf Meeuwissen | 7ac30dced0 | |
Olaf Meeuwissen | 00df971593 | |
m. allan noah | c85185bd41 | |
m. allan noah | 7dbfccb532 | |
m. allan noah | 5205d1d09d | |
Ralph Little | b1a2b5fdb6 | |
Ralph Little | 23a4c86b32 | |
Ordissimo | 678495f596 | |
Thierry HUCHARD | 5f2209ffd9 | |
Timo Teräs | baa26ffd95 | |
Ralph Little | 3bbf104ea0 |
|
@ -6,7 +6,8 @@
|
|||
# Your editor may need a plugin for this configuration to take effect.
|
||||
# See http://editorconfig.org/#download for details.
|
||||
|
||||
root = true ; look no further
|
||||
; look no further
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
|
|
|
@ -58,3 +58,7 @@ test-suite.log
|
|||
|
||||
# `make dist` artifacts
|
||||
/sane-backends-*.tar.gz
|
||||
|
||||
# editor temp files
|
||||
*~
|
||||
\#*\#
|
||||
|
|
|
@ -19,7 +19,7 @@ stages:
|
|||
# Debian GNU/Linux.
|
||||
|
||||
make-dist:
|
||||
image: $REGISTRY_HUB:debian-buster-mini
|
||||
image: $REGISTRY_HUB:debian-bullseye-mini
|
||||
stage: tarball
|
||||
script:
|
||||
- git ls-files | xargs ./tools/style-check.sh
|
||||
|
@ -38,29 +38,29 @@ make-dist:
|
|||
- mkdir build
|
||||
- cd build
|
||||
- tar xzf ../sane-backends-*.tar.gz --strip-components=1
|
||||
- ./configure $CONFIGURE_OPTS
|
||||
- make -j2 -k $MAKE_FLAGS
|
||||
- (set -x; ./configure $CONFIGURE_OPTS)
|
||||
- eval "(set -x; make -j2 -k $MAKE_FLAGS)"
|
||||
|
||||
debian-9-full:
|
||||
image: $REGISTRY_HUB:debian-stretch-full
|
||||
debian-10-full:
|
||||
image: $REGISTRY_HUB:debian-buster-full
|
||||
variables:
|
||||
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
|
||||
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
|
||||
<<: *compile_definition
|
||||
|
||||
debian-10-mini:
|
||||
image: $REGISTRY_HUB:debian-buster-mini
|
||||
debian-11-mini:
|
||||
image: $REGISTRY_HUB:debian-bullseye-mini
|
||||
variables:
|
||||
CONFIGURE_OPTS: "$CONFIGURE_MINI"
|
||||
MAKE_FLAGS: "CFLAGS=-Werror"
|
||||
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
|
||||
<<: *compile_definition
|
||||
|
||||
# In addition to the regular compile check, the full Debian stable
|
||||
# environment is used to keep some of the HTML documentation that's
|
||||
# available from our website up-to-date.
|
||||
|
||||
debian-10-full:
|
||||
image: $REGISTRY_HUB:debian-buster-full
|
||||
debian-11-full:
|
||||
image: $REGISTRY_HUB:debian-bullseye-full
|
||||
variables:
|
||||
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
|
||||
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
|
||||
|
@ -76,20 +76,22 @@ debian-10-full:
|
|||
- doc/sanei-html
|
||||
expire_in: 1 day
|
||||
|
||||
fedora-33-clang:
|
||||
image: $REGISTRY_HUB:fedora-33-clang
|
||||
fedora-36-clang:
|
||||
image: $REGISTRY_HUB:fedora-36-clang
|
||||
variables:
|
||||
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
|
||||
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
|
||||
<<: *compile_definition
|
||||
|
||||
alpine-3.13-musl:
|
||||
image: $REGISTRY_HUB:alpine-3.13-musl
|
||||
alpine-3.15-musl:
|
||||
image: $REGISTRY_HUB:alpine-3.15-musl
|
||||
variables:
|
||||
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
|
||||
MAKE_FLAGS: "CFLAGS='-Werror -Wno-pedantic' CXXFLAGS=-Werror"
|
||||
<<: *compile_definition
|
||||
|
||||
ubuntu-16.04-lts:
|
||||
image: $REGISTRY_HUB:ubuntu-xenial-dist
|
||||
ubuntu-22.04-lts:
|
||||
image: $REGISTRY_HUB:ubuntu-jammy-dist
|
||||
variables:
|
||||
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
|
||||
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
|
||||
|
@ -107,10 +109,10 @@ ubuntu-16.04-lts:
|
|||
# hence the dependency.
|
||||
|
||||
make-distcheck:
|
||||
image: $REGISTRY_HUB:debian-buster-full
|
||||
image: $REGISTRY_HUB:debian-bullseye-full
|
||||
stage: snapshot
|
||||
dependencies:
|
||||
- debian-10-full
|
||||
- debian-11-full
|
||||
script:
|
||||
- tar xzf sane-backends-*.tar.gz --strip-components=1
|
||||
- rm sane-backends-*.tar.gz
|
||||
|
|
17
AUTHORS
17
AUTHORS
|
@ -24,10 +24,10 @@ Backends:
|
|||
dc240: Peter Fales
|
||||
dell1600n_net: Jon Chambers
|
||||
dll: David Mosberger
|
||||
dmc: David F. Skoll
|
||||
dmc: Dianne Skoll
|
||||
epjitsu: m. allan noah (*)
|
||||
epson: Karl Heinz Kremer
|
||||
epson2: Alessandro Zummo
|
||||
epson2: Alessandro Zummo, Wolfram Sang (*)
|
||||
epsonds: Alessandro Zummo
|
||||
escl: Touboul Nathane, Thierry HUCHARD (*)
|
||||
fujitsu: Randolph Bentson, Frederik Ramm, Oliver Schirrmeister,
|
||||
|
@ -51,11 +51,12 @@ Backends:
|
|||
ibm: M.F., Henning Geinitz
|
||||
kodak: m. allan noah (*)
|
||||
kodakaio: Paul Newall (*)
|
||||
kvs1025: Tao Zhang, m. allan noah (*)
|
||||
kvs20xx: unknown, m. allan noah (*)
|
||||
kvs40xx: unknown, m. allan noah (*)
|
||||
kvs1025: Tao Zhang
|
||||
kvs20xx: Panasonic Russia Ltd
|
||||
kvs40xx: Panasonic Russia Ltd
|
||||
leo: Frank Zago
|
||||
lexmark: Fred Odendaal, Stéphane Voltz
|
||||
lexmark_x2600: Benoit Juin
|
||||
ma1509: Henning Geinitz
|
||||
magicolor: Reinhold Kainhofer(based on epson2 backend)
|
||||
matsushita: Frank Zago
|
||||
|
@ -77,7 +78,7 @@ Backends:
|
|||
Nicolas Martin
|
||||
Louis Lagendijk (*)
|
||||
Dennis Lou
|
||||
Rolf Bensch (*)
|
||||
Rolf Bensch
|
||||
Povilas Kanapickas (*)
|
||||
plustek: Gerhard Jaeger (*)
|
||||
plustek_pp: Rick Bronson (former pp driver-code), Gerhard Jaeger (*)
|
||||
|
@ -158,6 +159,7 @@ Andreas Czechanowski <m075@ins.uni-stuttgart.de>
|
|||
Andreas Nowack <nowack.andreas@gmx.de>
|
||||
Andreas Rick <andreas.rick@free.fr>
|
||||
Andrew Kuchling <amk@magnet.com>
|
||||
Benoit Juin <benoit.juin@gmail.com>
|
||||
Bernd Schroeder <bernd@aquila.muc.de>
|
||||
Bertrik Sikken <bertrik@zonnet.nl>
|
||||
Brian J. Murrell <brian@interlinx.bc.ca>
|
||||
|
@ -165,10 +167,10 @@ Chris Bagwell <cbagwell-guest@users.alioth.debian.org>
|
|||
Chris Pinkham <cpinkham@corp.infi.net>
|
||||
Christian Bucher <cbucher@vernetzt.at>
|
||||
David Etherton <etherton@netcom.com>
|
||||
David F. Skoll <dskoll@iname.com>
|
||||
David Huggins-Daines <bn711@freenet.carleton.ca>
|
||||
David Mosberger <David.Mosberger@acm.org>
|
||||
David Stevenson <david.stevenson@zoom.co.uk>
|
||||
Dianne Skoll <dianne@skoll.ca>
|
||||
Didier Carlier <didier@sema.be>
|
||||
Earle F. Philhower III <earle@ziplabel.com>
|
||||
Eddy De Greef <eddy_de_greef at scarlet dot be>
|
||||
|
@ -257,4 +259,5 @@ Troy Rollo <sane@troy.rollo.name>
|
|||
Ullrich Sigwanz <usigwanz@freesurf.ch>
|
||||
Ulrich Deiters <ukd@xenon.pc.Uni-Koeln.DE>
|
||||
Wittawat Yamwong <wittawat@web.de>
|
||||
Wolfram Sang <wsa@kernel.org>
|
||||
m. allan noah <kitno455 at gmail dot com>
|
||||
|
|
|
@ -419,7 +419,7 @@
|
|||
|
||||
1998-05-22 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* backend/dmc.c: Updated with David Skoll's latest patch.
|
||||
* backend/dmc.c: Updated with Dianne Skoll's latest patch.
|
||||
|
||||
* sanei/sanei_scsi.c (sanei_scsi_find_devices): Declare missing
|
||||
findtype arg for dummy sanei_scsi_find_devices().
|
||||
|
@ -675,7 +675,7 @@
|
|||
blocking mode, *len==0 implies end of scan).
|
||||
* frontend/xscanimage.c: Ditto.
|
||||
|
||||
* doc/sane-dmc.man: New file by David Skoll.
|
||||
* doc/sane-dmc.man: New file by Dianne Skoll.
|
||||
|
||||
* sanei/sanei_DomainOS.c: New file by Paul Walker.
|
||||
|
||||
|
@ -806,8 +806,8 @@
|
|||
* doc/Makefile.in (SECT5): Ditto.
|
||||
|
||||
* backend/dmc.c, backend/dmc.h: Update with Feb 26 patch from
|
||||
David Skoll.
|
||||
* doc/dmc.man: New file by David Skoll.
|
||||
Dianne Skoll.
|
||||
* doc/dmc.man: New file by Dianne Skoll.
|
||||
|
||||
1998-02-25 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
|
@ -862,8 +862,8 @@
|
|||
* backend/coolscan-scsidef.h: Ditto.
|
||||
* backend/coolscan.h: Ditto.
|
||||
|
||||
* backend/hp.c (sane_close): Change s to s->next (patch by David
|
||||
Skoll <dskoll@chipworks.com>).
|
||||
* backend/hp.c (sane_close): Change s to s->next (patch by Dianne
|
||||
Skoll <dianne@skoll.ca>).
|
||||
|
||||
1998-02-17 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
|
||||
* frontend/saned.c (DBG): Remove extraneous parens around "msg".
|
||||
|
||||
* AUTHORS (Frontends): Update David Skoll's email address.
|
||||
* AUTHORS (Frontends): Update Dianne Skoll's email address.
|
||||
|
||||
* frontend/saned.c (get_free_handle): Check for out of memory
|
||||
situations and initialize newly allocated memory.
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,196 @@
|
|||
commit d5187355f6e0de529b562569509a1851dda7ad84
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-17 20:16:28 +0900
|
||||
|
||||
NEWS: Document changes for 1.0.30 release
|
||||
|
||||
commit 1fe94e6674d0572d2408361903730f012c60fc6c
|
||||
Merge: 898ab1834864 5104b80fc8f0
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-17 16:26:00 +0900
|
||||
|
||||
Merge branch '279-confidential-issue' into release/1.0.30
|
||||
|
||||
commit 5104b80fc8f0d6528b856233a52846a414ae6616
|
||||
Merge: f38c9f0d64a5 30b1831a28f2
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-14 09:36:25 +0000
|
||||
|
||||
Merge branch 'mitigate-epsonds-net-security-issue' into '279-confidential-issue'
|
||||
|
||||
epsonds: Mitigate potential network related security issues. Re #279
|
||||
|
||||
See merge request paddy-hack/backends!9
|
||||
|
||||
commit 30b1831a28f24ab2921b9f717c66d37f02bb81cc
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-11 21:07:12 +0900
|
||||
|
||||
epsonds: Mitigate potential network related security issues. Re #279
|
||||
|
||||
This pre-empts the possibility of triggering GHSL-2020-079, GHSL-2020-080
|
||||
and GHSL-2020-081.
|
||||
|
||||
commit f38c9f0d64a52697562abdfbf9c9044cb1b7e897
|
||||
Merge: 3d005c2570a7 b9b0173409df
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-07 09:42:42 +0000
|
||||
|
||||
Merge branch 'issue09-esci2-img-buffer-size-check' into '279-confidential-issue'
|
||||
|
||||
epsonds: Prevent possible buffer overflow when reading image data
|
||||
|
||||
See merge request paddy-hack/backends!8
|
||||
|
||||
commit b9b0173409df73e235da2aa0dae5edd21fb55967
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-04-27 18:48:29 +0900
|
||||
|
||||
epsonds: Prevent possible buffer overflow when reading image data
|
||||
|
||||
Addresses GHSL-2020-084, re #279.
|
||||
|
||||
commit 3d005c2570a71fe93a63192d9c47ee54cb39049b
|
||||
Merge: 226d9c92899f 27ea994d23ee
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-06 04:06:49 +0000
|
||||
|
||||
Merge branch 'issue05-out-of-bounds-read-decode_binary' into '279-confidential-issue'
|
||||
|
||||
epsonds: Do not read beyond the end of the token
|
||||
|
||||
See merge request paddy-hack/backends!5
|
||||
|
||||
commit 27ea994d23ee52fe1ec1249c92ebc1080a358288
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-04-30 21:15:45 +0900
|
||||
|
||||
epsonds: Do not read beyond the end of the token
|
||||
|
||||
Addresses GHSL-2020-082, re #279.
|
||||
|
||||
commit 226d9c92899facf4b22b98c73be6ad2cd0effc4a
|
||||
Merge: 02b5d33b7a7c db9480b09ea8
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-06 04:05:59 +0000
|
||||
|
||||
Merge branch 'issue07-out-of-bounds-read-in-esci2_check_header' into '279-confidential-issue'
|
||||
|
||||
epsonds: Read only up to seven hexdigits to determine payload size
|
||||
|
||||
See merge request paddy-hack/backends!6
|
||||
|
||||
commit db9480b09ea807e52029f2334769a55d4b95e45b
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-04-27 18:24:56 +0900
|
||||
|
||||
epsonds: Read only up to seven hexdigits to determine payload size
|
||||
|
||||
Addresses GHSL-2020-083, re #279.
|
||||
|
||||
commit 02b5d33b7a7c0b72137f5b968c46a1d52a75aa63
|
||||
Merge: 4c9e4efd4a82 8682023faa27
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-06 04:04:18 +0000
|
||||
|
||||
Merge branch 'issue08-integer-overflow-sanei_tcp_read' into '279-confidential-issue'
|
||||
|
||||
sanei: Integer overflow sanei tcp read
|
||||
|
||||
See merge request paddy-hack/backends!7
|
||||
|
||||
commit 8682023faa27c61156a354955c89617a3304d66f
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-04 11:54:35 +0900
|
||||
|
||||
sanei_tcp: Address possible integer overflow. Re #279, issue 8
|
||||
|
||||
commit fe08bbee6b238ea0be73af67b560ffc2c47562fd
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-04 11:48:46 +0900
|
||||
|
||||
epsonds: Handle error condition. Re #279, issue 8
|
||||
|
||||
commit 4c9e4efd4a82214719eeb1377a900e3a85c1c369
|
||||
Merge: 2b4aa45bad61 fff83e7eacd0
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-06 04:03:19 +0000
|
||||
|
||||
Merge branch 'issue01-null-pointer-deref-sanei_epson_net_read' into '279-confidential-issue'
|
||||
|
||||
epson2: Rewrite network I/O
|
||||
|
||||
See merge request paddy-hack/backends!3
|
||||
|
||||
commit fff83e7eacd0f27bb2d71c42488e0fd735c15ac3
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-04-30 18:24:51 +0900
|
||||
|
||||
epson2: Rewrite network I/O
|
||||
|
||||
This addresses GHSL-2020-075 as well as all other problematic code
|
||||
uncovered as a result of investigating that. This includes:
|
||||
|
||||
- buffer overflows due to use of unchecked lengths
|
||||
- integer overflows due to type conversions
|
||||
- potential memory leaks
|
||||
- checking for memory allocation failures
|
||||
|
||||
Re #279.
|
||||
|
||||
commit 2b4aa45bad61d5e34996645581a606fd8795a48c
|
||||
Merge: 37b142494bf6 07e3834127f8
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-04 08:24:19 +0000
|
||||
|
||||
Merge branch 'issue11-read_of_uninitialized_data' into '279-confidential-issue'
|
||||
|
||||
magicolor: Added security mediation to device discovery
|
||||
|
||||
See merge request paddy-hack/backends!2
|
||||
|
||||
commit 07e3834127f8bcd9dac02b91c17127dc41fbfb5b
|
||||
Author: Ralph Little <skelband@gmail.com>
|
||||
Date: 2020-04-30 23:21:00 -0700
|
||||
|
||||
magicolor: Added security mediation to device discovery
|
||||
|
||||
Extraction of values from the SNMP response were not checked.
|
||||
Also fixed a bug that mistakenly matched any SNMP OIDs with the
|
||||
first model in the model list, in function mc_get_device_from_identification().
|
||||
|
||||
commit 37b142494bf659d8147b6f0fcb8629408717d14d
|
||||
Merge: e52a5bf71979 af0442f15cc9
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-05-04 05:28:37 +0000
|
||||
|
||||
Merge branch 'issue10-SIGFPE-in-mc_setup_block_mode' into '279-confidential-issue'
|
||||
|
||||
magicolor: Added security remediation for pixels_per_line.
|
||||
|
||||
See merge request paddy-hack/backends!1
|
||||
|
||||
commit af0442f15cc966bbc3d7d9322380005ea0ee8340
|
||||
Author: Ralph Little <skelband@gmail.com>
|
||||
Date: 2020-04-26 13:04:41 -0700
|
||||
|
||||
magicolor: Added security remediation for pixels_per_line.
|
||||
|
||||
This implements a security issue reported by GitHub Security Lab.
|
||||
The details are disclosed in GitLab issue #279.
|
||||
The issue relates to an invalid scan parameter block being sent to
|
||||
the backend containing 8 bytes of 0x00 which leads to pixels_per_line
|
||||
being set to 0. Later arithmetic involves the division by this value
|
||||
which causes a div by zero crash.
|
||||
|
||||
commit 898ab1834864e3b813f0d0ae234f38ac05813756
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-02-06 20:56:21 +0900
|
||||
|
||||
Really remove libxml2 linker/loader flags from dependencies. Re #239
|
||||
|
||||
commit 76bf742aba32ec1ed4ae641285f8e6a0b038326d
|
||||
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
|
||||
Date: 2020-02-05 21:30:11 +0900
|
||||
|
||||
Remove libxml2 linker/loader flags from dependencies. Re #239
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
287
NEWS
287
NEWS
|
@ -1,5 +1,290 @@
|
|||
<!-- -*- Mode: markdown -*- -->
|
||||
|
||||
<!-- Please add new release notes to the newsfragments directory (read the README.md file there).
|
||||
The release notes will be collected at release time and put into this document
|
||||
semi-automatically.
|
||||
-->
|
||||
|
||||
<!--(towncrier release notes start)-->
|
||||
|
||||
## New with 1.3.1 (released 2024-05-22)
|
||||
|
||||
### Backends
|
||||
|
||||
- `avision`:
|
||||
- Correction for ADF presence detect which caused a hang.
|
||||
- Internationalised some text items in the backend to make them available for translation.
|
||||
- `epsonds`:
|
||||
- Some small changes to option documentation.
|
||||
- Added support for models: ES-C220, DS-C330, and DS-C490.
|
||||
- `escl`:
|
||||
- Fix for pwf:Version item.
|
||||
- Fix for crash in libjpeg when cropping image.
|
||||
- Fix for issue with configured device when AVAHI not running.
|
||||
- Fix for build without poppler-glib.
|
||||
- `fujitsu`:
|
||||
- Added support for Ricoh scanners: FI-8040, FI-70F.
|
||||
- `genesys`:
|
||||
- Added missing configuration for Plustek OpticFilm 7500i and Plustek OpticFilm 8100.
|
||||
- `hpljm1005`:
|
||||
- Fixes to maximum geometries and various cropping and geometry details specifically for the HP LaserJet M1005.
|
||||
- `lexmark_X2670`:
|
||||
- Added new backend for the Lexmark X26xx series of scanners.
|
||||
- `pixma`:
|
||||
- Fix to prevent mode change when source is selected. Mode should not change if still valid for source.
|
||||
- Added support for models: TS8630 Series, XK110 Series, GX3000 Series, GX4000 Series, G3070 Series, G2070 Series, G4070 Series, G3030 Series, G2030 Series, TC-20M, TC-5200M, TR4500 Series, TS8700 series, XK120 series, GX1000 series, GX2000 series, TS6630 series, TS7700 series, TS7600i series, TS6730 series, TR7800 series, TS7700i series, TS7700A series, GX6500 series, i-SENSYS MF750 Series
|
||||
- `snapscan`:
|
||||
- Corrections for Agfa ARCUS 1200 scan area.
|
||||
- `test`:
|
||||
- Fix for a crash in the backend.
|
||||
- `xerox_mfp`:
|
||||
- Added support for Dell 1135n, which is a clone of the Samsung SCX-4623F.
|
||||
- Added support for Xerox WorkCentre 3335.
|
||||
- Added JPEG mitigation for modules that don't properly support JPEG output: Xerox WorkCentre 3225
|
||||
- Fix to remove USB CLEAR HALT during initialisation which can potentially lock up devices.
|
||||
- General fixes to support the SCX-4521F model.
|
||||
|
||||
### Frontends
|
||||
|
||||
- `saned`:
|
||||
- Default scan buffer is now 1MB. -B option added to permit the buffersize to be set.
|
||||
- Documentation fixes.
|
||||
|
||||
- `scanimage`:
|
||||
- Fix for keyboard prompt processing
|
||||
- Default scan buffer is now 1MB. --buffer-size and -B options now require an argument to be provided.
|
||||
- Fix for PDF generation, missing newline in generated file.
|
||||
|
||||
### Build
|
||||
|
||||
- Fixes for clang-16 compiler
|
||||
- Fixes for FreeBSD build.
|
||||
- Fixes for escl build option involving poppler-glib.
|
||||
- Optionally take build version from ChangeLog if not other version source is available.
|
||||
- Fixes to autoconf files to remove unnecessary warnings from test logs.
|
||||
- Fix for macOS builds related to threading support: SANE in macOS doesn't work for multi-process with libusb.
|
||||
|
||||
### Tools
|
||||
|
||||
- sane-find-scanner: Added some Linux SCSI device names since some later potential names are missing. Better solution in the pipeline.
|
||||
|
||||
### Documentation
|
||||
|
||||
- Fixes for a number of man pages.
|
||||
- Added documentation for a number of Ricoh scanners which are rebranded products acquired from Fujitsu.
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- sanei_config: Fix for a potential crash.
|
||||
- New Georgian translation added.
|
||||
- Translations updated for: British English, Ukrainian, French and Simplified Chinese.
|
||||
|
||||
## New with 1.2.1 (released 2023-02-05)
|
||||
|
||||
### Backends
|
||||
|
||||
- `avision`:
|
||||
- Minor fix for protocol packet length.
|
||||
- Added “basic” support for Avision AD345F. Note that multi-sheet scanning is problematic.
|
||||
- Fix for 32-bit limitation on scan line size which caused early abort of scan.
|
||||
- Fix for minimum resolution for devices with AV_ASIC_C6.
|
||||
- Various small logic errors addressed.
|
||||
|
||||
- `canon`: Use the common model name instead of string from the device.
|
||||
- `canon_lide70`: Some small corrections to option support.
|
||||
- `canon_pp`: Potential buffer overrun issue addressed.
|
||||
- `canon-dr`: Added support for lifecycle counters for dr-x10c scanners.
|
||||
- `epjitsu`: Hang fix for Scansnap S1300i.
|
||||
- `epsonds`: Added support for Epson XP-2200 Series devices.
|
||||
- `escl`:
|
||||
- Fixes related to support for HP M277dw.
|
||||
- Fix for Canon TS-3400 series resolution support.
|
||||
- Added support for Epson EcoTank L3160.
|
||||
- Fix for segfault crash.
|
||||
- Performance and memory use enhancements through the use of memory-mapped I/O.
|
||||
- Fix for TIFF file type generation failure.
|
||||
- IPv6 detection improvements.
|
||||
- `fujitsu`:
|
||||
- Contrast/brightness fixes for Fujitsu ix500.
|
||||
- Support confirmed for Fujitsu fi-7300NX.
|
||||
- Support added for ScanSnap ix1400.
|
||||
- Added support for ScanPartner SP30.
|
||||
- `genesys`:
|
||||
- Fixes for unit test build errors related to GCC 12.
|
||||
- Fix for 32-bit limitation on scan line size which caused early abort. of scan.
|
||||
- Build issue fix for OSX.
|
||||
- Button support for Canon 8400f scanner corrected.
|
||||
- Support added back in for Plustek OpticFilm 7600i: config file entry was missing.
|
||||
- `kvs40xx`: Compiler warnings fixed.
|
||||
- `mustek_usb2`: Compiler warnings fixed.
|
||||
- `pixma`:
|
||||
- Fix for Canon TS-3400 series resolution support.
|
||||
- Button support for Canon MG5700 series corrected.
|
||||
- Added support for Canon imageRUNNER 1018/1022/1023.
|
||||
- Added support for Canon PIXMA TS2400 Series.
|
||||
- Added support for Canon PIXMA TS2600 Series.
|
||||
- Testing confirmed for Canon TS6400 series devices.
|
||||
- Testing confirmed for Canon TS3400 series devices.
|
||||
- Various devices’ max resolutions fixed.
|
||||
- Minor fix for broadcast buffer size error.
|
||||
- `plustek_pp`: Support removed for deprecated Linux kernel driver build.
|
||||
- `test`: Fix for 32-bit limitation on scan line size which caused early abort of scan.
|
||||
- `xerox_mfp`:
|
||||
- JPEG support fix for Samsung SCX-4828 FN and similar.
|
||||
- JPEG support fix for Samsung SCX-4824 FN and similar.
|
||||
|
||||
|
||||
### Frontends
|
||||
|
||||
- `sane-find-scanner`: Alteration to output to indicate that indicated devices are potentially scanners.
|
||||
- `saned`: Fix for poll.h header file, which caused problems on Alpine Linux.
|
||||
- `scanimage`:
|
||||
- Attempts to set readonly options will give a warning about readonly option set attempt now, instead of the misleading "unknown option" error.
|
||||
- Header file build fixes for FreeBSD.
|
||||
- Fix for backends presenting NULL attributes in deactivated options.
|
||||
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- Updated translation to Russian, Italian, British English and Ukraine.
|
||||
- Compiler warnings addressed for a number of backends.
|
||||
- A number of fixes for the build system:
|
||||
- Fix to ignore LDFLAGS environment variable in build.
|
||||
- Fix to not build umax_pp tool when disabled.
|
||||
- Fix for CLANG compiler warnings.
|
||||
- Various small improvements to dependency checking and CI builds.
|
||||
- General corrections for backends’ use of mkstemp() function.
|
||||
- Added support for autotools’ silent build option.
|
||||
- Remove –with-group configure option, since it is no longer used.
|
||||
- Autotools fixes for backend library installation.
|
||||
|
||||
|
||||
## New with 1.1.1 (released 2022-01-18)
|
||||
|
||||
### Backends
|
||||
|
||||
- `epson2`: Fixed support for many scanners that don't support focus command.
|
||||
- `epson2`: Improve reliability of long scans.
|
||||
- `epsonds`: Implemented support for the following Epson scanners:
|
||||
- DS-1610
|
||||
- DS-1630
|
||||
- DS-1660W
|
||||
- DS-310
|
||||
- DS-320
|
||||
- DS-360W
|
||||
- DS-410
|
||||
- DS-530
|
||||
- DS-530II
|
||||
- DS-531
|
||||
- DS-535
|
||||
- DS-535H
|
||||
- DS-535II
|
||||
- DS-570W
|
||||
- DS-570WII
|
||||
- DS-571W
|
||||
- DS-575W
|
||||
- DS-575WII
|
||||
- DS-70
|
||||
- DS-80W
|
||||
- ES-200
|
||||
- ES-300W
|
||||
- ES-300WR
|
||||
- ES-400
|
||||
- ES-400II
|
||||
- ES-50
|
||||
- ES-500W
|
||||
- ES-500WII
|
||||
- ES-500WR
|
||||
- ES-55R
|
||||
- ES-580W
|
||||
- ES-60W
|
||||
- ES-60WB
|
||||
- ES-60WW
|
||||
- ES-65WR
|
||||
- ET-2700 Series
|
||||
- ET-2710 Series
|
||||
- ET-2810 Series
|
||||
- ET-M2140 Series
|
||||
- ET-M3140 Series
|
||||
- EW-052A Series
|
||||
- FF-680W
|
||||
- L3150 Series
|
||||
- L3200 Series
|
||||
- L3210 Series
|
||||
- L3250 Series
|
||||
- L4150 Series
|
||||
- M2140 Series
|
||||
- M3140 Series
|
||||
- RR-60
|
||||
- RR-600W
|
||||
- RR-70W
|
||||
- XP-2100 Series
|
||||
- XP-2150 Series
|
||||
- `epson2`: Marked XP-452 455 series as supported in documentation.
|
||||
- `escl`: Fixed scanning problems on certain scanners due to incorrect URL being used
|
||||
(https://gitlab.com/sane-project/backends/-/issues/479)
|
||||
- `escl`: Fixed support for different resolutions when using JPEG format.
|
||||
- `escl`: Fixed handling of ipp-usb redirects to localhost which previously caused certain scanners
|
||||
to be always reported as busy.
|
||||
- `escl`: Added support for Brother DCP-J772DW and Epson ET-2750 scanners.
|
||||
- `escl`: Marked the following scanners as supported in documentation:
|
||||
- Canon PIXMA G4511
|
||||
- Canon PIXMA TR4550 Series
|
||||
- Canon PIXMA TR4551 Series
|
||||
- Epson ET-6100
|
||||
- `escl`: Implemented support for disabling PDF output on scanners where it's broken
|
||||
(https://gitlab.com/sane-project/backends/-/issues/510)
|
||||
- `escl`: Implemented support for Canon PIXME TR4520 and TR7500 scanners.
|
||||
- `genesys`: Improved scan quality on Canon LiDE 35/40/50/60 by using brighter LED illumination.
|
||||
- `genesys`: Fixed control of contrast and brigthness on certain scanners
|
||||
(https://gitlab.com/sane-project/backends/-/issues/271).
|
||||
- `genesys`: Fixed crashes when handling slightly unexpected conditions
|
||||
(https://gitlab.com/sane-project/backends/-/issues/464).
|
||||
- `genesys`: Fixed support for Plustek Opticfilm 7200 v2 scanner.
|
||||
- `genesys`: Fixed button support on HP ScanJet G4010.
|
||||
- `genesys`: Fixed compilation on gcc-4.8.
|
||||
- `genesys`: Fixed incorrect LED exposure calculation leading to wrong color balance on certain
|
||||
resolutions on gl841 scanners
|
||||
- `genesys`: Improved gray scan quality on Canon LiDE 110, 120, 210, 220
|
||||
(https://gitlab.com/sane-project/backends/-/issues/106,
|
||||
https://gitlab.com/sane-project/backends/-/issues/52).
|
||||
- `genesys`: Fixed issue of motor becoming stuck at certain resolutions on Canon LiDE 50
|
||||
and possibly other gl841 scanners (https://gitlab.com/sane-project/backends/-/issues/357)
|
||||
- `genesys`: Fixed periodic black lines in gray scans on Canon LiDE 80.
|
||||
- `genesys`: Removed support for broken 75 and 100 dpi hardware resolutions to fix preview
|
||||
scans (https://gitlab.com/sane-project/backends/-/issues/383). These resolutions did
|
||||
not have any benefit compared to next smallest 150 dpi resolution.
|
||||
- `genesys`: Add support for running in embedded environments that don't support threads.
|
||||
- `genesys`: Fixed gray scans to use white color for illumination instead of red on
|
||||
Canon LiDE 35/40/50/60 and potentially other gl841 scanners. Old behavior can
|
||||
be restored via the color filter setting to select specific color component for
|
||||
the gray scan.
|
||||
- `genesys`: The genesys backend is now distributed under GPL v2 or later license.
|
||||
Previously there existed an exception that allowed additional uses of the backend.
|
||||
- `gt68xx`: Fixed several memory issues that can potentially lead to crashes or increased memory use.
|
||||
- `hp4200`: Fixed crash when using HP ScanJet 4200C
|
||||
(https://gitlab.com/sane-project/backends/-/issues/454).
|
||||
- `microtek`: Fixed support for embedded platforms using `uclibc`.
|
||||
- `pieusb`: Implemented support for Reflecta RPS 10M scanner.
|
||||
- `pieusb`: Fixed support for automatically advancing slides on DigitDia 4000.
|
||||
- `pixma`: Fixed compliation with `NDEBUG` macro defined.
|
||||
- `pixma`: Marked Canon PIXMA G4511 as supported in documentation
|
||||
- `scangearmp2`: Mark GX6000, GX7000, TS5400 and MX455 series as supported.
|
||||
- `sm3600-scanutil`: Fixed support for embedded platforms using `uclibc`.
|
||||
|
||||
|
||||
### Frontends
|
||||
|
||||
- Improved documentation of `scanimage` concerning options provided by backends.
|
||||
- `scanimage`: Improved help to specify which options are advanced.
|
||||
- `scanimage`: Implemented support for PDF output format.
|
||||
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- Added translation to Simplified Chinese.
|
||||
|
||||
|
||||
## New with 1.0.32 (released 2021-02-14)
|
||||
|
||||
### Backends
|
||||
|
@ -1102,7 +1387,7 @@ There is now support for the SnapScan 310 and 600 scanner models.
|
|||
New with 0.71:
|
||||
|
||||
* Polaroid Digital Microscope Camera (DMC) backend
|
||||
Written by David Skoll <dskoll@chipworks.com>.
|
||||
Written by Dianne Skoll <dianne@skoll.ca>
|
||||
|
||||
* Apple scanner backend
|
||||
Written by Milon Firikis <milonf@isosun.ariadne-t.gr>. This backend
|
||||
|
|
14
PROBLEMS
14
PROBLEMS
|
@ -1,5 +1,3 @@
|
|||
Last update: 2006-01-05
|
||||
|
||||
- Avoiding damage on flatbed scanners
|
||||
|
||||
Most flatbed scanners have no protection against exceeding the physical scan
|
||||
|
@ -15,8 +13,10 @@ Last update: 2006-01-05
|
|||
|
||||
- Security problems with saned (SANE network scanning daemon)
|
||||
|
||||
saned is not intended to be exposed to the internet or other non-trusted
|
||||
networks. Make sure that access is limited by tcpwrappers and/or a firewall
|
||||
setup. Don't depend only on saned's own authentication. Don't run saned
|
||||
as root if it's not necessary. And do not install saned as setuid root.
|
||||
Read man saned(8) for details.
|
||||
saned does not provide confidentiality when communicating with clients.
|
||||
If saned is exposed directly on the network, other users may be able to
|
||||
intercept scanned images, or learn passwords for connecting to saned,
|
||||
with little effort. Client systems should connect to saned through a
|
||||
secure tunnel to the server instead.
|
||||
|
||||
saned is not a trusted program and should not run with root privileges.
|
||||
|
|
2
README
2
README
|
@ -38,7 +38,7 @@ Ubuntu PPA https://launchpad.net/~sane-project/+archive/ubuntu/sane-release
|
|||
|
||||
sudo add-apt-repository ppa:sane-project/sane-release
|
||||
sudo apt update
|
||||
apt install libsane libsane-common sane-utils
|
||||
sudo apt install libsane libsane-common sane-utils
|
||||
|
||||
|
||||
Prerequisites
|
||||
|
|
39
acinclude.m4
39
acinclude.m4
|
@ -248,8 +248,16 @@ AC_DEFUN([SANE_CHECK_PTHREAD],
|
|||
AC_DEFINE(PTHREAD_T_IS_INTEGER, 1,
|
||||
[Define if pthread_t is integer.])
|
||||
else
|
||||
# Until the sanei_thread implementation is fixed.
|
||||
use_pthread=no
|
||||
case "$host_os" in
|
||||
darwin*)
|
||||
# Always use pthreads on macOS
|
||||
use_pthread=yes
|
||||
;;
|
||||
*)
|
||||
# Until the sanei_thread implementation is fixed.
|
||||
use_pthread=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "$have_pthread" = "yes" ; then
|
||||
|
@ -322,10 +330,9 @@ AC_DEFUN([SANE_CHECK_PNG],
|
|||
])
|
||||
|
||||
#
|
||||
# Checks for pthread support
|
||||
# Checks for device locking support
|
||||
AC_DEFUN([SANE_CHECK_LOCKING],
|
||||
[
|
||||
LOCKPATH_GROUP=uucp
|
||||
use_locking=yes
|
||||
case "${host_os}" in
|
||||
os2* )
|
||||
|
@ -345,23 +352,6 @@ AC_DEFUN([SANE_CHECK_LOCKING],
|
|||
use_locking=no
|
||||
fi
|
||||
])
|
||||
if test $use_locking = yes ; then
|
||||
AC_ARG_WITH([group],
|
||||
AS_HELP_STRING([--with-group],
|
||||
[use the specified group for lock dir @<:@default=uucp@:>@]),
|
||||
[LOCKPATH_GROUP="$withval"]
|
||||
)
|
||||
# check if the group does exist
|
||||
lasterror=""
|
||||
touch sanetest.file
|
||||
chgrp $LOCKPATH_GROUP sanetest.file 2>/dev/null || lasterror=$?
|
||||
rm -f sanetest.file
|
||||
if test ! -z "$lasterror"; then
|
||||
AC_MSG_WARN([Group $LOCKPATH_GROUP does not exist on this system.])
|
||||
AC_MSG_WARN([Locking feature will be disabled.])
|
||||
use_locking=no
|
||||
fi
|
||||
fi
|
||||
if test $use_locking = yes ; then
|
||||
INSTALL_LOCKPATH=install-lockpath
|
||||
AC_DEFINE([ENABLE_LOCKING], 1,
|
||||
|
@ -371,11 +361,7 @@ AC_DEFUN([SANE_CHECK_LOCKING],
|
|||
fi
|
||||
AC_MSG_CHECKING([whether to enable device locking])
|
||||
AC_MSG_RESULT([$use_locking])
|
||||
if test $use_locking = yes ; then
|
||||
AC_MSG_NOTICE([Setting lockdir group to $LOCKPATH_GROUP])
|
||||
fi
|
||||
AC_SUBST(INSTALL_LOCKPATH)
|
||||
AC_SUBST(LOCKPATH_GROUP)
|
||||
])
|
||||
|
||||
dnl
|
||||
|
@ -493,6 +479,7 @@ AC_DEFUN([SANE_CHECK_IPV6],
|
|||
if test "$ipv6" != "no" ; then
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#define INET6
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> ]], [[
|
||||
/* AF_INET6 available check */
|
||||
|
@ -514,6 +501,7 @@ AC_DEFUN([SANE_CHECK_IPV6],
|
|||
AC_MSG_CHECKING([whether struct sockaddr_storage has an ss_family member])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#define INET6
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> ]], [[
|
||||
/* test if the ss_family member exists in struct sockaddr_storage */
|
||||
|
@ -526,6 +514,7 @@ AC_DEFUN([SANE_CHECK_IPV6],
|
|||
], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#define INET6
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> ]], [[
|
||||
/* test if the __ss_family member exists in struct sockaddr_storage */
|
||||
|
|
14
autogen.sh
14
autogen.sh
|
@ -2,6 +2,20 @@
|
|||
test -n "$srcdir" || srcdir=`dirname "$0"`
|
||||
test -n "$srcdir" || srcdir=.
|
||||
|
||||
# When repos are forked on GitLab tags aren't copied thus making
|
||||
# git-version-gen producing incorrect version ("UNKNOWN") which in turn causes
|
||||
# CI build failures. To workaround this reconstruct version from ChangeLogs
|
||||
# files (handy updated on every release). If git describe is not working and we
|
||||
# are not in dist package - take version from the top-most ChangeLog file.
|
||||
if [ ! -e .tarball-version ] &&
|
||||
! git describe >/dev/null 2>&1; then
|
||||
ls ChangeLogs \
|
||||
| sort -Vr \
|
||||
| grep -m1 -P -o '(?<=ChangeLog-).*' > .tarball-version
|
||||
read v < .tarball-version
|
||||
echo >&2 "Package version reconstructed from ChangeLog: $v"
|
||||
fi
|
||||
|
||||
patchdir="$srcdir/patches"
|
||||
|
||||
# Suppress warnings about obsolete macros if still needed (#122)
|
||||
|
|
1080
backend/Makefile.am
1080
backend/Makefile.am
Plik diff jest za duży
Load Diff
|
@ -236,8 +236,8 @@ wait_ready (int fd)
|
|||
static SANE_Status
|
||||
sense_handler (int scsi_fd, u_char * result, void *arg)
|
||||
{
|
||||
scsi_fd = scsi_fd; /* silence gcc */
|
||||
arg = arg; /* silence gcc */
|
||||
(void) scsi_fd; /* silence gcc */
|
||||
(void) arg; /* silence gcc */
|
||||
|
||||
switch (result[2] & 0x0F)
|
||||
{
|
||||
|
@ -850,12 +850,12 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
size_t len;
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize; /* silence gcc */
|
||||
(void) authorize; /* silence gcc */
|
||||
|
||||
DBG_INIT ();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (ABATON_CONFIG_FILE);
|
||||
if (!fp)
|
||||
|
@ -915,7 +915,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
Abaton_Device *dev;
|
||||
int i;
|
||||
|
||||
local_only = local_only; /* silence gcc */
|
||||
(void) local_only; /* silence gcc */
|
||||
|
||||
if (devlist)
|
||||
free (devlist);
|
||||
|
@ -1399,7 +1399,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
|
|||
|
||||
status = sanei_scsi_cmd (s->fd, test_unit_ready,
|
||||
sizeof (test_unit_ready), 0, 0);
|
||||
if (status != SANE_STATUS_GOOD || status != SANE_STATUS_INVAL)
|
||||
if (status != SANE_STATUS_GOOD && status != SANE_STATUS_INVAL)
|
||||
return status;
|
||||
return SANE_STATUS_CANCELLED;
|
||||
}
|
||||
|
@ -1472,8 +1472,8 @@ sane_cancel (SANE_Handle handle)
|
|||
SANE_Status
|
||||
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
||||
{
|
||||
handle = handle; /* silence gcc */
|
||||
non_blocking = non_blocking; /* silence gcc */
|
||||
(void) handle; /* silence gcc */
|
||||
(void) non_blocking; /* silence gcc */
|
||||
|
||||
DBG (FLOW_CONTROL, "sane_set_io_mode: Don't call me please. "
|
||||
"Unimplemented function\n");
|
||||
|
@ -1483,8 +1483,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
|||
SANE_Status
|
||||
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
|
||||
{
|
||||
handle = handle; /* silence gcc */
|
||||
fd = fd; /* silence gcc */
|
||||
(void) handle; /* silence gcc */
|
||||
(void) fd; /* silence gcc */
|
||||
|
||||
DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. "
|
||||
"Unimplemented function\n");
|
||||
|
|
|
@ -236,8 +236,8 @@ test_ready (int fd)
|
|||
static SANE_Status
|
||||
sense_handler (int scsi_fd, u_char *result, void *arg)
|
||||
{
|
||||
scsi_fd = scsi_fd; /* silence gcc */
|
||||
arg = arg; /* silence gcc */
|
||||
(void) scsi_fd; /* silence gcc */
|
||||
(void) arg; /* silence gcc */
|
||||
|
||||
if (result[0])
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
|
|||
static SANE_Status
|
||||
stop_scan (int fd)
|
||||
{
|
||||
fd = fd; /* silence gcc */
|
||||
(void) fd; /* silence gcc */
|
||||
|
||||
/* XXX don't know how to stop the scanner. To be tested ! */
|
||||
#if 0
|
||||
|
@ -1280,14 +1280,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
size_t len;
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize; /* silence gcc */
|
||||
(void) authorize; /* silence gcc */
|
||||
|
||||
DBG_INIT ();
|
||||
|
||||
sanei_thread_init ();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open ("agfafocus.conf");
|
||||
if (!fp)
|
||||
|
@ -1335,7 +1335,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
AgfaFocus_Device *dev;
|
||||
int i;
|
||||
|
||||
local_only = local_only; /* silence gcc */
|
||||
(void) local_only; /* silence gcc */
|
||||
|
||||
if (devlist)
|
||||
free (devlist);
|
||||
|
|
|
@ -328,8 +328,8 @@ return SANE_STATUS_GOOD;
|
|||
static SANE_Status
|
||||
sense_handler (int scsi_fd, u_char * result, void *arg)
|
||||
{
|
||||
scsi_fd = scsi_fd; /* silence gcc */
|
||||
arg = arg; /* silence gcc */
|
||||
(void) scsi_fd; /* silence gcc */
|
||||
(void) arg; /* silence gcc */
|
||||
|
||||
switch (result[2] & 0x0F)
|
||||
{
|
||||
|
@ -1866,12 +1866,12 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
size_t len;
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize; /* silence gcc */
|
||||
(void) authorize; /* silence gcc */
|
||||
|
||||
DBG_INIT ();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (APPLE_CONFIG_FILE);
|
||||
if (!fp)
|
||||
|
@ -1930,7 +1930,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
Apple_Device *dev;
|
||||
int i;
|
||||
|
||||
local_only = local_only; /* silence gcc */
|
||||
(void) local_only; /* silence gcc */
|
||||
|
||||
if (devlist)
|
||||
free (devlist);
|
||||
|
@ -2667,7 +2667,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
|||
{
|
||||
DBG (FLOW_CONTROL,"sane_set_io_mode: Entering.\n");
|
||||
|
||||
handle = handle; /* silence gcc */
|
||||
(void) handle; /* silence gcc */
|
||||
|
||||
if (non_blocking)
|
||||
{
|
||||
|
@ -2682,8 +2682,8 @@ return SANE_STATUS_GOOD;
|
|||
SANE_Status
|
||||
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
|
||||
{
|
||||
handle = handle; /* silence gcc */
|
||||
fd = fd; /* silence gcc */
|
||||
(void) handle; /* silence gcc */
|
||||
(void) fd; /* silence gcc */
|
||||
|
||||
DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. "
|
||||
"Unimplemented function\n");
|
||||
|
|
|
@ -2591,7 +2591,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
strcpy (artec_model, "");
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
if (authorize)
|
||||
DBG (7, "sane_init(), authorize %s null\n", (authorize) ? "!=" : "==");
|
||||
|
@ -3474,7 +3474,7 @@ artec_sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int
|
|||
SANE_Byte line_buf[ARTEC_MAX_READ_SIZE];
|
||||
|
||||
|
||||
DBG (7, "artec_sane_read( %p, %p, %d, %d )\n", handle, buf, max_len, *len);
|
||||
DBG (7, "artec_sane_read( %p, %p, %d, %d )\n", handle, (void *) buf, max_len, *len);
|
||||
|
||||
*len = 0;
|
||||
|
||||
|
@ -3674,7 +3674,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
|
|||
static SANE_Byte temp_buf[ARTEC_MAX_READ_SIZE];
|
||||
static int bytes_in_buf = 0;
|
||||
|
||||
DBG (7, "sane_read( %p, %p, %d, %d )\n", handle, buf, max_len, *len);
|
||||
DBG (7, "sane_read( %p, %p, %d, %d )\n", handle, (void *) buf, max_len, *len);
|
||||
DBG (9, "sane_read: bib = %d, ml = %d\n", bytes_in_buf, max_len);
|
||||
|
||||
if (bytes_in_buf != 0)
|
||||
|
|
|
@ -351,9 +351,6 @@ static void
|
|||
finish_shading_buffer (Artec48U_Scanner * s, SANE_Bool white)
|
||||
{
|
||||
unsigned int i, j, cnt, c, div;
|
||||
unsigned long max_r;
|
||||
unsigned long max_g;
|
||||
unsigned long max_b;
|
||||
unsigned char *shading_buffer;
|
||||
cnt = 0;
|
||||
|
||||
|
@ -379,18 +376,12 @@ finish_shading_buffer (Artec48U_Scanner * s, SANE_Bool white)
|
|||
++cnt;
|
||||
}
|
||||
}
|
||||
max_r = 0;
|
||||
max_g = 0;
|
||||
max_b = 0;
|
||||
|
||||
for (c = 0; c < (30720 * s->dev->epro_mult) - 5; c += 6) /*epro*/
|
||||
{
|
||||
i = (int) shading_buffer[c] + ((int) shading_buffer[c + 1] << 8);
|
||||
max_r += i;
|
||||
i = (int) shading_buffer[c + 2] + ((int) shading_buffer[c + 3] << 8);
|
||||
max_g += i;
|
||||
i = (int) shading_buffer[c + 4] + ((int) shading_buffer[c + 5] << 8);
|
||||
max_b += i;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1628,7 +1619,7 @@ artec48u_device_memory_read (Artec48U_Device * dev,
|
|||
SANE_Status status;
|
||||
|
||||
XDBG ((8, "%s: dev=%p, addr=0x%x, size=0x%x, data=%p\n",
|
||||
function_name, (void *) dev, addr, size, data));
|
||||
function_name, (void *) dev, addr, size, (void *) data));
|
||||
CHECK_DEV_ACTIVE (dev, function_name);
|
||||
|
||||
status = sanei_usb_control_msg (dev->fd, 0xc0, 0x01,
|
||||
|
@ -4458,7 +4449,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
auth = authorize;
|
||||
|
||||
if (version_code != NULL)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (ARTEC48U_CONFIG_FILE);
|
||||
|
||||
|
|
|
@ -626,7 +626,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
DBG_INIT ();
|
||||
DBG (2, "sane_init (authorize %s null)\n", (authorize) ? "!=" : "==");
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
/* fp = sanei_config_open (AS6E_CONFIG_FILE);*/
|
||||
if (!fp)
|
||||
{
|
||||
|
|
1090
backend/avision.c
1090
backend/avision.c
Plik diff jest za duży
Load Diff
|
@ -66,6 +66,65 @@ typedef enum Avision_ConnectionType {
|
|||
AV_USB
|
||||
} Avision_ConnectionType;
|
||||
|
||||
/*
|
||||
* Translatable custom options text.
|
||||
*
|
||||
*/
|
||||
#define SANE_TITLE_MISC_GROUP SANE_I18N("Miscellaneous")
|
||||
#define SANE_TITLE_INSTALLED_OPTS_GROUP SANE_I18N("Installed options")
|
||||
|
||||
#define SANE_TITLE_OVERSCAN_TOP SANE_I18N("Overscan top")
|
||||
#define SANE_TITLE_OVERSCAN_BOTTOM SANE_I18N("Overscan bottom")
|
||||
#define SANE_TITLE_BACKGROUND_LINES SANE_I18N("Background raster lines")
|
||||
#define SANE_TITLE_QUALITY_SCAN SANE_I18N("Quality scan")
|
||||
#define SANE_TITLE_MANUAL_EXPOSURE SANE_I18N("Exposure")
|
||||
#define SANE_TITLE_MULTI_SAMPLE SANE_I18N("Multi-sample")
|
||||
#define SANE_TITLE_POWER_SAVE_TIME SANE_I18N("Power save timer control")
|
||||
#define SANE_TITLE_OPTIONS_MSG SANE_I18N("Message text from the scanner")
|
||||
#define SANE_TITLE_NVRAM SANE_I18N("Obtain NVRAM values")
|
||||
#define SANE_TITLE_PAPER_LENGTH SANE_I18N("Use paper length")
|
||||
#define SANE_TITLE_FLIP_PAGE SANE_I18N("Flip document after duplex scanning")
|
||||
#define SANE_TITLE_ADF_INSTALLED SANE_I18N("ADF installed")
|
||||
#define SANE_TITLE_LIGHTBOX_INSTALLED SANE_I18N("Lightbox installed")
|
||||
|
||||
#define SANE_DESC_OVERSCAN_TOP \
|
||||
SANE_I18N("The top overscan controls the additional area to scan before the "\
|
||||
"paper is detected.")
|
||||
#define SANE_DESC_OVERSCAN_BOTTOM \
|
||||
SANE_I18N("The bottom overscan controls the additional area to scan after "\
|
||||
"the paper end is detected.")
|
||||
#define SANE_DESC_BACKGROUND_LINES \
|
||||
SANE_I18N("The background raster controls the additional background lines to "\
|
||||
"scan before the paper is feed through the scanner.")
|
||||
#define SANE_DESC_QUALITY_SCAN \
|
||||
SANE_I18N("Turn on quality scanning (slower but better).")
|
||||
#define SANE_DESC_MANUAL_EXPOSURE \
|
||||
SANE_I18N("Manual exposure adjustment.")
|
||||
#define SANE_DESC_MULTI_SAMPLE \
|
||||
SANE_I18N("Enable multi-sample scan mode.")
|
||||
#define SANE_DESC_POWER_SAVE_TIME \
|
||||
SANE_I18N("Allows control of the scanner's power save timer, dimming or "\
|
||||
"turning off the light.")
|
||||
#define SANE_DESC_OPTIONS_MSG \
|
||||
SANE_I18N("This text contains device specific options controlled by the "\
|
||||
"user on the scanner hardware.")
|
||||
#define SANE_DESC_NVRAM \
|
||||
SANE_I18N("Allows access obtaining the scanner's NVRAM values as pretty "\
|
||||
"printed text.")
|
||||
#define SANE_DESC_PAPER_LENGTH \
|
||||
SANE_I18N("Newer scanners can utilize this paper length to detect double feeds. "\
|
||||
"However some others (DM152) can get confused during media flush if it is set.")
|
||||
#define SANE_DESC_FLIP_PAGE \
|
||||
SANE_I18N("Tells page-flipping document scanners to flip the paper back to its "\
|
||||
"original orientation before dropping it in the output tray. "\
|
||||
"Turning this off might make scanning a little faster if you don't "\
|
||||
"care about manually flipping the pages afterwards.")
|
||||
#define SANE_DESC_ADF_INSTALLED \
|
||||
SANE_I18N("ADF option is detected as installed.")
|
||||
#define SANE_DESC_LIGHTBOX_INSTALLED \
|
||||
SANE_I18N("Lightbox option is detected as installed.")
|
||||
|
||||
|
||||
/* information needed for device access */
|
||||
typedef struct Avision_Connection {
|
||||
Avision_ConnectionType connection_type;
|
||||
|
@ -336,6 +395,10 @@ enum Avision_Option
|
|||
OPT_PAPERLEN, /* Use paper_length field to detect double feeds */
|
||||
OPT_ADF_FLIP, /* For flipping duplex, reflip the document */
|
||||
|
||||
OPT_OPTIONS_GROUP,
|
||||
OPT_OPTION_ADF, // ADF installed/detected?
|
||||
OPT_OPTION_LIGHTBOX, // LightBox installed/detected?
|
||||
|
||||
NUM_OPTIONS /* must come last */
|
||||
};
|
||||
|
||||
|
@ -398,8 +461,7 @@ typedef struct Avision_Device
|
|||
SANE_Bool inquiry_nvram_read;
|
||||
SANE_Bool inquiry_power_save_time;
|
||||
|
||||
SANE_Bool inquiry_light_box;
|
||||
SANE_Bool inquiry_adf;
|
||||
SANE_Bool inquiry_adf_capability;
|
||||
SANE_Bool inquiry_duplex;
|
||||
SANE_Bool inquiry_duplex_interlaced;
|
||||
SANE_Bool inquiry_paper_length;
|
||||
|
@ -419,6 +481,10 @@ typedef struct Avision_Device
|
|||
SANE_Bool inquiry_light_control;
|
||||
SANE_Bool inquiry_exposure_control;
|
||||
|
||||
// Determines from accessories query.
|
||||
SANE_Bool inquiry_light_box_present;
|
||||
SANE_Bool inquiry_adf_present;
|
||||
|
||||
int inquiry_max_shading_target;
|
||||
SANE_Bool inquiry_button_control;
|
||||
unsigned int inquiry_buttons;
|
||||
|
@ -502,7 +568,6 @@ typedef struct Avision_Scanner
|
|||
|
||||
/* Internal data for duplex scans */
|
||||
char duplex_rear_fname [PATH_MAX];
|
||||
char duplex_offtmp_fname [PATH_MAX];
|
||||
SANE_Bool duplex_rear_valid;
|
||||
|
||||
color_mode c_mode;
|
||||
|
@ -795,17 +860,17 @@ typedef struct acceleration_info
|
|||
|
||||
/* set/get SCSI highended (big-endian) variables. Declare them as an array
|
||||
* of chars endianness-safe, int-size safe ... */
|
||||
#define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \
|
||||
var[1] = ((val) ) & 0xff
|
||||
#define set_double(var,val) var[0] = (uint8_t) (((val) >> 8) & 0xff); \
|
||||
var[1] = (uint8_t) (((val) ) & 0xff)
|
||||
|
||||
#define set_triple(var,val) var[0] = ((val) >> 16) & 0xff; \
|
||||
var[1] = ((val) >> 8 ) & 0xff; \
|
||||
var[2] = ((val) ) & 0xff
|
||||
#define set_triple(var,val) var[0] = (uint8_t) (((val) >> 16) & 0xff); \
|
||||
var[1] = (uint8_t) (((val) >> 8 ) & 0xff); \
|
||||
var[2] = (uint8_t) (((val) ) & 0xff)
|
||||
|
||||
#define set_quad(var,val) var[0] = ((val) >> 24) & 0xff; \
|
||||
var[1] = ((val) >> 16) & 0xff; \
|
||||
var[2] = ((val) >> 8 ) & 0xff; \
|
||||
var[3] = ((val) ) & 0xff
|
||||
#define set_quad(var,val) var[0] = (uint8_t) (((val) >> 24) & 0xff); \
|
||||
var[1] = (uint8_t) (((val) >> 16) & 0xff); \
|
||||
var[2] = (uint8_t) (((val) >> 8 ) & 0xff); \
|
||||
var[3] = (uint8_t) (((val) ) & 0xff)
|
||||
|
||||
#define get_double(var) ((*var << 8) + *(var + 1))
|
||||
|
||||
|
@ -817,10 +882,10 @@ typedef struct acceleration_info
|
|||
(*(var + 2) << 8) + *(var + 3))
|
||||
|
||||
/* set/get Avision lowended (little-endian) shading data */
|
||||
#define set_double_le(var,val) var[0] = ((val) ) & 0xff; \
|
||||
var[1] = ((val) >> 8) & 0xff
|
||||
#define set_double_le(var,val) var[0] = (uint8_t) (((val) ) & 0xff); \
|
||||
var[1] = (uint8_t) (((val) >> 8) & 0xff)
|
||||
|
||||
#define get_double_le(var) ((*(var + 1) << 8) + *var)
|
||||
#define get_double_le(var) ((uint16_t) ((*(var + 1) << 8) + *(var)))
|
||||
|
||||
#define BIT(n, p) ((n & (1 << p)) ? 1 : 0)
|
||||
|
||||
|
@ -851,4 +916,29 @@ extern SANE_Status ENTRY(media_check) (SANE_Handle handle);
|
|||
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
AVISION_DATATYPECODE_READ_IMAGE_DATA = 0x00,
|
||||
AVISION_DATATYPECODE_GET_CALIBRATION_FORMAT = 0x60,
|
||||
AVISION_DATATYPECODE_DETECT_ACCESSORIES = 0x64,
|
||||
AVISION_DATATYPECODE_READ_NVRAM_DATA = 0x69,
|
||||
AVISION_DATATYPECODE_FLASH_RAM_INFO = 0x6a,
|
||||
AVISION_DATATYPECODE_ACCELERATION_TABLE = 0x6c,
|
||||
AVISION_DATATYPECODE_DOWNLOAD_GAMMA_TABLE = 0x81,
|
||||
AVISION_DATATYPECODE_3X3_COLOR_MATRIX = 0x83,
|
||||
AVISION_DATATYPECODE_SEND_NVRAM_DATA = 0x85,
|
||||
AVISION_DATATYPECODE_FLASH_DATA = 0x86,
|
||||
AVISION_DATATYPECODE_FILM_HOLDER_SENSE = 0x87,
|
||||
AVISION_DATATYPECODE_FIRMWARE_STATUS = 0x90,
|
||||
AVISION_DATATYPECODE_ATTACH_TRUNCATE_TAIL = 0x95,
|
||||
AVISION_DATATYPECODE_ATTACH_TRUNCATE_HEAD = 0x96,
|
||||
AVISION_DATATYPECODE_GET_BACKGROUND_RASTER = 0x9b,
|
||||
AVISION_DATATYPECODE_LIGHT_STATUS = 0xa0,
|
||||
AVISION_DATATYPECODE_BUTTON_STATUS = 0xa1,
|
||||
AVISION_DATATYPECODE_POWER_SAVING_TIMER = 0xa2,
|
||||
AVISION_DATATYPECODE_READ_DUPLEX_INFO = 0xb1,
|
||||
AVISION_DATATYPECODE_UNKNOWN = 0xd0,
|
||||
AVISION_DATATYPECODE_READ_GENERAL_ABILITY_PARAM = 0xd2,
|
||||
} Avision_Datatypecode;
|
||||
|
||||
#endif /* avision_h */
|
||||
|
|
19
backend/bh.c
19
backend/bh.c
|
@ -1895,6 +1895,11 @@ start_scan (BH_Scanner *s)
|
|||
{
|
||||
DBG(1, "sane_start: error opening barfile `%s'\n",
|
||||
s->barfname);
|
||||
if (fd !=-1)
|
||||
{
|
||||
close(fd);
|
||||
unlink(s->barfname);
|
||||
}
|
||||
status = SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -1979,7 +1984,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
|
|||
SANE_Status status = SANE_STATUS_INVAL;
|
||||
SANE_Char print_sense[(16 * 3) + 1];
|
||||
|
||||
scsi_fd = scsi_fd; /* get rid of compiler warning */
|
||||
(void) scsi_fd; /* get rid of compiler warning */
|
||||
ErrorCode = result[0] & 0x7F;
|
||||
ValidData = (result[0] & 0x80) != 0;
|
||||
sense = result[2] & 0x0f; /* Key */
|
||||
|
@ -3145,16 +3150,16 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize)
|
|||
char devnam[PATH_MAX] = "/dev/scanner";
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize; /* get rid of compiler warning */
|
||||
(void) authorize; /* get rid of compiler warning */
|
||||
|
||||
DBG_INIT();
|
||||
DBG(3, "sane_init called\n");
|
||||
DBG(1, "Bell+Howell SANE backend %d.%d build %d %s endian\n",
|
||||
SANE_CURRENT_MAJOR, V_MINOR, BUILD,
|
||||
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD,
|
||||
_is_host_little_endian() ? "little" : "big");
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
|
||||
|
||||
fp = sanei_config_open(BH_CONFIG_FILE);
|
||||
if (fp)
|
||||
|
@ -3233,7 +3238,7 @@ sane_get_devices (const SANE_Device ***device_list, SANE_Bool local)
|
|||
int i;
|
||||
DBG(3, "sane_get_devices called\n");
|
||||
|
||||
local = local; /* get rid of compiler warning */
|
||||
(void) local; /* get rid of compiler warning */
|
||||
if (devlist)
|
||||
free (devlist);
|
||||
devlist = malloc ((num_devices + 1) * sizeof (devlist[0]));
|
||||
|
@ -3806,7 +3811,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
|||
|
||||
return SANE_STATUS_GOOD;
|
||||
#else
|
||||
handle = handle; /* get rid of compiler warning */
|
||||
(void) handle; /* get rid of compiler warning */
|
||||
return (non_blocking == 1) ? SANE_STATUS_UNSUPPORTED : SANE_STATUS_GOOD;
|
||||
#endif
|
||||
}
|
||||
|
@ -3828,7 +3833,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
|
|||
|
||||
return SANE_STATUS_GOOD;
|
||||
#else
|
||||
handle = handle; fd = fd; /* get rid of compiler warning */
|
||||
(void) handle; (void) fd; /* get rid of compiler warning */
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
|
|||
#endif
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (CANON_CONFIG_FILE);
|
||||
if (fp)
|
||||
|
@ -1111,9 +1111,6 @@ sane_start (SANE_Handle handle)
|
|||
u_char cbuf[2]; /* modification for FB620S */
|
||||
size_t buf_size, i;
|
||||
|
||||
char tmpfilename[] = "/tmp/canon.XXXXXX"; /* for FB1200S */
|
||||
char *thistmpfile; /* for FB1200S */
|
||||
|
||||
DBG (1, ">> sane_start\n");
|
||||
|
||||
s->tmpfile = -1; /* for FB1200S */
|
||||
|
@ -1121,36 +1118,18 @@ sane_start (SANE_Handle handle)
|
|||
/******* making a tempfile for 1200 dpi scanning of FB1200S ******/
|
||||
if (s->hw->info.model == FB1200)
|
||||
{
|
||||
thistmpfile = strdup(tmpfilename);
|
||||
|
||||
if (thistmpfile != NULL)
|
||||
{
|
||||
if (!mkstemp(thistmpfile))
|
||||
{
|
||||
DBG(1, "mkstemp(thistmpfile) is failed\n");
|
||||
return (SANE_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG(1, "strdup(thistmpfile) is failed\n");
|
||||
return (SANE_STATUS_INVAL);
|
||||
}
|
||||
|
||||
s->tmpfile = open(thistmpfile, O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
char tmpfilename[] = "/tmp/canon.XXXXXX"; /* for FB1200S */
|
||||
|
||||
s->tmpfile = mkstemp(tmpfilename);
|
||||
if (s->tmpfile == -1)
|
||||
{
|
||||
DBG(1, "error opening temp file %s\n", thistmpfile);
|
||||
DBG(1, "error opening temp file %s\n", tmpfilename);
|
||||
DBG(1, "errno: %i; %s\n", errno, strerror(errno));
|
||||
errno = 0;
|
||||
return (SANE_STATUS_INVAL);
|
||||
}
|
||||
DBG(1, " ****** tmpfile is opened ****** \n");
|
||||
|
||||
unlink(thistmpfile);
|
||||
free (thistmpfile);
|
||||
DBG(1, "free thistmpfile\n");
|
||||
unlink(tmpfilename);
|
||||
}
|
||||
/******************************************************************/
|
||||
|
||||
|
|
|
@ -817,14 +817,12 @@ attach (const char *devnam, CANON_Device ** devp)
|
|||
|
||||
dev->sane.name = strdup (devnam);
|
||||
dev->sane.vendor = "CANON";
|
||||
if ((str = calloc (16 + 1, 1)) == NULL)
|
||||
if ((str = strndup ((char *) ibuf + 16, 16)) == NULL)
|
||||
{
|
||||
sanei_scsi_close (fd);
|
||||
fd = -1;
|
||||
return (SANE_STATUS_NO_MEM);
|
||||
}
|
||||
strncpy (str, (char *) (ibuf + 16), 16);
|
||||
dev->sane.model = str;
|
||||
|
||||
/* Register the fixed properties of the scanner below:
|
||||
- whether it is a film scanner or a flatbed scanner
|
||||
|
@ -842,6 +840,7 @@ attach (const char *devnam, CANON_Device ** devp)
|
|||
if (!strncmp (str, "IX-27015", 8)) /* FS2700S */
|
||||
{
|
||||
dev->info.model = CS2700;
|
||||
dev->sane.model = strdup("FS2700S");
|
||||
dev->sane.type = SANE_I18N("film scanner");
|
||||
dev->adf.Status = ADF_STAT_NONE;
|
||||
dev->tpu.Status = TPU_STAT_NONE;
|
||||
|
@ -857,6 +856,7 @@ attach (const char *devnam, CANON_Device ** devp)
|
|||
else if (!strncmp (str, "IX-27025E", 9)) /* FS2710S */
|
||||
{
|
||||
dev->info.model = FS2710;
|
||||
dev->sane.model = strdup("FS2710S");
|
||||
dev->sane.type = SANE_I18N("film scanner");
|
||||
dev->adf.Status = ADF_STAT_NONE;
|
||||
dev->tpu.Status = TPU_STAT_NONE;
|
||||
|
@ -872,6 +872,7 @@ attach (const char *devnam, CANON_Device ** devp)
|
|||
else if (!strncmp (str, "IX-06035E", 9)) /* FB620S */
|
||||
{
|
||||
dev->info.model = FB620;
|
||||
dev->sane.model = strdup("FB620S");
|
||||
dev->sane.type = SANE_I18N("flatbed scanner");
|
||||
dev->adf.Status = ADF_STAT_NONE;
|
||||
dev->tpu.Status = TPU_STAT_NONE;
|
||||
|
@ -887,6 +888,7 @@ attach (const char *devnam, CANON_Device ** devp)
|
|||
else if (!strncmp (str, "IX-12015E", 9)) /* FB1200S */
|
||||
{
|
||||
dev->info.model = FB1200;
|
||||
dev->sane.model = strdup("FB1200S");
|
||||
dev->sane.type = SANE_I18N("flatbed scanner");
|
||||
dev->adf.Status = ADF_STAT_INACTIVE;
|
||||
dev->tpu.Status = TPU_STAT_INACTIVE;
|
||||
|
@ -930,6 +932,20 @@ attach (const char *devnam, CANON_Device ** devp)
|
|||
dev->info.has_fixed_resolutions = SANE_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use the model from the device if we don't have more
|
||||
* common model name for the device, otherwise free the
|
||||
* string with internal model name.
|
||||
*
|
||||
* Please keep the memory allocation source consistent
|
||||
* for model string - allocate on the heap via dynamic
|
||||
* allocation.
|
||||
*/
|
||||
if (dev->sane.model == NULL)
|
||||
dev->sane.model = str;
|
||||
else
|
||||
free(str);
|
||||
|
||||
DBG (5, "dev->sane.name = '%s'\n", dev->sane.name);
|
||||
DBG (5, "dev->sane.vendor = '%s'\n", dev->sane.vendor);
|
||||
DBG (5, "dev->sane.model = '%s'\n", dev->sane.model);
|
||||
|
|
|
@ -937,7 +937,10 @@ plugin_cal (CANON_Handle * s)
|
|||
{
|
||||
DBG (1, "No temp filename!\n");
|
||||
s->fname = strdup ("/tmp/cal.XXXXXX");
|
||||
mkstemp (s->fname);
|
||||
|
||||
/* FIXME: we should be using fd, not discarding it, and also checking for error! */
|
||||
int fd = mkstemp (s->fname);
|
||||
close(fd);
|
||||
}
|
||||
s->width = 2551;
|
||||
s->height = 75;
|
||||
|
@ -1546,7 +1549,7 @@ CANON_open_device (CANON_Handle * scan, const char *dev)
|
|||
static const char *
|
||||
CANON_get_device_name (CANON_Handle * scanner)
|
||||
{
|
||||
scanner = scanner; /* Eliminate warning about unused parameters */
|
||||
(void) scanner; /* Eliminate warning about unused parameters */
|
||||
return "Canoscan FB630U";
|
||||
}
|
||||
|
||||
|
@ -1581,8 +1584,12 @@ CANON_start_scan (CANON_Handle * scanner)
|
|||
|
||||
/* choose a temp file name for scan data */
|
||||
scanner->fname = strdup ("/tmp/scan.XXXXXX");
|
||||
if (!mkstemp (scanner->fname))
|
||||
|
||||
/* FIXME: we should be using fd, not discarding it! */
|
||||
int fd = mkstemp (scanner->fname);
|
||||
if (fd == -1)
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
close(fd);
|
||||
|
||||
/* calibrate if needed */
|
||||
rv = init (scanner->fd);
|
||||
|
|
|
@ -133,9 +133,9 @@ static SANE_Status
|
|||
optionNumOptionsCallback (SANE_Option * option, SANE_Handle handle,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
option = option;
|
||||
handle = handle;
|
||||
info = info; /* Eliminate warning about unused parameters */
|
||||
(void) option;
|
||||
(void) handle;
|
||||
(void) info; /* Eliminate warning about unused parameters */
|
||||
|
||||
if (action != SANE_ACTION_GET_VALUE)
|
||||
return SANE_STATUS_INVAL;
|
||||
|
@ -168,8 +168,8 @@ static SANE_Status
|
|||
optionCalibrateCallback (SANE_Option * option, SANE_Handle handle,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
handle = handle;
|
||||
option = option; /* Eliminate warning about unused parameters */
|
||||
(void) handle;
|
||||
(void) option; /* Eliminate warning about unused parameters */
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ optionResolutionCallback (SANE_Option * option, SANE_Handle handle,
|
|||
SANE_Status status;
|
||||
SANE_Word autoValue = 75;
|
||||
|
||||
handle = handle; /* Eliminate warning about unused parameters */
|
||||
(void) handle; /* Eliminate warning about unused parameters */
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -268,8 +268,8 @@ static SANE_Status
|
|||
optionGrayscaleCallback (SANE_Option * option, SANE_Handle handle,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
handle = handle;
|
||||
option = option; /* Eliminate warning about unused parameters */
|
||||
(void) handle;
|
||||
(void) option; /* Eliminate warning about unused parameters */
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -315,9 +315,9 @@ static SANE_Status
|
|||
optionAGainCallback (SANE_Option * option, SANE_Handle handle,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
option = option;
|
||||
handle = handle;
|
||||
info = info; /* Eliminate warning about unused parameters */
|
||||
(void) option;
|
||||
(void) handle;
|
||||
(void) info; /* Eliminate warning about unused parameters */
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -357,9 +357,9 @@ static SANE_Status
|
|||
optionGammaCallback (SANE_Option * option, SANE_Handle handle,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
option = option;
|
||||
handle = handle;
|
||||
info = info; /* Eliminate warning about unused parameters */
|
||||
(void) option;
|
||||
(void) handle;
|
||||
(void) info; /* Eliminate warning about unused parameters */
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -418,9 +418,9 @@ static SANE_Status
|
|||
optionTopLeftXCallback (SANE_Option * option, SANE_Handle handle,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
option = option;
|
||||
handle = handle;
|
||||
value = value; /* Eliminate warning about unused parameters */
|
||||
(void) option;
|
||||
(void) handle;
|
||||
(void) value; /* Eliminate warning about unused parameters */
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -462,8 +462,8 @@ optionTopLeftYCallback (SANE_Option * option, SANE_Handle handle,
|
|||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
/* Eliminate warnings about unused parameters */
|
||||
option = option;
|
||||
handle = handle;
|
||||
(void) option;
|
||||
(void) handle;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -506,8 +506,8 @@ optionBotRightXCallback (SANE_Option * option, SANE_Handle handle,
|
|||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
/* Eliminate warnings about unused parameters */
|
||||
option = option;
|
||||
handle = handle;
|
||||
(void) option;
|
||||
(void) handle;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -550,8 +550,8 @@ optionBotRightYCallback (SANE_Option * option, SANE_Handle handle,
|
|||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
/* Eliminate warnings about unused parameters */
|
||||
option = option;
|
||||
handle = handle;
|
||||
(void) option;
|
||||
(void) handle;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -720,10 +720,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
DBG (2, "sane_init: version_code %s 0, authorize %s 0\n",
|
||||
version_code == 0 ? "=" : "!=", authorize == 0 ? "=" : "!=");
|
||||
DBG (1, "sane_init: SANE Canon630u backend version %d.%d.%d from %s\n",
|
||||
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
|
||||
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
|
||||
|
||||
sanei_usb_init ();
|
||||
|
||||
|
@ -912,7 +912,7 @@ sane_close (SANE_Handle handle)
|
|||
const SANE_Option_Descriptor *
|
||||
sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
|
||||
{
|
||||
handle = handle; /* Eliminate compiler warning */
|
||||
(void) handle; /* Eliminate compiler warning */
|
||||
|
||||
DBG (3, "sane_get_option_descriptor: option = %d\n", option);
|
||||
if (option < 0 || option >= NELEMS (so))
|
||||
|
@ -924,7 +924,7 @@ SANE_Status
|
|||
sane_control_option (SANE_Handle handle, SANE_Int option,
|
||||
SANE_Action action, void *value, SANE_Int * info)
|
||||
{
|
||||
handle = handle; /* Eliminate compiler warning */
|
||||
(void) handle; /* Eliminate compiler warning */
|
||||
|
||||
DBG (3,
|
||||
"sane_control_option: handle=%p, opt=%d, act=%d, val=%p, info=%p\n",
|
||||
|
@ -945,7 +945,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
|
|||
SANE_UNFIX (optionBotRightYValue -
|
||||
optionTopLeftYValue) / MM_IN_INCH * optionResolutionValue;
|
||||
|
||||
handle = handle; /* Eliminate compiler warning */
|
||||
(void) handle; /* Eliminate compiler warning */
|
||||
|
||||
DBG (3, "sane_get_parameters\n");
|
||||
parms.depth = 8;
|
||||
|
@ -1035,7 +1035,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
|||
SANE_Status
|
||||
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
|
||||
{
|
||||
handle = handle; /* silence gcc */
|
||||
fd = fd; /* silence gcc */
|
||||
(void) handle; /* silence gcc */
|
||||
(void) fd; /* silence gcc */
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
#define USB_HEADER_LEN 12
|
||||
#define USB_COMMAND_LEN 12
|
||||
#define USB_STATUS_LEN 4
|
||||
#define USB_COMMAND_TIME 30000
|
||||
#define USB_DATA_TIME 30000
|
||||
#define USB_STATUS_TIME 30000
|
||||
#define USB_PACKET_TIMEOUT 30000
|
||||
|
||||
/*static inline void */
|
||||
static void
|
||||
|
@ -116,8 +114,10 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
#define INQUIRY_code 0x12
|
||||
#define INQUIRY_len 6
|
||||
|
||||
#define INQUIRY_std_len 0x30
|
||||
#define INQUIRY_vpd_len 0x1e
|
||||
#define INQUIRY_std_max_len 0x30
|
||||
#define INQUIRY_std_typ_len 0x30
|
||||
#define INQUIRY_vpd_max_len 0x30
|
||||
#define INQUIRY_vpd_typ_len 0x1e
|
||||
|
||||
#define set_IN_evpd(icb, val) setbitfield(icb + 1, 1, 0, val)
|
||||
#define set_IN_page_code(icb, val) icb[0x02]=val
|
||||
|
@ -131,9 +131,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
#define IN_periph_devtype_unknown 0x1f
|
||||
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
|
||||
#define IN_recognized 0x02
|
||||
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
|
||||
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
|
||||
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
|
||||
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
|
||||
0x08, (char*)in + 0x08)
|
||||
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
|
||||
0x10, (char*)in + 0x10)
|
||||
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
|
||||
0x04, (char*)in + 0x20)
|
||||
|
||||
/* the VPD response */
|
||||
#define get_IN_page_length(in) in[0x04]
|
||||
|
@ -219,6 +222,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
#define SR_datatype_endorser 0x90
|
||||
#define SR_datatype_fineoffset 0x90
|
||||
#define SR_datatype_finegain 0x91
|
||||
#define SR_datatype_imprinters 0x96 /*DR-X10C*/
|
||||
|
||||
/* ==================================================================== */
|
||||
/* READ */
|
||||
|
@ -252,7 +256,20 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
|
||||
/*counters*/
|
||||
#define R_COUNTERS_len 0x80
|
||||
#define get_R_COUNTERS_scans(in) getnbyte(in + 0x04, 4)
|
||||
#define get_R_COUNTERS_total(in) getnbyte(in + 0x04, 4)
|
||||
#define get_R_COUNTERS_last_srv(in) getnbyte(in + 0x44, 4)
|
||||
|
||||
/*imprinters*/
|
||||
#define R_IMPRINTER_len 0x20
|
||||
#define R_PRE_IMPRINTER 0
|
||||
#define R_POST_IMPRINTER 1
|
||||
#define get_R_IMPRINTER_found(in) getbitfield(in+1, 1, 0)
|
||||
/*4 bytes at in + 0: (DR-X10C)
|
||||
pre-imprinter on: 0x07010000
|
||||
pre-imprinter off: 0x06000000
|
||||
post-imprinter on: 0x03010000
|
||||
post-imprinter off: 0x02000000
|
||||
*/
|
||||
|
||||
/*endorser unread?*/
|
||||
|
||||
|
@ -454,6 +471,14 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
#define SM2_pc_buffer 0x02
|
||||
#define SM2_pc_hw_enhancement 0x03
|
||||
#define SM2_pc_dropout 0x06
|
||||
#define SM2_pc_date_time 0x07
|
||||
#define SM2_pc_imprinter_settings 0x33
|
||||
#define SM2_pc_imprinter_specstring 0x34
|
||||
|
||||
/* ==================================================================== */
|
||||
/* GET SCAN MODE 2 */
|
||||
#define GET_SCAN_MODE2_code 0xe4
|
||||
#define GET_SCAN_MODE2_len 12
|
||||
|
||||
/* ==================================================================== */
|
||||
/* SET SCAN MODE 2 */
|
||||
|
@ -465,11 +490,15 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
|
||||
/* the payload */
|
||||
#define SSM2_PAY_len 0x10
|
||||
#define SSM2_IMPRINTER_STRING_PAY_len 0x8e
|
||||
|
||||
/* for DF (0x00) page */
|
||||
#define set_SSM2_DF_thick(sb, val) setbitfield(sb+3, 1, 2, val)
|
||||
#define set_SSM2_DF_imprint(sb, val) setbitfield(sb+2, 1, 0, val)
|
||||
#define set_SSM2_DF_post_addon(sb, val) setbitfield(sb+2, 1, 1, val)
|
||||
#define set_SSM2_DF_len(sb, val) setbitfield(sb+3, 1, 0, val)
|
||||
#define set_SSM2_DF_thick(sb, val) setbitfield(sb+3, 1, 2, val)
|
||||
#define set_SSM2_DF_staple(sb, val) setbitfield(sb+3, 1, 4, val)
|
||||
#define set_SSM2_DF_imprint2(sb, val) setbitfield(sb+3, 1, 6, val)
|
||||
|
||||
/* for ULTRA (0x01) page */
|
||||
#define set_SSM2_ULTRA_top(sb, val) putnbyte(sb + 0x07, val, 2)
|
||||
|
@ -489,6 +518,32 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
#define set_SSM2_DO_en(sb, val) sb[0x0a] = val
|
||||
#define set_SSM2_DO_side(sb, val) sb[0x05] = val
|
||||
|
||||
/* for IMPRINT DATE & TIME (0x07) */
|
||||
#define set_SSM2_imprint_year(sb, val) putnbyte(sb + 0x02, val, 2)
|
||||
#define set_SSM2_imprint_month(sb, val) putnbyte(sb + 0x04, val, 1)
|
||||
#define set_SSM2_imprint_day(sb, val) putnbyte(sb + 0x05, val, 1)
|
||||
#define set_SSM2_imprint_hour(sb, val) putnbyte(sb + 0x06, val, 1)
|
||||
#define set_SSM2_imprint_min(sb, val) putnbyte(sb + 0x07, val, 1)
|
||||
#define set_SSM2_imprint_sec(sb, val) putnbyte(sb + 0x08, val, 1)
|
||||
|
||||
/* for IMPRINTER SETTINGS (0x33) page */
|
||||
#define set_SSM2_postimprint_cmd(sb) sb[0x04] = 1
|
||||
#define set_SSM2_postimprint_addon(sb) setbitfield(sb, 1, 1, 1)
|
||||
#define set_SSM2_imprint_hoffset(sb, val) putnbyte(sb + 0x05, val, 2)
|
||||
#define set_SSM2_imprint_voffset(sb, val) putnbyte(sb + 0x07, val, 2)
|
||||
|
||||
/* for IMPRINTER STRING SPECIFICATION (0x34) page */
|
||||
#define IMPRINTER_12x12_FONT 0
|
||||
#define IMPRINTER_8x12_FONT 1
|
||||
#define set_SSM2_imprint_fontsize(sb, val) setbitfield(sb + 0xA, 1, 0, val)
|
||||
#define set_SSM2_imprint_spacing(sb, val) setbitfield(sb + 0xA, 1, 1, val)
|
||||
#define set_SSM2_imprint_addonmode(sb, val) setbitfield(sb + 0x9, 3, 4, val)
|
||||
#define IMPRINTER_0_FONT_ROT 0
|
||||
#define IMPRINTER_90_FONT_ROT 1
|
||||
#define IMPRINTER_180_FONT_ROT 2
|
||||
#define IMPRINTER_270_FONT_ROT 3
|
||||
#define set_SSM2_imprint_fontrot(sb, val) setbitfield(sb + 0x9, 3, 0, val)
|
||||
|
||||
/* ==================================================================== */
|
||||
/* window descriptor macros for SET_WINDOW and GET_WINDOW */
|
||||
|
||||
|
|
1156
backend/canon_dr.c
1156
backend/canon_dr.c
Plik diff jest za duży
Load Diff
|
@ -103,6 +103,7 @@ option duplex-offset 400
|
|||
usb 0x1083 0x1617
|
||||
|
||||
# DR-X10C
|
||||
option tur-timeout 5000
|
||||
usb 0x1083 0x1618
|
||||
|
||||
# CR-25
|
||||
|
@ -173,6 +174,7 @@ usb 0x1083 0x164a
|
|||
usb 0x1083 0x164b
|
||||
|
||||
# P-208
|
||||
option duplex-offset 260
|
||||
usb 0x1083 0x164c
|
||||
|
||||
# DR-G1130
|
||||
|
@ -194,6 +196,8 @@ option duplex-offset 1640
|
|||
usb 0x1083 0x1654
|
||||
|
||||
# DR-M1060
|
||||
option inquiry-length 0x24
|
||||
option vpd-length 0x30
|
||||
usb 0x1083 0x1657
|
||||
|
||||
# DR-C225
|
||||
|
@ -210,3 +214,7 @@ usb 0x1083 0x165d
|
|||
|
||||
# P-208II
|
||||
usb 0x1083 0x165f
|
||||
|
||||
# R40
|
||||
option duplex-offset 320
|
||||
usb 0x1083 0x1679
|
||||
|
|
|
@ -51,6 +51,22 @@ enum scanner_Option
|
|||
OPT_SIDE,
|
||||
OPT_HW_CROP,
|
||||
|
||||
/*imprinter option group*/
|
||||
OPT_IMPRINT_GROUP,
|
||||
OPT_PRE_IMPRINT_SPECSTRING,
|
||||
OPT_PRE_IMPRINT_H_OFFSET,
|
||||
OPT_PRE_IMPRINT_V_OFFSET,
|
||||
OPT_PRE_IMPRINT_FONT_SIZE,
|
||||
OPT_PRE_IMPRINT_FONT_ROT,
|
||||
OPT_PRE_IMPRINT_SPACING,
|
||||
OPT_POST_IMPRINT_SPECSTRING,
|
||||
OPT_POST_IMPRINT_H_OFFSET,
|
||||
OPT_POST_IMPRINT_V_OFFSET,
|
||||
OPT_POST_IMPRINT_FONT_SIZE,
|
||||
OPT_POST_IMPRINT_FONT_ROT,
|
||||
OPT_POST_IMPRINT_SPACING,
|
||||
OPT_POST_IMPRINT_ADDON_MODE,
|
||||
|
||||
/*sensor group*/
|
||||
OPT_SENSOR_GROUP,
|
||||
OPT_START,
|
||||
|
@ -60,6 +76,8 @@ enum scanner_Option
|
|||
OPT_COUNTONLY,
|
||||
OPT_BYPASSMODE,
|
||||
OPT_COUNTER,
|
||||
OPT_ROLLERCOUNTER,
|
||||
OPT_TOTALCOUNTER,
|
||||
OPT_ADF_LOADED,
|
||||
OPT_CARD_LOADED,
|
||||
|
||||
|
@ -106,6 +124,32 @@ struct img_params
|
|||
|
||||
};
|
||||
|
||||
struct imprint_params
|
||||
{
|
||||
/* ------------------------------------------------------------------------------ */
|
||||
/* allowed values for post imprinter (in mm units): */
|
||||
/* 21, 35, 47, 59, 72, 99, 114, 143, 155, 167, 196, 211, 239, 251, 263, 275, 289 */
|
||||
/* allowed values for pre imprinter (in mm units): */
|
||||
/* 14, 28, 41, 53, 65, 106 */
|
||||
int h_offset;
|
||||
/* --------------------------------------- */
|
||||
/* allowed values: 0 to 500 (in mm units) */
|
||||
int v_offset;
|
||||
|
||||
int font_size;
|
||||
int font_rot;
|
||||
int spacing;
|
||||
|
||||
#define IMPRINT_SPECSTRING_LEN 64
|
||||
/* ---------------------------------- */
|
||||
/* special tokens: */
|
||||
/* \TIME time in HH:MM:SS */
|
||||
/* \DMY date in DD/MM/YYYY */
|
||||
/* \YMD date in YYYY/MM/DD */
|
||||
/* [[0-9]+] scan page count */
|
||||
char specstring[IMPRINT_SPECSTRING_LEN];
|
||||
};
|
||||
|
||||
struct scanner
|
||||
{
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
@ -116,12 +160,18 @@ struct scanner
|
|||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* immutable values which are set during reading of config file. */
|
||||
int connection; /* hardware interface type */
|
||||
int buffer_size;
|
||||
int connection; /* hardware interface type */
|
||||
int duplex_offset; /* number of lines of padding added to front (1/1200)*/
|
||||
int extra_status; /* some machines need extra status read after cmd */
|
||||
int inquiry_length; /* some models are particular about inquiry size */
|
||||
int padded_read; /* some machines need extra 12 bytes on reads */
|
||||
int tur_timeout; /* some models are slow to wake up */
|
||||
int vpd_length; /* some models are particular about vpd size */
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* immutable values which are set during inquiry probing of the scanner. */
|
||||
/* members in order found in scsi data... */
|
||||
/* members in order found in scsi data. These can also be in config file */
|
||||
char vendor_name[9]; /* raw data as returned by SCSI inquiry. */
|
||||
char model_name[17]; /* raw data as returned by SCSI inquiry. */
|
||||
char version_name[5]; /* raw data as returned by SCSI inquiry. */
|
||||
|
@ -198,17 +248,18 @@ struct scanner
|
|||
int has_ssm2; /* newer scanners user this similar command */
|
||||
int has_ssm_pay_head_len; /* newer scanners put the length twice in ssm */
|
||||
int has_hwcrop;
|
||||
int has_pre_imprinter;
|
||||
int has_post_imprinter;
|
||||
int can_read_sensors;
|
||||
int can_read_panel;
|
||||
int can_write_panel;
|
||||
int can_read_lifecycle_counters;
|
||||
int rgb_format; /* meaning unknown */
|
||||
int padding; /* meaning unknown */
|
||||
|
||||
int always_op; /* send object pos between pages */
|
||||
int invert_tly; /* weird bug in some smaller scanners */
|
||||
int unknown_byte2; /* weird byte, required, meaning unknown */
|
||||
int padded_read; /* some machines need extra 12 bytes on reads */
|
||||
int extra_status; /* some machines need extra status read after cmd */
|
||||
int fixed_width; /* some machines always scan full width */
|
||||
int even_Bpl; /* some machines require even bytes per line */
|
||||
|
||||
|
@ -217,7 +268,6 @@ struct scanner
|
|||
int color_inter_by_res[16]; /* and some even change by resolution */
|
||||
int duplex_interlace; /* different models interlace sides differently */
|
||||
int jpeg_interlace; /* different models interlace jpeg sides differently */
|
||||
int duplex_offset; /* number of lines of padding added to front (1/1200)*/
|
||||
int duplex_offset_side; /* padding added to front or back? */
|
||||
|
||||
int sw_lut; /* no hardware brightness/contrast support */
|
||||
|
@ -314,13 +364,34 @@ struct scanner
|
|||
unsigned char lut[256];
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* values used by the software enhancement code (deskew, crop, etc) */
|
||||
/* values used by the software enhancement code (deskew, crop, etc) */
|
||||
SANE_Status deskew_stat;
|
||||
int deskew_vals[2];
|
||||
double deskew_slope;
|
||||
|
||||
int crop_vals[4];
|
||||
|
||||
/* imprinter params */
|
||||
struct imprint_params pre_imprint;
|
||||
struct imprint_params post_imprint;
|
||||
enum {
|
||||
/*Black-on-White*/
|
||||
ADDON_BoW = 0,
|
||||
/*White-on-Black*/
|
||||
ADDON_WoB,
|
||||
/*Black-on-Image*/
|
||||
ADDON_BoI,
|
||||
ADDON_DISABLED
|
||||
} post_imprint_addon_mode;
|
||||
|
||||
/* imprinter param constraints */
|
||||
SANE_Int pre_imprinter_h_offset_list[7];
|
||||
SANE_Int post_imprinter_h_offset_list[18];
|
||||
SANE_Range imprinter_v_offset_range;
|
||||
SANE_String_Const imprint_font_size_list[3];
|
||||
SANE_Int imprinter_font_angle_list[5];
|
||||
SANE_String_Const imprint_addon_mode_list[5];
|
||||
|
||||
/* this is defined in sane spec as a struct containing:
|
||||
SANE_Frame format;
|
||||
SANE_Bool last_frame;
|
||||
|
@ -376,6 +447,8 @@ struct scanner
|
|||
int panel_counter;
|
||||
int sensor_adf_loaded;
|
||||
int sensor_card_loaded;
|
||||
int roller_counter;
|
||||
int total_counter;
|
||||
|
||||
/* values which are used to track the frontend's access to sensors */
|
||||
char panel_read[OPT_COUNTER - OPT_START + 1];
|
||||
|
@ -538,7 +611,9 @@ static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg);
|
|||
static SANE_Status init_inquire (struct scanner *s);
|
||||
static SANE_Status init_vpd (struct scanner *s);
|
||||
static SANE_Status init_model (struct scanner *s);
|
||||
static SANE_Status init_imprinters (struct scanner *s);
|
||||
static SANE_Status init_panel (struct scanner *s);
|
||||
static SANE_Status init_counters (struct scanner *s);
|
||||
static SANE_Status init_user (struct scanner *s);
|
||||
static SANE_Status init_options (struct scanner *s);
|
||||
|
||||
|
@ -586,6 +661,7 @@ static SANE_Status update_params (struct scanner *s, int calib);
|
|||
static SANE_Status update_i_params (struct scanner *s);
|
||||
static SANE_Status clean_params (struct scanner *s);
|
||||
|
||||
static SANE_Status read_counters(struct scanner *s);
|
||||
static SANE_Status read_sensors(struct scanner *s, SANE_Int option);
|
||||
static SANE_Status read_panel(struct scanner *s, SANE_Int option);
|
||||
static SANE_Status send_panel(struct scanner *s);
|
||||
|
@ -629,6 +705,12 @@ static SANE_Status calibrate_fine_dest_hw(struct scanner *s);
|
|||
static SANE_Status write_AFE (struct scanner *s);
|
||||
static SANE_Status calibration_scan (struct scanner *s, int);
|
||||
|
||||
static SANE_Status send_imprint_positioning(struct scanner* s, int is_postimprint, int enabled);
|
||||
static SANE_Status send_imprint_specstring(struct scanner* s, int is_postimprint);
|
||||
static SANE_Status send_imprint_date_and_time(struct scanner* s);
|
||||
static SANE_Status load_imprinting_settings(struct scanner *s);
|
||||
static SANE_Status detect_imprinter(struct scanner *s, SANE_Int option);
|
||||
|
||||
static void hexdump (int level, char *comment, unsigned char *p, int l);
|
||||
static void default_globals (void);
|
||||
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -225,10 +225,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
DBG (2, "sane_init: version_code %s 0, authorize %s 0\n",
|
||||
version_code == 0 ? "=" : "!=", authorize == 0 ? "=" : "!=");
|
||||
DBG (1, "sane_init: SANE Canon LiDE70 backend version %d.%d.%d from %s\n",
|
||||
V_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
|
||||
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
|
||||
|
||||
sanei_usb_init ();
|
||||
|
||||
|
@ -819,8 +819,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action,
|
|||
"sane_control_option: get option %d (%s), value=%.1f %s\n",
|
||||
option, chndl->opt[option].name,
|
||||
SANE_UNFIX (*(SANE_Fixed *) value),
|
||||
chndl->opt[option].unit ==
|
||||
SANE_UNIT_MM ? "mm" : SANE_UNIT_DPI ? "dpi" : "");
|
||||
chndl->opt[option].unit == SANE_UNIT_MM ? "mm" :
|
||||
(chndl->opt[option].unit == SANE_UNIT_DPI ? "dpi" : ""));
|
||||
break;
|
||||
}
|
||||
case opt_non_blocking:
|
||||
|
@ -863,7 +863,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
|
|||
Canon_Scanner *hndl = handle; /* Eliminate compiler warning */
|
||||
CANON_Handle *chndl = &hndl->scan;
|
||||
|
||||
int rc = SANE_STATUS_GOOD;
|
||||
SANE_Status rc = SANE_STATUS_GOOD;
|
||||
int w = SANE_UNFIX (chndl->val[opt_br_x].w -
|
||||
chndl->val[opt_tl_x].w) / MM_IN_INCH *
|
||||
chndl->val[opt_resolution].w;
|
||||
|
@ -956,7 +956,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
|||
SANE_Status
|
||||
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
|
||||
{
|
||||
handle = handle; /* silence gcc */
|
||||
fd = fd; /* silence gcc */
|
||||
(void) handle; /* silence gcc */
|
||||
(void) fd; /* silence gcc */
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
|
|
@ -178,8 +178,8 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode)
|
|||
usleep(100000);
|
||||
}
|
||||
|
||||
} while ((i < max_cycles) && (!expect(port,"Scanner wakeup reply 2",
|
||||
0x03, 0x1f, 100000) == 0));
|
||||
} while ((i < max_cycles) && expect(port, "Scanner wakeup reply 2",
|
||||
0x03, 0x1f, 100000));
|
||||
|
||||
/* Block just after chessboarding
|
||||
Reply 1 (S3 and S4 on, S5 and S7 off) */
|
||||
|
|
|
@ -147,7 +147,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb)
|
|||
#endif
|
||||
|
||||
if(vc)
|
||||
*vc = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*vc = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
DBG(2,"sane_init: >> ieee1284_find_ports\n");
|
||||
/* Find lp ports */
|
||||
|
@ -1787,7 +1787,9 @@ static int init_cal(char *file)
|
|||
************************************************************************/
|
||||
static SANE_Status fix_weights_file(CANONP_Scanner *cs)
|
||||
{
|
||||
char *tmp, *myhome, buf[PATH_MAX];
|
||||
static const char default_weights_file_prefix[] =
|
||||
"~/.sane/canon_pp-calibration-";
|
||||
char *tmp, *myhome;
|
||||
int i;
|
||||
struct stat *f_stat;
|
||||
|
||||
|
@ -1804,31 +1806,32 @@ static SANE_Status fix_weights_file(CANONP_Scanner *cs)
|
|||
|
||||
if (cs->weights_file == NULL)
|
||||
{
|
||||
/* Will be of form canon_pp-calibration-parport0 or -0x378 */
|
||||
sprintf(buf, "~/.sane/canon_pp-calibration-%s",
|
||||
/* Form is ~/.sane/canon_pp-calibration-parport0 or -0x378 */
|
||||
i = strlen(default_weights_file_prefix) +
|
||||
strlen(cs->params.port->name);
|
||||
if ((cs->weights_file = malloc(i + 1)) == NULL)
|
||||
return SANE_STATUS_NO_MEM;
|
||||
sprintf(cs->weights_file, "%s%s", default_weights_file_prefix,
|
||||
cs->params.port->name);
|
||||
cs->weights_file = strdup(buf);
|
||||
}
|
||||
|
||||
/* Get the user's home dir if they used ~ */
|
||||
if (cs->weights_file[0] == '~')
|
||||
{
|
||||
if ((tmp = malloc(PATH_MAX)) == NULL)
|
||||
return SANE_STATUS_NO_MEM;
|
||||
if ((myhome = getenv("HOME")) == NULL)
|
||||
{
|
||||
DBG(0,"fix_weights_file: FATAL: ~ used, but $HOME not"
|
||||
" set!\n");
|
||||
free(tmp);
|
||||
tmp = NULL;
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
strncpy(tmp, myhome, PATH_MAX);
|
||||
strncpy(tmp+strlen(tmp), (cs->weights_file)+1,
|
||||
PATH_MAX-strlen(tmp));
|
||||
i = strlen(myhome) + strlen(&cs->weights_file[1]);
|
||||
if ((tmp = malloc(i + 1)) == NULL)
|
||||
return SANE_STATUS_NO_MEM;
|
||||
sprintf(tmp, "%s%s", myhome, &cs->weights_file[1]);
|
||||
|
||||
free(cs->weights_file);
|
||||
cs->weights_file = tmp;
|
||||
tmp = NULL;
|
||||
}
|
||||
|
||||
if ((f_stat = malloc(sizeof(*f_stat))) == NULL)
|
||||
|
|
|
@ -271,7 +271,7 @@ static struct scanner *scanner_devList = NULL;
|
|||
SANE_Status
|
||||
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
||||
{
|
||||
authorize = authorize; /* get rid of compiler warning */
|
||||
(void) authorize; /* get rid of compiler warning */
|
||||
|
||||
DBG_INIT ();
|
||||
DBG (10, "sane_init: start\n");
|
||||
|
@ -279,10 +279,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
sanei_usb_init();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
|
||||
|
||||
DBG (5, "sane_init: cardscan backend %d.%d.%d, from %s\n",
|
||||
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
|
||||
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
|
||||
|
||||
DBG (10, "sane_init: finish\n");
|
||||
|
||||
|
@ -323,7 +323,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
int num_devices=0;
|
||||
int i=0;
|
||||
|
||||
local_only = local_only; /* get rid of compiler warning */
|
||||
(void) local_only; /* get rid of compiler warning */
|
||||
|
||||
DBG (10, "sane_get_devices: start\n");
|
||||
|
||||
|
|
|
@ -1853,8 +1853,8 @@ hexdump (int level, char *comment, unsigned char *p, int l)
|
|||
static SANE_Status
|
||||
sense_handler (int scsi_fd, unsigned char * result, void *arg)
|
||||
{
|
||||
scsi_fd = scsi_fd;
|
||||
arg = arg;
|
||||
(void) scsi_fd;
|
||||
(void) arg;
|
||||
|
||||
if (result[0] != 0x70)
|
||||
{
|
||||
|
@ -2155,7 +2155,7 @@ attach_one (const char *devName)
|
|||
static void
|
||||
sigterm_handler (int signal)
|
||||
{
|
||||
signal = signal;
|
||||
(void) signal;
|
||||
sanei_scsi_req_flush_all (); /* flush SCSI queue */
|
||||
_exit (SANE_STATUS_GOOD);
|
||||
}
|
||||
|
@ -2360,7 +2360,7 @@ static int RGBIfix16(Coolscan_t * scanner,
|
|||
unsigned short *opr,*opg,*opb,*opi;
|
||||
int x;
|
||||
|
||||
scanner = scanner; lutr = lutr; lutg = lutg; lutb = lutb; luti = luti;
|
||||
(void) scanner; (void) lutr; (void) lutg; (void) lutb; (void) luti;
|
||||
|
||||
for(x=0;x<size;x++)
|
||||
{
|
||||
|
@ -2459,7 +2459,7 @@ static int RGBIfix1(unsigned char* rgbimat,unsigned char* orgbimat,
|
|||
int ii;
|
||||
int x;
|
||||
|
||||
lutg = lutg; lutb = lutb;
|
||||
(void) lutg; (void) lutb;
|
||||
|
||||
/* calculate regression between r and ir */
|
||||
cc.sum=0;
|
||||
|
@ -3237,14 +3237,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
size_t len;
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize;
|
||||
(void) authorize;
|
||||
|
||||
DBG_INIT ();
|
||||
sanei_thread_init ();
|
||||
|
||||
DBG (10, "sane_init\n");
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (COOLSCAN_CONFIG_FILE);
|
||||
if (!fp)
|
||||
|
@ -3297,7 +3297,7 @@ sane_get_devices (const SANE_Device *** device_list,
|
|||
Coolscan_t *dev;
|
||||
int i;
|
||||
|
||||
local_only = local_only;
|
||||
(void) local_only;
|
||||
|
||||
DBG (10, "sane_get_devices\n");
|
||||
|
||||
|
|
|
@ -344,11 +344,11 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
DBG (10, "sane_init() called.\n");
|
||||
DBG (1, "coolscan2 backend, version %i.%i.%i initializing.\n", CS2_VERSION_MAJOR, CS2_VERSION_MINOR, CS2_REVISION);
|
||||
|
||||
authorize = authorize; /* to shut up compiler */
|
||||
(void) authorize; /* to shut up compiler */
|
||||
|
||||
if (version_code)
|
||||
*version_code =
|
||||
SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
sanei_usb_init ();
|
||||
|
||||
|
@ -378,7 +378,7 @@ sane_get_devices (const SANE_Device *** list, SANE_Bool local_only)
|
|||
char line[PATH_MAX], *p;
|
||||
FILE *config;
|
||||
|
||||
local_only = local_only; /* to shut up compiler */
|
||||
(void) local_only; /* to shut up compiler */
|
||||
|
||||
DBG (10, "sane_get_devices() called.\n");
|
||||
|
||||
|
@ -468,7 +468,10 @@ sane_open (SANE_String_Const name, SANE_Handle * h)
|
|||
for (i_option = 0; i_option < CS2_N_OPTIONS; i_option++)
|
||||
{
|
||||
o.name = o.title = o.desc = NULL;
|
||||
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
|
||||
o.type = SANE_TYPE_BOOL;
|
||||
o.unit = SANE_UNIT_NONE;
|
||||
o.size = o.cap = 0;
|
||||
o.constraint_type = SANE_CONSTRAINT_NONE;
|
||||
o.constraint.range = NULL; /* only one union member needs to be NULLed */
|
||||
switch (i_option)
|
||||
{
|
||||
|
@ -1738,8 +1741,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
|
|||
|
||||
DBG (10, "sane_get_select_fd() called.\n");
|
||||
|
||||
fd = fd; /* to shut up compiler */
|
||||
s = s; /* to shut up compiler */
|
||||
(void) fd; /* to shut up compiler */
|
||||
(void) s; /* to shut up compiler */
|
||||
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
@ -2003,7 +2006,7 @@ cs2_scsi_sense_handler (int fd, u_char * sense_buffer, void *arg)
|
|||
{
|
||||
cs2_t *s = (cs2_t *) arg;
|
||||
|
||||
fd = fd; /* to shut up compiler */
|
||||
(void) fd; /* to shut up compiler */
|
||||
|
||||
/* sort this out ! XXXXXXXXX */
|
||||
|
||||
|
|
|
@ -314,10 +314,10 @@ sane_init(SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
DBG(1, "coolscan3 backend, version %i.%i.%i initializing.\n",
|
||||
CS3_VERSION_MAJOR, CS3_VERSION_MINOR, CS3_REVISION);
|
||||
|
||||
authorize = authorize; /* to shut up compiler */
|
||||
(void) authorize; /* to shut up compiler */
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
sanei_usb_init();
|
||||
|
||||
|
@ -346,7 +346,7 @@ sane_get_devices(const SANE_Device *** list, SANE_Bool local_only)
|
|||
char line[PATH_MAX], *p;
|
||||
FILE *config;
|
||||
|
||||
local_only = local_only; /* to shut up compiler */
|
||||
(void) local_only; /* to shut up compiler */
|
||||
|
||||
DBG(10, "%s\n", __func__);
|
||||
|
||||
|
@ -424,7 +424,10 @@ sane_open(SANE_String_Const name, SANE_Handle * h)
|
|||
|
||||
for (i_option = 0; i_option < CS3_N_OPTIONS; i_option++) {
|
||||
o.name = o.title = o.desc = NULL;
|
||||
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
|
||||
o.type = SANE_TYPE_BOOL;
|
||||
o.unit = SANE_UNIT_NONE;
|
||||
o.size = o.cap = 0;
|
||||
o.constraint_type = SANE_CONSTRAINT_NONE;
|
||||
o.constraint.range = NULL; /* only one union member needs to be NULLed */
|
||||
switch (i_option) {
|
||||
case CS3_OPTION_NUM:
|
||||
|
@ -1746,8 +1749,8 @@ sane_get_select_fd(SANE_Handle h, SANE_Int * fd)
|
|||
|
||||
DBG(10, "%s\n", __func__);
|
||||
|
||||
fd = fd; /* to shut up compiler */
|
||||
s = s; /* to shut up compiler */
|
||||
(void) fd; /* to shut up compiler */
|
||||
(void) s; /* to shut up compiler */
|
||||
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
@ -2026,7 +2029,7 @@ cs3_scsi_sense_handler(int fd, u_char * sense_buffer, void *arg)
|
|||
{
|
||||
cs3_t *s = (cs3_t *) arg;
|
||||
|
||||
fd = fd; /* to shut up compiler */
|
||||
(void) fd; /* to shut up compiler */
|
||||
|
||||
/* sort this out ! XXX */
|
||||
|
||||
|
|
|
@ -663,7 +663,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
|
|||
DBG_INIT ();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (DC210_CONFIG_FILE);
|
||||
|
||||
|
|
|
@ -820,7 +820,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
|
|||
DBG_INIT ();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (DC240_CONFIG_FILE);
|
||||
|
||||
|
|
|
@ -134,8 +134,7 @@ static char tty_name[PATH_MAX];
|
|||
#define DEF_TTY_NAME "/dev/ttyS0"
|
||||
|
||||
static speed_t tty_baud = DEFAULT_TTY_BAUD;
|
||||
static char *tmpname;
|
||||
static char tmpnamebuf[] = "/tmp/dc25XXXXXX";
|
||||
#define TMPFILE_PATTERN "/tmp/dc25XXXXXX";
|
||||
|
||||
static Dc20Info *dc20_info;
|
||||
static Dc20Info CameraInfo;
|
||||
|
@ -925,7 +924,6 @@ adjust_color_and_saturation (short red[], short green[], short blue[])
|
|||
int line, column;
|
||||
int r_min = SMAX, g_min = SMAX, b_min = SMAX;
|
||||
int r_max = 0, g_max = 0, b_max = 0;
|
||||
int r_sum = 0, g_sum = 0, b_sum = 0;
|
||||
float sqr_saturation = sqrt (saturation);
|
||||
for (line = TOP_MARGIN; line < HEIGHT - BOTTOM_MARGIN; line++)
|
||||
{
|
||||
|
@ -1008,9 +1006,6 @@ adjust_color_and_saturation (short red[], short green[], short blue[])
|
|||
g_max = g;
|
||||
if (b_max < b)
|
||||
b_max = b;
|
||||
r_sum += r;
|
||||
g_sum += g;
|
||||
b_sum += b;
|
||||
BIDIM_ARRAY (red, column, line, columns) = r;
|
||||
BIDIM_ARRAY (green, column, line, columns) = g;
|
||||
BIDIM_ARRAY (blue, column, line, columns) = b;
|
||||
|
@ -1153,7 +1148,6 @@ output_rgb (const short red[],
|
|||
{
|
||||
int r_min = 255, g_min = 255, b_min = 255;
|
||||
int r_max = 0, g_max = 0, b_max = 0;
|
||||
int r_sum = 0, g_sum = 0, b_sum = 0;
|
||||
int column, line;
|
||||
unsigned char *gamma_table = make_gamma_table (high_i - low_i);
|
||||
|
||||
|
@ -1202,19 +1196,9 @@ output_rgb (const short red[],
|
|||
g_max = g;
|
||||
if (b_max < b)
|
||||
b_max = b;
|
||||
r_sum += r;
|
||||
g_sum += g;
|
||||
b_sum += b;
|
||||
}
|
||||
}
|
||||
free (gamma_table);
|
||||
/*
|
||||
{
|
||||
fprintf (stderr, "%s: output_rgb: r: min = %d, max = %d, ave = %d\n", __progname, r_min, r_max, r_sum / NET_PIXELS);
|
||||
fprintf (stderr, "%s: output_rgb: g: min = %d, max = %d, ave = %d\n", __progname, g_min, g_max, g_sum / NET_PIXELS);
|
||||
fprintf (stderr, "%s: output_rgb: b: min = %d, max = %d, ave = %d\n", __progname, b_min, b_max, b_sum / NET_PIXELS);
|
||||
}
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1833,7 +1817,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
|
|||
DBG_INIT ();
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
|
||||
fp = sanei_config_open (DC25_CONFIG_FILE);
|
||||
|
||||
|
@ -2022,16 +2006,6 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle)
|
|||
DBG (1, "No device info\n");
|
||||
}
|
||||
|
||||
if (tmpname == NULL)
|
||||
{
|
||||
tmpname = tmpnamebuf;
|
||||
if (!mkstemp (tmpname))
|
||||
{
|
||||
DBG (1, "Unable to make temp file %s\n", tmpname);
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
}
|
||||
|
||||
DBG (3, "sane_open: pictures taken=%d\n", dc20_info->pic_taken);
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
|
@ -2445,14 +2419,15 @@ sane_start (SANE_Handle handle)
|
|||
* port overruns on a 90MHz pentium until I used hdparm
|
||||
* to set the "-u1" flag on the system drives.
|
||||
*/
|
||||
int fd;
|
||||
char tmpnamebuf[] = TMPFILE_PATTERN;
|
||||
|
||||
fd = open (tmpname, O_CREAT | O_EXCL | O_WRONLY, 0600);
|
||||
int fd = mkstemp (tmpnamebuf);
|
||||
if (fd == -1)
|
||||
{
|
||||
DBG (0, "Unable to open tmp file\n");
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
{
|
||||
DBG (0, "Unable to make temp file %s\n", tmpnamebuf);
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
|
||||
f = fdopen (fd, "wb");
|
||||
if (f == NULL)
|
||||
{
|
||||
|
@ -2524,12 +2499,12 @@ sane_start (SANE_Handle handle)
|
|||
else
|
||||
{
|
||||
fclose (f);
|
||||
if (convert_pic (tmpname, SAVE_ADJASPECT | SAVE_24BITS) == -1)
|
||||
if (convert_pic (tmpnamebuf, SAVE_ADJASPECT | SAVE_24BITS) == -1)
|
||||
{
|
||||
DBG (3, "sane_open: unable to convert\n");
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
unlink (tmpname);
|
||||
unlink (tmpnamebuf);
|
||||
outbytes = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
#define MAX_SCANNERS 32
|
||||
|
||||
/* version number */
|
||||
#define DRIVER_VERSION SANE_VERSION_CODE( SANE_CURRENT_MAJOR, V_MINOR, 0 )
|
||||
#define DRIVER_VERSION SANE_VERSION_CODE( SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0 )
|
||||
|
||||
/* size of buffer for socket communication */
|
||||
#define SOCK_BUF_SIZE 2048
|
||||
|
@ -946,7 +946,7 @@ HexDump (int debugLevel, const unsigned char *buf, size_t bufSize)
|
|||
{
|
||||
|
||||
if (!(i % 16))
|
||||
sprintf (lineBuf, "%p: ", (buf + i));
|
||||
sprintf (lineBuf, "%p: ", (void *) &buf[i]);
|
||||
|
||||
sprintf (itemBuf, "%02x ", (const unsigned int) buf[i]);
|
||||
|
||||
|
@ -1199,7 +1199,7 @@ ProcessFindResponse (unsigned char *pData, size_t size)
|
|||
|
||||
|
||||
DBG (10, "ProcessFindResponse: processing %lu bytes, pData=%p\n",
|
||||
(unsigned long)size, pData);
|
||||
(unsigned long) size, (void *) pData);
|
||||
|
||||
/* check we have a complete packet */
|
||||
if (!MessageIsComplete (pData, size))
|
||||
|
@ -1355,7 +1355,7 @@ ProcessUdpResponse (unsigned char *pData, size_t size,
|
|||
HexDump (15, pData, size);
|
||||
|
||||
DBG (10, "ProcessUdpResponse: processing %lu bytes, pData=%p\n",
|
||||
(unsigned long)size, pData);
|
||||
(unsigned long) size, (void *) pData);
|
||||
|
||||
/* check we have a complete packet */
|
||||
if (!MessageIsComplete (pData, size))
|
||||
|
@ -1486,7 +1486,7 @@ ProcessTcpResponse (struct ScannerState *pState, struct ComBuf *pTcpBuf)
|
|||
int bProcessImage = 0;
|
||||
|
||||
DBG (10, "ProcessTcpResponse: processing %lu bytes, pData=%p\n",
|
||||
(unsigned long)pTcpBuf->m_used, pData);
|
||||
(unsigned long) pTcpBuf->m_used, (void *) pData);
|
||||
HexDump (15, pData, pTcpBuf->m_used);
|
||||
|
||||
/* if message not complete then wait for more to arrive */
|
||||
|
@ -1799,7 +1799,7 @@ ProcessPageData (struct ScannerState *pState)
|
|||
struct PageInfo pageInfo;
|
||||
|
||||
JSAMPLE *pJpegLine = NULL;
|
||||
uint32 *pTiffRgba = NULL;
|
||||
uint32_t *pTiffRgba = NULL;
|
||||
unsigned char *pOut;
|
||||
char tiffErrBuf[1024];
|
||||
|
||||
|
|
|
@ -1068,7 +1068,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
char *full_name;
|
||||
int i, num_devs;
|
||||
size_t len;
|
||||
#define ASSERT_SPACE(n) \
|
||||
#define ASSERT_SPACE(n) do \
|
||||
{ \
|
||||
if (devlist_len + (n) > devlist_size) \
|
||||
{ \
|
||||
|
@ -1080,7 +1080,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
if (!devlist) \
|
||||
return SANE_STATUS_NO_MEM; \
|
||||
} \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
DBG (3, "sane_get_devices\n");
|
||||
|
||||
|
@ -1365,7 +1365,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length,
|
|||
struct meta_scanner *s = handle;
|
||||
|
||||
DBG (3, "sane_read(handle=%p,data=%p,maxlen=%d,lenp=%p)\n",
|
||||
handle, data, max_length, (void *) length);
|
||||
handle, (void *) data, max_length, (void *) length);
|
||||
return (*(op_read_t)s->be->op[OP_READ]) (s->handle, data, max_length, length);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* sane - Scanner Access Now Easy.
|
||||
Copyright (C) 1998 David F. Skoll
|
||||
Copyright (C) 1998 Dianne Skoll
|
||||
Heavily based on "hp.c" driver for HP Scanners, by
|
||||
David Mosberger-Tang.
|
||||
|
||||
|
@ -812,11 +812,11 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize)
|
|||
size_t len;
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize;
|
||||
(void) authorize;
|
||||
|
||||
DBG_INIT();
|
||||
if (version_code) {
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
|
||||
}
|
||||
|
||||
fp = sanei_config_open(DMC_CONFIG_FILE);
|
||||
|
@ -891,7 +891,7 @@ sane_get_devices(SANE_Device const ***device_list, SANE_Bool local_only)
|
|||
DMC_Device *dev;
|
||||
int i = 0;
|
||||
|
||||
local_only = local_only;
|
||||
(void) local_only;
|
||||
|
||||
if (devlist) free(devlist);
|
||||
devlist = malloc((NumDevices+1) * sizeof(devlist[0]));
|
||||
|
@ -1392,8 +1392,8 @@ sane_cancel (SANE_Handle handle)
|
|||
SANE_Status
|
||||
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
||||
{
|
||||
handle = handle;
|
||||
non_blocking = non_blocking;
|
||||
(void) handle;
|
||||
(void) non_blocking;
|
||||
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
@ -1401,8 +1401,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
|||
SANE_Status
|
||||
sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
|
||||
{
|
||||
handle = handle;
|
||||
fd = fd;
|
||||
(void) handle;
|
||||
(void) fd;
|
||||
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* sane - Scanner Access Now Easy.
|
||||
Copyright (C) 1998 David F. Skoll
|
||||
Copyright (C) 1998 Dianne Skoll
|
||||
This file is part of the SANE package.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
This file implements a SANE backend for the Fujitsu fi-60F, the
|
||||
ScanSnap S300/S1300, and (hopefully) other Epson-based scanners.
|
||||
|
||||
Copyright 2007-2015 by m. allan noah <kitno455 at gmail dot com>
|
||||
Copyright 2007-2022 by m. allan noah <kitno455 at gmail dot com>
|
||||
Copyright 2009 by Richard Goedeken <richard at fascinationsoftware dot com>
|
||||
|
||||
Development funded by Microdea, Inc., TrueCheck, Inc. and Archivista, GmbH
|
||||
|
@ -155,6 +155,10 @@
|
|||
v31 2017-04-09, MAN
|
||||
- hardware gray support for fi-60F/65F (disabled pending calibration)
|
||||
- merge fi-60F/65F settings
|
||||
v32 2022-11-15, MAN
|
||||
- fix hanging scan when using source = ADF Back (fixes #601)
|
||||
v33 2022-11-17, MAN
|
||||
- S1300i: fix color plane offset at 225 and 330 dpi (fixes #538)
|
||||
|
||||
SANE FLOW DIAGRAM
|
||||
|
||||
|
@ -203,8 +207,14 @@
|
|||
#include "epjitsu-cmd.h"
|
||||
|
||||
#define DEBUG 1
|
||||
#define BUILD 31
|
||||
#define BUILD 33
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX3
|
||||
#define MAX3(a,b,c) ((a) > (b) ? ((a) > (c) ? a : c) : ((b) > (c) ? b : c))
|
||||
#endif
|
||||
|
@ -265,16 +275,16 @@ static struct scanner *scanner_devList = NULL;
|
|||
SANE_Status
|
||||
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
||||
{
|
||||
authorize = authorize; /* get rid of compiler warning */
|
||||
(void) authorize; /* get rid of compiler warning */
|
||||
|
||||
DBG_INIT ();
|
||||
DBG (10, "sane_init: start\n");
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
|
||||
|
||||
DBG (5, "sane_init: epjitsu backend %d.%d.%d, from %s\n",
|
||||
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
|
||||
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
|
||||
|
||||
DBG (10, "sane_init: finish\n");
|
||||
|
||||
|
@ -317,7 +327,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
int num_devices=0;
|
||||
int i=0;
|
||||
|
||||
local_only = local_only; /* get rid of compiler warning */
|
||||
(void) local_only; /* get rid of compiler warning */
|
||||
|
||||
DBG (10, "sane_get_devices: start\n");
|
||||
|
||||
|
@ -1137,7 +1147,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
|
|||
/* values stored in 1200 dpi units */
|
||||
/* must be converted to MM for sane */
|
||||
s->tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(0);
|
||||
s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)-s->min_x);
|
||||
s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(0, get_page_width(s)-s->min_x));
|
||||
s->tl_x_range.quant = MM_PER_UNIT_FIX;
|
||||
|
||||
opt->name = SANE_NAME_SCAN_TL_X;
|
||||
|
@ -1156,7 +1166,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
|
|||
/* values stored in 1200 dpi units */
|
||||
/* must be converted to MM for sane */
|
||||
s->tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(0);
|
||||
s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)-s->min_y);
|
||||
s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(0, get_page_height(s)-s->min_y));
|
||||
s->tl_y_range.quant = MM_PER_UNIT_FIX;
|
||||
|
||||
opt->name = SANE_NAME_SCAN_TL_Y;
|
||||
|
@ -1174,7 +1184,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
|
|||
/* values stored in 1200 dpi units */
|
||||
/* must be converted to MM for sane */
|
||||
s->br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x);
|
||||
s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s));
|
||||
s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(s->min_x, get_page_width(s)));
|
||||
s->br_x_range.quant = MM_PER_UNIT_FIX;
|
||||
|
||||
opt->name = SANE_NAME_SCAN_BR_X;
|
||||
|
@ -1193,7 +1203,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
|
|||
/* values stored in 1200 dpi units */
|
||||
/* must be converted to MM for sane */
|
||||
s->br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y);
|
||||
s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s));
|
||||
s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(s->min_y, get_page_height(s)));
|
||||
s->br_y_range.quant = MM_PER_UNIT_FIX;
|
||||
|
||||
opt->name = SANE_NAME_SCAN_BR_Y;
|
||||
|
@ -2042,14 +2052,12 @@ change_params(struct scanner *s)
|
|||
/* height */
|
||||
if (s->tl_y > s->max_y - s->min_y)
|
||||
s->tl_y = s->max_y - s->min_y - s->adf_height_padding;
|
||||
if (s->tl_y + s->page_height > s->max_y - s->adf_height_padding)
|
||||
s->page_height = s->max_y - s->adf_height_padding - s->tl_y;
|
||||
if (s->page_height < s->min_y && s->page_height > 0)
|
||||
s->page_height = s->min_y;
|
||||
s->page_height = MIN(s->page_height, s->max_y - s->adf_height_padding - s->tl_y);
|
||||
if (s->page_height > 0)
|
||||
s->page_height = MAX(s->page_height, s->min_y);
|
||||
if (s->tl_y + s->page_height > s->max_y)
|
||||
s->tl_y = s->max_y - s->adf_height_padding - s->page_height;
|
||||
if (s->tl_y < 0)
|
||||
s->tl_y = 0;
|
||||
s->tl_y = MAX(s->tl_y, 0);
|
||||
|
||||
if (s->page_height > 0) {
|
||||
s->br_y = s->tl_y + s->page_height;
|
||||
|
@ -2059,10 +2067,9 @@ change_params(struct scanner *s)
|
|||
}
|
||||
|
||||
/*width*/
|
||||
if (s->page_width > s->max_x)
|
||||
s->page_width = s->max_x;
|
||||
else if (s->page_width < s->min_x)
|
||||
s->page_width = s->min_x;
|
||||
s->page_width = MIN(s->page_width, s->max_x);
|
||||
s->page_width = MAX(s->page_width, s->min_x);
|
||||
|
||||
s->tl_x = (s->max_x - s->page_width)/2;
|
||||
s->br_x = (s->max_x + s->page_width)/2;
|
||||
|
||||
|
@ -2177,7 +2184,7 @@ change_params(struct scanner *s)
|
|||
/* adf with specified paper size */
|
||||
s->front.height = SCANNER_UNIT_TO_PIX(s->page_height, s->front.y_res);
|
||||
}
|
||||
s->front.width_pix = s->block_img.width_pix;
|
||||
s->front.width_pix = SCANNER_UNIT_TO_PIX(s->page_width, s->resolution * img_heads);
|
||||
s->front.x_start_offset = (s->block_xfr.image->width_pix - s->front.width_pix)/2;
|
||||
switch (s->mode) {
|
||||
case MODE_COLOR:
|
||||
|
@ -2310,12 +2317,8 @@ load_lut (unsigned char * lut,
|
|||
for(i=0;i<=max_in_val;i++){
|
||||
j = rise*i + shift;
|
||||
|
||||
if(j<out_min){
|
||||
j=out_min;
|
||||
}
|
||||
else if(j>out_max){
|
||||
j=out_max;
|
||||
}
|
||||
j = MAX(j, out_min);
|
||||
j = MIN(j, out_max);
|
||||
|
||||
*lut_p=j;
|
||||
lut_p++;
|
||||
|
@ -2654,7 +2657,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay)
|
|||
unsigned char stat[1];
|
||||
size_t cmdLen,statLen,payLen;
|
||||
|
||||
DBG (5, "coarsecal_send_cal: start\n");
|
||||
DBG (10, "coarsecal_send_cal: start\n");
|
||||
/* send coarse cal (c6) */
|
||||
cmd[0] = 0x1b;
|
||||
cmd[1] = 0xc6;
|
||||
|
@ -2697,7 +2700,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay)
|
|||
return SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
|
||||
DBG (5, "coarsecal_send_cal: finish\n");
|
||||
DBG (10, "coarsecal_send_cal: finish\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2709,7 +2712,7 @@ coarsecal_get_line(struct scanner *s, struct image *img)
|
|||
unsigned char stat[1];
|
||||
size_t cmdLen,statLen;
|
||||
|
||||
DBG (5, "coarsecal_get_line: start\n");
|
||||
DBG (10, "coarsecal_get_line: start\n");
|
||||
|
||||
/* send scan d2 command */
|
||||
cmd[0] = 0x1b;
|
||||
|
@ -2746,7 +2749,7 @@ coarsecal_get_line(struct scanner *s, struct image *img)
|
|||
/* convert the raw data into normal packed pixel data */
|
||||
descramble_raw(s, &s->cal_image);
|
||||
|
||||
DBG (5, "coarsecal_get_line: finish\n");
|
||||
DBG (10, "coarsecal_get_line: finish\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2758,7 +2761,7 @@ coarsecal_dark(struct scanner *s, unsigned char *pay)
|
|||
int try_count, cal_good[2], x, j;
|
||||
int param[2], zcount[2], high_param[2], low_param[2], avg[2], maxval[2];
|
||||
|
||||
DBG (5, "coarsecal_dark: start\n");
|
||||
DBG (10, "coarsecal_dark: start\n");
|
||||
|
||||
/* dark cal, lamp off */
|
||||
ret = lamp(s,0);
|
||||
|
@ -2844,7 +2847,7 @@ coarsecal_dark(struct scanner *s, unsigned char *pay)
|
|||
|
||||
} /* continue looping for up to 8 tries */
|
||||
|
||||
DBG (5, "coarsecal_dark: finish\n");
|
||||
DBG (10, "coarsecal_dark: finish\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2857,7 +2860,7 @@ coarsecal_light(struct scanner *s, unsigned char *pay)
|
|||
int param[2], zcount[2], high_param[2], low_param[2], avg[2];
|
||||
int rgb_avg[2][3], rgb_hicount[2][3];
|
||||
|
||||
DBG (5, "coarsecal_light: start\n");
|
||||
DBG (10, "coarsecal_light: start\n");
|
||||
|
||||
/* light cal, lamp on */
|
||||
ret = lamp(s,1);
|
||||
|
@ -2961,7 +2964,7 @@ coarsecal_light(struct scanner *s, unsigned char *pay)
|
|||
}
|
||||
}
|
||||
|
||||
DBG (5, "coarsecal_light: finish\n");
|
||||
DBG (10, "coarsecal_light: finish\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3023,6 +3026,8 @@ finecal_send_cal(struct scanner *s)
|
|||
unsigned char *p_out, *p_in = s->sendcal.buffer;
|
||||
int planes;
|
||||
|
||||
DBG (10, "finecal_send_cal: start\n");
|
||||
|
||||
if(s->model == MODEL_FI60F || s->model == MODEL_FI65F)
|
||||
planes = 3;
|
||||
if(s->model == MODEL_S300 || s->model == MODEL_S1300i)
|
||||
|
@ -3165,6 +3170,7 @@ finecal_send_cal(struct scanner *s)
|
|||
return SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
|
||||
DBG (10, "finecal_send_cal: finish\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3182,6 +3188,8 @@ finecal_get_line(struct scanner *s, struct image *img)
|
|||
int round_offset = img->height / 2;
|
||||
int i, j, k;
|
||||
|
||||
DBG (10, "finecal_get_line: start\n");
|
||||
|
||||
/* ask for 16 lines */
|
||||
ret = set_window(s, WINDOW_FINECAL);
|
||||
if(ret){
|
||||
|
@ -3238,6 +3246,8 @@ finecal_get_line(struct scanner *s, struct image *img)
|
|||
avgpix[j] = (total + round_offset) / img->height;
|
||||
}
|
||||
}
|
||||
|
||||
DBG (10, "finecal_get_line: finish\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3385,8 +3395,8 @@ finecal(struct scanner *s)
|
|||
else
|
||||
s->sendcal.buffer[idx * 2 + 1] = newgain;
|
||||
/* update statistics */
|
||||
if (pixvalue < min_value[i][k]) min_value[i][k] = pixvalue;
|
||||
if (pixvalue > max_value[i][k]) max_value[i][k] = pixvalue;
|
||||
min_value[i][k] = MIN(min_value[i][k], pixvalue);
|
||||
max_value[i][k] = MAX(max_value[i][k], pixvalue);
|
||||
avg_value[i][k] += pixerror;
|
||||
variance[i][k] += (pixerror * pixerror);
|
||||
idx++;
|
||||
|
@ -3658,13 +3668,8 @@ send_lut (struct scanner *s)
|
|||
for(i=0;i<width;i++){
|
||||
j=slope*i + offset + b;
|
||||
|
||||
if(j<0){
|
||||
j=0;
|
||||
}
|
||||
|
||||
if(j>(height-1)){
|
||||
j=height-1;
|
||||
}
|
||||
j = MAX(j, 0);
|
||||
j = MIN(j, height-1);
|
||||
|
||||
if (s->model == MODEL_S1100){
|
||||
/*only one table, be order*/
|
||||
|
@ -4078,9 +4083,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
|
|||
}
|
||||
|
||||
*len = page->bytes_scanned - page->bytes_read;
|
||||
if(*len > max_len){
|
||||
*len = max_len;
|
||||
}
|
||||
*len = MIN(*len, max_len);
|
||||
|
||||
if(*len){
|
||||
DBG (10, "sane_read: copy rx:%d tx:%d tot:%d len:%d\n",
|
||||
|
@ -4088,12 +4091,12 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
|
|||
|
||||
memcpy(buf, page->image->buffer + page->bytes_read, *len);
|
||||
page->bytes_read += *len;
|
||||
}
|
||||
|
||||
/* sent it all, return eof on next read */
|
||||
if(page->bytes_read == page->bytes_scanned && s->fullscan.done){
|
||||
DBG (10, "sane_read: side done\n");
|
||||
page->done = 1;
|
||||
}
|
||||
/* sent it all, return eof on next read */
|
||||
if(page->bytes_read == page->bytes_scanned && s->fullscan.done){
|
||||
DBG (10, "sane_read: side done\n");
|
||||
page->done = 1;
|
||||
}
|
||||
|
||||
DBG (10, "sane_read: finish si:%d len:%d max:%d\n",s->side,*len,max_len);
|
||||
|
@ -4161,6 +4164,7 @@ descramble_raw(struct scanner *s, struct transfer * tp)
|
|||
for (j = 0; j < height; j++){ /* row (y)*/
|
||||
int curr_col = 0;
|
||||
int r=0, g=0, b=0, ppc=0;
|
||||
int g_offset=0, b_offset=0;
|
||||
|
||||
for (k = 0; k <= tp->plane_width; k++){ /* column (x) */
|
||||
int this_col = k*tp->image->x_res/tp->x_res;
|
||||
|
@ -4185,14 +4189,20 @@ descramble_raw(struct scanner *s, struct transfer * tp)
|
|||
break;
|
||||
}
|
||||
|
||||
/* if we're using an S1300i with scan resolution 225 or 300, on AC power, the color planes are shifted */
|
||||
if(s->model == MODEL_S1300i && !s->usb_power && (tp->x_res == 225 || tp->x_res == 300) && tp != &s->cal_image && k + 2 <= tp->plane_width){
|
||||
g_offset = 3;
|
||||
b_offset = 6;
|
||||
}
|
||||
|
||||
/*red is first*/
|
||||
r += tp->raw_data[j*tp->line_stride + k*3 + i];
|
||||
|
||||
/*green is second*/
|
||||
g += tp->raw_data[j*tp->line_stride + tp->plane_stride + k*3 + i];
|
||||
g += tp->raw_data[j*tp->line_stride + tp->plane_stride + k*3 + i + g_offset];
|
||||
|
||||
/*blue is third*/
|
||||
b += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k*3 + i];
|
||||
b += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k*3 + i + b_offset];
|
||||
|
||||
ppc++;
|
||||
}
|
||||
|
@ -4341,8 +4351,8 @@ read_from_scanner(struct scanner *s, struct transfer * tp)
|
|||
size_t bufLen;
|
||||
|
||||
/* determine amount to ask for, S1300i wants big requests */
|
||||
if(bytes > remainBlock && s->model != MODEL_S1300i){
|
||||
bytes = remainBlock;
|
||||
if(s->model != MODEL_S1300i){
|
||||
bytes = MIN(bytes, remainBlock);
|
||||
}
|
||||
|
||||
if (tp->image == NULL)
|
||||
|
@ -4932,8 +4942,7 @@ maxStringSize (const SANE_String_Const strings[])
|
|||
|
||||
for (i = 0; strings[i]; ++i) {
|
||||
size = strlen (strings[i]) + 1;
|
||||
if (size > max_size)
|
||||
max_size = size;
|
||||
max_size = MAX(max_size, size);
|
||||
}
|
||||
|
||||
return max_size;
|
||||
|
|
|
@ -2653,7 +2653,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
size_t len;
|
||||
FILE *fp;
|
||||
|
||||
authorize = authorize; /* get rid of compiler warning */
|
||||
(void) authorize; /* get rid of compiler warning */
|
||||
|
||||
/* sanei_authorization(devicename, STRINGIFY(BACKEND_NAME), auth_callback); */
|
||||
|
||||
|
@ -2663,7 +2663,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
#endif
|
||||
|
||||
if (version_code != NULL)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, SANE_EPSON_BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, SANE_EPSON_BUILD);
|
||||
|
||||
sanei_usb_init ();
|
||||
|
||||
|
@ -2753,7 +2753,7 @@ sane_get_devices (const SANE_Device * **device_list, SANE_Bool local_only)
|
|||
|
||||
DBG (5, "sane_get_devices()\n");
|
||||
|
||||
local_only = local_only; /* just to get rid of the compiler warning */
|
||||
(void) local_only; /* just to get rid of the compiler warning */
|
||||
|
||||
if (devlist)
|
||||
{
|
||||
|
@ -6383,8 +6383,8 @@ SANE_Status
|
|||
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
|
||||
{
|
||||
/* get rid of compiler warning */
|
||||
handle = handle;
|
||||
non_blocking = non_blocking;
|
||||
(void) handle;
|
||||
(void) non_blocking;
|
||||
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
@ -6399,8 +6399,8 @@ SANE_Status
|
|||
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
|
||||
{
|
||||
/* get rid of compiler warnings */
|
||||
handle = handle;
|
||||
fd = fd;
|
||||
(void) handle;
|
||||
(void) fd;
|
||||
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,8 @@ e2_send(Epson_Scanner * s, void *buf, size_t buf_size, size_t reply_len,
|
|||
if (reply_len == 0) {
|
||||
DBG(0,
|
||||
"Cannot send this command to a networked scanner\n");
|
||||
return SANE_STATUS_INVAL;
|
||||
*status = SANE_STATUS_INVAL;
|
||||
return 0; /* nothing actually sent */
|
||||
}
|
||||
return sanei_epson_net_write(s, 0x2000, buf, buf_size,
|
||||
reply_len, status);
|
||||
|
|
|
@ -291,14 +291,14 @@ e2_dev_post_init(struct Epson_Device *dev)
|
|||
dev->need_reset_on_source_change = SANE_FALSE;
|
||||
|
||||
if (e2_dev_model(dev, "ES-9000H") || e2_dev_model(dev, "GT-30000")) {
|
||||
dev->cmd->set_focus_position = 0;
|
||||
dev->focusSupport = SANE_FALSE;
|
||||
dev->cmd->feed = 0x19;
|
||||
}
|
||||
|
||||
if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650")
|
||||
|| e2_dev_model(dev, "Perfection1640") || e2_dev_model(dev, "GT-8700")) {
|
||||
dev->focusSupport = SANE_FALSE;
|
||||
dev->cmd->feed = 0;
|
||||
dev->cmd->set_focus_position = 0;
|
||||
dev->need_reset_on_source_change = SANE_TRUE;
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ e2_discover_capabilities(Epson_Scanner *s)
|
|||
/* ESC F, request status */
|
||||
status = esci_request_status(s, &scanner_status);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return status;;
|
||||
return status;
|
||||
|
||||
/* set capabilities */
|
||||
if (scanner_status & STATUS_OPTION)
|
||||
|
@ -817,20 +817,17 @@ e2_discover_capabilities(Epson_Scanner *s)
|
|||
DBG(1, "maximum supported color depth: %d\n", dev->maxDepth);
|
||||
|
||||
/*
|
||||
* Check for "request focus position" command. If this command is
|
||||
* supported, then the scanner does also support the "set focus
|
||||
* position" command.
|
||||
* XXX ???
|
||||
* We assume that setting focus is supported when we can get the focus.
|
||||
* This assumption may be overridden in e2_dev_post_init()
|
||||
*/
|
||||
|
||||
if (esci_request_focus_position(s, &s->currentFocusPosition) ==
|
||||
SANE_STATUS_GOOD) {
|
||||
DBG(1, "setting focus is supported, current focus: %u\n", s->currentFocusPosition);
|
||||
DBG(1, "getting focus is supported, current focus: %u\n", s->currentFocusPosition);
|
||||
dev->focusSupport = SANE_TRUE;
|
||||
s->opt[OPT_FOCUS_POS].cap &= ~SANE_CAP_INACTIVE;
|
||||
s->val[OPT_FOCUS_POS].w = s->currentFocusPosition;
|
||||
} else {
|
||||
DBG(1, "setting focus is not supported\n");
|
||||
DBG(1, "getting focus is not supported\n");
|
||||
dev->focusSupport = SANE_FALSE;
|
||||
s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_INACTIVE;
|
||||
s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; /* just in case */
|
||||
|
@ -1596,7 +1593,7 @@ e2_check_adf(Epson_Scanner * s)
|
|||
|
||||
status = esci_request_extended_status(s, &buf, NULL);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return status;;
|
||||
return status;
|
||||
|
||||
t = buf[1];
|
||||
|
||||
|
@ -1649,11 +1646,23 @@ e2_start_ext_scan(Epson_Scanner * s)
|
|||
if (buf[0] != STX)
|
||||
return SANE_STATUS_INVAL;
|
||||
|
||||
if (buf[1] & 0x80) {
|
||||
if (buf[1] & STATUS_FER) {
|
||||
DBG(1, "%s: fatal error\n", __func__);
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* The 12000XL signals busy only with FS+G, all other status queries
|
||||
* say non-busy. Probably because you can in deed communicate with the
|
||||
* device, just scanning is not yet possible. I tried polling with FS+G
|
||||
* every 5 seconds, but that made scary noises. So, bail out and let
|
||||
* the user retry manually.
|
||||
*/
|
||||
if (buf[1] & STATUS_NOT_READY) {
|
||||
DBG(1, "%s: device not ready\n", __func__);
|
||||
return SANE_STATUS_DEVICE_BUSY;
|
||||
}
|
||||
|
||||
s->ext_block_len = le32atoh(&buf[2]);
|
||||
s->ext_blocks = le32atoh(&buf[6]);
|
||||
s->ext_last_len = le32atoh(&buf[10]);
|
||||
|
@ -1765,10 +1774,16 @@ e2_ext_read(struct Epson_Scanner *s)
|
|||
return status;
|
||||
}
|
||||
|
||||
if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650")) {
|
||||
/* See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597922#127 */
|
||||
s->buf[buf_len] &= 0xc0;
|
||||
}
|
||||
/* Some scanners wrongly set FSG_STATUS_CANCEL_REQ. Mask it out.
|
||||
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597922#127
|
||||
* https://gitlab.com/sane-project/backends/-/issues/716
|
||||
*/
|
||||
if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650") ||
|
||||
e2_dev_model(dev, "GT-10000") || e2_dev_model(dev, "ES-6000") ||
|
||||
e2_dev_model(dev, "Perfection610") || e2_dev_model(dev, "GT-6600") ||
|
||||
e2_dev_model(dev, "Perfection1200") || e2_dev_model(dev, "GT-7600") ||
|
||||
e2_dev_model(dev, "Expression1600") || e2_dev_model(dev, "ES-2000"))
|
||||
s->buf[buf_len] &= FSG_STATUS_FER | FSG_STATUS_NOT_READY;
|
||||
|
||||
if (s->buf[buf_len] & FSG_STATUS_CANCEL_REQ) {
|
||||
DBG(0, "%s: cancel request received\n", __func__);
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
* published by the Free Software Foundation, version 2.
|
||||
*/
|
||||
|
||||
#define EPSON2_VERSION 1
|
||||
#define EPSON2_REVISION 0
|
||||
#define EPSON2_BUILD 124
|
||||
|
||||
/* debugging levels:
|
||||
*
|
||||
* 127 e2_recv buffer
|
||||
|
@ -900,16 +896,14 @@ SANE_Status
|
|||
sane_init(SANE_Int *version_code, SANE_Auth_Callback __sane_unused__ authorize)
|
||||
{
|
||||
DBG_INIT();
|
||||
DBG(2, "%s: " PACKAGE " " VERSION "\n", __func__);
|
||||
DBG(1, "%s: version " VERSION "\n", __func__);
|
||||
|
||||
DBG(1, "epson2 backend, version %i.%i.%i\n",
|
||||
EPSON2_VERSION, EPSON2_REVISION, EPSON2_BUILD);
|
||||
|
||||
if (version_code != NULL)
|
||||
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, V_MINOR,
|
||||
EPSON2_BUILD);
|
||||
/* Keep '124' as our build version. The arg is obsolete by now */
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 124);
|
||||
|
||||
sanei_usb_init();
|
||||
sanei_usb_set_timeout(60 * 1000);
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
@ -2303,21 +2297,6 @@ sane_start(SANE_Handle handle)
|
|||
return status;
|
||||
}
|
||||
|
||||
static inline int
|
||||
get_color(int status)
|
||||
{
|
||||
switch ((status >> 2) & 0x03) {
|
||||
case 1:
|
||||
return 1;
|
||||
case 2:
|
||||
return 0;
|
||||
case 3:
|
||||
return 2;
|
||||
default:
|
||||
return 0; /* required to make the compiler happy */
|
||||
}
|
||||
}
|
||||
|
||||
/* this moves data from our buffers to SANE */
|
||||
|
||||
SANE_Status
|
||||
|
@ -2354,7 +2333,7 @@ sane_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length,
|
|||
/* XXX if FS G and STATUS_IOERR, use e2_check_extended_status */
|
||||
|
||||
DBG(18, "moving data %p %p, %d (%d lines)\n",
|
||||
s->ptr, s->end,
|
||||
(void *) s->ptr, (void *) s->end,
|
||||
max_length, max_length / s->params.bytes_per_line);
|
||||
|
||||
e2_copy_image_data(s, data, max_length, length);
|
||||
|
|
|
@ -70,7 +70,7 @@ sanei_epson_net_read_buf(Epson_Scanner *s, unsigned char *buf, ssize_t wanted,
|
|||
ssize_t read = 0;
|
||||
|
||||
DBG(23, "%s: reading up to %lu from buffer at %p, %lu available\n",
|
||||
__func__, (u_long) wanted, s->netptr, (u_long) s->netlen);
|
||||
__func__, (u_long) wanted, (void *) s->netptr, (u_long) s->netlen);
|
||||
|
||||
if ((size_t) wanted > s->netlen) {
|
||||
*status = SANE_STATUS_IO_ERROR;
|
||||
|
@ -84,7 +84,7 @@ sanei_epson_net_read_buf(Epson_Scanner *s, unsigned char *buf, ssize_t wanted,
|
|||
s->netlen -= read;
|
||||
|
||||
if (s->netlen == 0) {
|
||||
DBG(23, "%s: freeing %p\n", __func__, s->netbuf);
|
||||
DBG(23, "%s: freeing %p\n", __func__, (void *) s->netbuf);
|
||||
free(s->netbuf);
|
||||
s->netbuf = s->netptr = NULL;
|
||||
s->netlen = 0;
|
||||
|
@ -179,7 +179,7 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
|
|||
if (reply_len) {
|
||||
if (s->netbuf) {
|
||||
DBG(23, "%s, freeing %p, %ld bytes unprocessed\n",
|
||||
__func__, s->netbuf, (u_long) s->netlen);
|
||||
__func__, (void *) s->netbuf, (u_long) s->netlen);
|
||||
free(s->netbuf);
|
||||
s->netbuf = s->netptr = NULL;
|
||||
s->netlen = 0;
|
||||
|
@ -192,11 +192,11 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
|
|||
}
|
||||
s->netlen = reply_len;
|
||||
DBG(24, "%s: allocated %lu bytes at %p\n", __func__,
|
||||
(u_long) s->netlen, s->netbuf);
|
||||
(u_long) s->netlen, (void *) s->netbuf);
|
||||
}
|
||||
|
||||
DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
|
||||
__func__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
|
||||
__func__, cmd, (void *) buf, (u_long) buf_size, (u_long) reply_len);
|
||||
|
||||
memset(h1, 0x00, 12);
|
||||
memset(h2, 0x00, 8);
|
||||
|
|
|
@ -27,8 +27,8 @@ sanei_epson2_scsi_sense_handler(int scsi_fd,
|
|||
unsigned char *result, void *arg)
|
||||
{
|
||||
/* to get rid of warnings */
|
||||
scsi_fd = scsi_fd;
|
||||
arg = arg;
|
||||
(void) scsi_fd;
|
||||
(void) arg;
|
||||
|
||||
if (result[0] && result[0] != 0x70) {
|
||||
DBG(2, "%s: sense code = 0x%02x\n",
|
||||
|
|
|
@ -5,184 +5,194 @@
|
|||
/* generated with epson2usb.pl doc/descriptions/epson2.desc */
|
||||
|
||||
SANE_Word sanei_epson_usb_product_ids[] = {
|
||||
0x101, /* GT-7000U, Perfection 636U */
|
||||
0x103, /* GT-6600U, Perfection 610 */
|
||||
0x104, /* GT-7600U, GT-7600UF, Perfection 1200U, Perfection 1200U PHOTO */
|
||||
0x105, /* Stylus Scan 2000 */
|
||||
0x106, /* Stylus Scan 2500 */
|
||||
0x107, /* ES-2000, Expression 1600 */
|
||||
0x109, /* ES-8500, Expression 1640XL */
|
||||
0x10a, /* GT-8700, GT-8700F, Perfection 1640SU, Perfection 1640SU PHOTO */
|
||||
0x10b, /* GT-7700U, Perfection 1240U */
|
||||
0x10c, /* GT-6700U, Perfection 640U */
|
||||
0x10e, /* ES-2200, Expression 1680 */
|
||||
0x110, /* GT-8200U, GT-8200UF, Perfection 1650, Perfection 1650 PHOTO */
|
||||
0x1116, /* XP-243 245 247 Series, XP-427 */
|
||||
0x112, /* GT-9700F, Perfection 2450 PHOTO */
|
||||
0x0101, /* GT-7000U, Perfection 636U */
|
||||
0x0103, /* GT-6600U, Perfection 610 */
|
||||
0x0104, /* GT-7600U, GT-7600UF, Perfection 1200U, Perfection 1200U PHOTO */
|
||||
0x0105, /* Stylus Scan 2000 */
|
||||
0x0106, /* Stylus Scan 2500 */
|
||||
0x0107, /* ES-2000, Expression 1600 */
|
||||
0x0109, /* ES-8500, Expression 1640XL */
|
||||
0x010a, /* GT-8700, GT-8700F, Perfection 1640SU, Perfection 1640SU PHOTO */
|
||||
0x010b, /* GT-7700U, Perfection 1240U */
|
||||
0x010c, /* GT-6700U, Perfection 640U */
|
||||
0x010e, /* ES-2200, Expression 1680 */
|
||||
0x0110, /* GT-8200U, GT-8200UF, Perfection 1650, Perfection 1650 PHOTO */
|
||||
0x0112, /* GT-9700F, Perfection 2450 PHOTO */
|
||||
0x011b, /* GT-9300UF, Perfection 2400 PHOTO */
|
||||
0x011c, /* GT-9800F, Perfection 3200 PHOTO */
|
||||
0x011e, /* GT-8300UF, Perfection 1660 PHOTO */
|
||||
0x0126, /* ES-7000H, GT-15000 */
|
||||
0x0128, /* GT-X700, Perfection 4870 PHOTO */
|
||||
0x0129, /* ES-10000G, Expression 10000XL */
|
||||
0x012a, /* GT-X800, Perfection 4990 PHOTO */
|
||||
0x012b, /* ES-H300, GT-2500 */
|
||||
0x012c, /* GT-X900, Perfection V700 Photo, Perfection V750 Photo */
|
||||
0x0135, /* GT-X970 */
|
||||
0x0138, /* ES-H7200, GT-20000 */
|
||||
0x014b, /* ES-G11000, Expression 11000XL */
|
||||
0x0151, /* GT-X980, Perfection V800 Photo, Perfection V850 Pro */
|
||||
0x015b, /* DS-G20000, Expression 12000XL */
|
||||
0x0801, /* CC-600PX, Stylus CX5100, Stylus CX5200 */
|
||||
0x0802, /* CC-570L, Stylus CX3100, Stylus CX3200 */
|
||||
0x0805, /* Stylus CX6300, Stylus CX6400 */
|
||||
0x0806, /* PM-A850, Stylus Photo RX600 */
|
||||
0x0807, /* Stylus Photo RX500, Stylus Photo RX510 */
|
||||
0x0808, /* Stylus CX5300, Stylus CX5400 */
|
||||
0x080d, /* Stylus CX4500, Stylus CX4600 */
|
||||
0x080e, /* PX-A550, Stylus CX3500, Stylus CX3600, Stylus CX3650 */
|
||||
0x080f, /* Stylus Photo RX420, Stylus Photo RX425, Stylus Photo RX430 */
|
||||
0x0810, /* PM-A900, Stylus Photo RX700 */
|
||||
0x0811, /* PM-A870, Stylus Photo RX620, Stylus Photo RX630 */
|
||||
0x0813, /* Stylus CX6500, Stylus CX6600 */
|
||||
0x0814, /* PM-A700 */
|
||||
0x0815, /* AcuLaser CX11, AcuLaser CX11NF, LP-A500 */
|
||||
0x0817, /* LP-M5500, LP-M5500F */
|
||||
0x0818, /* Stylus CX3700, Stylus CX3800, Stylus CX3810, Stylus DX3800 */
|
||||
0x0819, /* PX-A650, Stylus CX4700, Stylus CX4800, Stylus DX4800, Stylus DX4850 */
|
||||
0x081a, /* PM-A750, Stylus Photo RX520, Stylus Photo RX530 */
|
||||
0x081c, /* PM-A890, Stylus Photo RX640, Stylus Photo RX650 */
|
||||
0x081d, /* PM-A950 */
|
||||
0x081f, /* Stylus CX7700, Stylus CX7800 */
|
||||
0x0820, /* Stylus CX4100, Stylus CX4200, Stylus DX4200 */
|
||||
0x0827, /* PM-A820, Stylus Photo RX560, Stylus Photo RX580, Stylus Photo RX590 */
|
||||
0x0828, /* PM-A970 */
|
||||
0x0829, /* PM-T990 */
|
||||
0x082a, /* PM-A920 */
|
||||
0x082b, /* Stylus CX4900, Stylus CX5000, Stylus DX5000 */
|
||||
0x082e, /* PX-A720, Stylus CX5900, Stylus CX6000, Stylus DX6000 */
|
||||
0x082f, /* PX-A620, Stylus CX3900, Stylus DX4000 */
|
||||
0x0830, /* ME 200, Stylus CX2800, Stylus CX2900 */
|
||||
0x0833, /* LP-M5600 */
|
||||
0x0834, /* LP-M6000 */
|
||||
0x0835, /* AcuLaser CX21 */
|
||||
0x0836, /* PM-T960 */
|
||||
0x0837, /* PM-A940, Stylus Photo RX680, Stylus Photo RX685, Stylus Photo RX690 */
|
||||
0x0838, /* PX-A640, Stylus CX7300, Stylus CX7400, Stylus DX7400 */
|
||||
0x0839, /* PX-A740, Stylus CX8300, Stylus CX8400, Stylus DX8400 */
|
||||
0x083a, /* PX-FA700, Stylus CX9300F, Stylus CX9400Fax, Stylus DX9400F */
|
||||
0x083c, /* PM-A840, PM-A840S, Stylus Photo RX585, Stylus Photo RX595, Stylus Photo RX610 */
|
||||
0x0841, /* ME 300, PX-401A, Stylus NX100, Stylus SX100, Stylus TX100 */
|
||||
0x0843, /* LP-M5000 */
|
||||
0x0844, /* Artisan 800, EP-901A, EP-901F, Stylus Photo PX800FW, Stylus Photo TX800FW */
|
||||
0x0846, /* Artisan 700, EP-801A, Stylus Photo PX700W, Stylus Photo TX700W */
|
||||
0x0847, /* ME Office 700FW, PX-601F, Stylus Office BX600FW, Stylus Office TX600FW, Stylus SX600FW, WorkForce 600 */
|
||||
0x0848, /* ME Office 600F, Stylus Office BX300F, Stylus Office TX300F, Stylus NX300 Series */
|
||||
0x0849, /* Stylus NX200, Stylus SX200, Stylus SX205, Stylus TX200, Stylus TX203, Stylus TX209 */
|
||||
0x084a, /* PX-501A, Stylus NX400, Stylus SX400, Stylus SX405, Stylus TX400 */
|
||||
0x084c, /* WorkForce 500 */
|
||||
0x084d, /* PX-402A, Stylus NX110 Series, Stylus SX110 Series, Stylus TX110 Series */
|
||||
0x084f, /* ME OFFICE 510, Stylus NX210 Series, Stylus SX210 Series, Stylus TX210 Series */
|
||||
0x0850, /* EP-702A, Stylus Photo PX650 Series, Stylus Photo TX650 Series */
|
||||
0x0851, /* Stylus NX410 Series, Stylus SX410 Series, Stylus TX410 Series */
|
||||
0x0852, /* Artisan 710 Series, EP-802A, Stylus Photo PX710W Series, Stylus Photo TX710W Series */
|
||||
0x0853, /* Artisan 810 Series, EP-902A, Stylus Photo PX810FW Series */
|
||||
0x0854, /* ME OFFICE 650FN Series, Stylus Office BX310FN Series, Stylus Office TX510FN Series, WorkForce 310 Series */
|
||||
0x0855, /* PX-602F, Stylus Office BX610FW Series, Stylus Office TX610FW Series, Stylus SX610FW Series, WorkForce 610 Series */
|
||||
0x0856, /* PX-502A, Stylus NX510 Series, Stylus SX510W Series, Stylus TX550W Series */
|
||||
0x085c, /* ME 320 Series, ME 330 Series, Stylus NX125, Stylus NX127, Stylus SX125, Stylus TX120 Series */
|
||||
0x085d, /* ME OFFICE 960FWD Series, PX-603F, Stylus Office BX625FWD, Stylus Office TX620FWD Series, Stylus SX620FW Series, WorkForce 630 Series */
|
||||
0x085e, /* ME OFFICE 900WD Series, PX-503A, Stylus Office BX525WD, Stylus NX625, Stylus SX525WD, Stylus TX560WD Series, WorkForce 625 */
|
||||
0x085f, /* Stylus Office BX320FW Series, Stylus Office TX525FW, WorkForce 520 Series */
|
||||
0x0860, /* Artisan 835, EP-903A, EP-903F, Stylus Photo PX820FWD Series, Stylus Photo TX820FWD Series */
|
||||
0x0861, /* Artisan 725, EP-803A, EP-803AW, Stylus Photo PX720WD Series, Stylus Photo TX720WD Series */
|
||||
0x0862, /* EP-703A, Stylus Photo PX660 Series */
|
||||
0x0863, /* ME OFFICE 620F Series, Stylus Office BX305F, Stylus Office BX305FW, Stylus Office TX320F Series, WorkForce 320 Series */
|
||||
0x0864, /* ME OFFICE 560W Series, Stylus NX420 Series, Stylus SX420W Series, Stylus TX420W Series */
|
||||
0x0865, /* ME OFFICE 520 Series, Stylus NX220 Series, Stylus SX218, Stylus TX220 Series */
|
||||
0x0866, /* AcuLaser MX20DN, AcuLaser MX20DNF, AcuLaser MX21DNF */
|
||||
0x0869, /* PX-1600F, WF-7510 Series */
|
||||
0x086a, /* PX-673F, Stylus Office BX925FWD, WorkForce 840 Series */
|
||||
0x0870, /* Stylus Office BX305FW Plus, WorkForce 435 */
|
||||
0x0871, /* K200 Series */
|
||||
0x0872, /* K300 Series, WorkForce K301 */
|
||||
0x0873, /* L200 Series */
|
||||
0x0878, /* Artisan 635, EP-704A */
|
||||
0x0879, /* Artisan 837, EP-904A, EP-904F, Stylus Photo PX830FWD Series */
|
||||
0x087b, /* Artisan 730 Series, EP-804A, EP-804AR, EP-804AW, Stylus Photo PX730WD Series, Stylus Photo TX730WD Series */
|
||||
0x087c, /* PX-1700F, WF-7520 Series */
|
||||
0x087d, /* PX-B750F, WP-4511, WP-4515, WP-4521, WP-4525, WP-4530 Series, WP-4540 Series */
|
||||
0x087e, /* WP-4590 Series */
|
||||
0x087f, /* PX-403A */
|
||||
0x0880, /* ME OFFICE 570W Series, PX-434A, Stylus NX330 Series, Stylus SX430W Series, Stylus TX430W Series */
|
||||
0x0881, /* ME OFFICE 535, PX-404A, Stylus SX230 Series, Stylus TX235 */
|
||||
0x0883, /* ME 340 Series, Stylus NX130 Series, Stylus SX130 Series, Stylus TX130 Series */
|
||||
0x0884, /* Stylus NX430W Series, Stylus SX440W Series, Stylus TX435W */
|
||||
0x0885, /* Stylus NX230 Series, Stylus SX235W, Stylus TX230W Series */
|
||||
0x088d, /* Epson ME 350 */
|
||||
0x088f, /* Stylus Office BX635FWD, WorkForce 645 */
|
||||
0x0890, /* ME OFFICE 940FW Series, Stylus Office BX630FW Series, WorkForce 545 */
|
||||
0x0891, /* PX-504A, Stylus Office BX535WD, Stylus NX530 Series, Stylus NX635, Stylus SX535WD */
|
||||
0x0892, /* Stylus Office BX935FWD, WorkForce 845 */
|
||||
0x0893, /* EP-774A */
|
||||
0x0894, /* LP-M5300 Series */
|
||||
0x0895, /* PX-045A, XP-100 Series */
|
||||
0x0896, /* ME-301, XP-200 Series */
|
||||
0x0897, /* ME-303, PX-405A */
|
||||
0x0898, /* ME-401, PX-435A, XP-300 Series, XP-400 Series */
|
||||
0x0899, /* PX-605F, PX-675F, WF-3520 Series, WF-3530 Series, WF-3540 Series */
|
||||
0x089a, /* EP-905F, XP-850 Series */
|
||||
0x089b, /* EP-905A, XP-800 Series */
|
||||
0x089c, /* EP-805A, EP-805AR, EP-805AW, XP-750 Series */
|
||||
0x089d, /* XP-700 Series */
|
||||
0x089e, /* EP-775A, EP-775AW, XP-600 Series */
|
||||
0x089f, /* EP-705A */
|
||||
0x08a0, /* ME-101 */
|
||||
0x08a1, /* L210 Series, L350, L351 */
|
||||
0x08a5, /* PX-505F, WF-2510 Series */
|
||||
0x08a6, /* PX-535F, WF-2520 Series, WF-2530 Series, WF-2540 Series */
|
||||
0x08a7, /* WP-M4525, WP-M4521, PX-K751F, WP-M4595 */
|
||||
0x08a8, /* L355, L358 */
|
||||
0x08a9, /* L550 Series */
|
||||
0x08aa, /* M200 Series */
|
||||
0x08ab, /* WF-M1560 Series */
|
||||
0x08ac, /* AL-MX300DN Series, AL-MX300DNF Series */
|
||||
0x08ad, /* LP-M8040, LP-M8040A, LP-M8040F */
|
||||
0x08ae, /* PX-046A, XP-211, XP-212, XP-215 */
|
||||
0x08af, /* PX-436A, XP-310 Series */
|
||||
0x08b0, /* XP-410 Series */
|
||||
0x08b3, /* EP-976A3, XP-950 Series */
|
||||
0x08b4, /* EP-906F, XP-810 Series */
|
||||
0x08b5, /* EP-806AB, EP-806AR, EP-806AW, XP-710 Series */
|
||||
0x08b6, /* EP-776AB, EP-776AW, XP-610 Series */
|
||||
0x08b7, /* EP-706A, XP-510 Series */
|
||||
0x08b8, /* PX-M740F, PX-M741F, WF-3620 Series, WF-3640 Series */
|
||||
0x08b9, /* PX-M5040F, PX-M5041F, WF-7610 Series, WF-7620 Series */
|
||||
0x08bd, /* PX-M840F, WF-5620 Series, WF-5690 Series */
|
||||
0x08be, /* WF-4630 Series, WF-4640 Series */
|
||||
0x08bf, /* PX-437A, XP-320 Series */
|
||||
0x08c0, /* PX-047A, XP-225 */
|
||||
0x08c1, /* XP-420 Series */
|
||||
0x08c3, /* PX-M650A, PX-M650F, WF-2650 Series, WF-2660 Series */
|
||||
0x08c4, /* WF-2630 Series */
|
||||
0x08c5, /* EP-977A3 */
|
||||
0x08c6, /* EP-907F, XP-820 Series, XP-860 Series */
|
||||
0x08c7, /* EP-807AB, EP-807AR, EP-807AW, XP-720 Series, XP-760 Series */
|
||||
0x08c8, /* EP-777A, XP-520 Series, XP-620 Series */
|
||||
0x08c9, /* EP-707A */
|
||||
0x08ca, /* L850 Series */
|
||||
0x08cd, /* WF-R4640 Series, WF-R5690 Series */
|
||||
0x08d0, /* PX-M350F, WF-M5690 Series */
|
||||
0x08d1, /* L360 Series */
|
||||
0x08d2, /* L365 Series, L366 Series */
|
||||
0x1102, /* PX-048A Series, XP-230 Series, XP-235 Series */
|
||||
0x1105, /* ET-2500 Series, L375 Series */
|
||||
0x110f, /* PX-M160T Series */
|
||||
0x1116, /* XP-240 243 245 247 Series, XP-427, PX-049A Series */
|
||||
0x1120, /* L380 */
|
||||
0x1121, /* ET-2650, L495 */
|
||||
0x1122, /* ET-2600 */
|
||||
0x1122, /* ET-2600 Series, ET-2610 Series, L3050 Series, L3060 Series, L395 Series, L396 Series */
|
||||
0x113d, /* XP-255 */
|
||||
0x11b, /* GT-9300UF, Perfection 2400 PHOTO */
|
||||
0x11c, /* GT-9800F, Perfection 3200 PHOTO */
|
||||
0x11e, /* GT-8300UF, Perfection 1660 PHOTO */
|
||||
0x126, /* ES-7000H, GT-15000 */
|
||||
0x128, /* GT-X700, Perfection 4870 PHOTO */
|
||||
0x129, /* ES-10000G, Expression 10000XL */
|
||||
0x12a, /* GT-X800, Perfection 4990 PHOTO */
|
||||
0x12b, /* ES-H300, GT-2500 */
|
||||
0x12c, /* GT-X900, Perfection V700 Photo, Perfection V750 Photo */
|
||||
0x135, /* GT-X970 */
|
||||
0x138, /* ES-H7200, GT-20000 */
|
||||
0x14b, /* ES-G11000, Expression 11000XL */
|
||||
0x151, /* GT-X980, Perfection V800 Photo, Perfection V850 Pro */
|
||||
0x15b, /* DS-G20000, Expression 12000XL */
|
||||
0x801, /* CC-600PX, Stylus CX5100, Stylus CX5200 */
|
||||
0x802, /* CC-570L, Stylus CX3100, Stylus CX3200 */
|
||||
0x805, /* Stylus CX6300, Stylus CX6400 */
|
||||
0x806, /* PM-A850, Stylus Photo RX600 */
|
||||
0x807, /* Stylus Photo RX500, Stylus Photo RX510 */
|
||||
0x808, /* Stylus CX5300, Stylus CX5400 */
|
||||
0x80d, /* Stylus CX4500, Stylus CX4600 */
|
||||
0x80e, /* PX-A550, Stylus CX3500, Stylus CX3600, Stylus CX3650 */
|
||||
0x80f, /* Stylus Photo RX420, Stylus Photo RX425, Stylus Photo RX430 */
|
||||
0x810, /* PM-A900, Stylus Photo RX700 */
|
||||
0x811, /* PM-A870, Stylus Photo RX620, Stylus Photo RX630 */
|
||||
0x813, /* Stylus CX6500, Stylus CX6600 */
|
||||
0x814, /* PM-A700 */
|
||||
0x815, /* AcuLaser CX11, AcuLaser CX11NF, LP-A500 */
|
||||
0x817, /* LP-M5500, LP-M5500F */
|
||||
0x818, /* Stylus CX3700, Stylus CX3800, Stylus CX3810, Stylus DX3800 */
|
||||
0x819, /* PX-A650, Stylus CX4700, Stylus CX4800, Stylus DX4800, Stylus DX4850 */
|
||||
0x81a, /* PM-A750, Stylus Photo RX520, Stylus Photo RX530 */
|
||||
0x81c, /* PM-A890, Stylus Photo RX640, Stylus Photo RX650 */
|
||||
0x81d, /* PM-A950 */
|
||||
0x81f, /* Stylus CX7700, Stylus CX7800 */
|
||||
0x820, /* Stylus CX4100, Stylus CX4200, Stylus DX4200 */
|
||||
0x827, /* PM-A820, Stylus Photo RX560, Stylus Photo RX580, Stylus Photo RX590 */
|
||||
0x828, /* PM-A970 */
|
||||
0x829, /* PM-T990 */
|
||||
0x82a, /* PM-A920 */
|
||||
0x82b, /* Stylus CX4900, Stylus CX5000, Stylus DX5000 */
|
||||
0x82e, /* PX-A720, Stylus CX5900, Stylus CX6000, Stylus DX6000 */
|
||||
0x82f, /* PX-A620, Stylus CX3900, Stylus DX4000 */
|
||||
0x830, /* ME 200, Stylus CX2800, Stylus CX2900 */
|
||||
0x833, /* LP-M5600 */
|
||||
0x834, /* LP-M6000 */
|
||||
0x835, /* AcuLaser CX21 */
|
||||
0x836, /* PM-T960 */
|
||||
0x837, /* PM-A940, Stylus Photo RX680, Stylus Photo RX685, Stylus Photo RX690 */
|
||||
0x838, /* PX-A640, Stylus CX7300, Stylus CX7400, Stylus DX7400 */
|
||||
0x839, /* PX-A740, Stylus CX8300, Stylus CX8400, Stylus DX8400 */
|
||||
0x83a, /* PX-FA700, Stylus CX9300F, Stylus CX9400Fax, Stylus DX9400F */
|
||||
0x83c, /* PM-A840, PM-A840S, Stylus Photo RX585, Stylus Photo RX595, Stylus Photo RX610 */
|
||||
0x841, /* ME 300, PX-401A, Stylus NX100, Stylus SX100, Stylus TX100 */
|
||||
0x843, /* LP-M5000 */
|
||||
0x844, /* Artisan 800, EP-901A, EP-901F, Stylus Photo PX800FW, Stylus Photo TX800FW */
|
||||
0x846, /* Artisan 700, EP-801A, Stylus Photo PX700W, Stylus Photo TX700W */
|
||||
0x847, /* ME Office 700FW, PX-601F, Stylus Office BX600FW, Stylus Office TX600FW, Stylus SX600FW, WorkForce 600 */
|
||||
0x848, /* ME Office 600F, Stylus Office BX300F, Stylus Office TX300F, Stylus NX300 Series */
|
||||
0x849, /* Stylus NX200, Stylus SX200, Stylus SX205, Stylus TX200, Stylus TX203, Stylus TX209 */
|
||||
0x84a, /* PX-501A, Stylus NX400, Stylus SX400, Stylus SX405, Stylus TX400 */
|
||||
0x84c, /* WorkForce 500 */
|
||||
0x84d, /* PX-402A, Stylus NX110 Series, Stylus SX110 Series, Stylus TX110 Series */
|
||||
0x84f, /* ME OFFICE 510, Stylus NX210 Series, Stylus SX210 Series, Stylus TX210 Series */
|
||||
0x850, /* EP-702A, Stylus Photo PX650 Series, Stylus Photo TX650 Series */
|
||||
0x851, /* Stylus NX410 Series, Stylus SX410 Series, Stylus TX410 Series */
|
||||
0x852, /* Artisan 710 Series, EP-802A, Stylus Photo PX710W Series, Stylus Photo TX710W Series */
|
||||
0x853, /* Artisan 810 Series, EP-902A, Stylus Photo PX810FW Series */
|
||||
0x854, /* ME OFFICE 650FN Series, Stylus Office BX310FN Series, Stylus Office TX510FN Series, WorkForce 310 Series */
|
||||
0x855, /* PX-602F, Stylus Office BX610FW Series, Stylus Office TX610FW Series, Stylus SX610FW Series, WorkForce 610 Series */
|
||||
0x856, /* PX-502A, Stylus NX510 Series, Stylus SX510W Series, Stylus TX550W Series */
|
||||
0x85c, /* ME 320 Series, ME 330 Series, Stylus NX125, Stylus NX127, Stylus SX125, Stylus TX120 Series */
|
||||
0x85d, /* ME OFFICE 960FWD Series, PX-603F, Stylus Office BX625FWD, Stylus Office TX620FWD Series, Stylus SX620FW Series, WorkForce 630 Series */
|
||||
0x85e, /* ME OFFICE 900WD Series, PX-503A, Stylus Office BX525WD, Stylus NX625, Stylus SX525WD, Stylus TX560WD Series, WorkForce 625 */
|
||||
0x85f, /* Stylus Office BX320FW Series, Stylus Office TX525FW, WorkForce 520 Series */
|
||||
0x860, /* Artisan 835, EP-903A, EP-903F, Stylus Photo PX820FWD Series, Stylus Photo TX820FWD Series */
|
||||
0x861, /* Artisan 725, EP-803A, EP-803AW, Stylus Photo PX720WD Series, Stylus Photo TX720WD Series */
|
||||
0x862, /* EP-703A, Stylus Photo PX660 Series */
|
||||
0x863, /* ME OFFICE 620F Series, Stylus Office BX305F, Stylus Office BX305FW, Stylus Office TX320F Series, WorkForce 320 Series */
|
||||
0x864, /* ME OFFICE 560W Series, Stylus NX420 Series, Stylus SX420W Series, Stylus TX420W Series */
|
||||
0x865, /* ME OFFICE 520 Series, Stylus NX220 Series, Stylus SX218, Stylus TX220 Series */
|
||||
0x866, /* AcuLaser MX20DN, AcuLaser MX20DNF, AcuLaser MX21DNF */
|
||||
0x869, /* PX-1600F, WF-7510 Series */
|
||||
0x86a, /* PX-673F, Stylus Office BX925FWD, WorkForce 840 Series */
|
||||
0x870, /* Stylus Office BX305FW Plus, WorkForce 435 */
|
||||
0x871, /* K200 Series */
|
||||
0x872, /* K300 Series, WorkForce K301 */
|
||||
0x873, /* L200 Series */
|
||||
0x878, /* Artisan 635, EP-704A */
|
||||
0x879, /* Artisan 837, EP-904A, EP-904F, Stylus Photo PX830FWD Series */
|
||||
0x87b, /* Artisan 730 Series, EP-804A, EP-804AR, EP-804AW, Stylus Photo PX730WD Series, Stylus Photo TX730WD Series */
|
||||
0x87c, /* PX-1700F, WF-7520 Series */
|
||||
0x87d, /* PX-B750F, WP-4511, WP-4515, WP-4521, WP-4525, WP-4530 Series, WP-4540 Series */
|
||||
0x87e, /* WP-4590 Series */
|
||||
0x87f, /* PX-403A */
|
||||
0x880, /* ME OFFICE 570W Series, PX-434A, Stylus NX330 Series, Stylus SX430W Series, Stylus TX430W Series */
|
||||
0x881, /* ME OFFICE 535, PX-404A, Stylus SX230 Series, Stylus TX235 */
|
||||
0x883, /* ME 340 Series, Stylus NX130 Series, Stylus SX130 Series, Stylus TX130 Series */
|
||||
0x884, /* Stylus NX430W Series, Stylus SX440W Series, Stylus TX435W */
|
||||
0x885, /* Stylus NX230 Series, Stylus SX235W, Stylus TX230W Series */
|
||||
0x88d, /* Epson ME 350 */
|
||||
0x88f, /* Stylus Office BX635FWD, WorkForce 645 */
|
||||
0x890, /* ME OFFICE 940FW Series, Stylus Office BX630FW Series, WorkForce 545 */
|
||||
0x891, /* PX-504A, Stylus Office BX535WD, Stylus NX530 Series, Stylus NX635, Stylus SX535WD */
|
||||
0x892, /* Stylus Office BX935FWD, WorkForce 845 */
|
||||
0x893, /* EP-774A */
|
||||
0x894, /* LP-M5300 Series */
|
||||
0x895, /* PX-045A, XP-100 Series */
|
||||
0x896, /* ME-301, XP-200 Series */
|
||||
0x897, /* ME-303, PX-405A */
|
||||
0x898, /* ME-401, PX-435A, XP-300 Series, XP-400 Series */
|
||||
0x899, /* PX-605F, PX-675F, WF-3520 Series, WF-3530 Series, WF-3540 Series */
|
||||
0x89a, /* EP-905F, XP-850 Series */
|
||||
0x89b, /* EP-905A, XP-800 Series */
|
||||
0x89c, /* EP-805A, EP-805AR, EP-805AW, XP-750 Series */
|
||||
0x89d, /* XP-700 Series */
|
||||
0x89e, /* EP-775A, EP-775AW, XP-600 Series */
|
||||
0x89f, /* EP-705A */
|
||||
0x8a0, /* ME-101 */
|
||||
0x8a1, /* L210 Series, L350, L351 */
|
||||
0x8a5, /* PX-505F, WF-2510 Series */
|
||||
0x8a6, /* PX-535F, WF-2520 Series, WF-2530 Series, WF-2540 Series */
|
||||
0x8a7, /* WP-M4525, WP-M4521, PX-K751F, WP-M4595 */
|
||||
0x8a8, /* L355, L358 */
|
||||
0x8a9, /* L550 Series */
|
||||
0x8aa, /* M200 Series */
|
||||
0x8ab, /* WF-M1560 Series */
|
||||
0x8ac, /* AL-MX300DN Series, AL-MX300DNF Series */
|
||||
0x8ad, /* LP-M8040, LP-M8040A, LP-M8040F */
|
||||
0x8ae, /* PX-046A, XP-211, XP-212, XP-215 */
|
||||
0x8af, /* PX-436A, XP-310 Series */
|
||||
0x8b0, /* XP-410 Series */
|
||||
0x8b3, /* EP-976A3, XP-950 Series */
|
||||
0x8b4, /* EP-906F, XP-810 Series */
|
||||
0x8b5, /* EP-806AB, EP-806AR, EP-806AW, XP-710 Series */
|
||||
0x8b6, /* EP-776AB, EP-776AW, XP-610 Series */
|
||||
0x8b7, /* EP-706A, XP-510 Series */
|
||||
0x8b8, /* PX-M740F, PX-M741F, WF-3620 Series, WF-3640 Series */
|
||||
0x8b9, /* PX-M5040F, PX-M5041F, WF-7610 Series, WF-7620 Series */
|
||||
0x8bd, /* PX-M840F, WF-5620 Series, WF-5690 Series */
|
||||
0x8be, /* WF-4630 Series, WF-4640 Series */
|
||||
0x8bf, /* PX-437A, XP-320 Series */
|
||||
0x8c0, /* PX-047A, XP-225 */
|
||||
0x8c1, /* XP-420 Series */
|
||||
0x8c3, /* PX-M650A, PX-M650F, WF-2650 Series, WF-2660 Series */
|
||||
0x8c4, /* WF-2630 Series */
|
||||
0x8c5, /* EP-977A3 */
|
||||
0x8c6, /* EP-907F, XP-820 Series, XP-860 Series */
|
||||
0x8c7, /* EP-807AB, EP-807AR, EP-807AW, XP-720 Series, XP-760 Series */
|
||||
0x8c8, /* EP-777A, XP-520 Series, XP-620 Series */
|
||||
0x8c9, /* EP-707A */
|
||||
0x8ca, /* L850 Series */
|
||||
0x8cd, /* WF-R4640 Series, WF-R5690 Series */
|
||||
0x8d0, /* PX-M350F, WF-M5690 Series */
|
||||
0 /* last entry - this is used for devices that are specified
|
||||
in the config file as "usb <vendor> <product>" */
|
||||
0x113e, /* XP-452 455 Series */
|
||||
0x1141, /* L3100 Series */
|
||||
0x1142, /* L3110 Series */
|
||||
0x1188, /* L3210 Series */
|
||||
0x1189, /* L3200 Series */
|
||||
0 /* last entry - this is used for devices that are specified
|
||||
in the config file as "usb <vendor> <product>" */
|
||||
};
|
||||
|
||||
int
|
||||
sanei_epson_getNumberOfUSBProductIds (void)
|
||||
sanei_epson_getNumberOfUSBProductIds(void)
|
||||
{
|
||||
return sizeof (sanei_epson_usb_product_ids) / sizeof (SANE_Word);
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@ SANE_Status
|
|||
sanei_epson_scsi_sense_handler (int scsi_fd, u_char * result, void *arg)
|
||||
{
|
||||
/* to get rid of warnings */
|
||||
scsi_fd = scsi_fd;
|
||||
arg = arg;
|
||||
(void) scsi_fd;
|
||||
(void) arg;
|
||||
|
||||
if (result[0] && result[0] != 0x70)
|
||||
{
|
||||
|
|
|
@ -134,6 +134,7 @@ static SANE_Status esci2_cmd(epsonds_scanner* s,
|
|||
SANE_Status status;
|
||||
unsigned int more;
|
||||
char header[13], rbuf[64]; /* add one more byte for header buffer to correct buffer overflow issue,*/
|
||||
char *buf;
|
||||
|
||||
DBG(8, "%s: %4s len %lu, payload len: %lu\n", __func__, cmd, len, plen);
|
||||
|
||||
|
@ -151,6 +152,21 @@ static SANE_Status esci2_cmd(epsonds_scanner* s,
|
|||
|
||||
// send RequestBlock, request immediate response if there's no payload
|
||||
status = eds_txrx(s, header, len, rbuf, (plen > 0) ? 0 : 64);
|
||||
|
||||
/* pointer to the token's value */
|
||||
buf = rbuf + 12;
|
||||
/* nrd / nrdBUSY */
|
||||
DBG(8, "buf = %s\n",buf);
|
||||
if (strncmp("#nrd", buf, 4) == 0) {
|
||||
buf += 4;
|
||||
DBG(8, "buf = %s\n",buf);
|
||||
if (strncmp("BUSY", buf, 4) == 0) {
|
||||
DBG(8, "device busy\n");
|
||||
DBG(8, "SANE_STATUS:%d\n", SANE_STATUS_DEVICE_BUSY);
|
||||
return SANE_STATUS_DEVICE_BUSY;
|
||||
}
|
||||
}
|
||||
|
||||
if (status != SANE_STATUS_GOOD) {
|
||||
return status;
|
||||
}
|
||||
|
@ -227,6 +243,21 @@ SANE_Status esci2_fin(epsonds_scanner *s)
|
|||
DBG(5, "%s\n", __func__);
|
||||
|
||||
status = esci2_cmd_simple(s, "FIN x0000000", NULL);
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
|
||||
if(status == SANE_STATUS_DEVICE_BUSY || status == SANE_STATUS_IO_ERROR) {
|
||||
status = esci2_cmd_simple(s, "FIN x0000000", NULL);
|
||||
}
|
||||
else {
|
||||
DBG(1, "break\n");
|
||||
break;
|
||||
}
|
||||
DBG(1, "sleep(5)\n");
|
||||
sleep(5);
|
||||
|
||||
}
|
||||
|
||||
s->locked = 0;
|
||||
return status;
|
||||
}
|
||||
|
@ -264,13 +295,13 @@ static char *decode_binary(char *buf, int len)
|
|||
|
||||
memcpy(tmp, buf, 4);
|
||||
tmp[4] = '\0';
|
||||
len -= 4;
|
||||
|
||||
if (buf[0] != 'h')
|
||||
return NULL;
|
||||
|
||||
hl = strtol(tmp + 1, NULL, 16);
|
||||
if (hl > len) hl = len;
|
||||
if (hl > len)
|
||||
hl = len;
|
||||
if (hl) {
|
||||
|
||||
char *v = malloc(hl + 1);
|
||||
|
@ -313,9 +344,6 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
|
|||
epsonds_scanner *s = (epsonds_scanner *)userdata;
|
||||
char *value;
|
||||
|
||||
if (DBG_LEVEL >= 11) {
|
||||
debug_token(DBG_LEVEL, __func__, token, len);
|
||||
}
|
||||
|
||||
/* pointer to the token's value */
|
||||
value = token + 3;
|
||||
|
@ -333,7 +361,6 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
|
|||
s->hw->model = decode_string(value, len);
|
||||
s->hw->sane.model = s->hw->model;
|
||||
DBG(1, " product: %s\n", s->hw->model);
|
||||
/* we will free the string later */
|
||||
}
|
||||
|
||||
if (strncmp("VER", token, 3) == 0) {
|
||||
|
@ -421,6 +448,7 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
|
|||
int max = decode_value(value + 4 + 8, 8);
|
||||
|
||||
DBG(1, " ADF: area %dx%d @ 100dpi\n", min, max);
|
||||
eds_set_adf_area(s->hw, min, max, 100);
|
||||
}
|
||||
|
||||
if (strncmp("AMIN", value, 4) == 0) {
|
||||
|
@ -437,11 +465,40 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
|
|||
int max = decode_value(value + 4 + 8, 8);
|
||||
|
||||
DBG(1, " ADF: max %dx%d @ 100dpi\n", min, max);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (len == 16) {
|
||||
|
||||
if (strncmp("AREA", value, 4) == 0) {
|
||||
|
||||
int min = decode_value(value + 4, 4);
|
||||
int max = decode_value(value + 4 + 4, 8);
|
||||
|
||||
DBG(1, " ADF: area %dx%d @ 100dpi\n", min, max);
|
||||
|
||||
eds_set_adf_area(s->hw, min, max, 100);
|
||||
}
|
||||
|
||||
if (strncmp("AMAX", value, 4) == 0) {
|
||||
|
||||
// d
|
||||
int min = decode_value(value + 4, 4);
|
||||
// i
|
||||
int max = decode_value(value + 4 + 4, 8);
|
||||
|
||||
DBG(1, " ADF: max %dx%d @ 100dpi\n", min, max);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (len == 12) {
|
||||
|
||||
/* RESOi0000600 */
|
||||
|
@ -483,6 +540,22 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (len == 16) {
|
||||
|
||||
/* AREAi0000850i0001400 */
|
||||
if (strncmp("AREA", value, 4) == 0) {
|
||||
//d
|
||||
int min = decode_value(value + 4, 4);
|
||||
//i
|
||||
int max = decode_value(value + 4 + 4, 8);
|
||||
|
||||
DBG(1, " FB: area %dx%d @ 100dpi\n", min, max);
|
||||
|
||||
eds_set_fbf_area(s->hw, min, max, 100);
|
||||
}
|
||||
}
|
||||
|
||||
if (len == 8) {
|
||||
|
||||
if (strncmp("ALGNLEFT", value, len) == 0) {
|
||||
|
@ -602,6 +675,7 @@ static SANE_Status capa_cb(void *userdata, char *token, int len)
|
|||
|
||||
if (strncmp("ADFCRP ", token, 3 + 4) == 0) {
|
||||
DBG(1, " ADF: image cropping\n");
|
||||
s->hw->adf_has_crp = 1;
|
||||
}
|
||||
|
||||
if (strncmp("ADFFAST", token, 3 + 4) == 0) {
|
||||
|
@ -636,6 +710,23 @@ static SANE_Status capa_cb(void *userdata, char *token, int len)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (strncmp("COLLIST", token, 3 + 4) == 0)
|
||||
{
|
||||
char *p = token + 3 + 4;
|
||||
int count = (len - 4);
|
||||
int readBytes = 0;
|
||||
s->hw->has_mono = 0;
|
||||
while (readBytes < count) {
|
||||
if (strncmp(p, "M001", 4) == 0)
|
||||
{
|
||||
s->hw->has_mono = 1;
|
||||
}
|
||||
readBytes+=4;
|
||||
p+=4;
|
||||
}
|
||||
}
|
||||
|
||||
/* RSMRANGi0000050i0000600 */
|
||||
|
||||
if (strncmp("RSMRANG", token, 3 + 4) == 0) {
|
||||
|
@ -659,17 +750,24 @@ static SANE_Status capa_cb(void *userdata, char *token, int len)
|
|||
|
||||
char *p = token + 3 + 4;
|
||||
|
||||
if (p[0] == 'i') {
|
||||
|
||||
int i;
|
||||
int count = (len - 4) / 8;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
int count = (len - 4);
|
||||
int readBytes = 0;
|
||||
|
||||
while (readBytes < count) {
|
||||
if(*p == 'i')
|
||||
{
|
||||
eds_add_resolution(s->hw, decode_value(p, 8));
|
||||
p += 8;
|
||||
readBytes += 8;
|
||||
}else if(*p == 'd')
|
||||
{
|
||||
eds_add_resolution(s->hw, decode_value(p, 4));
|
||||
p += 4;
|
||||
readBytes +=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
|
@ -684,16 +782,26 @@ SANE_Status esci2_capa(epsonds_scanner *s)
|
|||
|
||||
static SANE_Status stat_cb(void *userdata, char *token, int len)
|
||||
{
|
||||
/*
|
||||
epsonds_scanner *s = (epsonds_scanner *)userdata;
|
||||
char *value = token + 3;
|
||||
*/
|
||||
userdata = userdata;
|
||||
|
||||
(void) userdata;
|
||||
|
||||
if (DBG_LEVEL >= 11) {
|
||||
debug_token(DBG_LEVEL, __func__, token, len);
|
||||
}
|
||||
|
||||
if (strncmp("ERR", token, 3) == 0) {
|
||||
if (strncmp("ADF PE ", value, len) == 0) {
|
||||
DBG(1, " PE : paper empty\n");
|
||||
return SANE_STATUS_NO_DOCS;
|
||||
}
|
||||
|
||||
if (strncmp("ADF OPN", value, len) == 0) {
|
||||
DBG(1, " conver open\n");
|
||||
return SANE_STATUS_COVER_OPEN;
|
||||
}
|
||||
}
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
|
@ -708,7 +816,7 @@ static SANE_Status resa_cb(void *userdata, char *token, int len)
|
|||
{
|
||||
/* epsonds_scanner *s = (epsonds_scanner *)userdata; */
|
||||
|
||||
userdata = userdata;
|
||||
(void) userdata;
|
||||
|
||||
if (DBG_LEVEL >= 11) {
|
||||
debug_token(DBG_LEVEL, __func__, token, len);
|
||||
|
@ -730,7 +838,7 @@ static SANE_Status para_cb(void *userdata, char *token, int len)
|
|||
debug_token(DBG_LEVEL, __func__, token, len);
|
||||
}
|
||||
|
||||
userdata = userdata;
|
||||
(void) userdata;
|
||||
|
||||
if (strncmp("par", token, 3) == 0) {
|
||||
if (strncmp("FAIL", token + 3, 4) == 0) {
|
||||
|
@ -742,10 +850,10 @@ static SANE_Status para_cb(void *userdata, char *token, int len)
|
|||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
SANE_Status esci2_para(epsonds_scanner *s, char *parameters)
|
||||
SANE_Status esci2_para(epsonds_scanner *s, char *parameters, int len)
|
||||
{
|
||||
DBG(8, "%s: %s\n", __func__, parameters);
|
||||
return esci2_cmd(s, "PARAx0000000", 12, parameters, strlen(parameters), NULL, ¶_cb);
|
||||
return esci2_cmd(s, "PARAx0000000", 12, parameters, len, NULL, ¶_cb);
|
||||
}
|
||||
|
||||
SANE_Status esci2_mech(epsonds_scanner *s, char *parameters)
|
||||
|
@ -784,12 +892,105 @@ static SANE_Status img_cb(void *userdata, char *token, int len)
|
|||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
if (len == 12 && strncmp("pst", token, 3) == 0) {
|
||||
|
||||
s->dummy = decode_value(token + 3 + 4, 4);
|
||||
|
||||
DBG(10, "%s: pst width: %d, height: %d, dummy: %d\n",
|
||||
__func__,
|
||||
decode_value(token + 3, 4),
|
||||
decode_value(token + 3 + 4 + 4, 4),
|
||||
s->dummy);
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
if (len == 16 && strncmp("pst", token, 3) == 0) {
|
||||
|
||||
s->dummy = decode_value(token + 3 + 4, 4);
|
||||
|
||||
DBG(10, "%s: pst width: %d, height: %d, dummy: %d\n",
|
||||
__func__,
|
||||
decode_value(token + 3, 4),
|
||||
decode_value(token + 3 + 4 + 4, 8),
|
||||
s->dummy);
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
if (len == 20 && strncmp("pst", token, 3) == 0) {
|
||||
|
||||
s->dummy = decode_value(token + 3 + 8, 4);
|
||||
|
||||
DBG(10, "%s: pst width: %d, height: %d, dummy: %d\n",
|
||||
__func__,
|
||||
decode_value(token + 3, 8),
|
||||
decode_value(token + 3 + 8 + 4, 8),
|
||||
s->dummy);
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
|
||||
// i0001696i0002347
|
||||
if (len == 16 && strncmp("pen", token, 3) == 0) {
|
||||
DBG(10, "%s: page end\n", __func__);
|
||||
s->eof = 1;
|
||||
if (s->isflatbedScan)
|
||||
{
|
||||
s->scanning = 0;
|
||||
}
|
||||
DBG(10, "%s: pen width: %d, height: %d, dummy: %d\n",
|
||||
__func__,
|
||||
decode_value(token + 3, 8),
|
||||
decode_value(token + 3 + 8, 8),
|
||||
s->dummy);
|
||||
s->width_temp = decode_value(token + 3, 8);
|
||||
s->height_temp = decode_value(token + 3 + 8, 8);
|
||||
return SANE_STATUS_EOF;
|
||||
}
|
||||
|
||||
// d696i0002347
|
||||
if (len == 12 && strncmp("pen", token, 3) == 0) {
|
||||
DBG(10, "%s: page end\n", __func__);
|
||||
s->eof = 1;
|
||||
if (s->isflatbedScan)
|
||||
{
|
||||
s->scanning = 0;
|
||||
}
|
||||
|
||||
DBG(10, "%s: pen width: %d, height: %d, dummy: %d\n",
|
||||
__func__,
|
||||
decode_value(token + 3, 4),
|
||||
decode_value(token + 3 + 4, 8),
|
||||
s->dummy);
|
||||
|
||||
s->width_temp = decode_value(token + 3, 4);
|
||||
s->height_temp = decode_value(token + 3 + 4, 8);
|
||||
return SANE_STATUS_EOF;
|
||||
}
|
||||
|
||||
// d696d2347
|
||||
if (len == 8 && strncmp("pen", token, 3) == 0) {
|
||||
DBG(10, "%s: page end\n", __func__);
|
||||
s->eof = 1;
|
||||
if (s->isflatbedScan)
|
||||
{
|
||||
s->scanning = 0;
|
||||
}
|
||||
DBG(10, "%s: pen width: %d, height: %d, dummy: %d\n",
|
||||
__func__,
|
||||
decode_value(token + 3, 4),
|
||||
decode_value(token + 3 + 4, 4),
|
||||
s->dummy);
|
||||
|
||||
s->width_temp = decode_value(token + 3, 4);
|
||||
s->height_temp = decode_value(token + 3 + 4, 4);
|
||||
|
||||
return SANE_STATUS_EOF;
|
||||
}
|
||||
|
||||
|
||||
/* typIMGA or typIMGB */
|
||||
if (len == 4 && strncmp("typ", token, 3) == 0) {
|
||||
|
||||
|
@ -807,6 +1008,7 @@ static SANE_Status img_cb(void *userdata, char *token, int len)
|
|||
char *cause = token + 3 + 4; /* OPN, PJ, PE, ERR, LTF, LOCK, DFED, DTCL, AUT, PERM */
|
||||
|
||||
s->scanning = 0;
|
||||
s->scanEnd = 1;
|
||||
|
||||
DBG(1, "%s: error on option %3.3s, cause %4.4s\n",
|
||||
__func__, option, cause);
|
||||
|
@ -831,6 +1033,8 @@ static SANE_Status img_cb(void *userdata, char *token, int len)
|
|||
}
|
||||
|
||||
if (len == 4 && strncmp("lftd000", token, 3 + 4) == 0) {
|
||||
DBG(1, "%s:lft ok\n", __func__);
|
||||
s->scanEnd = 1;
|
||||
s->scanning = 0;
|
||||
}
|
||||
|
||||
|
@ -846,6 +1050,8 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
|
|||
unsigned int more;
|
||||
ssize_t read;
|
||||
|
||||
DBG(15, "esci2_img start\n");
|
||||
|
||||
*length = 0;
|
||||
|
||||
if (s->canceling)
|
||||
|
@ -856,6 +1062,7 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
|
|||
if (status != SANE_STATUS_GOOD) {
|
||||
return status;
|
||||
}
|
||||
DBG(15, "request img OK\n");
|
||||
|
||||
/* receive DataHeaderBlock */
|
||||
memset(s->buf, 0x00, 64);
|
||||
|
@ -863,6 +1070,7 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
|
|||
if (status != SANE_STATUS_GOOD) {
|
||||
return status;
|
||||
}
|
||||
DBG(15, "receive img OK\n");
|
||||
|
||||
/* check if we need to read any image data */
|
||||
more = 0;
|
||||
|
@ -873,6 +1081,17 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
|
|||
/* this handles eof and errors */
|
||||
parse_status = esci2_parse_block((char *)s->buf + 12, 64 - 12, s, &img_cb);
|
||||
|
||||
if (s->backside)
|
||||
{
|
||||
s->width_back = s->width_temp;
|
||||
s->height_back = s->height_temp;
|
||||
}else{
|
||||
s->width_front = s->width_temp;
|
||||
s->height_front = s->height_temp;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* no more data? return using the status of the esci2_parse_block
|
||||
* call, which might hold other error conditions.
|
||||
*/
|
||||
|
@ -884,7 +1103,6 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
|
|||
if (more > s->bsz) {
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
|
||||
/* ALWAYS read image data */
|
||||
if (s->hw->connection == SANE_EPSONDS_NET) {
|
||||
epsonds_net_request_read(s, more);
|
||||
|
|
|
@ -20,7 +20,7 @@ SANE_Status esci2_can(epsonds_scanner *s);
|
|||
SANE_Status esci2_capa(epsonds_scanner *s);
|
||||
SANE_Status esci2_resa(epsonds_scanner *s);
|
||||
SANE_Status esci2_stat(epsonds_scanner *s);
|
||||
SANE_Status esci2_para(epsonds_scanner *s, char *parameters);
|
||||
SANE_Status esci2_para(epsonds_scanner *s, char *parameters, int len);
|
||||
SANE_Status esci2_mech(epsonds_scanner *s, char *parameters);
|
||||
SANE_Status esci2_trdt(epsonds_scanner *s);
|
||||
SANE_Status esci2_img(struct epsonds_scanner *s, SANE_Int *length) ;
|
||||
|
|
|
@ -20,19 +20,39 @@
|
|||
#include "epsonds.h"
|
||||
#include "epsonds-jpeg.h"
|
||||
#include "epsonds-ops.h"
|
||||
#include <setjmp.h>
|
||||
|
||||
#define min(A,B) (((A)<(B)) ? (A) : (B))
|
||||
struct my_error_mgr {
|
||||
struct jpeg_error_mgr pub;
|
||||
jmp_buf setjmp_buffer;
|
||||
};
|
||||
|
||||
typedef struct my_error_mgr * my_error_ptr;
|
||||
|
||||
|
||||
METHODDEF(void) my_error_exit (j_common_ptr cinfo)
|
||||
{
|
||||
|
||||
char buffer[JMSG_LENGTH_MAX];
|
||||
(*cinfo->err->format_message) (cinfo, buffer);
|
||||
|
||||
DBG(10,"Jpeg decode error [%s]", buffer);
|
||||
}
|
||||
|
||||
LOCAL(struct jpeg_error_mgr *) jpeg_custom_error (struct my_error_mgr * err)
|
||||
{
|
||||
|
||||
struct jpeg_error_mgr* pRet = jpeg_std_error(&(err->pub));
|
||||
err->pub.error_exit = my_error_exit;
|
||||
|
||||
return pRet;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct jpeg_source_mgr pub;
|
||||
|
||||
epsonds_scanner *s;
|
||||
JOCTET *buffer;
|
||||
|
||||
SANE_Byte *linebuffer;
|
||||
SANE_Int linebuffer_size;
|
||||
SANE_Int linebuffer_index;
|
||||
int length;
|
||||
}
|
||||
epsonds_src_mgr;
|
||||
|
||||
|
@ -50,22 +70,11 @@ METHODDEF(boolean)
|
|||
jpeg_fill_input_buffer(j_decompress_ptr cinfo)
|
||||
{
|
||||
epsonds_src_mgr *src = (epsonds_src_mgr *)cinfo->src;
|
||||
int avail, size;
|
||||
|
||||
/* read from the scanner or the ring buffer */
|
||||
|
||||
avail = eds_ring_avail(src->s->current);
|
||||
if (avail == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* read from scanner if no data? */
|
||||
size = min(1024, avail);
|
||||
|
||||
eds_ring_read(src->s->current, src->buffer, size);
|
||||
|
||||
src->pub.next_input_byte = src->buffer;
|
||||
src->pub.bytes_in_buffer = size;
|
||||
src->pub.bytes_in_buffer = src->length;
|
||||
DBG(18, "reading from ring buffer, %d left\n", src->length);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -87,140 +96,140 @@ jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
|||
}
|
||||
}
|
||||
|
||||
SANE_Status
|
||||
eds_jpeg_start(epsonds_scanner *s)
|
||||
|
||||
void eds_decode_jpeg(epsonds_scanner*s, SANE_Byte *data, SANE_Int size, ring_buffer* ringBuffer, SANE_Int isBackSide, SANE_Int needToConvertBW)
|
||||
{
|
||||
epsonds_src_mgr *src;
|
||||
struct jpeg_decompress_struct jpeg_cinfo;
|
||||
struct my_error_mgr jpeg_err;
|
||||
|
||||
s->jpeg_cinfo.err = jpeg_std_error(&s->jpeg_err);
|
||||
{
|
||||
epsonds_src_mgr *src;
|
||||
|
||||
jpeg_create_decompress(&s->jpeg_cinfo);
|
||||
jpeg_cinfo.err = jpeg_custom_error(&jpeg_err);
|
||||
|
||||
s->jpeg_cinfo.src = (struct jpeg_source_mgr *)(*s->jpeg_cinfo.mem->alloc_small)((j_common_ptr)&s->jpeg_cinfo,
|
||||
JPOOL_PERMANENT, sizeof(epsonds_src_mgr));
|
||||
jpeg_create_decompress(&jpeg_cinfo);
|
||||
|
||||
memset(s->jpeg_cinfo.src, 0x00, sizeof(epsonds_src_mgr));
|
||||
jpeg_cinfo.src = (struct jpeg_source_mgr *)(*jpeg_cinfo.mem->alloc_small)((j_common_ptr)&jpeg_cinfo,
|
||||
JPOOL_PERMANENT, sizeof(epsonds_src_mgr));
|
||||
|
||||
src = (epsonds_src_mgr *)s->jpeg_cinfo.src;
|
||||
src->s = s;
|
||||
memset(jpeg_cinfo.src, 0x00, sizeof(epsonds_src_mgr));
|
||||
;
|
||||
src = (epsonds_src_mgr *)jpeg_cinfo.src;
|
||||
src->pub.init_source = jpeg_init_source;
|
||||
src->pub.fill_input_buffer = jpeg_fill_input_buffer;
|
||||
src->pub.skip_input_data = jpeg_skip_input_data;
|
||||
src->pub.resync_to_restart = jpeg_resync_to_restart;
|
||||
src->pub.term_source = jpeg_term_source;
|
||||
src->pub.bytes_in_buffer = 0;
|
||||
src->pub.next_input_byte = NULL;
|
||||
src->buffer = (JOCTET*)data;
|
||||
src->length = size;
|
||||
}
|
||||
{
|
||||
if (jpeg_read_header(&jpeg_cinfo, TRUE)) {
|
||||
|
||||
src->buffer = (JOCTET *)(*s->jpeg_cinfo.mem->alloc_small)((j_common_ptr)&s->jpeg_cinfo,
|
||||
JPOOL_PERMANENT,
|
||||
1024 * sizeof(JOCTET));
|
||||
if (jpeg_start_decompress(&jpeg_cinfo)) {
|
||||
|
||||
src->pub.init_source = jpeg_init_source;
|
||||
src->pub.fill_input_buffer = jpeg_fill_input_buffer;
|
||||
src->pub.skip_input_data = jpeg_skip_input_data;
|
||||
src->pub.resync_to_restart = jpeg_resync_to_restart;
|
||||
src->pub.term_source = jpeg_term_source;
|
||||
src->pub.bytes_in_buffer = 0;
|
||||
src->pub.next_input_byte = NULL;
|
||||
|
||||
s->jpeg_header_seen = 0;
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
SANE_Status
|
||||
eds_jpeg_read_header(epsonds_scanner *s)
|
||||
{
|
||||
epsonds_src_mgr *src = (epsonds_src_mgr *)s->jpeg_cinfo.src;
|
||||
|
||||
if (jpeg_read_header(&s->jpeg_cinfo, TRUE)) {
|
||||
|
||||
s->jdst = sanei_jpeg_jinit_write_ppm(&s->jpeg_cinfo);
|
||||
|
||||
if (jpeg_start_decompress(&s->jpeg_cinfo)) {
|
||||
|
||||
int size;
|
||||
|
||||
DBG(3, "%s: w: %d, h: %d, components: %d\n",
|
||||
DBG(10,"%s: w: %d, h: %d, components: %d\n",
|
||||
__func__,
|
||||
s->jpeg_cinfo.output_width, s->jpeg_cinfo.output_height,
|
||||
s->jpeg_cinfo.output_components);
|
||||
|
||||
size = s->jpeg_cinfo.output_width * s->jpeg_cinfo.output_components * 1;
|
||||
|
||||
src->linebuffer = (*s->jpeg_cinfo.mem->alloc_large)((j_common_ptr)&s->jpeg_cinfo,
|
||||
JPOOL_PERMANENT, size);
|
||||
|
||||
src->linebuffer_size = 0;
|
||||
src->linebuffer_index = 0;
|
||||
|
||||
s->jpeg_header_seen = 1;
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
|
||||
} else {
|
||||
DBG(0, "%s: decompression failed\n", __func__);
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
jpeg_cinfo.output_width, jpeg_cinfo.output_height,
|
||||
jpeg_cinfo.output_components);
|
||||
}
|
||||
} else {
|
||||
DBG(0, "%s: cannot read JPEG header\n", __func__);
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
eds_jpeg_finish(epsonds_scanner *s)
|
||||
{
|
||||
jpeg_destroy_decompress(&s->jpeg_cinfo);
|
||||
}
|
||||
|
||||
void
|
||||
eds_jpeg_read(SANE_Handle handle, SANE_Byte *data,
|
||||
SANE_Int max_length, SANE_Int *length)
|
||||
{
|
||||
epsonds_scanner *s = handle;
|
||||
|
||||
struct jpeg_decompress_struct cinfo = s->jpeg_cinfo;
|
||||
epsonds_src_mgr *src = (epsonds_src_mgr *)s->jpeg_cinfo.src;
|
||||
|
||||
int l;
|
||||
|
||||
*length = 0;
|
||||
|
||||
/* copy from line buffer if available */
|
||||
if (src->linebuffer_size && src->linebuffer_index < src->linebuffer_size) {
|
||||
|
||||
*length = src->linebuffer_size - src->linebuffer_index;
|
||||
|
||||
if (*length > max_length)
|
||||
*length = max_length;
|
||||
|
||||
memcpy(data, src->linebuffer + src->linebuffer_index, *length);
|
||||
src->linebuffer_index += *length;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (cinfo.output_scanline >= cinfo.output_height) {
|
||||
*length = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* scanlines of decompressed data will be in s->jdst->buffer
|
||||
* only one line at time is supported
|
||||
*/
|
||||
|
||||
l = jpeg_read_scanlines(&cinfo, s->jdst->buffer, 1);
|
||||
if (l == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* from s->jdst->buffer to linebuffer
|
||||
* linebuffer holds width * bytesperpixel
|
||||
*/
|
||||
|
||||
(*s->jdst->put_pixel_rows)(&cinfo, s->jdst, 1, (char *)src->linebuffer);
|
||||
|
||||
*length = cinfo.output_width * cinfo.output_components * 1;
|
||||
src->linebuffer_size = *length;
|
||||
src->linebuffer_index = 0;
|
||||
|
||||
if (*length > max_length)
|
||||
*length = max_length;
|
||||
|
||||
memcpy(data, src->linebuffer + src->linebuffer_index, *length);
|
||||
src->linebuffer_index += *length;
|
||||
}
|
||||
}
|
||||
{
|
||||
int sum = 0;
|
||||
int bufSize = jpeg_cinfo.output_width * jpeg_cinfo.output_components;
|
||||
|
||||
int monoBufSize = (jpeg_cinfo.output_width + 7)/8;
|
||||
|
||||
JSAMPARRAY scanlines = (jpeg_cinfo.mem->alloc_sarray)((j_common_ptr)&jpeg_cinfo, JPOOL_IMAGE, bufSize, 1);
|
||||
while (jpeg_cinfo.output_scanline < jpeg_cinfo.output_height) {
|
||||
int l = jpeg_read_scanlines(&jpeg_cinfo, scanlines, 1);
|
||||
if (l == 0) {
|
||||
break;
|
||||
}
|
||||
sum += l;
|
||||
|
||||
if (needToConvertBW)
|
||||
{
|
||||
SANE_Byte* bytes = scanlines[0];
|
||||
|
||||
SANE_Int imgPos = 0;
|
||||
|
||||
for (int i = 0; i < monoBufSize; i++)
|
||||
{
|
||||
SANE_Byte outByte = 0;
|
||||
|
||||
for(SANE_Int bitIndex = 0; bitIndex < 8 && imgPos < bufSize; bitIndex++) {
|
||||
//DBG(10,"bytes[imgPos] = %d\n", bytes[imgPos]);
|
||||
|
||||
if(bytes[imgPos] >= 110) {
|
||||
SANE_Byte bit = 7 - (bitIndex % 8);
|
||||
outByte |= (1<< bit);
|
||||
}
|
||||
imgPos += 1;
|
||||
}
|
||||
//DBG(10,"outByte = %d\n", outByte);
|
||||
eds_ring_write(ringBuffer, &outByte, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eds_ring_write(ringBuffer, scanlines[0], bufSize);
|
||||
}
|
||||
|
||||
// decode until valida data
|
||||
if (isBackSide)
|
||||
{
|
||||
if (sum >= s->height_back)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}else
|
||||
{
|
||||
if (sum >= s->height_front)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
DBG(10,"decodded lines = %d\n", sum);
|
||||
|
||||
// abandon unncessary data
|
||||
if ((JDIMENSION)sum < jpeg_cinfo.output_height)
|
||||
{
|
||||
// unncessary data
|
||||
while(1)
|
||||
{
|
||||
int l = jpeg_read_scanlines(&jpeg_cinfo, scanlines, 1);
|
||||
if (l == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if not auto crop mode padding to lines
|
||||
if (s->val[OPT_ADF_CRP].w == 0)
|
||||
{
|
||||
unsigned char* padding = malloc(s->params.bytes_per_line);
|
||||
memset(padding, 255, s->params.bytes_per_line);
|
||||
DBG(10,"padding data lines = %d to %d pa \n", sum, s->params.lines);
|
||||
|
||||
while(sum < s->params.lines)
|
||||
{
|
||||
eds_ring_write(ringBuffer, padding, bufSize);
|
||||
sum++;
|
||||
}
|
||||
|
||||
free(padding);
|
||||
padding = NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
jpeg_finish_decompress(&jpeg_cinfo);
|
||||
jpeg_destroy_decompress(&jpeg_cinfo);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -10,8 +10,4 @@
|
|||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation, version 2.
|
||||
*/
|
||||
|
||||
SANE_Status eds_jpeg_start(epsonds_scanner *s);
|
||||
void eds_jpeg_finish(epsonds_scanner *s);
|
||||
SANE_Status eds_jpeg_read_header(epsonds_scanner *s);
|
||||
void eds_jpeg_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length, SANE_Int *length);
|
||||
void eds_decode_jpeg(epsonds_scanner*s, SANE_Byte *data, SANE_Int size, ring_buffer* ringBuffer, SANE_Int isBackSide, SANE_Int needToConvertBW);
|
||||
|
|
|
@ -32,10 +32,19 @@
|
|||
|
||||
#include "sane/sanei_debug.h"
|
||||
|
||||
|
||||
static ssize_t
|
||||
epsonds_net_read_raw(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
|
||||
SANE_Status *status)
|
||||
{
|
||||
DBG(15, "%s: wanted: %ld\n", __func__, wanted);
|
||||
|
||||
if (wanted == 0)
|
||||
{
|
||||
*status = SANE_STATUS_GOOD;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ready;
|
||||
ssize_t read = -1;
|
||||
fd_set readable;
|
||||
|
@ -70,7 +79,7 @@ epsonds_net_read_buf(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
|
|||
ssize_t read = 0;
|
||||
|
||||
DBG(23, "%s: reading up to %lu from buffer at %p, %lu available\n",
|
||||
__func__, (u_long) wanted, s->netptr, (u_long) s->netlen);
|
||||
__func__, (u_long) wanted, (void *) s->netptr, (u_long) s->netlen);
|
||||
|
||||
if ((size_t) wanted > s->netlen) {
|
||||
*status = SANE_STATUS_IO_ERROR;
|
||||
|
@ -84,7 +93,7 @@ epsonds_net_read_buf(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
|
|||
s->netlen -= read;
|
||||
|
||||
if (s->netlen == 0) {
|
||||
DBG(23, "%s: freeing %p\n", __func__, s->netbuf);
|
||||
DBG(23, "%s: freeing %p\n", __func__, (void *) s->netbuf);
|
||||
free(s->netbuf);
|
||||
s->netbuf = s->netptr = NULL;
|
||||
s->netlen = 0;
|
||||
|
@ -186,7 +195,7 @@ epsonds_net_write(epsonds_scanner *s, unsigned int cmd, const unsigned char *buf
|
|||
if (reply_len) {
|
||||
if (s->netbuf) {
|
||||
DBG(23, "%s, freeing %p, %ld bytes unprocessed\n",
|
||||
__func__, s->netbuf, (u_long) s->netlen);
|
||||
__func__, (void *) s->netbuf, (u_long) s->netlen);
|
||||
free(s->netbuf);
|
||||
s->netbuf = s->netptr = NULL;
|
||||
s->netlen = 0;
|
||||
|
@ -199,11 +208,11 @@ epsonds_net_write(epsonds_scanner *s, unsigned int cmd, const unsigned char *buf
|
|||
}
|
||||
s->netlen = reply_len;
|
||||
DBG(24, "%s: allocated %lu bytes at %p\n", __func__,
|
||||
(u_long) s->netlen, s->netbuf);
|
||||
(u_long) s->netlen, (void *) s->netbuf);
|
||||
}
|
||||
|
||||
DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
|
||||
__func__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
|
||||
__func__, cmd, (void *) buf, (u_long) buf_size, (u_long) reply_len);
|
||||
|
||||
memset(h1, 0x00, 12);
|
||||
memset(h2, 0x00, 8);
|
||||
|
@ -284,3 +293,228 @@ epsonds_net_unlock(struct epsonds_scanner *s)
|
|||
/* epsonds_net_read(s, buf, 1, &status); */
|
||||
return status;
|
||||
}
|
||||
#if WITH_AVAHI
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <avahi-client/lookup.h>
|
||||
#include <avahi-common/error.h>
|
||||
#include <avahi-common/simple-watch.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
|
||||
static AvahiSimplePoll *simple_poll = NULL;
|
||||
|
||||
static struct timeval borowseEndTime;
|
||||
|
||||
static int resolvedCount = 0;
|
||||
static int browsedCount = 0;
|
||||
static int waitResolver = 0;
|
||||
|
||||
typedef struct {
|
||||
AvahiClient* client;
|
||||
Device_Found_CallBack callBack;
|
||||
}EDSAvahiUserData;
|
||||
|
||||
static int my_avahi_simple_poll_loop(AvahiSimplePoll *s) {
|
||||
struct timeval currentTime;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int r = avahi_simple_poll_iterate(s, 1);
|
||||
if (r != 0)
|
||||
{
|
||||
if (r >= 0 || errno != EINTR)
|
||||
{
|
||||
DBG(10, "my_avahi_simple_poll_loop end\n");
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
if (waitResolver) {
|
||||
gettimeofday(¤tTime, NULL);
|
||||
|
||||
if ((currentTime.tv_sec - borowseEndTime.tv_sec) >= 3)
|
||||
{
|
||||
avahi_simple_poll_quit(simple_poll);
|
||||
DBG(10, "resolve timeout\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
epsonds_resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface,
|
||||
AVAHI_GCC_UNUSED AvahiProtocol protocol,
|
||||
AvahiResolverEvent event, const char *name,
|
||||
const char *type,
|
||||
const char *domain,
|
||||
const char *host_name,
|
||||
const AvahiAddress *address, uint16_t port, AvahiStringList *txt,
|
||||
AvahiLookupResultFlags flags,
|
||||
void *userdata)
|
||||
{
|
||||
// unused parameter
|
||||
(void)r;
|
||||
(void)type;
|
||||
(void)domain;
|
||||
(void)host_name;
|
||||
(void)port;
|
||||
(void)flags;
|
||||
EDSAvahiUserData* data = userdata;
|
||||
char ipAddr[AVAHI_ADDRESS_STR_MAX];
|
||||
|
||||
DBG(10, "epsonds_searchDevices resolve_callback\n");
|
||||
|
||||
|
||||
resolvedCount++;
|
||||
|
||||
switch (event) {
|
||||
case AVAHI_RESOLVER_FAILURE:
|
||||
break;
|
||||
case AVAHI_RESOLVER_FOUND:
|
||||
avahi_address_snprint(ipAddr, sizeof(ipAddr), address);
|
||||
DBG(10, "epsonds_searchDevices name = %s \n", name);
|
||||
if (strlen(name) > 7)
|
||||
{
|
||||
if (strncmp(name, "EPSON", 5) == 0)
|
||||
{
|
||||
while(txt != NULL)
|
||||
{
|
||||
char* text = (char*)avahi_string_list_get_text(txt);
|
||||
DBG(10, "avahi string = %s\n", text);
|
||||
|
||||
if (strlen(text) > 4 && strncmp(text, "mdl=", 4) == 0)
|
||||
{
|
||||
if (data->callBack)
|
||||
{
|
||||
data->callBack(&text[4], ipAddr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
txt = avahi_string_list_get_next(txt);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
browse_callback(AvahiServiceBrowser *b, AvahiIfIndex interface,
|
||||
AvahiProtocol protocol, AvahiBrowserEvent event,
|
||||
const char *name, const char *type,
|
||||
const char *domain,
|
||||
AvahiLookupResultFlags flags,
|
||||
void* userdata)
|
||||
{
|
||||
DBG(10, "browse_callback event = %d\n", event);
|
||||
|
||||
//unused parameter
|
||||
(void)b;
|
||||
(void)flags;
|
||||
|
||||
EDSAvahiUserData *data = userdata;
|
||||
switch (event) {
|
||||
case AVAHI_BROWSER_FAILURE:
|
||||
avahi_simple_poll_quit(simple_poll);
|
||||
return;
|
||||
case AVAHI_BROWSER_NEW:
|
||||
DBG(10, "browse_callback name = %s\n", name);
|
||||
browsedCount++;
|
||||
if (!(avahi_service_resolver_new(data->client, interface, protocol, name,
|
||||
type, domain,
|
||||
AVAHI_PROTO_UNSPEC, 0,
|
||||
epsonds_resolve_callback, data)))
|
||||
{
|
||||
DBG(10, "avahi_service_resolver_new fails\n");
|
||||
break;
|
||||
}
|
||||
case AVAHI_BROWSER_REMOVE:
|
||||
break;
|
||||
case AVAHI_BROWSER_ALL_FOR_NOW:
|
||||
DBG(10, "AVAHI_BROWSER_ALL_FOR_NOW\n");
|
||||
gettimeofday(&borowseEndTime, NULL);
|
||||
|
||||
if (browsedCount > resolvedCount)
|
||||
{
|
||||
DBG(10, "WAIT RESOLVER\n");
|
||||
waitResolver = 1;
|
||||
}else{
|
||||
DBG(10, "QUIT POLL\n");
|
||||
avahi_simple_poll_quit(simple_poll);
|
||||
}
|
||||
break;
|
||||
case AVAHI_BROWSER_CACHE_EXHAUSTED:
|
||||
DBG(10, "AVAHI_BROWSER_CACHE_EXHAUSTED\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
client_callback(AvahiClient *c, AvahiClientState state,
|
||||
AVAHI_GCC_UNUSED void *userdata)
|
||||
{
|
||||
assert(c);
|
||||
if (state == AVAHI_CLIENT_FAILURE)
|
||||
avahi_simple_poll_quit(simple_poll);
|
||||
}
|
||||
|
||||
SANE_Status epsonds_searchDevices(Device_Found_CallBack deviceFoundCallBack)
|
||||
{
|
||||
int result = SANE_STATUS_GOOD;
|
||||
|
||||
AvahiClient *client = NULL;
|
||||
AvahiServiceBrowser *sb = NULL;
|
||||
|
||||
EDSAvahiUserData data;
|
||||
|
||||
resolvedCount = 0;
|
||||
browsedCount = 0;
|
||||
waitResolver = 0;
|
||||
|
||||
|
||||
int error = 0;
|
||||
DBG(10, "epsonds_searchDevices\n");
|
||||
|
||||
if (!(simple_poll = avahi_simple_poll_new())) {
|
||||
DBG(10, "avahi_simple_poll_new failed\n");
|
||||
result = SANE_STATUS_INVAL;
|
||||
goto fail;
|
||||
}
|
||||
client = avahi_client_new(avahi_simple_poll_get(simple_poll), 0,
|
||||
client_callback, NULL, &error);
|
||||
if (!client) {
|
||||
DBG(10, "avahi_client_new failed %s\n", avahi_strerror(error));
|
||||
result = SANE_STATUS_INVAL;
|
||||
goto fail;
|
||||
}
|
||||
data.client = client;
|
||||
data.callBack = deviceFoundCallBack;
|
||||
|
||||
if (!(sb = avahi_service_browser_new(client, AVAHI_IF_UNSPEC,
|
||||
AVAHI_PROTO_UNSPEC, "_scanner._tcp",
|
||||
NULL, 0, browse_callback, &data))) {
|
||||
DBG(10, "avahi_service_browser_new failed: %s\n",
|
||||
avahi_strerror(avahi_client_errno(client)));
|
||||
result = SANE_STATUS_INVAL;
|
||||
goto fail;
|
||||
}
|
||||
my_avahi_simple_poll_loop(simple_poll);
|
||||
fail:
|
||||
if (sb)
|
||||
avahi_service_browser_free(sb);
|
||||
if (client)
|
||||
avahi_client_free(client);
|
||||
if (simple_poll)
|
||||
avahi_simple_poll_free(simple_poll);
|
||||
|
||||
DBG(10, "epsonds_searchDevices fin\n");
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include <sys/types.h>
|
||||
#include "../include/sane/sane.h"
|
||||
|
||||
typedef void (*Device_Found_CallBack) (const char* name, const char* ip);
|
||||
|
||||
extern ssize_t epsonds_net_read(struct epsonds_scanner *s, unsigned char *buf, ssize_t buf_size,
|
||||
SANE_Status *status);
|
||||
extern size_t epsonds_net_write(struct epsonds_scanner *s, unsigned int cmd, const unsigned char *buf,
|
||||
|
@ -13,4 +15,8 @@ extern SANE_Status epsonds_net_lock(struct epsonds_scanner *s);
|
|||
extern SANE_Status epsonds_net_unlock(struct epsonds_scanner *s);
|
||||
extern SANE_Status epsonds_net_request_read(epsonds_scanner *s, size_t len);
|
||||
|
||||
#if WITH_AVAHI
|
||||
extern SANE_Status epsonds_searchDevices(Device_Found_CallBack deviceFoundCallBack);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,10 +28,9 @@
|
|||
extern struct mode_param mode_params[];
|
||||
|
||||
/* Define the different scan sources */
|
||||
|
||||
#define FBF_STR SANE_I18N("Flatbed")
|
||||
#define TPU_STR SANE_I18N("Transparency Unit")
|
||||
#define ADF_STR SANE_I18N("Automatic Document Feeder")
|
||||
#define STRING_FLATBED SANE_I18N("Flatbed")
|
||||
#define STRING_ADFFRONT SANE_I18N("ADF Front")
|
||||
#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex")
|
||||
|
||||
extern SANE_String_Const source_list[];
|
||||
|
||||
|
@ -53,10 +52,13 @@ eds_dev_post_init(struct epsonds_device *dev)
|
|||
DBG(10, "%s\n", __func__);
|
||||
|
||||
if (dev->has_fb)
|
||||
*source_list_add++ = FBF_STR;
|
||||
*source_list_add++ = STRING_FLATBED;
|
||||
|
||||
if (dev->has_adf)
|
||||
*source_list_add++ = ADF_STR;
|
||||
*source_list_add++ = STRING_ADFFRONT;
|
||||
|
||||
if (dev->adf_is_duplex)
|
||||
*source_list_add++ = STRING_ADFDUPLEX;
|
||||
|
||||
if (source_list[0] == 0
|
||||
|| (dev->res_list[0] == 0 && dev->dpi_range.min == 0)
|
||||
|
@ -209,8 +211,6 @@ eds_init_parameters(epsonds_scanner *s)
|
|||
|
||||
memset(&s->params, 0, sizeof(SANE_Parameters));
|
||||
|
||||
s->dummy = 0;
|
||||
|
||||
/* setup depth according to our mode table */
|
||||
if (mode_params[s->val[OPT_MODE].w].depth == 1)
|
||||
s->params.depth = 1;
|
||||
|
@ -314,6 +314,7 @@ eds_init_parameters(epsonds_scanner *s)
|
|||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
#define min(A,B) (((A)<(B)) ? (A) : (B))
|
||||
|
||||
void
|
||||
eds_copy_image_from_ring(epsonds_scanner *s, SANE_Byte *data, SANE_Int max_length,
|
||||
|
@ -322,17 +323,13 @@ eds_copy_image_from_ring(epsonds_scanner *s, SANE_Byte *data, SANE_Int max_lengt
|
|||
int lines, available;
|
||||
int hw_line_size = (s->params.bytes_per_line + s->dummy);
|
||||
|
||||
/* trim max_length to a multiple of hw_line_size */
|
||||
max_length -= (max_length % hw_line_size);
|
||||
|
||||
/* check available data */
|
||||
available = eds_ring_avail(s->current);
|
||||
if (max_length > available)
|
||||
max_length = available;
|
||||
|
||||
lines = max_length / hw_line_size;
|
||||
lines = min(max_length / s->params.bytes_per_line, available / hw_line_size);
|
||||
|
||||
DBG(18, "copying %d lines (%d, %d)\n", lines, s->params.bytes_per_line, s->dummy);
|
||||
DBG(18, "copying %d lines (%d, %d, %d)\n", lines, s->params.bytes_per_line, s->dummy, s->params.depth);
|
||||
|
||||
/* need more data? */
|
||||
if (lines == 0) {
|
||||
|
@ -490,3 +487,12 @@ void eds_ring_flush(ring_buffer *ring)
|
|||
{
|
||||
eds_ring_skip(ring, ring->fill);
|
||||
}
|
||||
|
||||
void eds_ring_destory(ring_buffer *ring)
|
||||
{
|
||||
if (ring->ring)
|
||||
{
|
||||
free(ring->ring);
|
||||
ring->ring = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,3 +38,4 @@ extern SANE_Int eds_ring_read(ring_buffer *ring, SANE_Byte *buf, SANE_Int size);
|
|||
extern SANE_Int eds_ring_skip(ring_buffer *ring, SANE_Int size);
|
||||
extern SANE_Int eds_ring_avail(ring_buffer *ring);
|
||||
extern void eds_ring_flush(ring_buffer *ring) ;
|
||||
extern void eds_ring_destory(ring_buffer *ring) ;
|
||||
|
|
|
@ -12,22 +12,3 @@
|
|||
*/
|
||||
|
||||
#include "epsonds-usb.h"
|
||||
|
||||
SANE_Word epsonds_usb_product_ids[] = {
|
||||
0x0145, /* DS-5500, DS-6500, DS-7500 */
|
||||
0x0146, /* DS-50000, DS-60000, DS-70000 */
|
||||
0x014c, /* DS-510 */
|
||||
0x014d, /* DS-560 */
|
||||
0x0150, /* DS-40 */
|
||||
0x0152, /* DS-760, DS-860 */
|
||||
0x0154, /* DS-520 */
|
||||
0x08bc, /* PX-M7050 Series, WF-8510/8590 Series */
|
||||
0x08cc, /* PX-M7050FX Series, WF-R8590 Series */
|
||||
0 /* last entry - this is used for devices that are specified
|
||||
in the config file as "usb <vendor> <product>" */
|
||||
};
|
||||
|
||||
int epsonds_get_number_of_ids(void)
|
||||
{
|
||||
return sizeof (epsonds_usb_product_ids) / sizeof (SANE_Word);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,4 @@
|
|||
|
||||
#define SANE_EPSONDS_VENDOR_ID (0x4b8)
|
||||
|
||||
extern SANE_Word epsonds_usb_product_ids[];
|
||||
extern int epsonds_get_number_of_ids(void);
|
||||
|
||||
#endif
|
||||
|
|
2695
backend/epsonds.c
2695
backend/epsonds.c
Plik diff jest za duży
Load Diff
|
@ -10,7 +10,8 @@ usb
|
|||
# e.g.:
|
||||
# usb 0x4b8 0x14c
|
||||
|
||||
# Network (not yet supported!)
|
||||
#
|
||||
# Network
|
||||
#
|
||||
# net 192.168.1.123
|
||||
#net autodiscovery
|
||||
net autodiscovery
|
||||
|
|
|
@ -66,9 +66,14 @@
|
|||
#define TPU_STR SANE_I18N("Transparency Unit")
|
||||
#define ADF_STR SANE_I18N("Automatic Document Feeder")
|
||||
|
||||
#define STRING_FLATBED SANE_I18N("Flatbed")
|
||||
#define STRING_ADFFRONT SANE_I18N("ADF Front")
|
||||
#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex")
|
||||
|
||||
enum {
|
||||
OPT_NUM_OPTS = 0,
|
||||
OPT_MODE_GROUP,
|
||||
OPT_STANDARD_GROUP,
|
||||
OPT_SOURCE,
|
||||
OPT_MODE,
|
||||
OPT_DEPTH,
|
||||
OPT_RESOLUTION,
|
||||
|
@ -78,11 +83,10 @@ enum {
|
|||
OPT_BR_X,
|
||||
OPT_BR_Y,
|
||||
OPT_EQU_GROUP,
|
||||
OPT_SOURCE,
|
||||
OPT_EJECT,
|
||||
OPT_LOAD,
|
||||
OPT_ADF_MODE,
|
||||
OPT_ADF_SKEW,
|
||||
OPT_ADF_CRP,
|
||||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
|
@ -119,6 +123,8 @@ struct epsonds_device
|
|||
|
||||
SANE_Bool has_raw; /* supports RAW format */
|
||||
|
||||
SANE_Bool has_mono; /*supprt M001*/
|
||||
|
||||
SANE_Bool has_fb; /* flatbed */
|
||||
SANE_Range fbf_x_range; /* x range */
|
||||
SANE_Range fbf_y_range; /* y range */
|
||||
|
@ -136,9 +142,13 @@ struct epsonds_device
|
|||
SANE_Byte adf_alignment; /* left, center, right */
|
||||
SANE_Byte adf_has_dfd; /* supports double feed detection */
|
||||
|
||||
SANE_Byte adf_has_crp; /* supports crp */
|
||||
|
||||
SANE_Bool has_tpu; /* tpu */
|
||||
SANE_Range tpu_x_range; /* transparency unit x range */
|
||||
SANE_Range tpu_y_range; /* transparency unit y range */
|
||||
|
||||
SANE_Int lut_id;
|
||||
};
|
||||
|
||||
typedef struct epsonds_device epsonds_device;
|
||||
|
@ -171,6 +181,10 @@ struct epsonds_scanner
|
|||
|
||||
SANE_Int left, top, pages, dummy;
|
||||
|
||||
SANE_Int width_front, height_front;
|
||||
SANE_Int width_back , height_back;
|
||||
SANE_Int width_temp, height_temp;
|
||||
|
||||
/* jpeg stuff */
|
||||
|
||||
djpeg_dest_ptr jdst;
|
||||
|
@ -181,7 +195,18 @@ struct epsonds_scanner
|
|||
/* network buffers */
|
||||
unsigned char *netbuf, *netptr;
|
||||
size_t netlen;
|
||||
};
|
||||
|
||||
SANE_Byte *frontJpegBuf, *backJpegBuf;
|
||||
SANE_Int frontJpegBufLen, backJpegBufLen;
|
||||
SANE_Int acquirePage;
|
||||
|
||||
SANE_Int isflatbedScan;
|
||||
SANE_Int isDuplexScan;
|
||||
|
||||
SANE_Int needToConvertBW;
|
||||
|
||||
SANE_Int scanEnd;
|
||||
};
|
||||
|
||||
typedef struct epsonds_scanner epsonds_scanner;
|
||||
|
||||
|
|
|
@ -11,6 +11,11 @@
|
|||
# You can also configure a device on a single line starting with 'device'
|
||||
# by writing a complete URL and an optional model name.
|
||||
|
||||
|
||||
# Name of the device not using the PDF format. Spaces are replaced by _. Please report the devices having this problem on sane-devel
|
||||
# Uncomment the line to add your device
|
||||
#pdfblacklist Brother_DCP-L2530DW_series
|
||||
|
||||
#device http://123.456.789.10:8080 OptionalModel1
|
||||
#device https://123.456.789.10:443 "Optional Model 2"
|
||||
#device https://123.456.789.10:443 "HP Color LaserJet FlowMFP M578" "hack=localhost"
|
||||
|
|
|
@ -61,6 +61,26 @@ static const SANE_Device **devlist = NULL;
|
|||
static ESCL_Device *list_devices_primary = NULL;
|
||||
static int num_devices = 0;
|
||||
|
||||
#ifdef CURL_SSLVERSION_MAX_DEFAULT
|
||||
static int proto_tls[] = {
|
||||
CURL_SSLVERSION_MAX_DEFAULT,
|
||||
#ifdef CURL_SSLVERSION_MAX_TLSv1_3
|
||||
CURL_SSLVERSION_MAX_TLSv1_3,
|
||||
#endif
|
||||
#ifdef CURL_SSLVERSION_MAX_TLSv1_2
|
||||
CURL_SSLVERSION_MAX_TLSv1_2,
|
||||
#endif
|
||||
#ifdef CURL_SSLVERSION_MAX_TLSv1_1
|
||||
CURL_SSLVERSION_MAX_TLSv1_1,
|
||||
#endif
|
||||
#ifdef CURL_SSLVERSION_MAX_TLSv1_0
|
||||
CURL_SSLVERSION_MAX_TLSv1_0,
|
||||
#endif
|
||||
-1
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Handled {
|
||||
struct Handled *next;
|
||||
ESCL_Device *device;
|
||||
|
@ -99,6 +119,60 @@ escl_free_device(ESCL_Device *current)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CURL_SSLVERSION_MAX_DEFAULT
|
||||
static int
|
||||
escl_tls_protocol_supported(char *url, int proto)
|
||||
{
|
||||
CURLcode res = CURLE_UNSUPPORTED_PROTOCOL;
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
|
||||
/* ask libcurl to use TLS version 1.0 or later */
|
||||
curl_easy_setopt(curl, CURLOPT_SSLVERSION, proto);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 3L);
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
escl_is_tls(char * url, char *type)
|
||||
{
|
||||
int tls_version = 0;
|
||||
if(!strcmp(type, "_uscans._tcp") ||
|
||||
!strcmp(type, "https"))
|
||||
{
|
||||
while(proto_tls[tls_version] != -1)
|
||||
{
|
||||
if (escl_tls_protocol_supported(url, proto_tls[tls_version]) == CURLE_OK)
|
||||
{
|
||||
DBG(10, "curl tls compatible (%d)\n", proto_tls[tls_version]);
|
||||
break;
|
||||
}
|
||||
tls_version++;
|
||||
}
|
||||
if (proto_tls[tls_version] < 1)
|
||||
return 0;
|
||||
}
|
||||
return proto_tls[tls_version];
|
||||
}
|
||||
#else
|
||||
static int
|
||||
escl_is_tls(char * url, char *type)
|
||||
{
|
||||
(void)url;
|
||||
(void)type;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
escl_free_handler(escl_sane_t *handler)
|
||||
{
|
||||
|
@ -187,8 +261,13 @@ escl_device_add(int port_nb,
|
|||
{
|
||||
char tmp[PATH_MAX] = { 0 };
|
||||
char *model = NULL;
|
||||
char url_port[512] = { 0 };
|
||||
int tls_version = 0;
|
||||
ESCL_Device *current = NULL;
|
||||
DBG (10, "escl_device_add\n");
|
||||
snprintf(url_port, sizeof(url_port), "https://%s:%d", ip_address, port_nb);
|
||||
tls_version = escl_is_tls(url_port, type);
|
||||
|
||||
for (current = list_devices_primary; current; current = current->next) {
|
||||
if ((strcmp(current->ip_address, ip_address) == 0) ||
|
||||
(uuid && current->uuid && !strcmp(current->uuid, uuid)))
|
||||
|
@ -206,6 +285,7 @@ escl_device_add(int port_nb,
|
|||
}
|
||||
current->port_nb = port_nb;
|
||||
current->https = SANE_TRUE;
|
||||
current->tls = tls_version;
|
||||
}
|
||||
return (SANE_STATUS_GOOD);
|
||||
}
|
||||
|
@ -226,6 +306,7 @@ escl_device_add(int port_nb,
|
|||
} else {
|
||||
current->https = SANE_FALSE;
|
||||
}
|
||||
current->tls = tls_version;
|
||||
model = (char*)(tmp[0] != 0 ? tmp : model_name);
|
||||
current->model_name = strdup(model);
|
||||
current->ip_address = strdup(ip_address);
|
||||
|
@ -432,7 +513,8 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line,
|
|||
int port = 0;
|
||||
SANE_Status status;
|
||||
static ESCL_Device *escl_device = NULL;
|
||||
|
||||
if (*line == '#') return SANE_STATUS_GOOD;
|
||||
if (!strncmp(line, "pdfblacklist", 12)) return SANE_STATUS_GOOD;
|
||||
if (strncmp(line, "device", 6) == 0) {
|
||||
char *name_str = NULL;
|
||||
char *opt_model = NULL;
|
||||
|
@ -469,7 +551,6 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line,
|
|||
}
|
||||
escl_device->model_name = opt_model ? opt_model : strdup("Unknown model");
|
||||
escl_device->is = strdup("flatbed or ADF scanner");
|
||||
escl_device->type = strdup("In url");
|
||||
escl_device->uuid = NULL;
|
||||
}
|
||||
|
||||
|
@ -514,6 +595,9 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line,
|
|||
}
|
||||
escl_device->is = strdup("flatbed or ADF scanner");
|
||||
escl_device->uuid = NULL;
|
||||
char url_port[512] = { 0 };
|
||||
snprintf(url_port, sizeof(url_port), "https://%s:%d", escl_device->ip_address, escl_device->port_nb);
|
||||
escl_device->tls = escl_is_tls(url_port, escl_device->type);
|
||||
status = escl_check_and_add_device(escl_device);
|
||||
if (status == SANE_STATUS_GOOD)
|
||||
escl_device = NULL;
|
||||
|
@ -537,16 +621,20 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only)
|
|||
ESCL_Device *dev = NULL;
|
||||
static const SANE_Device **devlist = 0;
|
||||
SANE_Status status;
|
||||
SANE_Status status2;
|
||||
|
||||
if (device_list == NULL)
|
||||
return (SANE_STATUS_INVAL);
|
||||
status = sanei_configure_attach(ESCL_CONFIG_FILE, NULL,
|
||||
status2 = sanei_configure_attach(ESCL_CONFIG_FILE, NULL,
|
||||
attach_one_config, NULL);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return (status);
|
||||
escl_devices(&status);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return (status);
|
||||
if (status != SANE_STATUS_GOOD && status2 != SANE_STATUS_GOOD)
|
||||
{
|
||||
if (status2 != SANE_STATUS_GOOD)
|
||||
return (status2);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return (status);
|
||||
}
|
||||
if (devlist)
|
||||
free(devlist);
|
||||
devlist = (const SANE_Device **) calloc (num_devices + 1, sizeof (devlist[0]));
|
||||
|
@ -955,7 +1043,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
|
|||
s->opt[OPT_BRIGHTNESS].constraint_type = SANE_CONSTRAINT_RANGE;
|
||||
if (s->scanner->brightness) {
|
||||
s->opt[OPT_BRIGHTNESS].constraint.range = &s->brightness_range;
|
||||
s->val[OPT_BRIGHTNESS].w = s->scanner->brightness->normal;
|
||||
s->val[OPT_BRIGHTNESS].w = s->scanner->brightness->value;
|
||||
s->brightness_range.quant=1;
|
||||
s->brightness_range.min=s->scanner->brightness->min;
|
||||
s->brightness_range.max=s->scanner->brightness->max;
|
||||
|
@ -974,7 +1062,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
|
|||
s->opt[OPT_CONTRAST].constraint_type = SANE_CONSTRAINT_RANGE;
|
||||
if (s->scanner->contrast) {
|
||||
s->opt[OPT_CONTRAST].constraint.range = &s->contrast_range;
|
||||
s->val[OPT_CONTRAST].w = s->scanner->contrast->normal;
|
||||
s->val[OPT_CONTRAST].w = s->scanner->contrast->value;
|
||||
s->contrast_range.quant=1;
|
||||
s->contrast_range.min=s->scanner->contrast->min;
|
||||
s->contrast_range.max=s->scanner->contrast->max;
|
||||
|
@ -993,7 +1081,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
|
|||
s->opt[OPT_SHARPEN].constraint_type = SANE_CONSTRAINT_RANGE;
|
||||
if (s->scanner->sharpen) {
|
||||
s->opt[OPT_SHARPEN].constraint.range = &s->sharpen_range;
|
||||
s->val[OPT_SHARPEN].w = s->scanner->sharpen->normal;
|
||||
s->val[OPT_SHARPEN].w = s->scanner->sharpen->value;
|
||||
s->sharpen_range.quant=1;
|
||||
s->sharpen_range.min=s->scanner->sharpen->min;
|
||||
s->sharpen_range.max=s->scanner->sharpen->max;
|
||||
|
@ -1013,7 +1101,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
|
|||
s->opt[OPT_THRESHOLD].constraint_type = SANE_CONSTRAINT_RANGE;
|
||||
if (s->scanner->threshold) {
|
||||
s->opt[OPT_THRESHOLD].constraint.range = &s->thresold_range;
|
||||
s->val[OPT_THRESHOLD].w = s->scanner->threshold->normal;
|
||||
s->val[OPT_THRESHOLD].w = s->scanner->threshold->value;
|
||||
s->thresold_range.quant=1;
|
||||
s->thresold_range.min= s->scanner->threshold->min;
|
||||
s->thresold_range.max=s->scanner->threshold->max;
|
||||
|
@ -1068,9 +1156,11 @@ escl_parse_name(SANE_String_Const name, ESCL_Device *device)
|
|||
|
||||
if (strncmp(name, "https://", 8) == 0) {
|
||||
device->https = SANE_TRUE;
|
||||
device->type = strdup("https");
|
||||
host = name + 8;
|
||||
} else if (strncmp(name, "http://", 7) == 0) {
|
||||
device->https = SANE_FALSE;
|
||||
device->type = strdup("http");
|
||||
host = name + 7;
|
||||
} else {
|
||||
DBG(1, "Unknown URL scheme in %s", name);
|
||||
|
@ -1135,6 +1225,37 @@ finish_hack:
|
|||
fclose(fp);
|
||||
}
|
||||
|
||||
static char*
|
||||
_get_blacklist_pdf(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char *blacklist = NULL;
|
||||
SANE_Char line[PATH_MAX];
|
||||
|
||||
/* open configuration file */
|
||||
fp = sanei_config_open (ESCL_CONFIG_FILE);
|
||||
if (!fp)
|
||||
{
|
||||
DBG (2, "_get_blacklit: couldn't access %s\n", ESCL_CONFIG_FILE);
|
||||
DBG (3, "_get_blacklist: exit\n");
|
||||
}
|
||||
|
||||
/* loop reading the configuration file, all line beginning by "option " are
|
||||
* parsed for value to store in configuration structure, other line are
|
||||
* used are device to try to attach
|
||||
*/
|
||||
while (sanei_config_read (line, PATH_MAX, fp))
|
||||
{
|
||||
if (!strncmp(line, "pdfblacklist", 12)) {
|
||||
blacklist = strdup(line);
|
||||
goto finish_;
|
||||
}
|
||||
}
|
||||
finish_:
|
||||
DBG (3, "_get_blacklist_pdf: finish\n");
|
||||
fclose(fp);
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1149,6 +1270,7 @@ finish_hack:
|
|||
SANE_Status
|
||||
sane_open(SANE_String_Const name, SANE_Handle *h)
|
||||
{
|
||||
char *blacklist = NULL;
|
||||
DBG (10, "escl sane_open\n");
|
||||
SANE_Status status;
|
||||
escl_sane_t *handler = NULL;
|
||||
|
@ -1173,7 +1295,8 @@ sane_open(SANE_String_Const name, SANE_Handle *h)
|
|||
return (SANE_STATUS_NO_MEM);
|
||||
}
|
||||
handler->device = device; // Handler owns device now.
|
||||
handler->scanner = escl_capabilities(device, &status);
|
||||
blacklist = _get_blacklist_pdf();
|
||||
handler->scanner = escl_capabilities(device, blacklist, &status);
|
||||
if (status != SANE_STATUS_GOOD) {
|
||||
escl_free_handler(handler);
|
||||
return (status);
|
||||
|
@ -1222,9 +1345,11 @@ sane_cancel(SANE_Handle h)
|
|||
}
|
||||
handler->scanner->work = SANE_FALSE;
|
||||
handler->cancel = SANE_TRUE;
|
||||
escl_scanner(handler->device, handler->result);
|
||||
escl_scanner(handler->device, handler->scanner->scanJob, handler->result, SANE_TRUE);
|
||||
free(handler->result);
|
||||
handler->result = NULL;
|
||||
free(handler->scanner->scanJob);
|
||||
handler->scanner->scanJob = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1381,6 +1506,7 @@ sane_control_option(SANE_Handle h, SANE_Int n, SANE_Action a, void *v, SANE_Int
|
|||
break;
|
||||
case OPT_RESOLUTION:
|
||||
handler->val[n].w = _get_resolution(handler, (int)(*(SANE_Word *) v));
|
||||
handler->scanner->caps[handler->scanner->source].default_resolution = handler->val[n].w;
|
||||
if (i)
|
||||
*i |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT;
|
||||
break;
|
||||
|
@ -1440,6 +1566,7 @@ sane_start(SANE_Handle h)
|
|||
handler->decompress_scan_data = SANE_FALSE;
|
||||
handler->end_read = SANE_FALSE;
|
||||
if (handler->scanner->work == SANE_FALSE) {
|
||||
escl_reset_all_jobs(handler->device);
|
||||
SANE_Status st = escl_status(handler->device,
|
||||
handler->scanner->source,
|
||||
NULL,
|
||||
|
@ -1591,7 +1718,7 @@ sane_start(SANE_Handle h)
|
|||
return SANE_STATUS_NO_DOCS;
|
||||
}
|
||||
}
|
||||
status = escl_scan(handler->scanner, handler->device, handler->result);
|
||||
status = escl_scan(handler->scanner, handler->device, handler->scanner->scanJob, handler->result);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
return (status);
|
||||
if (!strcmp(handler->scanner->caps[handler->scanner->source].default_format, "image/jpeg"))
|
||||
|
@ -1774,6 +1901,8 @@ escl_curl_url(CURL *handle, const ESCL_Device *device, SANE_String_Const path)
|
|||
DBG( 1, "Ignoring safety certificates, use https\n");
|
||||
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
if (device->tls > 0)
|
||||
curl_easy_setopt(handle, CURLOPT_SSLVERSION, device->tls);
|
||||
}
|
||||
if (device->unix_socket != NULL) {
|
||||
DBG( 1, "Using local socket %s\n", device->unix_socket );
|
||||
|
|
|
@ -92,10 +92,12 @@ typedef struct {
|
|||
typedef struct ESCL_Device {
|
||||
struct ESCL_Device *next;
|
||||
|
||||
char *version;
|
||||
char *model_name;
|
||||
int port_nb;
|
||||
char *ip_address;
|
||||
char *is;
|
||||
int tls;
|
||||
char *uuid;
|
||||
char *type;
|
||||
SANE_Bool https;
|
||||
|
@ -146,6 +148,7 @@ typedef struct support
|
|||
int min;
|
||||
int max;
|
||||
int normal;
|
||||
int value;
|
||||
int step;
|
||||
} support_t;
|
||||
|
||||
|
@ -156,6 +159,7 @@ typedef struct capabilities
|
|||
SANE_String_Const *Sources;
|
||||
int SourcesSize;
|
||||
FILE *tmp;
|
||||
char *scanJob;
|
||||
unsigned char *img_data;
|
||||
long img_size;
|
||||
long img_read;
|
||||
|
@ -230,6 +234,7 @@ SANE_Status escl_status(const ESCL_Device *device,
|
|||
SANE_Status *job);
|
||||
|
||||
capabilities_t *escl_capabilities(ESCL_Device *device,
|
||||
char *blacklist,
|
||||
SANE_Status *status);
|
||||
|
||||
char *escl_newjob(capabilities_t *scanner,
|
||||
|
@ -238,10 +243,16 @@ char *escl_newjob(capabilities_t *scanner,
|
|||
|
||||
SANE_Status escl_scan(capabilities_t *scanner,
|
||||
const ESCL_Device *device,
|
||||
char *scanJob,
|
||||
char *result);
|
||||
|
||||
void escl_scanner(const ESCL_Device *device,
|
||||
char *result);
|
||||
char *scanJob,
|
||||
char *result,
|
||||
SANE_Bool status);
|
||||
|
||||
SANE_Status escl_reset_all_jobs(ESCL_Device *device);
|
||||
|
||||
|
||||
typedef void CURL;
|
||||
|
||||
|
|
|
@ -40,6 +40,25 @@ struct cap
|
|||
size_t size;
|
||||
};
|
||||
|
||||
static size_t
|
||||
header_callback(void *str, size_t size, size_t nmemb, void *userp)
|
||||
{
|
||||
struct cap *header = (struct cap *)userp;
|
||||
size_t realsize = size * nmemb;
|
||||
char *content = realloc(header->memory, header->size + realsize + 1);
|
||||
|
||||
if (content == NULL) {
|
||||
DBG( 1, "Not enough memory (realloc returned NULL)\n");
|
||||
return (0);
|
||||
}
|
||||
header->memory = content;
|
||||
memcpy(&(header->memory[header->size]), str, realsize);
|
||||
header->size = header->size + realsize;
|
||||
header->memory[header->size] = 0;
|
||||
return (realsize);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn static SANE_String_Const convert_elements(SANE_String_Const str)
|
||||
* \brief Function that converts the 'color modes' of the scanner (color/gray) to be understood by SANE.
|
||||
|
@ -53,7 +72,7 @@ convert_elements(SANE_String_Const str)
|
|||
return (SANE_VALUE_SCAN_MODE_GRAY);
|
||||
else if (strcmp(str, "RGB24") == 0)
|
||||
return (SANE_VALUE_SCAN_MODE_COLOR);
|
||||
#if(defined HAVE_POPPLER_GLIB)
|
||||
#if HAVE_POPPLER_GLIB
|
||||
else if (strcmp(str, "BlackAndWhite1") == 0)
|
||||
return (SANE_VALUE_SCAN_MODE_LINEART);
|
||||
#endif
|
||||
|
@ -182,10 +201,12 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
|
|||
{
|
||||
const char *name = (const char *)node->name;
|
||||
if (strcmp(name, "ColorMode") == 0) {
|
||||
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
|
||||
if (type == PLATEN || strcmp(color, "BlackAndWhite1"))
|
||||
#ifndef HAVE_POPPLER_GLIB
|
||||
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
|
||||
if (strcmp(color, "BlackAndWhite1"))
|
||||
#endif
|
||||
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes, &scanner->caps[type].ColorModesSize, (SANE_String_Const)xmlNodeGetContent(node), 1);
|
||||
}
|
||||
}
|
||||
else if (strcmp(name, "ContentType") == 0)
|
||||
scanner->caps[type].ContentTypes = char_to_array(scanner->caps[type].ContentTypes, &scanner->caps[type].ContentTypesSize, (SANE_String_Const)xmlNodeGetContent(node), 0);
|
||||
else if (strcmp(name, "DocumentFormat") == 0)
|
||||
|
@ -212,14 +233,14 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
|
|||
}
|
||||
#endif
|
||||
#if(defined HAVE_TIFFIO_H)
|
||||
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
|
||||
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
|
||||
{
|
||||
have_tiff = SANE_TRUE;
|
||||
scanner->caps[type].have_tiff = i;
|
||||
}
|
||||
#endif
|
||||
#if(defined HAVE_POPPLER_GLIB)
|
||||
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
|
||||
#if HAVE_POPPLER_GLIB
|
||||
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
|
||||
{
|
||||
have_pdf = SANE_TRUE;
|
||||
scanner->caps[type].have_pdf = i;
|
||||
|
@ -306,7 +327,8 @@ print_support(xmlNode *node)
|
|||
cpt++;
|
||||
}
|
||||
else if (!strcmp((const char *)node->name, "Normal")) {
|
||||
sup->normal = atoi((const char *)xmlNodeGetContent(node));
|
||||
sup->value = atoi((const char *)xmlNodeGetContent(node));
|
||||
sup->normal = sup->value;
|
||||
cpt++;
|
||||
have_norm = 1;
|
||||
}
|
||||
|
@ -319,7 +341,8 @@ print_support(xmlNode *node)
|
|||
if (cpt == 4)
|
||||
return sup;
|
||||
if (cpt == 3 && have_norm == 0) {
|
||||
sup->normal = (sup->max / 2 );
|
||||
sup->value = (sup->max / 2 );
|
||||
sup->normal = sup->value;
|
||||
return sup;
|
||||
}
|
||||
free(sup);
|
||||
|
@ -385,6 +408,16 @@ find_true_variables(xmlNode *node, capabilities_t *scanner, int type)
|
|||
return (0);
|
||||
}
|
||||
|
||||
static char*
|
||||
replace_char(char* str, char find, char replace){
|
||||
char *current_pos = strchr(str,find);
|
||||
while (current_pos) {
|
||||
*current_pos = replace;
|
||||
current_pos = strchr(current_pos,find);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* \fn static int print_xml_c(xmlNode *node, capabilities_t *scanner)
|
||||
* \brief Function that browses the xml file, node by node.
|
||||
|
@ -399,6 +432,10 @@ print_xml_c(xmlNode *node, ESCL_Device *device, capabilities_t *scanner, int typ
|
|||
if (find_nodes_c(node) && type != -1)
|
||||
find_true_variables(node, scanner, type);
|
||||
}
|
||||
if (!strcmp((const char *)node->name, "Version")&& node->ns && node->ns->prefix){
|
||||
if (!strcmp((const char*)node->ns->prefix, "pwg"))
|
||||
device->version = strdup((const char *)xmlNodeGetContent(node));
|
||||
}
|
||||
if (!strcmp((const char *)node->name, "MakeAndModel")){
|
||||
device->model_name = strdup((const char *)xmlNodeGetContent(node));
|
||||
}
|
||||
|
@ -454,6 +491,37 @@ _reduce_color_modes(capabilities_t *scanner)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_delete_pdf(capabilities_t *scanner)
|
||||
{
|
||||
int type = 0;
|
||||
for (type = 0; type < 3; type++) {
|
||||
if (scanner->caps[type].ColorModesSize) {
|
||||
if (scanner->caps[type].default_format) {
|
||||
scanner->caps[type].have_pdf = -1;
|
||||
if (!strcmp(scanner->caps[type].default_format, "application/pdf")) {
|
||||
free(scanner->caps[type].default_format);
|
||||
if (scanner->caps[type].have_tiff > -1)
|
||||
scanner->caps[type].default_format = strdup("image/tiff");
|
||||
else if (scanner->caps[type].have_png > -1)
|
||||
scanner->caps[type].default_format = strdup("image/png");
|
||||
else if (scanner->caps[type].have_jpeg > -1)
|
||||
scanner->caps[type].default_format = strdup("image/jpeg");
|
||||
}
|
||||
free(scanner->caps[type].ColorModes);
|
||||
scanner->caps[type].ColorModes = NULL;
|
||||
scanner->caps[type].ColorModesSize = 0;
|
||||
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes,
|
||||
&scanner->caps[type].ColorModesSize,
|
||||
(SANE_String_Const)SANE_VALUE_SCAN_MODE_GRAY, 0);
|
||||
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes,
|
||||
&scanner->caps[type].ColorModesSize,
|
||||
(SANE_String_Const)SANE_VALUE_SCAN_MODE_COLOR, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \fn capabilities_t *escl_capabilities(const ESCL_Device *device, SANE_Status *status)
|
||||
* \brief Function that finally recovers all the capabilities of the scanner, using curl.
|
||||
|
@ -463,15 +531,17 @@ _reduce_color_modes(capabilities_t *scanner)
|
|||
* \return scanner (the structure that stocks all the capabilities elements)
|
||||
*/
|
||||
capabilities_t *
|
||||
escl_capabilities(ESCL_Device *device, SANE_Status *status)
|
||||
escl_capabilities(ESCL_Device *device, char *blacklist, SANE_Status *status)
|
||||
{
|
||||
capabilities_t *scanner = (capabilities_t*)calloc(1, sizeof(capabilities_t));
|
||||
CURL *curl_handle = NULL;
|
||||
struct cap *var = NULL;
|
||||
struct cap *header = NULL;
|
||||
xmlDoc *data = NULL;
|
||||
xmlNode *node = NULL;
|
||||
int i = 0;
|
||||
const char *scanner_capabilities = "/eSCL/ScannerCapabilities";
|
||||
SANE_Bool use_pdf = SANE_TRUE;
|
||||
|
||||
*status = SANE_STATUS_GOOD;
|
||||
if (device == NULL)
|
||||
|
@ -481,11 +551,22 @@ escl_capabilities(ESCL_Device *device, SANE_Status *status)
|
|||
*status = SANE_STATUS_NO_MEM;
|
||||
var->memory = malloc(1);
|
||||
var->size = 0;
|
||||
header = (struct cap *)calloc(1, sizeof(struct cap));
|
||||
if (header == NULL)
|
||||
*status = SANE_STATUS_NO_MEM;
|
||||
header->memory = malloc(1);
|
||||
header->size = 0;
|
||||
curl_handle = curl_easy_init();
|
||||
escl_curl_url(curl_handle, device, scanner_capabilities);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, memory_callback_c);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)var);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)header);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
|
||||
CURLcode res = curl_easy_perform(curl_handle);
|
||||
if (res == CURLE_OK)
|
||||
DBG( 1, "Create NewJob : the scanner header responded : [%s]\n", header->memory);
|
||||
if (res != CURLE_OK) {
|
||||
DBG( 1, "The scanner didn't respond: %s\n", curl_easy_strerror(res));
|
||||
*status = SANE_STATUS_INVAL;
|
||||
|
@ -503,18 +584,46 @@ escl_capabilities(ESCL_Device *device, SANE_Status *status)
|
|||
goto clean;
|
||||
}
|
||||
|
||||
if (device->hack &&
|
||||
header &&
|
||||
header->memory &&
|
||||
strstr(header->memory, "Server: HP_Compact_Server"))
|
||||
device->hack = curl_slist_append(NULL, "Host: localhost");
|
||||
|
||||
scanner->source = 0;
|
||||
scanner->Sources = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * 4);
|
||||
for (i = 0; i < 4; i++)
|
||||
scanner->Sources[i] = NULL;
|
||||
print_xml_c(node, device, scanner, -1);
|
||||
_reduce_color_modes(scanner);
|
||||
DBG (3, "1-blacklist_pdf: %s\n", (use_pdf ? "TRUE" : "FALSE") );
|
||||
if (device->model_name != NULL) {
|
||||
if (strcasestr(device->model_name, "MFC-J985DW")) {
|
||||
DBG (3, "blacklist_pdf: device not support PDF\n");
|
||||
use_pdf = SANE_FALSE;
|
||||
}
|
||||
else if (blacklist) {
|
||||
char *model = strdup(device->model_name);
|
||||
replace_char(model, ' ', '_');
|
||||
if (strcasestr(blacklist, model)) {
|
||||
use_pdf = SANE_FALSE;
|
||||
}
|
||||
free(model);
|
||||
}
|
||||
}
|
||||
DBG (3, "1-blacklist_pdf: %s\n", (use_pdf ? "TRUE" : "FALSE") );
|
||||
if (use_pdf)
|
||||
_reduce_color_modes(scanner);
|
||||
else
|
||||
_delete_pdf(scanner);
|
||||
clean:
|
||||
xmlFreeDoc(data);
|
||||
clean_data:
|
||||
xmlCleanupParser();
|
||||
xmlMemoryDump();
|
||||
curl_easy_cleanup(curl_handle);
|
||||
if (header)
|
||||
free(header->memory);
|
||||
free(header);
|
||||
if (var)
|
||||
free(var->memory);
|
||||
free(var);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <avahi-client/lookup.h>
|
||||
#include <avahi-common/error.h>
|
||||
|
@ -53,39 +54,65 @@ static int count_finish = 0;
|
|||
*/
|
||||
static void
|
||||
resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface,
|
||||
AVAHI_GCC_UNUSED AvahiProtocol protocol,
|
||||
AvahiResolverEvent event, const char *name,
|
||||
AvahiProtocol protocol,
|
||||
AvahiResolverEvent event,
|
||||
const char *name,
|
||||
const char __sane_unused__ *type,
|
||||
const char __sane_unused__ *domain,
|
||||
const char __sane_unused__ *host_name,
|
||||
const AvahiAddress *address, uint16_t port, AvahiStringList *txt,
|
||||
const AvahiAddress *address,
|
||||
uint16_t port,
|
||||
AvahiStringList *txt,
|
||||
AvahiLookupResultFlags __sane_unused__ flags,
|
||||
void __sane_unused__ *userdata)
|
||||
{
|
||||
char a[AVAHI_ADDRESS_STR_MAX], *t;
|
||||
char a[(AVAHI_ADDRESS_STR_MAX + 10)] = { 0 };
|
||||
char *t;
|
||||
const char *is;
|
||||
const char *uuid;
|
||||
AvahiStringList *s;
|
||||
assert(r);
|
||||
switch (event) {
|
||||
case AVAHI_RESOLVER_FAILURE:
|
||||
break;
|
||||
case AVAHI_RESOLVER_FOUND:
|
||||
avahi_address_snprint(a, sizeof(a), address);
|
||||
t = avahi_string_list_to_string(txt);
|
||||
if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) {
|
||||
s = avahi_string_list_find(txt, "is");
|
||||
if (s && s->size > 3)
|
||||
is = (const char*)s->text + 3;
|
||||
else
|
||||
is = (const char*)NULL;
|
||||
s = avahi_string_list_find(txt, "uuid");
|
||||
if (s && s->size > 5)
|
||||
uuid = (const char*)s->text + 5;
|
||||
else
|
||||
uuid = (const char*)NULL;
|
||||
escl_device_add(port, name, a, is, uuid, (char*)type);
|
||||
}
|
||||
case AVAHI_RESOLVER_FAILURE:
|
||||
break;
|
||||
case AVAHI_RESOLVER_FOUND:
|
||||
{
|
||||
char *psz_addr = ((void*)0);
|
||||
char b[128] = { 0 };
|
||||
avahi_address_snprint(b, (sizeof(b)/sizeof(b[0]))-1, address);
|
||||
#ifdef ENABLE_IPV6
|
||||
if (protocol == AVAHI_PROTO_INET6 && strchr(b, ':'))
|
||||
{
|
||||
if ( asprintf( &psz_addr, "[%s]", b ) == -1 )
|
||||
break;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ( asprintf( &psz_addr, "%s", b ) == -1 )
|
||||
break;
|
||||
}
|
||||
t = avahi_string_list_to_string(txt);
|
||||
if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) {
|
||||
s = avahi_string_list_find(txt, "is");
|
||||
if (s && s->size > 3)
|
||||
is = (const char*)s->text + 3;
|
||||
else
|
||||
is = (const char*)NULL;
|
||||
s = avahi_string_list_find(txt, "uuid");
|
||||
if (s && s->size > 5)
|
||||
uuid = (const char*)s->text + 5;
|
||||
else
|
||||
uuid = (const char*)NULL;
|
||||
DBG (10, "resolve_callback [%s]\n", a);
|
||||
if (strstr(psz_addr, "127.0.0.1") != NULL) {
|
||||
escl_device_add(port, name, "localhost", is, uuid, (char*)type);
|
||||
DBG (10,"resolve_callback fix redirect [localhost]\n");
|
||||
}
|
||||
else
|
||||
escl_device_add(port, name, psz_addr, is, uuid, (char*)type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -192,40 +192,53 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
|||
cinfo.out_color_space = JCS_RGB;
|
||||
cinfo.quantize_colors = FALSE;
|
||||
jpeg_calc_output_dimensions(&cinfo);
|
||||
if (cinfo.output_width < (unsigned int)scanner->caps[scanner->source].width)
|
||||
scanner->caps[scanner->source].width = cinfo.output_width;
|
||||
if (scanner->caps[scanner->source].pos_x < 0)
|
||||
scanner->caps[scanner->source].pos_x = 0;
|
||||
double ratio = (double)cinfo.output_width / (double)scanner->caps[scanner->source].width;
|
||||
int rw = (int)((double)scanner->caps[scanner->source].width * ratio);
|
||||
int rh = (int)((double)scanner->caps[scanner->source].height * ratio);
|
||||
int rx = (int)((double)scanner->caps[scanner->source].pos_x * ratio);
|
||||
int ry = (int)((double)scanner->caps[scanner->source].pos_y * ratio);
|
||||
|
||||
if (cinfo.output_height < (unsigned int)scanner->caps[scanner->source].height)
|
||||
scanner->caps[scanner->source].height = cinfo.output_height;
|
||||
if (scanner->caps[scanner->source].pos_y < 0)
|
||||
scanner->caps[scanner->source].pos_y = 0;
|
||||
|
||||
if (cinfo.output_width < (unsigned int)rw)
|
||||
rw = cinfo.output_width;
|
||||
if (rx < 0)
|
||||
rx = 0;
|
||||
|
||||
if (cinfo.output_height < (unsigned int)rh)
|
||||
rh = cinfo.output_height;
|
||||
if (ry < 0)
|
||||
ry = 0;
|
||||
DBG(10, "1-JPEF Geometry [%dx%d|%dx%d]\n",
|
||||
scanner->caps[scanner->source].pos_x,
|
||||
scanner->caps[scanner->source].pos_y,
|
||||
scanner->caps[scanner->source].width,
|
||||
scanner->caps[scanner->source].height);
|
||||
x_off = scanner->caps[scanner->source].pos_x;
|
||||
if (x_off > (unsigned int)scanner->caps[scanner->source].width) {
|
||||
w = scanner->caps[scanner->source].width;
|
||||
rx,
|
||||
ry,
|
||||
rw,
|
||||
rh);
|
||||
x_off = rx;
|
||||
if (x_off > (unsigned int)rw) {
|
||||
w = rw;
|
||||
x_off = 0;
|
||||
}
|
||||
else
|
||||
w = scanner->caps[scanner->source].width - x_off;
|
||||
y_off = scanner->caps[scanner->source].pos_y;
|
||||
if(y_off > (unsigned int)scanner->caps[scanner->source].height) {
|
||||
h = scanner->caps[scanner->source].height;
|
||||
w = rw - x_off;
|
||||
y_off = ry;
|
||||
if(y_off > (unsigned int)rh) {
|
||||
h = rh;
|
||||
y_off = 0;
|
||||
}
|
||||
else
|
||||
h = scanner->caps[scanner->source].height - y_off;
|
||||
h = rh - y_off;
|
||||
DBG(10, "2-JPEF Geometry [%dx%d|%dx%d]\n",
|
||||
x_off,
|
||||
y_off,
|
||||
w,
|
||||
h);
|
||||
surface = malloc(w * h * cinfo.output_components);
|
||||
jpeg_start_decompress(&cinfo);
|
||||
if (x_off > 0 || w < cinfo.output_width)
|
||||
jpeg_crop_scanline(&cinfo, &x_off, &w);
|
||||
lineSize = w * cinfo.output_components;
|
||||
if (y_off > 0)
|
||||
jpeg_skip_scanlines(&cinfo, y_off);
|
||||
surface = malloc(cinfo.output_width * cinfo.output_height * cinfo.output_components);
|
||||
if (surface == NULL) {
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
DBG( 1, "Escl Jpeg : Memory allocation problem\n");
|
||||
|
@ -235,14 +248,8 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
|||
}
|
||||
return (SANE_STATUS_NO_MEM);
|
||||
}
|
||||
jpeg_start_decompress(&cinfo);
|
||||
if (x_off > 0 || w < cinfo.output_width)
|
||||
jpeg_crop_scanline(&cinfo, &x_off, &w);
|
||||
lineSize = w * cinfo.output_components;
|
||||
if (y_off > 0)
|
||||
jpeg_skip_scanlines(&cinfo, y_off);
|
||||
pos = 0;
|
||||
while (cinfo.output_scanline < (unsigned int)scanner->caps[scanner->source].height) {
|
||||
while (cinfo.output_scanline < (unsigned int)rh) {
|
||||
rowptr[0] = (JSAMPROW)surface + (lineSize * pos); // ..cinfo.output_scanline);
|
||||
jpeg_read_scanlines(&cinfo, rowptr, (JDIMENSION) 1);
|
||||
pos++;
|
||||
|
@ -253,7 +260,7 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
|||
*width = w;
|
||||
*height = h;
|
||||
*bps = cinfo.output_components;
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
// jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(scanner->tmp);
|
||||
scanner->tmp = NULL;
|
||||
|
|
|
@ -46,7 +46,7 @@ struct downloading
|
|||
static const char settings[] =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
|
||||
"<scan:ScanSettings xmlns:pwg=\"http://www.pwg.org/schemas/2010/12/sm\" xmlns:scan=\"http://schemas.hp.com/imaging/escl/2011/05/03\">" \
|
||||
" <pwg:Version>2.0</pwg:Version>" \
|
||||
" <pwg:Version>%s</pwg:Version>" \
|
||||
" <pwg:ScanRegions>" \
|
||||
" <pwg:ScanRegion>" \
|
||||
" <pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>" \
|
||||
|
@ -56,13 +56,11 @@ static const char settings[] =
|
|||
" <pwg:YOffset>%d</pwg:YOffset>" \
|
||||
" </pwg:ScanRegion>" \
|
||||
" </pwg:ScanRegions>" \
|
||||
" <pwg:DocumentFormat>%s</pwg:DocumentFormat>" \
|
||||
"%s" \
|
||||
" <scan:ColorMode>%s</scan:ColorMode>" \
|
||||
" <scan:XResolution>%d</scan:XResolution>" \
|
||||
" <scan:YResolution>%d</scan:YResolution>" \
|
||||
" <pwg:InputSource>%s</pwg:InputSource>" \
|
||||
" <scan:InputSource>%s</scan:InputSource>" \
|
||||
"%s" \
|
||||
"%s" \
|
||||
"</scan:ScanSettings>";
|
||||
|
@ -138,8 +136,8 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
|||
char *location = NULL;
|
||||
char *result = NULL;
|
||||
char *temporary = NULL;
|
||||
char *f_ext = "";
|
||||
char *format_ext = NULL;
|
||||
char f_ext_tmp[1024];
|
||||
char duplex_mode[1024] = { 0 };
|
||||
int wakup_count = 0;
|
||||
|
||||
|
@ -170,35 +168,38 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
|||
int have_tiff = scanner->caps[scanner->source].have_tiff;
|
||||
int have_pdf = scanner->caps[scanner->source].have_pdf;
|
||||
|
||||
if ((scanner->source == PLATEN && have_pdf == -1) ||
|
||||
(scanner->source > PLATEN)) {
|
||||
if (have_tiff != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
|
||||
}
|
||||
else if (have_png != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
|
||||
}
|
||||
else if (have_jpeg != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
|
||||
}
|
||||
if (have_pdf != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
||||
}
|
||||
else {
|
||||
else if (have_tiff != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
|
||||
}
|
||||
if (scanner->caps[scanner->source].format_ext == 1)
|
||||
else if (have_png != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
|
||||
}
|
||||
else if (have_jpeg != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
|
||||
}
|
||||
if (atof ((const char *)device->version) <= 2.0)
|
||||
{
|
||||
char f_ext_tmp[1024];
|
||||
// For eSCL 2.0 and older clients
|
||||
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
|
||||
" <pwg:DocumentFormat>%s</pwg:DocumentFormat>",
|
||||
scanner->caps[scanner->source].default_format);
|
||||
}
|
||||
else
|
||||
{
|
||||
// For eSCL 2.1 and newer clients
|
||||
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
|
||||
" <scan:DocumentFormatExt>%s</scan:DocumentFormatExt>",
|
||||
scanner->caps[scanner->source].default_format);
|
||||
format_ext = f_ext_tmp;
|
||||
}
|
||||
else
|
||||
format_ext = f_ext;
|
||||
format_ext = f_ext_tmp;
|
||||
|
||||
if(scanner->source > PLATEN && scanner->Sources[ADFDUPLEX]) {
|
||||
snprintf(duplex_mode, sizeof(duplex_mode),
|
||||
" <scan:Duplex>%s</scan:Duplex>",
|
||||
|
@ -215,52 +216,63 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
|||
char *source = (scanner->source == PLATEN ? "Platen" : "Feeder");
|
||||
if (scanner->use_threshold)
|
||||
{
|
||||
char *tmp = add_support_option("ThresholdSupport", scanner->val_threshold);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
if (scanner->val_threshold != scanner->threshold->value)
|
||||
{
|
||||
char *tmp = add_support_option("ThresholdSupport", scanner->val_threshold);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
if (scanner->use_sharpen)
|
||||
{
|
||||
char *tmp = add_support_option("SharpenSupport", scanner->val_sharpen);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
if (scanner->val_sharpen != scanner->sharpen->value)
|
||||
{
|
||||
char *tmp = add_support_option("SharpenSupport", scanner->val_sharpen);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
if (scanner->use_contrast)
|
||||
{
|
||||
char *tmp = add_support_option("ContrastSupport", scanner->val_contrast);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
if (scanner->val_contrast != scanner->contrast->value)
|
||||
{
|
||||
char *tmp = add_support_option("ContrastSupport", scanner->val_contrast);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
if (scanner->use_brightness)
|
||||
{
|
||||
char *tmp = add_support_option("BrightnessSupport", scanner->val_brightness);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
if (scanner->val_brightness != scanner->brightness->value)
|
||||
{
|
||||
char *tmp = add_support_option("BrightnessSupport", scanner->val_brightness);
|
||||
if (support_options[0])
|
||||
strcat(support_options, tmp);
|
||||
else
|
||||
strcpy(support_options, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
snprintf(cap_data, sizeof(cap_data), settings,
|
||||
device->version,
|
||||
scanner->caps[scanner->source].height,
|
||||
scanner->caps[scanner->source].width,
|
||||
off_x,
|
||||
off_y,
|
||||
scanner->caps[scanner->source].default_format,
|
||||
format_ext,
|
||||
scanner->caps[scanner->source].default_color,
|
||||
scanner->caps[scanner->source].default_resolution,
|
||||
scanner->caps[scanner->source].default_resolution,
|
||||
source,
|
||||
source,
|
||||
duplex_mode[0] == 0 ? " " : duplex_mode,
|
||||
support_options[0] == 0 ? " " : support_options);
|
||||
upload->memory = strdup(cap_data);
|
||||
|
@ -277,6 +289,8 @@ wake_up_device:
|
|||
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, upload->size);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, download_callback);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)download);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
|
||||
CURLcode res = curl_easy_perform(curl_handle);
|
||||
if (res != CURLE_OK) {
|
||||
DBG( 1, "Create NewJob : the scanner responded incorrectly: %s\n", curl_easy_strerror(res));
|
||||
|
@ -296,7 +310,17 @@ wake_up_device:
|
|||
result = strdup(location);
|
||||
DBG( 1, "Create NewJob : %s\n", result);
|
||||
*temporary = '\n';
|
||||
*location = '\0';
|
||||
location = strrchr(tmp_location,'/');
|
||||
wakup_count = 0;
|
||||
if (location) {
|
||||
location++;
|
||||
scanner->scanJob = strdup(location);
|
||||
DBG( 1, "Full location header [%s]\n", scanner->scanJob);
|
||||
}
|
||||
else
|
||||
scanner->scanJob = strdup("ScanJobs");
|
||||
*location = '/';
|
||||
}
|
||||
}
|
||||
if (result == NULL) {
|
||||
|
|
|
@ -44,8 +44,9 @@
|
|||
|
||||
#if HAVE_POPPLER_GLIB
|
||||
|
||||
#define INPUT_BUFFER_SIZE 4096
|
||||
#define ESCL_PDF_USE_MAPPED_FILE POPPLER_CHECK_VERSION(0,82,0)
|
||||
|
||||
#if ! ESCL_PDF_USE_MAPPED_FILE
|
||||
static unsigned char*
|
||||
set_file_in_buffer(FILE *fp, int *size)
|
||||
{
|
||||
|
@ -70,6 +71,7 @@ set_file_in_buffer(FILE *fp, int *size)
|
|||
*size = nx;
|
||||
return data;
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned char *
|
||||
cairo_surface_to_pixels (cairo_surface_t *surface, int bps)
|
||||
|
@ -109,29 +111,53 @@ get_PDF_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
|||
PopplerPage *page;
|
||||
PopplerDocument *doc;
|
||||
double dw, dh;
|
||||
int w, h, size = 0;
|
||||
char *data = NULL;
|
||||
int w, h;
|
||||
unsigned char* surface = NULL;
|
||||
SANE_Status status = SANE_STATUS_GOOD;
|
||||
|
||||
#if ESCL_PDF_USE_MAPPED_FILE
|
||||
GMappedFile *file;
|
||||
GBytes *bytes;
|
||||
|
||||
data = (char*)set_file_in_buffer(scanner->tmp, &size);
|
||||
if (!data) {
|
||||
DBG(1, "Error : poppler_document_new_from_data");
|
||||
file = g_mapped_file_new_from_fd (fileno (scanner->tmp), 0, NULL);
|
||||
if (!file) {
|
||||
DBG(1, "Error : g_mapped_file_new_from_fd");
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto close_file;
|
||||
}
|
||||
doc = poppler_document_new_from_data(data,
|
||||
size,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
if (!doc) {
|
||||
DBG(1, "Error : poppler_document_new_from_data");
|
||||
bytes = g_mapped_file_get_bytes (file);
|
||||
if (!bytes) {
|
||||
DBG(1, "Error : g_mapped_file_get_bytes");
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto free_file;
|
||||
}
|
||||
|
||||
doc = poppler_document_new_from_bytes (bytes, NULL, NULL);
|
||||
if (!doc) {
|
||||
DBG(1, "Error : poppler_document_new_from_bytes");
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto free_bytes;
|
||||
}
|
||||
#else
|
||||
int size = 0;
|
||||
char *data = NULL;
|
||||
|
||||
data = (char*)set_file_in_buffer(scanner->tmp, &size);
|
||||
if (!data) {
|
||||
DBG(1, "Error : set_file_in_buffer");
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto close_file;
|
||||
}
|
||||
|
||||
doc = poppler_document_new_from_data (data, size, NULL, NULL);
|
||||
if (!doc) {
|
||||
DBG(1, "Error : poppler_document_new_from_data");
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto free_data;
|
||||
}
|
||||
#endif
|
||||
|
||||
page = poppler_document_get_page (doc, 0);
|
||||
if (!page) {
|
||||
DBG(1, "Error : poppler_document_get_page");
|
||||
|
@ -201,8 +227,15 @@ free_page:
|
|||
g_object_unref (page);
|
||||
free_doc:
|
||||
g_object_unref (doc);
|
||||
#if ESCL_PDF_USE_MAPPED_FILE
|
||||
free_bytes:
|
||||
g_bytes_unref (bytes);
|
||||
free_file:
|
||||
g_mapped_file_unref (file);
|
||||
#else
|
||||
free_data:
|
||||
free(data);
|
||||
#endif
|
||||
close_file:
|
||||
if (scanner->tmp)
|
||||
fclose(scanner->tmp);
|
||||
|
|
|
@ -44,10 +44,35 @@ write_callback(void __sane_unused__*str,
|
|||
* This function is called in the 'sane_cancel' function.
|
||||
*/
|
||||
void
|
||||
escl_scanner(const ESCL_Device *device, char *result)
|
||||
escl_delete(const ESCL_Device *device, char *uri)
|
||||
{
|
||||
CURL *curl_handle = NULL;
|
||||
const char *scan_jobs = "/eSCL/ScanJobs";
|
||||
long answer = 0;
|
||||
|
||||
if (uri == NULL)
|
||||
return;
|
||||
curl_handle = curl_easy_init();
|
||||
if (curl_handle != NULL) {
|
||||
escl_curl_url(curl_handle, device, uri);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||
if (curl_easy_perform(curl_handle) == CURLE_OK) {
|
||||
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &answer);
|
||||
return;
|
||||
}
|
||||
curl_easy_cleanup(curl_handle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \fn void escl_scanner(const ESCL_Device *device, char *result)
|
||||
* \brief Function that resets the scanner after each scan, using curl.
|
||||
* This function is called in the 'sane_cancel' function.
|
||||
*/
|
||||
void
|
||||
escl_scanner(const ESCL_Device *device, char *scanJob, char *result, SANE_Bool status)
|
||||
{
|
||||
CURL *curl_handle = NULL;
|
||||
const char *scan_jobs = "/eSCL/";
|
||||
const char *scanner_start = "/NextDocument";
|
||||
char scan_cmd[PATH_MAX] = { 0 };
|
||||
int i = 0;
|
||||
|
@ -58,20 +83,27 @@ escl_scanner(const ESCL_Device *device, char *result)
|
|||
CURL_CALL:
|
||||
curl_handle = curl_easy_init();
|
||||
if (curl_handle != NULL) {
|
||||
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s",
|
||||
scan_jobs, result, scanner_start);
|
||||
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s%s",
|
||||
scan_jobs, scanJob, result, scanner_start);
|
||||
escl_curl_url(curl_handle, device, scan_cmd);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
|
||||
if (curl_easy_perform(curl_handle) == CURLE_OK) {
|
||||
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &answer);
|
||||
i++;
|
||||
if (i >= 15) return;
|
||||
}
|
||||
curl_easy_cleanup(curl_handle);
|
||||
if (SANE_STATUS_GOOD != escl_status(device,
|
||||
PLATEN,
|
||||
NULL,
|
||||
NULL))
|
||||
goto CURL_CALL;
|
||||
char* end = strrchr(scan_cmd, '/');
|
||||
*end = 0;
|
||||
escl_delete(device, scan_cmd);
|
||||
if (status) {
|
||||
if (SANE_STATUS_GOOD != escl_status(device,
|
||||
PLATEN,
|
||||
NULL,
|
||||
NULL))
|
||||
goto CURL_CALL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ write_callback(void *str, size_t size, size_t nmemb, void *userp)
|
|||
* \return status (if everything is OK, status = SANE_STATUS_GOOD, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
|
||||
*/
|
||||
SANE_Status
|
||||
escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
|
||||
escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *scanJob, char *result)
|
||||
{
|
||||
CURL *curl_handle = NULL;
|
||||
const char *scan_jobs = "/eSCL/ScanJobs";
|
||||
const char *scan_jobs = "/eSCL/";
|
||||
const char *scanner_start = "/NextDocument";
|
||||
char scan_cmd[PATH_MAX] = { 0 };
|
||||
SANE_Status status = SANE_STATUS_GOOD;
|
||||
|
@ -70,10 +70,12 @@ escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
|
|||
scanner->real_read = 0;
|
||||
curl_handle = curl_easy_init();
|
||||
if (curl_handle != NULL) {
|
||||
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s",
|
||||
scan_jobs, result, scanner_start);
|
||||
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s%s",
|
||||
scan_jobs, scanJob, result, scanner_start);
|
||||
escl_curl_url(curl_handle, device, scan_cmd);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
|
||||
if (scanner->tmp)
|
||||
fclose(scanner->tmp);
|
||||
scanner->tmp = tmpfile();
|
||||
|
@ -82,6 +84,7 @@ escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
|
|||
CURLcode res = curl_easy_perform(curl_handle);
|
||||
if (res != CURLE_OK) {
|
||||
DBG( 1, "Unable to scan: %s\n", curl_easy_strerror(res));
|
||||
scanner->real_read = 0;
|
||||
fclose(scanner->tmp);
|
||||
scanner->tmp = NULL;
|
||||
status = SANE_STATUS_INVAL;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libxml/parser.h>
|
||||
|
||||
|
@ -220,6 +221,8 @@ reload:
|
|||
escl_curl_url(curl_handle, device, scanner_status);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, memory_callback_s);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)var);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
|
||||
CURLcode res = curl_easy_perform(curl_handle);
|
||||
if (res != CURLE_OK) {
|
||||
DBG( 1, "The scanner didn't respond: %s\n", curl_easy_strerror(res));
|
||||
|
@ -268,3 +271,135 @@ clean_data:
|
|||
}
|
||||
return (status);
|
||||
}
|
||||
|
||||
static void
|
||||
print_xml_job_finish(xmlNode *node,
|
||||
SANE_Status *job)
|
||||
{
|
||||
while (node) {
|
||||
if (node->type == XML_ELEMENT_NODE) {
|
||||
if (find_nodes_s(node)) {
|
||||
if (strcmp((const char *)node->name, "JobState") == 0) {
|
||||
const char *state = (const char *)xmlNodeGetContent(node);
|
||||
if (!strcmp(state, "Canceled")) {
|
||||
*job = SANE_STATUS_GOOD;
|
||||
DBG(10, "jobId Completed SANE_STATUS_GOOD\n");
|
||||
}
|
||||
else if (!strcmp(state, "Aborted")) {
|
||||
*job = SANE_STATUS_GOOD;
|
||||
DBG(10, "jobId Completed SANE_STATUS_GOOD\n");
|
||||
}
|
||||
else if (!strcmp(state, "Completed")) {
|
||||
*job = SANE_STATUS_GOOD;
|
||||
DBG(10, "jobId Completed SANE_STATUS_GOOD\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print_xml_job_finish(node->children, job);
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_xml_reset_all_jobs (xmlNode *node,
|
||||
ESCL_Device *device)
|
||||
{
|
||||
DBG(10, "print_xml_reset_all_jobs\n");
|
||||
SANE_Status status = SANE_STATUS_DEVICE_BUSY;
|
||||
while (node) {
|
||||
if (node->type == XML_ELEMENT_NODE) {
|
||||
if (find_nodes_s(node)) {
|
||||
if (strcmp((const char *)node->name, "JobUri") == 0) {
|
||||
DBG(10, "print_xml_reset_all_jobs: %s\n", node->name);
|
||||
if (device != NULL) {
|
||||
print_xml_job_finish (node, &status);
|
||||
if (status == SANE_STATUS_DEVICE_BUSY) {
|
||||
char *jobUri = (char *)xmlNodeGetContent(node);
|
||||
char *job = strrchr((const char *)jobUri, '/');
|
||||
char *scanj = NULL;
|
||||
if (job != NULL) {
|
||||
if (strstr(jobUri,"ScanJobs"))
|
||||
scanj = strdup("ScanJobs");
|
||||
else
|
||||
scanj = strdup("ScanJob");
|
||||
DBG(10, "print_xml_reset_all_jobs: %s/%s\n", scanj, job);
|
||||
escl_scanner(device, scanj, job, SANE_FALSE);
|
||||
free(scanj);
|
||||
}
|
||||
DBG(10, "print_xml_reset_all_jobs: sleep to finish the job\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print_xml_reset_all_jobs (node->children,
|
||||
device);
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \fn SANE_Status escl_reset_all_jobs (ESCL_Device *device, , char *scanJob)
|
||||
* \brief Function that forces the end of jobs, using curl.
|
||||
* This function is called in the 'sane_start' function.
|
||||
*
|
||||
* \return status (if everything is OK, status = SANE_STATUS_GOOD, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
|
||||
*/
|
||||
SANE_Status
|
||||
escl_reset_all_jobs(ESCL_Device *device)
|
||||
{
|
||||
CURL *curl_handle = NULL;
|
||||
xmlDoc *data = NULL;
|
||||
xmlNode *node = NULL;
|
||||
struct idle *var = NULL;
|
||||
const char *scanner_status = "/eSCL/ScannerStatus";
|
||||
SANE_Status status = SANE_STATUS_DEVICE_BUSY;
|
||||
|
||||
DBG(10, "escl_reset_all_jobs\n");
|
||||
if (device == NULL)
|
||||
return (SANE_STATUS_NO_MEM);
|
||||
DBG(10, "1 - escl_reset_all_jobs\n");
|
||||
var = (struct idle*)calloc(1, sizeof(struct idle));
|
||||
if (var == NULL)
|
||||
return (SANE_STATUS_NO_MEM);
|
||||
DBG(10, "2 - escl_reset_all_jobs\n");
|
||||
var->memory = malloc(1);
|
||||
var->size = 0;
|
||||
curl_handle = curl_easy_init();
|
||||
|
||||
escl_curl_url(curl_handle, device, scanner_status);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, memory_callback_s);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)var);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
|
||||
CURLcode res = curl_easy_perform(curl_handle);
|
||||
if (res != CURLE_OK) {
|
||||
DBG( 1, "The scanner didn't respond: %s\n", curl_easy_strerror(res));
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto clean_data1;
|
||||
}
|
||||
DBG(10, "3 - escl_reset_all_jobs\n");
|
||||
DBG( 10, "eSCL : Status : %s.\n", var->memory);
|
||||
data = xmlReadMemory(var->memory, var->size, "file.xml", NULL, 0);
|
||||
if (data == NULL) {
|
||||
status = SANE_STATUS_NO_MEM;
|
||||
goto clean_data1;
|
||||
}
|
||||
node = xmlDocGetRootElement(data);
|
||||
if (node == NULL) {
|
||||
status = SANE_STATUS_NO_MEM;
|
||||
goto clean1;
|
||||
}
|
||||
print_xml_reset_all_jobs (node, device);
|
||||
status = SANE_STATUS_GOOD;
|
||||
clean1:
|
||||
xmlFreeDoc(data);
|
||||
clean_data1:
|
||||
xmlCleanupParser();
|
||||
xmlMemoryDump();
|
||||
curl_easy_cleanup(curl_handle);
|
||||
free(var->memory);
|
||||
free(var);
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include "escl.h"
|
||||
|
||||
#include "../include/_stdint.h"
|
||||
|
||||
#include "../include/sane/sanei.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -53,11 +55,11 @@ SANE_Status
|
|||
get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
||||
{
|
||||
TIFF* tif = NULL;
|
||||
uint32 w = 0;
|
||||
uint32 h = 0;
|
||||
uint32_t w = 0;
|
||||
uint32_t h = 0;
|
||||
unsigned char *surface = NULL; /* image data*/
|
||||
int components = 4;
|
||||
uint32 npixels = 0;
|
||||
uint32_t npixels = 0;
|
||||
SANE_Status status = SANE_STATUS_GOOD;
|
||||
|
||||
lseek(fileno(scanner->tmp), 0, SEEK_SET);
|
||||
|
@ -71,15 +73,15 @@ get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
|||
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
|
||||
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
|
||||
npixels = w * h;
|
||||
surface = (unsigned char*) malloc(npixels * sizeof (uint32));
|
||||
if (surface != NULL)
|
||||
surface = (unsigned char*) malloc(npixels * sizeof (uint32_t));
|
||||
if (surface == NULL)
|
||||
{
|
||||
DBG( 1, "Escl Tiff : raster Memory allocation problem.\n");
|
||||
status = SANE_STATUS_INVAL;
|
||||
goto close_tiff;
|
||||
}
|
||||
|
||||
if (!TIFFReadRGBAImage(tif, w, h, (uint32 *)surface, 0))
|
||||
if (!TIFFReadRGBAImage(tif, w, h, (uint32_t *)surface, 0))
|
||||
{
|
||||
DBG( 1, "Escl Tiff : Problem reading image data.\n");
|
||||
status = SANE_STATUS_INVAL;
|
||||
|
|
|
@ -140,9 +140,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
|
|||
#define IN_periph_devtype_unknown 0x1f
|
||||
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
|
||||
#define IN_recognized 0x02
|
||||
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
|
||||
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
|
||||
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
|
||||
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
|
||||
0x08, (char *)in + 0x08)
|
||||
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
|
||||
0x10, (char *)in + 0x10)
|
||||
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
|
||||
0x04, (char *)in + 0x20)
|
||||
#define get_IN_color_offset(in) getnbyte (in+0x2A, 2) /* offset between colors */
|
||||
|
||||
/* these only in some scanners */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* sane - Scanner Access Now Easy.
|
||||
|
||||
This file is part of the SANE package, and implements a SANE backend
|
||||
for various Fujitsu scanners.
|
||||
for various Fujitsu and Ricoh scanners.
|
||||
|
||||
Copyright (C) 2000 Randolph Bentson
|
||||
Copyright (C) 2001 Frederik Ramm
|
||||
Copyright (C) 2001-2004 Oliver Schirrmeister
|
||||
Copyright (C) 2003-2019 m. allan noah
|
||||
Copyright (C) 2003-2023 m. allan noah
|
||||
|
||||
JPEG output and low memory usage support funded by:
|
||||
Archivista GmbH, www.archivista.ch
|
||||
|
@ -15,7 +15,7 @@
|
|||
Automatic length detection support funded by:
|
||||
Martin G. Miller, mgmiller at optonline.net
|
||||
Software image enhancement routines and recent scanner support funded by:
|
||||
Fujitsu Computer Products of America, Inc. www.fcpa.com
|
||||
PFU America, Inc., fujitsuscanners.com
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
|
@ -611,6 +611,13 @@
|
|||
- fix JPEG duplex memory corruption
|
||||
- change window_gamma init (fixes bright/contrast for iX1500)
|
||||
- only call send_lut after set_window (remove late_lut)
|
||||
v138 2022-06-01, MAN
|
||||
- minor updates to company name (FCPA -> PFU)
|
||||
v139 2022-11-15, MAN
|
||||
- move updated window_gamma logic to set_window
|
||||
- use internal gamma table if possible (fixes #618)
|
||||
v140 2023-03-27, MAN
|
||||
- add initial support for Ricoh scanners
|
||||
|
||||
SANE FLOW DIAGRAM
|
||||
|
||||
|
@ -660,7 +667,7 @@
|
|||
#include "fujitsu.h"
|
||||
|
||||
#define DEBUG 1
|
||||
#define BUILD 137
|
||||
#define BUILD 140
|
||||
|
||||
/* values for SANE_DEBUG_FUJITSU env var:
|
||||
- errors 5
|
||||
|
@ -764,16 +771,16 @@ static struct fujitsu *fujitsu_devList = NULL;
|
|||
SANE_Status
|
||||
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
||||
{
|
||||
authorize = authorize; /* get rid of compiler warning */
|
||||
(void) authorize; /* get rid of compiler warning */
|
||||
|
||||
DBG_INIT ();
|
||||
DBG (10, "sane_init: start\n");
|
||||
|
||||
if (version_code)
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
|
||||
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
|
||||
|
||||
DBG (5, "sane_init: fujitsu backend %d.%d.%d, from %s\n",
|
||||
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
|
||||
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
|
||||
|
||||
sanei_magic_init();
|
||||
|
||||
|
@ -819,7 +826,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
|
|||
int num_devices=0;
|
||||
int i=0;
|
||||
|
||||
local_only = local_only; /* get rid of compiler warning */
|
||||
(void) local_only; /* get rid of compiler warning */
|
||||
|
||||
DBG (10, "sane_get_devices: start\n");
|
||||
|
||||
|
@ -1149,7 +1156,7 @@ connect_fd (struct fujitsu *s)
|
|||
}
|
||||
|
||||
/*
|
||||
* This routine will check if a certain device is a Fujitsu scanner
|
||||
* This routine will check if a certain device is a Fujitsu/Ricoh scanner
|
||||
* It also copies interesting data from INQUIRY into the handle structure
|
||||
*/
|
||||
static SANE_Status
|
||||
|
@ -1204,9 +1211,9 @@ init_inquire (struct fujitsu *s)
|
|||
for (i = 3; s->version_name[i] == ' ' && i >= 0; i--)
|
||||
s->version_name[i] = 0;
|
||||
|
||||
if (strcmp ("FUJITSU", s->vendor_name)) {
|
||||
if (strcmp ("FUJITSU", s->vendor_name) && strcmp ("RICOH", s->vendor_name)) {
|
||||
DBG (5, "The device at '%s' is reported to be made by '%s'\n", s->device_name, s->vendor_name);
|
||||
DBG (5, "This backend only supports Fujitsu products.\n");
|
||||
DBG (5, "This backend only supports Fujitsu and Ricoh products.\n");
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
|
||||
|
@ -2107,12 +2114,6 @@ init_model (struct fujitsu *s)
|
|||
s->ppl_mod_by_mode[MODE_GRAYSCALE] = 1;
|
||||
s->ppl_mod_by_mode[MODE_COLOR] = 1;
|
||||
|
||||
/* we prefer to use the downloaded (LUT) gamma table (0x80) if possible.
|
||||
* but if scanner has only built-in gamma tables, we use the first one (0) */
|
||||
if (s->num_download_gamma){
|
||||
s->window_gamma = 0x80;
|
||||
}
|
||||
|
||||
/* endorser type tells string length (among other things) */
|
||||
if(s->has_endorser_b){
|
||||
/*old-style is 40 bytes*/
|
||||
|
@ -2206,7 +2207,10 @@ init_model (struct fujitsu *s)
|
|||
s->color_interlace = COLOR_INTERLACE_3091;
|
||||
s->duplex_interlace = DUPLEX_INTERLACE_3091;
|
||||
s->ghs_in_rs = 1;
|
||||
s->window_gamma = 0;
|
||||
|
||||
/* might be inaccurate */
|
||||
s->num_internal_gamma = 1;
|
||||
s->num_download_gamma = 0;
|
||||
|
||||
s->reverse_by_mode[MODE_LINEART] = 1;
|
||||
s->reverse_by_mode[MODE_HALFTONE] = 1;
|
||||
|
@ -7055,12 +7059,11 @@ sane_start (SANE_Handle handle)
|
|||
goto errors;
|
||||
}
|
||||
|
||||
/* send lut if scanner has no hardware brightness/contrast,
|
||||
* or we are going to ask it to use a downloaded gamma table */
|
||||
if (!s->brightness_steps || !s->contrast_steps || s->window_gamma & 0x80){
|
||||
/* send lut if set_window said we would */
|
||||
if ( s->window_gamma ){
|
||||
ret = send_lut(s);
|
||||
if (ret != SANE_STATUS_GOOD)
|
||||
DBG (5, "sane_start: WARNING: cannot late send_lut %d\n", ret);
|
||||
DBG (5, "sane_start: WARNING: cannot send_lut %d\n", ret);
|
||||
}
|
||||
|
||||
/* some scanners need the q table sent, even when not scanning jpeg */
|
||||
|
@ -7614,6 +7617,23 @@ set_window (struct fujitsu *s)
|
|||
/* the remainder of the block varies based on model and mode,
|
||||
* except for gamma and paper size, those are in the same place */
|
||||
|
||||
/* determine if we need to send gamma LUT.
|
||||
* send lut if scanner supports it and any of:
|
||||
* has no hardware brightness but user changed it
|
||||
* has no hardware contrast but user changed it
|
||||
* has no internal gamma table */
|
||||
if ( s->num_download_gamma && (
|
||||
(!s->brightness_steps && s->brightness != 0)
|
||||
|| (!s->contrast_steps && s->contrast != 0 )
|
||||
|| !s->num_internal_gamma
|
||||
) ){
|
||||
s->window_gamma = 0x80;
|
||||
}
|
||||
/* otherwise, use the internal table */
|
||||
else{
|
||||
s->window_gamma = 0;
|
||||
}
|
||||
|
||||
/*vuid c0*/
|
||||
if(s->has_vuid_3091){
|
||||
set_WD_vendor_id_code (desc1, WD_VUID_3091);
|
||||
|
@ -9270,7 +9290,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg)
|
|||
DBG (5, "sense_handler: start\n");
|
||||
|
||||
/* kill compiler warning */
|
||||
fd = fd;
|
||||
(void) fd;
|
||||
|
||||
/* copy the rs return data into the scanner struct
|
||||
so that the caller can use it if he wants */
|
||||
|
@ -9605,8 +9625,8 @@ do_scsi_cmd(struct fujitsu *s, int runRS, int shortTime,
|
|||
int ret;
|
||||
|
||||
/*shut up compiler*/
|
||||
runRS=runRS;
|
||||
shortTime=shortTime;
|
||||
(void) runRS;
|
||||
(void) shortTime;
|
||||
|
||||
DBG(10, "do_scsi_cmd: start\n");
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ scsi FUJITSU
|
|||
# To use a specific scsi device
|
||||
#scsi /dev/sg1
|
||||
|
||||
# For Fujitsu scanners connected via USB on a known device (kernel driver):
|
||||
# For scanners connected via USB on a known device (kernel driver):
|
||||
#usb /dev/usb/scanner0
|
||||
|
||||
# For Fujitsu scanners connected via USB using vendor and device ids (libusb):
|
||||
# For scanners connected via USB using vendor and device ids (libusb):
|
||||
#usb VENDORID PRODUCTID
|
||||
|
||||
# NOTE: if you have to add your device here- please send the id and model
|
||||
|
@ -264,3 +264,51 @@ usb 0x04c5 0x160a
|
|||
|
||||
#fi-7800
|
||||
usb 0x04c5 0x160b
|
||||
|
||||
#ScanSnap iX1600
|
||||
usb 0x04c5 0x1632
|
||||
|
||||
#ScanPartner SP30
|
||||
usb 0x04c5 0x140a
|
||||
|
||||
#fi-7300NX
|
||||
usb 0x04c5 0x1575
|
||||
|
||||
#fi-8190
|
||||
usb 0x04c5 0x15fd
|
||||
|
||||
#fi-8290
|
||||
usb 0x04c5 0x15fe
|
||||
|
||||
#fi-8170
|
||||
usb 0x04c5 0x15ff
|
||||
|
||||
#fi-8270
|
||||
usb 0x04c5 0x1600
|
||||
|
||||
#fi-8150
|
||||
usb 0x04c5 0x1601
|
||||
|
||||
#fi-8250
|
||||
usb 0x04c5 0x1602
|
||||
|
||||
#fi-8150U
|
||||
usb 0x04c5 0x162d
|
||||
|
||||
#fi-8250U
|
||||
usb 0x04c5 0x162e
|
||||
|
||||
#ScanSnap iX1300
|
||||
usb 0x04c5 0x162c
|
||||
|
||||
#ScanSnap iX1400
|
||||
usb 0x04c5 0x1630
|
||||
|
||||
######################################
|
||||
# Ricoh-only scanners
|
||||
|
||||
#fi-8040
|
||||
usb 0x05ca 0x0307
|
||||
|
||||
#fi-70F"
|
||||
usb 0x05ca 0x0308
|
||||
|
|
|
@ -325,7 +325,6 @@ struct fujitsu
|
|||
int jpeg_interlace; /* different models interlace jpeg sides differently */
|
||||
int cropping_mode; /* lower-end scanners don't crop from paper size */
|
||||
int ghs_in_rs;
|
||||
int window_gamma;
|
||||
int endorser_string_len;
|
||||
int has_pixelsize;
|
||||
int has_short_pixelsize; /* m3091/2 put weird stuff at end, ignore it */
|
||||
|
@ -520,6 +519,7 @@ struct fujitsu
|
|||
/* the user never directly modifies these */
|
||||
|
||||
int s_mode; /*color,lineart,etc: sent to scanner*/
|
||||
int window_gamma; /* depends on brightness/contrast and lut */
|
||||
|
||||
/* this is defined in sane spec as a struct containing:
|
||||
SANE_Frame format;
|
||||
|
|
|
@ -131,6 +131,9 @@ usb 0x07b3 0x0900
|
|||
# Plustek OpticFilm 7200
|
||||
usb 0x07b3 0x0807
|
||||
|
||||
# Plustek OpticFilm 7200 V2
|
||||
usb 0x07b3 0x0c07
|
||||
|
||||
# Plustek OpticFilm 7200i
|
||||
usb 0x07b3 0x0c04
|
||||
|
||||
|
@ -143,6 +146,12 @@ usb 0x07b3 0x0c3a
|
|||
# Plustek OpticFilm 7500i
|
||||
usb 0x07b3 0x0c13
|
||||
|
||||
# Plustek OpticFilm 7600i
|
||||
usb 0x07b3 0x0c3b
|
||||
|
||||
# Plustek OpticFilm 8100
|
||||
usb 0x07b3 0x130c
|
||||
|
||||
# Plustek OpticFilm 8200i
|
||||
usb 0x07b3 0x130d
|
||||
|
||||
|
@ -157,3 +166,6 @@ usb 0x1803 0x162e
|
|||
|
||||
# Plustek OpticBook 3800
|
||||
usb 0x07b3 0x1300
|
||||
|
||||
# Plustek OpticFilm 7600i
|
||||
usb 0x07b3 0x0c3b
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#ifndef BACKEND_GENESYS_CALIBRATION_H
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#ifndef BACKEND_GENESYS_COMMAND_SET_H
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#define DEBUG_DECLARE_ONLY
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#ifndef BACKEND_GENESYS_DEVICE_H
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#define DEBUG_DECLARE_ONLY
|
||||
|
@ -279,6 +258,7 @@ std::ostream& operator<<(std::ostream& out, GpioId id)
|
|||
case GpioId::CANON_8600F: out << "CANON_8600F"; break;
|
||||
case GpioId::DP665: out << "DP665"; break;
|
||||
case GpioId::DP685: out << "DP685"; break;
|
||||
case GpioId::G4010: out << "G4010"; break;
|
||||
case GpioId::G4050: out << "G4050"; break;
|
||||
case GpioId::HP2300: out << "HP2300"; break;
|
||||
case GpioId::HP2400: out << "HP2400"; break;
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#ifndef BACKEND_GENESYS_ENUMS_H
|
||||
|
@ -372,6 +351,7 @@ enum class GpioId : unsigned
|
|||
DP665,
|
||||
DP685,
|
||||
G4050,
|
||||
G4010,
|
||||
HP2300,
|
||||
HP2400,
|
||||
HP3670,
|
||||
|
@ -525,6 +505,9 @@ enum class ModelFlag : unsigned
|
|||
// disable fast feeding mode on this scanner
|
||||
DISABLE_FAST_FEEDING = 1 << 14,
|
||||
|
||||
// scan gray scans as color and combine on host side
|
||||
HOST_SIDE_GRAY = 1 << 15,
|
||||
|
||||
// the scanner uses multi-segment sensors that must be handled during calibration
|
||||
SIS_SENSOR = 1 << 16,
|
||||
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#define DEBUG_DECLARE_ONLY
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#ifndef BACKEND_GENESYS_ERROR_H
|
||||
|
|
|
@ -16,27 +16,6 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#ifndef BACKEND_GENESYS_FWD_H
|
||||
|
@ -80,7 +59,7 @@ struct Pixel;
|
|||
struct RawPixel;
|
||||
|
||||
// low.h
|
||||
struct UsbDeviceEntry;
|
||||
class UsbDeviceEntry;
|
||||
|
||||
// motor.h
|
||||
struct Genesys_Motor;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue