├── .gitattributes ├── LICENSE ├── README.md ├── css ├── .htaccess ├── dd.css ├── jcrop.gif ├── jquery.jcrop.css ├── nouislider.fox.css └── style.css ├── doc ├── .htaccess ├── CHANGELOG ├── LICENSE ├── README_DE.txt ├── README_EN.txt └── README_PL.txt ├── download.php ├── favicon.ico ├── help ├── help_0.php ├── help_1.php ├── help_2.php ├── help_4.php ├── help_6.php ├── help_7.php ├── help_8.php └── help_9.php ├── images ├── .htaccess ├── Thumbs.db ├── btn_accept.png ├── btn_preview.png ├── filetype_bmp.png ├── filetype_jpg.png ├── filetype_other.png ├── filetype_pdf.png ├── filetype_png.png ├── filetype_pnm.png ├── filetype_tif.png ├── filetype_txt.png ├── help_icon.png ├── lang_cz.gif ├── lang_de.gif ├── lang_en.gif ├── lang_fi.gif ├── lang_fr.gif ├── lang_it.gif ├── lang_nl.gif ├── lang_pl.gif ├── lang_ru.gif ├── lang_uk.gif ├── logo.jpg ├── mode_color.png ├── mode_gray.png ├── mode_lineart.png ├── msdropdown_arrow.gif ├── msdropdown_bg.gif ├── pagesize_a4.png ├── pagesize_a5.png ├── pagesize_a6.png ├── pagesize_custom.png ├── phpSane_Screenshot_1.png ├── phpSane_Screenshot_2.png ├── scan.jpg ├── source │ ├── Hardware-Scanner-2-icon.png │ ├── file type │ │ ├── file_icons_version_2_by_jrdn88-dxmw0i.zip │ │ ├── file_icons_version_3_by_jrdn88-d14uaad.zip │ │ ├── filetype_bmp.png │ │ ├── filetype_jpg.png │ │ ├── filetype_pdf.png │ │ ├── filetype_png.png │ │ ├── filetype_pnm.png │ │ ├── filetype_tif.png │ │ └── filetype_txt.png │ └── page size │ │ ├── pagesize_a4.xcf │ │ ├── pagesize_a5.xcf │ │ ├── pagesize_a6.xcf │ │ └── pagesize_custom.xcf ├── source_adf.png ├── source_auto.png ├── source_flatbed.png └── spinner.gif ├── incl ├── .htaccess ├── config.php ├── files.php ├── functions.php ├── language.php ├── menu.php ├── scan.php └── security.php ├── index.html ├── index.php ├── javascript ├── .htaccess ├── jquery.jcrop.min.js ├── jquery.min.js ├── jquery.msdropdown_custom.min.js ├── jquery.nouislider.min.js └── source │ ├── jquery.jcrop.js │ ├── jquery.js │ ├── jquery.msdropdown_custom.js │ ├── jquery.msdropdown_original.js │ ├── jquery.msdropdown_original.min.js │ └── jquery.nouislider.js ├── phpsane.php └── save.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 2018 Decaux Nicolas 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | phpSANE is a web-based frontend for SANE written in HTML/PHP so you can scan with your web-browser. It also supports OCR. 2 | It's forked from [SourceForge phpSane](https://sourceforge.net/projects/phpsane/) 3 | 4 | [![Screen Shot 1](https://github.com/gawindx/phpSane/blob/master/images/phpSane_Screenshot_1.png)](https://github.com/gawindx/phpSane) 5 | [![Screen Shot 2](https://github.com/gawindx/phpSane/blob/master/images/phpSane_Screenshot_2.png)](https://github.com/gawindx/phpSane) 6 | 7 | ## Installing phpSANE on FreeBSD 8 | 9 | ### Prerequisites 10 | `pkg_add -r sane-backends` 11 | `pkg_add -r sane-frontends` 12 | `pkg_add -r git*` 13 | 14 | ### Testing 15 | The following programs must succeed, because phpSANE is based on them. 16 | 17 | `sane-find-scanner -q` 18 | `scanimage -L` 19 | `su -m www -c 'scanimage --test'` 20 | 21 | ### Obtain the source code 22 | #### Use git 23 | `cd /var/www` 24 | `git clone https://github.com/gawindx/phpSane.git` 25 | 26 | #### Or download the latest version 27 | `mkdir /var/www/phpsane` 28 | `cd /var/www` 29 | `fetch https://github.com/gawindx/phpSane/archive/master.zip` 30 | `unzip master.zip` 31 | 32 | ### Set permissions 33 | `chown -R root:www phpsane/tmp phpsane/output` 34 | `chmod 775 phpsane/tmp phpsane/output` 35 | 36 | ## Apache configuration 37 | ` ` 38 | ` DirectoryIndex index.php` 39 | ` Require group Admins Users Faktura` 40 | ` ` 41 | 42 | ## For Fedora User (fc32) 43 | On a fresh install, you need to install "netpbm-progs", "gocr", "ImageMagick" and "poppler-utils" : 44 | 45 | `dnf install gocr netpbm-progs poppler-utils ImageMagick` 46 | 47 | ## OPTIONAL: 48 | ### SELinux 49 | 50 | If SELinux is activated and Enforced, you need to apply this custom rule : 51 | ```semanage fcontext -a -t httpd_sys_content_t "/var/www/phpsane(/.*)?" 52 | semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/phpsane/scanners(/.*)?" 53 | semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/phpsane/tmp(/.*)?" 54 | semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/phpsane/output(/.*)?" 55 | restorecon -R -v /var/www/phpsane 56 | 57 | cat my-phpSane.te< 2 | #one year 3 | 4 | Header set Cache-Control "max-age=29030400" 5 | 6 | -------------------------------------------------------------------------------- /css/dd.css: -------------------------------------------------------------------------------- 1 | .borderRadius{-moz-border-radius:5px; border-radius:5px; } 2 | .borderRadiusTp{-moz-border-radius:5px 5px 0 0; border-radius:5px 5px 0 0;} 3 | .borderRadiusBtm{-moz-border-radius:0 0 5px 5px ; border-radius:0 0 5px 5px;} 4 | 5 | .ddcommon {position:relative;display:-moz-inline-stack; zoom:1; display:inline-block; *display:inline; cursor:default;} 6 | .ddcommon ul{padding:0;margin:0;} 7 | .ddcommon ul li{list-style-type:none;} 8 | .borderRadiusTp ul li:last-child{-moz-border-radius:0 0 5px 5px ; border-radius:0 0 5px 5px;border-bottom:0 none #c3c3c3; } 9 | .borderRadiusBtm ul li:first-child{-moz-border-radius:5px 5px 0 0; border-radius:5px 5px 0 0 ;border-bottom:1 solid #c3c3c3; } 10 | 11 | .ddcommon .disabled img, .ddcommon .disabled span, .ddcommon.disabledAll{ 12 | opacity: .5; /* standard: ff gt 1.5, opera, safari */ 13 | -ms-filter:"alpha(opacity=50)"; /* ie 8 */ 14 | filter:alpha(opacity=50); /* ie lt 7 */ 15 | -khtml-opacity:.5; /* safari 1.x */ 16 | -moz-opacity:.5; /* ff lt 1.5, netscape */ 17 | color:#999999; 18 | } 19 | .ddcommon .clear{clear:both} 20 | .ddcommon .shadow{-moz-box-shadow:5px 5px 5px -5px #888888;-webkit-box-shadow:5px 5px 5px -5px #888888;box-shadow: 5px 5px 5px -5px #888888;} 21 | .ddcommon input.text{color:#7e7e7e;padding:0 0 0 0; position:absolute; background:#fff; display:block; width:98%; height:98%; left:2px; top:0; border:none;} 22 | .ddOutOfVision{position:relative; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline;} 23 | .borderRadius .shadow{-moz-box-shadow:5px 5px 5px -5px #888888;-webkit-box-shadow:5px 5px 5px -5px #888888;box-shadow: 5px 5px 5px -5px #888888;} 24 | .borderRadiusBtm .shadow{-moz-box-shadow:-5px -5px 5px -5px #888888;-webkit-box-shadow:-5px -5px 5px -5px #888888;box-shadow: -5px -5px 5px -5px #888888} 25 | .borderRadiusTp .border, .borderRadius .border{-moz-border-radius:0 0 5px 5px ; border-radius:0 0 5px 5px;} 26 | .borderRadiusBtm .border{-moz-border-radius:5px 5px 0 0; border-radius:5px 5px 0 0;} 27 | img.fnone{float:none !important} 28 | .ddcommon .divider{width:0; height:100%; position:absolute;} 29 | .ddcommon .ddArrow{display:inline-block; position:absolute; top:50%; right:4px;} 30 | .ddcommon .ddArrow:hover{background-position:0 100%;} 31 | .ddcommon .ddTitle{padding:0; position:relative; display:inline-block; width:100%} 32 | .ddcommon .ddTitle .ddTitleText{display:block;} 33 | .ddcommon .ddTitle .ddTitleText .ddTitleText{padding:0;} 34 | .ddcommon .ddTitle .description{display:block;} 35 | .ddcommon .ddTitle .ddTitleText img{position:relative; vertical-align:middle; float:left} 36 | .ddcommon .ddChild{position:absolute;display:none;width:100%;overflow-y:auto; overflow-x:hidden; zoom:1; z-index:9999} 37 | .ddcommon .ddChild li{clear:both;} 38 | .ddcommon .ddChild li .description{display:block;} 39 | .ddcommon .ddChild li img{border:0 none; position:relative;vertical-align:middle;float:left} 40 | .ddcommon .ddChild li.optgroup{padding:0;} 41 | .ddcommon .ddChild li.optgroup .optgroupTitle{padding:0 5px; font-weight:bold; font-style:italic} 42 | .ddcommon .ddChild li.optgroup ul li{padding:5px 5px 5px 15px} 43 | .ddcommon .noBorderTop{border-top:none 0 !important; padding:0; margin:0;} 44 | 45 | /*************** default theme **********************/ 46 | .dd{border:1px solid #c3c3c3;} 47 | .dd .divider{border-left:1px solid #c3c3c3; border-right:1px solid #fff;; right:24px;} 48 | .dd .ddArrow{width:16px;height:16px; margin-top:-8px; background:url(../../images/msdropdown/skin1/dd_arrow.gif) no-repeat;} 49 | .dd .ddArrow:hover{background-position:0 100%;} 50 | .dd .ddTitle{color:#000;background:#e2e2e4 url(../../images/msdropdown/skin1/title-bg.gif) repeat-x left top;} 51 | .dd .ddTitle .ddTitleText{padding:5px 20px 5px 5px;} 52 | .dd .ddTitle .ddTitleText .ddTitleText{padding:0;} 53 | .dd .ddTitle .description{font-size:12px; color:#666} 54 | .dd .ddTitle .ddTitleText img{padding-right:5px;} 55 | .dd .ddChild{border:1px solid #c3c3c3; background-color:#fff; left:-1px;} 56 | .dd .ddChild li{padding:5px; background-color:#fff; border-bottom:1px solid #c3c3c3;} 57 | .dd .ddChild li .description{color:#666;} 58 | .dd .ddChild li .ddlabel{color:#333;} 59 | .dd .ddChild li.hover{background-color:#f2f2f2} 60 | .dd .ddChild li img{padding:0 6px 0 0;} 61 | .dd .ddChild li.optgroup{padding:0;} 62 | .dd .ddChild li.optgroup .optgroupTitle{padding:0 5px; font-weight:bold; font-style:italic} 63 | .dd .ddChild li.optgroup ul li{padding:5px 5px 5px 15px} 64 | .dd .ddChild li.selected{background-color:#d5d5d5; color:#000;} -------------------------------------------------------------------------------- /css/jcrop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/css/jcrop.gif -------------------------------------------------------------------------------- /css/jquery.jcrop.css: -------------------------------------------------------------------------------- 1 | /* jquery.Jcrop.css v0.9.12 - MIT License */ 2 | /* 3 | The outer-most container in a typical Jcrop instance 4 | If you are having difficulty with formatting related to styles 5 | on a parent element, place any fixes here or in a like selector 6 | 7 | You can also style this element if you want to add a border, etc 8 | A better method for styling can be seen below with .jcrop-light 9 | (Add a class to the holder and style elements for that extended class) 10 | */ 11 | .jcrop-holder { 12 | direction: ltr; 13 | text-align: left; 14 | } 15 | /* Selection Border */ 16 | .jcrop-vline, 17 | .jcrop-hline { 18 | background: #ffffff url("jcrop.gif"); 19 | font-size: 0; 20 | position: absolute; 21 | } 22 | .jcrop-vline { 23 | height: 100%; 24 | width: 1px !important; 25 | } 26 | .jcrop-vline.right { 27 | right: 0; 28 | } 29 | .jcrop-hline { 30 | height: 1px !important; 31 | width: 100%; 32 | } 33 | .jcrop-hline.bottom { 34 | bottom: 0; 35 | } 36 | /* Invisible click targets */ 37 | .jcrop-tracker { 38 | height: 100%; 39 | width: 100%; 40 | /* "turn off" link highlight */ 41 | -webkit-tap-highlight-color: transparent; 42 | /* disable callout, image save panel */ 43 | -webkit-touch-callout: none; 44 | /* disable cut copy paste */ 45 | -webkit-user-select: none; 46 | } 47 | /* Selection Handles */ 48 | .jcrop-handle { 49 | background-color: #333333; 50 | border: 1px #eeeeee solid; 51 | width: 7px; 52 | height: 7px; 53 | font-size: 1px; 54 | } 55 | .jcrop-handle.ord-n { 56 | left: 50%; 57 | margin-left: -4px; 58 | margin-top: -4px; 59 | top: 0; 60 | } 61 | .jcrop-handle.ord-s { 62 | bottom: 0; 63 | left: 50%; 64 | margin-bottom: -4px; 65 | margin-left: -4px; 66 | } 67 | .jcrop-handle.ord-e { 68 | margin-right: -4px; 69 | margin-top: -4px; 70 | right: 0; 71 | top: 50%; 72 | } 73 | .jcrop-handle.ord-w { 74 | left: 0; 75 | margin-left: -4px; 76 | margin-top: -4px; 77 | top: 50%; 78 | } 79 | .jcrop-handle.ord-nw { 80 | left: 0; 81 | margin-left: -4px; 82 | margin-top: -4px; 83 | top: 0; 84 | } 85 | .jcrop-handle.ord-ne { 86 | margin-right: -4px; 87 | margin-top: -4px; 88 | right: 0; 89 | top: 0; 90 | } 91 | .jcrop-handle.ord-se { 92 | bottom: 0; 93 | margin-bottom: -4px; 94 | margin-right: -4px; 95 | right: 0; 96 | } 97 | .jcrop-handle.ord-sw { 98 | bottom: 0; 99 | left: 0; 100 | margin-bottom: -4px; 101 | margin-left: -4px; 102 | } 103 | /* Dragbars */ 104 | .jcrop-dragbar.ord-n, 105 | .jcrop-dragbar.ord-s { 106 | height: 7px; 107 | width: 100%; 108 | } 109 | .jcrop-dragbar.ord-e, 110 | .jcrop-dragbar.ord-w { 111 | height: 100%; 112 | width: 7px; 113 | } 114 | .jcrop-dragbar.ord-n { 115 | margin-top: -4px; 116 | } 117 | .jcrop-dragbar.ord-s { 118 | bottom: 0; 119 | margin-bottom: -4px; 120 | } 121 | .jcrop-dragbar.ord-e { 122 | margin-right: -4px; 123 | right: 0; 124 | } 125 | .jcrop-dragbar.ord-w { 126 | margin-left: -4px; 127 | } 128 | /* The "jcrop-light" class/extension */ 129 | .jcrop-light .jcrop-vline, 130 | .jcrop-light .jcrop-hline { 131 | background: #ffffff; 132 | filter: alpha(opacity=70) !important; 133 | opacity: .70!important; 134 | } 135 | .jcrop-light .jcrop-handle { 136 | -moz-border-radius: 3px; 137 | -webkit-border-radius: 3px; 138 | background-color: #000000; 139 | border-color: #ffffff; 140 | border-radius: 3px; 141 | } 142 | /* The "jcrop-dark" class/extension */ 143 | .jcrop-dark .jcrop-vline, 144 | .jcrop-dark .jcrop-hline { 145 | background: #000000; 146 | filter: alpha(opacity=70) !important; 147 | opacity: 0.7 !important; 148 | } 149 | .jcrop-dark .jcrop-handle { 150 | -moz-border-radius: 3px; 151 | -webkit-border-radius: 3px; 152 | background-color: #ffffff; 153 | border-color: #000000; 154 | border-radius: 3px; 155 | } 156 | /* Simple macro to turn off the antlines */ 157 | .solid-line .jcrop-vline, 158 | .solid-line .jcrop-hline { 159 | background: #ffffff; 160 | } 161 | /* Fix for twitter bootstrap et al. */ 162 | .jcrop-holder img, 163 | img.jcrop-preview { 164 | max-width: none; 165 | } 166 | -------------------------------------------------------------------------------- /css/nouislider.fox.css: -------------------------------------------------------------------------------- 1 | .noUiSlider, 2 | .noUiSlider * { 3 | -webkit-box-sizing: border-box; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box; 6 | -webkit-user-select: none; 7 | -moz-user-select: none; 8 | -ms-user-select: none; 9 | display: block; 10 | cursor: default; 11 | } 12 | .noUiSlider { 13 | position: relative; 14 | } 15 | .noUiSlider a { 16 | position: absolute; 17 | z-index: 1; 18 | } 19 | .noUiSlider a:nth-child(2) { 20 | background: inherit !important; 21 | } 22 | .noUiSlider.vertical a { 23 | width: 100%; 24 | bottom: 0; 25 | } 26 | .noUiSlider.horizontal a { 27 | height: 100%; 28 | right: 0; 29 | } 30 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 31 | .noUiSlider:before, 32 | body.TOUCH, 33 | .noUiSlider div { 34 | -ms-touch-action: none; 35 | } 36 | .noUiSlider:before { 37 | display: block; 38 | position: absolute; 39 | width: 150%; 40 | left: -25%; 41 | height: 400%; 42 | top: -150%; 43 | content: ""; 44 | z-index: -1; 45 | } 46 | .noUiSlider.vertical:before { 47 | width: 400%; 48 | left: -150%; 49 | height: 150%; 50 | top: -25%; 51 | } 52 | } 53 | .noUiSlider { 54 | border: 1px solid #908d84; 55 | border-radius: 3px; 56 | } 57 | .noUiSlider.connect a, 58 | .noUiSlider.connect.lower { 59 | background: #b2a98f; 60 | } 61 | .noUiSlider, 62 | .noUiSlider.connect.lower a { 63 | background: #d9d7cb; 64 | box-shadow: inset 0px 1px 7px #b6b4a8 65 | } 66 | .noUiSlider.disabled, 67 | .noUiSlider.disabled.connect.lower a { 68 | background: #ccc; 69 | box-shadow: none; 70 | } 71 | .noUiSlider div { 72 | height: 18px; 73 | width: 18px; 74 | border: 1px solid #99968f; 75 | border-radius: 3px; 76 | background: #efefe7; 77 | } 78 | .noUiSlider.disabled div { 79 | background: transparent; 80 | } 81 | .noUiSlider.horizontal { 82 | width: 300px; 83 | height: 10px; 84 | } 85 | .noUiSlider.horizontal div { 86 | margin: -5px 0 0 -9px; 87 | } 88 | .noUiSlider.vertical { 89 | width: 10px; 90 | height: 300px; 91 | } 92 | .noUiSlider.vertical div { 93 | margin: -9px 0 0 -5px; 94 | } -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 100%; 3 | -webkit-text-size-adjust: 100%; 4 | -ms-text-size-adjust: 100%; 5 | } 6 | 7 | body { 8 | font-family: Arial, Verdana, Helvetica, sans-serif; 9 | font-style: normal; 10 | font-weight: normal; 11 | text-decoration: none; 12 | font-size: 10pt; 13 | line-height: 110%; 14 | color: #000000; 15 | background: #ffffff; 16 | margin: 0.0em 0.75em 0.75em 0.75em; 17 | border: 0em; 18 | padding: 0em; 19 | text-align: left; 20 | min-width: 780px; 21 | } 22 | 23 | a { 24 | color: #0088cc; 25 | text-decoration: none; 26 | } 27 | a:hover { 28 | color: #005580; 29 | text-decoration: underline; 30 | outline: 0; 31 | } 32 | a:focus { 33 | outline: thin dotted #333; 34 | outline: 5px auto -webkit-focus-ring-color; 35 | outline-offset: -2px; 36 | } 37 | 38 | /* ------------------------------------------------------------------ */ 39 | /* header */ 40 | #page_header { 41 | width: 100%; 42 | white-space: nowrap; 43 | border-collapse: collapse; 44 | border: none; 45 | padding: 0.0em 0.0em; 46 | margin: 0.0em 0.0em; 47 | } 48 | 49 | #page_header td { 50 | vertical-align: top; 51 | border: none; 52 | padding: 0.0em 0.0em; 53 | margin: 0.0em 0.0em; 54 | } 55 | 56 | #logo { 57 | padding-top: 0.4em; 58 | float: left; 59 | border: none; 60 | width: 455px; 61 | height: 95px; 62 | } 63 | 64 | #header_menu { 65 | text-align: center; 66 | padding: 0.5em 0 0.5em 0; 67 | margin: 0; 68 | background-color: #cbcbcb; 69 | border-radius: 0px 0px 10px 10px; 70 | float: right; 71 | min-width: 4em; 72 | } 73 | 74 | #header_menu > li { 75 | padding: 0 0.5em 0 0.5em; 76 | display: inline; 77 | list-style-type: none; 78 | text-align: left; 79 | } 80 | 81 | #header_menu a { 82 | font-weight: bold; 83 | font-size: 110%; 84 | color: #005580; 85 | } 86 | 87 | #language_select { 88 | width: 12.5em; 89 | display: inline-block; 90 | } 91 | 92 | #language_select_msdd { 93 | width: 12em; 94 | } 95 | 96 | /* ------------------------------------------------------------------ */ 97 | /* body */ 98 | #page_body { 99 | padding: 0.0em; 100 | margin: 1.5em auto; 101 | } 102 | 103 | #page_body > tbody > tr > td { 104 | padding: 0.6em; 105 | } 106 | 107 | .input_error { 108 | color: red; 109 | } 110 | 111 | #tab_menu_error_text { 112 | font-size: 170%; 113 | font-weight: bold; 114 | line-height: 170%; 115 | color: red; 116 | height: 8em; 117 | } 118 | 119 | #tab_menu_error_button { 120 | font-size: 150%; 121 | height: 2em; 122 | } 123 | 124 | #tab_preview, #tab_menu{ 125 | vertical-align: top; 126 | padding: 0.0em 0.5em; 127 | height: 100%; 128 | } 129 | #preview_image { 130 | border: solid black 1px; 131 | } 132 | 133 | #tab_menu_settings { 134 | height: 100%; 135 | padding: 0.0em; 136 | margin: 0.0em; 137 | } 138 | #tab_menu_settings td { 139 | padding: 0.15em 0.0em; 140 | } 141 | #tab_menu_settings .value_column > input[type="text"] { 142 | line-height: 30px; 143 | width: 210px; 144 | display: inline-block; 145 | height: 30px; 146 | padding: 4px 6px; 147 | -webkit-box-sizing: border-box; 148 | -moz-box-sizing: border-box; 149 | box-sizing: border-box; 150 | font-size: 14px; 151 | line-height: 20px; 152 | color: #555555; 153 | -webkit-border-radius: 4px; 154 | -moz-border-radius: 4px; 155 | border-radius: 5px; 156 | vertical-align: middle; 157 | background-color: #ffffff; 158 | border: 1px solid #cccccc; 159 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 160 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 161 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 162 | -webkit-transition: border linear .2s, box-shadow linear .2s; 163 | -moz-transition: border linear .2s, box-shadow linear .2s; 164 | -o-transition: border linear .2s, box-shadow linear .2s; 165 | transition: border linear .2s, box-shadow linear .2s; 166 | } 167 | #tab_menu_settings .value_column > input[type="text"]:focus { 168 | border-color: rgba(82, 168, 236, 0.8); 169 | outline: 0; 170 | outline: thin dotted \9; /* IE6-9 */ 171 | -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); 172 | -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); 173 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); 174 | } 175 | 176 | #tab_menu_settings #brightness_slider { 177 | width: 155px; 178 | display: inline-block; 179 | vertical-align:middle; 180 | margin-top: auto; 181 | background-color: #e5e5e7; 182 | } 183 | #tab_menu_settings #brightness { 184 | width: 44px; 185 | margin-left: 7px; 186 | } 187 | 188 | #tab_menu_settings #contrast_slider { 189 | width: 155px; 190 | display: inline-block; 191 | vertical-align:middle; 192 | margin-top: auto; 193 | background-color: #e5e5e7; 194 | } 195 | #tab_menu_settings #contrast { 196 | width: 44px; 197 | margin-left: 7px; 198 | } 199 | 200 | #tab_menu_settings select { 201 | width: 210px; 202 | } 203 | #tab_menu_settings tr:first-child th{ 204 | padding-top: 0px; 205 | margin-top: 0px; 206 | } 207 | #tab_menu_settings #scanner_name { 208 | padding-top: 0.8em; 209 | padding-bottom: 0.8em; 210 | } 211 | #tab_menu_settings th { 212 | font-weight: bold; 213 | padding: 1em 0em 0.1em 0.0em; 214 | text-align: left; 215 | } 216 | #tab_menu_settings .value_column { 217 | padding-left: 0.75em; 218 | } 219 | #tab_menu_settings .unit_column, .unit_spacer { 220 | padding: 0; 221 | width: 2.0em; 222 | padding-left: 0.2em; 223 | } 224 | 225 | #tab_menu_buttons { 226 | height: 100%; 227 | vertical-align: bottom !important; 228 | padding: 0.0em !important; 229 | margin: 0.0em; 230 | } 231 | #tab_menu_buttons input { 232 | padding: 0.6em 0em; 233 | width: 49.5%; 234 | text-align: left; 235 | border: solid 1px #dcdcdc; 236 | background-position: 10px center; 237 | background-repeat: no-repeat; 238 | -webkit-border-radius: 2px; 239 | -moz-border-radius: 2px; 240 | border-radius: 2px; 241 | border-width: 1px; 242 | color: #666666; 243 | font: bold 130% arial,sans-serif; 244 | } 245 | #tab_menu_buttons input:hover { 246 | background-color: #e2e2e4; 247 | border-color: #b0b0b0; 248 | } 249 | #tab_menu_buttons_preview { 250 | padding-left: 40px !important; 251 | background-image: url(../images/btn_preview.png); 252 | } 253 | #tab_menu_buttons_accept { 254 | padding-left: 47px !important; 255 | background-image: url(../images/btn_accept.png); 256 | } 257 | #tab_menu_buttons input + input { 258 | margin-left: 1%; 259 | } 260 | 261 | #files_table_wrapper { 262 | width: 100%; 263 | } 264 | #files_table_wrapper td { 265 | margin: 0; 266 | padding: 0; 267 | } 268 | #files_table_wrapper .ruler { 269 | margin-top: -0.6em; 270 | background-color: #888; 271 | margin-left: -0.1em; 272 | } 273 | 274 | #files_table { 275 | background-color: #F3F3F3; 276 | border-collapse: collapse; 277 | width: 100%; 278 | margin: 5px 0; 279 | border: solid 1px #AAA; 280 | } 281 | #files_table th { 282 | background-color: #666; 283 | color: #FFF; 284 | cursor: default; 285 | padding: 5px 5px 5px 5px; 286 | } 287 | #files_table td, #files_table th { 288 | text-align: left; 289 | padding-top: 10px; 290 | padding-bottom: 10px; 291 | white-space: nowrap; 292 | } 293 | #files_table a { 294 | text-decoration: none; 295 | } 296 | #files_table td a { 297 | color: #444; 298 | display: block; 299 | padding: 5px; 300 | } 301 | #files_table td input { 302 | margin: 10px; 303 | } 304 | #files_table .file_row_new { 305 | background-color: #FFE599 !important; 306 | } 307 | #files_table .file_column_ext { 308 | text-align: left; 309 | } 310 | #files_table .file_column_size, #files_table .file_column_modtime { 311 | text-align: right; 312 | } 313 | #files_table .file_column_category { 314 | display: none; 315 | } 316 | #files_table .file_column_name a { 317 | background: url(../images/filetype_other.png) no-repeat 5px 50%; 318 | padding-left: 38px; 319 | } 320 | #files_table .file_column_name { 321 | width: 100%; 322 | } 323 | #files_table td:not(.file_column_name) a { 324 | background-image: none !important; 325 | } 326 | #files_table tr:nth-of-type(odd) { 327 | background-color: #E6E6E6; 328 | } 329 | #files_table tr:hover td { 330 | background-color:#CACACA; 331 | } 332 | #files_table tr:hover td a { 333 | color: #000; 334 | } 335 | /* icons for file types */ 336 | #files_table .file_column_name a[href$=".bmp"] {background-image: url(../images/filetype_bmp.png);} 337 | #files_table .file_column_name a[href$=".jpg"], #files_table .file_column_name a[href$=".jpeg"] {background-image: url(../images/filetype_jpg.png);} 338 | #files_table .file_column_name a[href$=".pdf"] {background-image: url(../images/filetype_pdf.png);} 339 | #files_table .file_column_name a[href$=".png"] {background-image: url(../images/filetype_png.png);} 340 | #files_table .file_column_name a[href$=".pnm"] {background-image: url(../images/filetype_pnm.png);} 341 | #files_table .file_column_name a[href$=".tif"], #files_table .file_column_name a[href$=".tiff"] {background-image: url(../images/filetype_tif.png);} 342 | #files_table .file_column_name a[href$=".txt"] {background-image: url(../images/filetype_txt.png);} 343 | 344 | #file_buttons { 345 | margin: 1em 0 0.2em 0; 346 | padding: 0; 347 | } 348 | #file_buttons li { 349 | float:left; 350 | margin: 0.0em 0.4em 0.0em 0.0em; 351 | list-style-type: none; 352 | height: 100%; 353 | border: none; 354 | } 355 | #select_menu_button, #file_delete, #file_download { 356 | position: relative; 357 | background: #f3f3f3; 358 | border: solid 1px #dcdcdc; 359 | border-collapse: separate; 360 | -webkit-border-radius: 2px; 361 | -moz-border-radius: 2px; 362 | border-radius: 2px; 363 | -webkit-touch-callout: none; 364 | -webkit-user-select: none; 365 | -khtml-user-select: none; 366 | -moz-user-select: none; 367 | -ms-user-select: none; 368 | user-select: none; 369 | padding-left: 10px; 370 | height: 35px; 371 | width: 50px; 372 | 373 | } 374 | #file_delete, #file_download { 375 | display: none; 376 | cursor: pointer; 377 | color: #666; 378 | font: bold 100% arial,sans-serif; 379 | width: auto; 380 | } 381 | #select_menu_button:hover, #file_delete:hover, #file_download:hover { 382 | background-color: #e2e2e4; 383 | border-color: #b0b0b0; 384 | } 385 | #file_download[disabled] { 386 | color: #aaa; 387 | } 388 | #file_download[disabled]:hover { 389 | background: #f3f3f3; 390 | border-color: #dcdcdc; 391 | } 392 | #file_download_spinner { 393 | display: none; 394 | background: url(../images/spinner.gif) no-repeat 0px 50%; 395 | height: 35px; 396 | line-height: 35px; 397 | padding-left: 35px; 398 | } 399 | #select_menu_button tr td{ 400 | padding: 0; 401 | } 402 | #select_menu_arrow { 403 | display: inline-block; 404 | border-left: 5px solid transparent; 405 | border-right: 5px solid transparent; 406 | border-top: 5px solid #777777; 407 | } 408 | #select_menu_dropdown { 409 | display: none; 410 | position: absolute; 411 | list-style: none; 412 | margin: 0px; 413 | padding: 0px; 414 | -webkit-box-shadow: 0 4px 10px #8b8b8b; 415 | -moz-box-shadow: 0 4px 10px #8b8b8b; 416 | box-shadow: 0 4px 10px #8b8b8b; 417 | font-size: 14px; 418 | width: 80px; 419 | -webkit-touch-callout: none; 420 | -webkit-user-select: none; 421 | -khtml-user-select: none; 422 | -moz-user-select: none; 423 | -ms-user-select: none; 424 | user-select: none; 425 | } 426 | #select_menu_dropdown li { 427 | position: relative; 428 | display: inline-block; 429 | font: bold 75% arial,sans-serif; 430 | text-decoration: none; 431 | padding: 7px 0px 7px 12px; 432 | color: #444; 433 | background: #fff; 434 | border: none; 435 | width: 70px; 436 | float: left; 437 | cursor: pointer; 438 | } 439 | /* hide text selection by setting selection background color to white */ 440 | #select_menu_dropdown li::selection { 441 | background: color: #000000; /* safari */ 442 | } 443 | #select_menu_dropdown li::-moz-selection { 444 | background: color: #000000; /* firefox */ 445 | } 446 | #select_menu_dropdown li:hover { 447 | background: #EEEEEE; 448 | } 449 | 450 | /* ------------------------------------------------------------------ */ 451 | /* footer */ 452 | #page_footer { 453 | width: 100%; 454 | font-size: 80%; 455 | font-weight: normal; 456 | line-height: 110%; 457 | text-align: center; 458 | border-collapse: collapse; 459 | border: none; 460 | margin: 150px 0.0em 0.4em 0.0em; 461 | background-color: silver; 462 | } 463 | 464 | #page_footer td { 465 | vertical-align: top; 466 | border: none; 467 | padding: 0.4em 0.0em; 468 | margin: 0.0em 0.0em; 469 | } 470 | 471 | /* ------------------------------------------------------------------ */ 472 | .ruler { 473 | background-color: black; 474 | width: 100%; 475 | height: 2px; 476 | border-style: solid; 477 | border-width: 0px; 478 | padding: 0px !important; 479 | } 480 | 481 | /******************* custom msdropdown.css *************************/ 482 | 483 | /* have padding and border inside width/height defined in width and height properties */ 484 | .dd { 485 | -webkit-box-sizing: border-box; 486 | -moz-box-sizing: border-box; 487 | box-sizing: border-box; 488 | } 489 | 490 | /* Modify image of dd class */ 491 | .dd .ddArrow{width:16px;height:16px; margin-top:-8px; background:url(../images/msdropdown_arrow.gif) no-repeat;} 492 | .dd .ddTitle{color:#000;background:#e2e2e4 url(../images/msdropdown_bg.gif) repeat-x left top;} 493 | 494 | /* prevent selection of text in dropdown */ 495 | .ddcommon { 496 | -webkit-touch-callout: none; 497 | -webkit-user-select: none; 498 | -khtml-user-select: none; 499 | -moz-user-select: none; 500 | -ms-user-select: none; 501 | user-select: none; 502 | } 503 | 504 | /* Adjust height of fnone img*/ 505 | img.fnone{float:none !important;height:24px;} 506 | 507 | /* prevent background overflow on the border-radius */ 508 | .borderRadiusTp{-moz-border-radius:0 0 0 0;border-radius:0 0 0 0;-moz-border-top-left-radius:5px; -moz-border-top-right-radius:5px; border-top-left-radius:5px; border-top-right-radius:5px;} 509 | .borderRadiusBtm{-moz-border-radius:0 0 0 0;border-radius:0 0 0 0;-moz-border-bottom-left-radius:5px; -moz-border-bottom-right-radius:5px; border-bottom-left-radius:5px; border-bottom-right-radius:5px;} 510 | 511 | -------------------------------------------------------------------------------- /doc/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Order allow,deny 3 | Deny from all 4 | 5 | -------------------------------------------------------------------------------- /doc/CHANGELOG: -------------------------------------------------------------------------------- 1 | Changelog 2 | ~~~~~~~~~~~ 3 | * 0.8.1 4 | - Add support of multiple Source (Flatbed/ADF) (option disabled when not available) 5 | - msdropdown was updated to last version (v3.5.2) 6 | - minor improvements (utf-8 corrected for date file, possibilty to download single as file and not zipfile) 7 | - some indentation was cleaned and corrected 8 | 9 | * 0.8.0 10 | -Initial Fork to GitHub by Gawindx 11 | 12 | * 0.6.1 13 | - JS scripting code is not inserted directly into the HTML code 14 | - forms are sent by POST 15 | - changed encoding to UTF-8 with a view to creating translations in other languages 16 | - added finish translation 17 | - added russian translation 18 | - added ukrainian translation 19 | - fixed typo in lineart (monochrom) scan mode 20 | - changed scanner detection routine to avoid webcams detected as scanners 21 | - added support for pdf output through imagemagick 22 | - changed mode option to support scanimage 1.0.21+ 23 | 24 | * 0.6.0 25 | - update by Wojciech Bronisz 26 | - Draw a box when selecting the scan area 27 | - Scanned file does not open pop-up windows (an option in config.php "save_type") 28 | - Scanned files are saved in "output" directory 29 | - While setting scan option is to broadcast the resulting 30 | file name (form field), if the file already exists in the 31 | directory "output" is added to the current date (YYYY-MM-dd HH-mm-ss) 32 | - And other small fixes in the code needed for these things 33 | - Add Polish language program. 34 | 35 | * 0.5.1 36 | - minor update by John Walsh 37 | - updated/fixed code for detecting resolutions supported, to include 38 | ranges 39 | 40 | * 0.5.0 41 | - major update by John Walsh 42 | - updated/fixed code for latest PHP 5 43 | - fixed all functionality for scan options and file types 44 | - added 'Extra' user options input area 45 | - added 'help' page to web interface 46 | - re-write of html and css for more standard/flexible page layout 47 | - cleaned up the config file, and made all options configurable 48 | from the config.php so that no other files need changing 49 | 50 | * 0.4.1 51 | - phpSANE now works without register_global 52 | 53 | * 0.4.0 54 | - Fixed bug #1104508 55 | - Supports feature #1104513 56 | - Code cleaned up. 57 | 58 | * 0.3.3 59 | - Some feature enhancements by Stefan Bernshausen 60 | 61 | * 0.3.2 62 | - Fixed bug #1086548 63 | 64 | * 0.3.1 65 | - You can specify your scanner manually (if phpSANE does not detect it). 66 | - The automatic installation _should_ do all necessary things now. 67 | 68 | * 0.3.0 69 | - phpSANE supports OCR now (requires gocr). 70 | 71 | * 0.2.0 72 | - phpSANE supports preview now. 73 | 74 | * 0.1.1 75 | - phpSANE verifies that a scanner is connected and does not print 76 | strange errors. 77 | - phpSANE is available in English and German. 78 | - Automatic installation with a bash-script. 79 | -------------------------------------------------------------------------------- /doc/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /doc/README_DE.txt: -------------------------------------------------------------------------------- 1 |  phpSANE (Version 0.6.0) 2 | ~~~~~~~~~ 3 | 4 | phpSANE ist ein in PHP geschriebenes web-basierendes Frontend für SANE. 5 | Jetzt können Sie auch mit Ihrem Web-Browser scannen. 6 | 7 | Copyright (C) 2009 David Fröhlich 8 | and John Walsh 9 | and Wojciech Bronisz 10 | 11 | Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU 12 | General Public License, wie von der Free Software Foundation veröffentlicht, 13 | weitergeben und/oder modifizieren, entweder gemäß Version 2 der Lizenz oder 14 | (nach Ihrer Option) jeder späteren Version. 15 | Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, daß es Ihnen von 16 | Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite 17 | Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. 18 | Details finden Sie in der GNU General Public License. 19 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 20 | Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software 21 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 22 | 23 | 24 | ------------------------------------------------------------------------ 25 | 26 | Voraussetzungen: 27 | ^^^^^^^^^^^^^^^^ 28 | * SANE 29 | * netpbm 30 | * Apache web-server mit PHP-Unterstützung 31 | * gocr (optional) 32 | 33 | 34 | ------------------------------------------------------------------------ 35 | 36 | Installation: 37 | ^^^^^^^^^^^^^ 38 | Kopieren Sie einfach das phpSANE-Verzeichnis in Ihr www-root Verzeichnis. 39 | Dann können Sie durch Öffnen der index.php in Ihrem Web-Browser scannen. 40 | 41 | 42 | ------------------------------------------------------------------------ 43 | 44 | FAQ: 45 | ^^^^ 46 | 47 | F: Wie uberprufe ich, ob mein Scanner arbeitet? 48 | 49 | A: Stellen Sie sicher, dass Ihr Scanner erkannt wurde und auf dem lokalen 50 | Computer ordnunsgemaess funktioniert. Um dies zu ueberpruefen, verwenden 51 | Sie bitte eine der Scanner-Anwendungen. 52 | 53 | Application Menu->Graphics->Scanner Tool 54 | Application Menu->Graphics->The GIMP, File->Aquire->XSane: Device Dialog... 55 | 56 | Sollte Ihr Scanner nicht lokal auf Ihrem Computer funktionieren, wird er 57 | auch nicht mit phpSANE funktionieren. 58 | 59 | ---------- 60 | 61 | Q: Mein Scanner wird nicht mit phpSANE gefunden? 62 | Q: Mein Scanner wird erkannt, aber wenn ich Vorschau waehle oder scanne 63 | ist die Bilddatei leer? 64 | 65 | A: Dies ist moeglicherweise auf ein Problem mit der Rechtevergabe 66 | zurueckzufuehren. Versuche :- 67 | 68 | chmod +s /usr/bin/scanimage 69 | chmod 775 WWW_PHPSANE_DIR/tmp 70 | 71 | WWW_PHPSANE_DIR = Der www Bereich, in dem phpSANE verwendet wird. 72 | 73 | z.B.: Stellen Sie sicher, dass Ihr Apache Benutzer scanimage verwenden 74 | kann und Schreibrechte fuer das phpSANE tmp Verzeichnis hat. 75 | 76 | ---------- 77 | 78 | Q: phpSANE zeigt fuer meinen Scanner einen anderen Namen/Model an? 79 | 80 | A: In verschiedenen Laendern kann ein Scanner unter unterschiedlichen 81 | Namen und Nummern verkauft werden, obwohl die Hardware identisch ist. 82 | Daher ist es moeglich, dass der Scanner mit einem anderen Namen 83 | aufgefuehrt wird. Zum Beispiel wird die Scannerserie Epson Perfection 84 | in Japan unter dem Namen GT-**** angeboten. 85 | 86 | ---------- 87 | 88 | Q: phpSANE funktioniert, aber wenn ich "Scan" verwende passiert nichts? 89 | 90 | A: Zwei Dinge koennen falsch sein:- 91 | 92 | a) Der Scan Bereich ist ungueltig, z.B. haben Sie keinen Bereich zum 93 | Scannen ausgewaehlt. 94 | 95 | b) Wenn ein Scan fertig ist, oeffnet sich ein neues Fenster mit der zu 96 | speichernden Datei - dieses kann durch einen 'pop-up' blockiert 97 | unterdrueckt worden sein. 98 | 99 | ---------- 100 | 101 | Q: phpSANE funktioniert, aber wie limitiere ich die Zugangsberechtigung 102 | auf mein internes Netzwerk? 103 | 104 | A: In httpd.conf :- 105 | 106 | 107 | DirectoryIndex index.php 108 | Order Deny,Allow 109 | Deny from all 110 | Allow from 127.0.0.0/8 111 | Allow from 192.168.1.0/24 112 | 113 | 114 | ------------------------------------------------------------------------ 115 | -------------------------------------------------------------------------------- /doc/README_EN.txt: -------------------------------------------------------------------------------- 1 | phpSANE (Version 0.6.0) 2 | ~~~~~~~~~ 3 | 4 | phpSANE is a web-based frontend for SANE written in PHP. 5 | Now you can scan with your web-browser, too. 6 | 7 | Copyright (C) 2009 David Froehlich 8 | and John Walsh 9 | and Wojciech Bronisz 10 | 11 | This program is free software; you can redistribute it and/or modify it under 12 | the terms of the GNU General Public License as published by the Free Software 13 | Foundation; either version 2 of the License, or (at your option) any later 14 | version. 15 | This program is distributed in the hope that it will be useful, but 16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 18 | details. 19 | You should have received a copy of the GNU General Public License along 20 | with this program; if not, write to the Free Software Foundation, Inc., 59 21 | Temple Place, Suite 330, Boston, MA 02111-1307, USA. 22 | 23 | 24 | ------------------------------------------------------------------------ 25 | 26 | Requirements: 27 | ^^^^^^^^^^^^^ 28 | * SANE 29 | * netpbm 30 | * Apache web-server with PHP-support 31 | * gocr (optional) 32 | 33 | 34 | ------------------------------------------------------------------------ 35 | 36 | Installation: 37 | ^^^^^^^^^^^^^ 38 | Just copy the phpSANE-directory into your www-root. 39 | Then you can scan by opening index.php in your web-browser. 40 | 41 | 42 | ------------------------------------------------------------------------ 43 | 44 | FAQ: 45 | ^^^^ 46 | 47 | Q: How do I check if my scanner is working ? 48 | 49 | A: Before trying phpSANE, it is a good idea to make sure that your 50 | scanner is detected and working from the local machine. To do this, 51 | just use one of the scanner applications :- 52 | 53 | Application Menu->Graphics->Scanner Tool 54 | Application Menu->Graphics->The GIMP, File->Aquire->XSane: Device Dialog... 55 | 56 | If your scanner does not work directly from your machine, then it will 57 | not work through phpSANE. 58 | 59 | ---------- 60 | 61 | Q: My scanner isn't found by phpSANE ? 62 | Q: My scanner is detected, but when I preview or scan, the image file 63 | is empty ? 64 | 65 | A: this is probably a permissions problem, try :- 66 | 67 | chmod +s /usr/bin/scanimage 68 | chmod 775 WWW_PHPSANE_DIR/tmp 69 | 70 | WWW_PHPSANE_DIR = the www file area you put phpSANE at. 71 | 72 | ie. Make sure that your apache user is able to scan with scanimage, 73 | and your apache user must have write-access to the phpSANE tmp directory. 74 | 75 | ---------- 76 | 77 | Q: phpSANE is showing my scanner by a different name/model ? 78 | 79 | A: In different regions of the world, a scanner may be sold by different 80 | model names and numbers, but the internal hardware is exactly the same. 81 | So it may be that to the SANE project, the scanner is recognised by a 82 | different name to the one that you know your scanner as. For example, 83 | the Epson Perfection range of scanners are sold in Japan under the 84 | model names GT-****. 85 | 86 | ---------- 87 | 88 | Q: phpSANE is working, but when I 'Scan', nothing happens ? 89 | 90 | A: There could be two things wrong :- 91 | 92 | a) the 'Scan Area' could be invalid, 93 | ie. you have not selected an area to scan. 94 | 95 | b) when a scan completes, a new window is opened with the scan 96 | results to allow you to save it - this may be blocked by a 97 | 'pop-up' blocker. 98 | 99 | ---------- 100 | 101 | Q: phpSANE is working fine, but how do I restrict access to it to my 102 | internal network only ? 103 | A: in httpd.conf :- 104 | 105 | 106 | DirectoryIndex index.php 107 | Order Deny,Allow 108 | Deny from all 109 | Allow from 127.0.0.0/8 110 | Allow from 192.168.1.0/24 111 | 112 | 113 | ------------------------------------------------------------------------ 114 | -------------------------------------------------------------------------------- /doc/README_PL.txt: -------------------------------------------------------------------------------- 1 | phpSANE (Version 0.6.0) 2 | ~~~~~~~~~ 3 | 4 | phpSANE jest interface'em do obsługi skanera napisanym w języku PHP 5 | wystarczy że skaner podłączony jest do komputera gdzie masz zainstalowany 6 | serwer www wraz z php, a użytkownik końcowy wystarczy że skorzysta 7 | z przeglądarki www - oro sposób na 'udostępnienie' dowolnego skanera w sieci 8 | lokalnej. 9 | 10 | Copyright (C) 2009 David Froehlich 11 | and John Walsh 12 | and Wojciech Bronisz 13 | 14 | This program is free software; you can redistribute it and/or modify it under 15 | the terms of the GNU General Public License as published by the Free Software 16 | Foundation; either version 2 of the License, or (at your option) any later 17 | version. 18 | This program is distributed in the hope that it will be useful, but 19 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 20 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 | details. 22 | You should have received a copy of the GNU General Public License along 23 | with this program; if not, write to the Free Software Foundation, Inc., 59 24 | Temple Place, Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | 27 | ------------------------------------------------------------------------ 28 | 29 | Requirements: 30 | ^^^^^^^^^^^^^ 31 | * SANE 32 | * netpbm 33 | * Apache web-server with PHP-support 34 | * gocr (optional) 35 | 36 | 37 | ------------------------------------------------------------------------ 38 | 39 | Installation: 40 | ^^^^^^^^^^^^^ 41 | Just copy the phpSANE-directory into your www-root. 42 | Then you can scan by opening index.php in your web-browser. 43 | 44 | 45 | ------------------------------------------------------------------------ 46 | 47 | FAQ: 48 | ^^^^ 49 | 50 | Q: How do I check if my scanner is working ? 51 | 52 | A: Before trying phpSANE, it is a good idea to make sure that your 53 | scanner is detected and working from the local machine. To do this, 54 | just use one of the scanner applications :- 55 | 56 | Application Menu->Graphics->Scanner Tool 57 | Application Menu->Graphics->The GIMP, File->Aquire->XSane: Device Dialog... 58 | 59 | If your scanner does not work directly from your machine, then it will 60 | not work through phpSANE. 61 | 62 | ---------- 63 | 64 | Q: My scanner isn't found by phpSANE ? 65 | Q: My scanner is detected, but when I preview or scan, the image file 66 | is empty ? 67 | 68 | A: this is probably a permissions problem, try :- 69 | 70 | chmod +s /usr/bin/scanimage 71 | chmod 775 WWW_PHPSANE_DIR/tmp 72 | 73 | WWW_PHPSANE_DIR = the www file area you put phpSANE at. 74 | 75 | ie. Make sure that your apache user is able to scan with scanimage, 76 | and your apache user must have write-access to the phpSANE tmp directory. 77 | 78 | ---------- 79 | 80 | Q: phpSANE is showing my scanner by a different name/model ? 81 | 82 | A: In different regions of the world, a scanner may be sold by different 83 | model names and numbers, but the internal hardware is exactly the same. 84 | So it may be that to the SANE project, the scanner is recognised by a 85 | different name to the one that you know your scanner as. For example, 86 | the Epson Perfection range of scanners are sold in Japan under the 87 | model names GT-****. 88 | 89 | ---------- 90 | 91 | Q: phpSANE is working, but when I 'Scan', nothing happens ? 92 | 93 | A: There could be two things wrong :- 94 | 95 | a) the 'Scan Area' could be invalid, 96 | ie. you have not selected an area to scan. 97 | 98 | b) when a scan completes, a new window is opened with the scan 99 | results to allow you to save it - this may be blocked by a 100 | 'pop-up' blocker. 101 | 102 | ---------- 103 | 104 | Q: phpSANE is working fine, but how do I restrict access to it to my 105 | internal network only ? 106 | A: in httpd.conf :- 107 | 108 | 109 | DirectoryIndex index.php 110 | Order Deny,Allow 111 | Deny from all 112 | Allow from 127.0.0.0/8 113 | Allow from 192.168.1.0/24 114 | 115 | 116 | ------------------------------------------------------------------------ 117 | -------------------------------------------------------------------------------- /download.php: -------------------------------------------------------------------------------- 1 | 1){ 9 | foreach($_REQUEST['selected_files'] as $selected_file) { 10 | $selected_file_path = $save_dir . basename($selected_file); 11 | if(is_readable($selected_file_path)) { 12 | array_push($selected_file_paths, $selected_file_path); 13 | } 14 | } 15 | $zipfile_path = $temp_dir . 'scanned_' . time() . '.zip'; 16 | if(sizeof($selected_file_paths) > 0) { 17 | create_zip($selected_file_paths, $zipfile_path, true); 18 | if(is_readable($zipfile_path)) { 19 | //output path to created file 20 | echo "$zipfile_path"; 21 | } 22 | } 23 | }else{ 24 | $selected_file = $_REQUEST['selected_files'][0]; 25 | $selected_file_path = $save_dir . basename($selected_file); 26 | if(sizeof($selected_file_path) > 0) { 27 | if(is_readable($selected_file_path)) { 28 | echo "$selected_file_path"; 29 | } 30 | } 31 | } 32 | } 33 | 34 | 35 | /* creates a compressed zip file */ 36 | function create_zip($files = array(),$destination = '',$overwrite = false) { 37 | //if the zip file already exists and overwrite is false, return false 38 | if(file_exists($destination) && !$overwrite) { return false; } 39 | 40 | //vars 41 | $valid_files = array(); 42 | //if files were passed in... 43 | if(is_array($files)) { 44 | //cycle through each file 45 | foreach($files as $file) { 46 | //make sure the file exists 47 | if(file_exists($file)) { 48 | $valid_files[] = $file; 49 | } 50 | } 51 | } 52 | //if we have good files... 53 | if(count($valid_files)) { 54 | //create the archive 55 | $zip = new ZipArchive(); 56 | if($overwrite) { 57 | if($zip->open($destination, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== true) { 58 | return false; 59 | } 60 | }else{ 61 | if($zip->open($destination, ZIPARCHIVE::CREATE ) !== true) { 62 | return false; 63 | } 64 | } 65 | 66 | //add the files 67 | foreach($valid_files as $file) { 68 | $zip->addFile($file, basename($file)); 69 | } 70 | 71 | //close the zip 72 | $zip->close(); 73 | 74 | //check to make sure the file exists 75 | return file_exists($destination); 76 | }else{ 77 | return false; 78 | } 79 | } 80 | ?> 81 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/favicon.ico -------------------------------------------------------------------------------- /help/help_0.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | phpSANE: help 9 | 10 | 11 | 12 | 31 | phpSANE: Hilfe 32 | 33 | 34 |

35 | Scan-Bereich 36 |

37 | 38 |

39 | Das Wählen einer Seitengröße stellt die erforderlichen 40 | Größen der Seiten ein. 41 |

42 | 43 |

44 | Ein Klick auf 'Bildvorschau' setzt die gewählte Ecke 45 | (oben linkes oder unteren rechts) an die Cursorposition. 46 |

47 | 48 | 49 |

50 | Scan-Wählen 51 |

52 | 53 |

54 | Nur die grundlegendsten Einstellmöglichkeiten werden direkt 55 | unterstützt, wie die Einstellung der Bildqualität 56 | (-Modus und -Auflösung) 57 | und das zu speichernde Dateiformat. 58 |

59 | 60 |

61 | Extra :- 62 |

63 | 64 |

65 | Für Ihren Scanner lautet die gesamte Liste von Optionen 66 | (Hilfe: scanimage - h) :- 67 |

68 | 69 |

70 |

 71 | {$sane_help}
 72 | 
73 |

74 | 75 | 76 |

77 | Extraoptionen, 78 | die Sie dem Scan-Befehl hinzufügen möchten, 79 | können Sie in das 'Extra' Feld eintragen. 80 |

81 | 82 |

83 | Anmerkung: Unzulässige Buchstaben werden durch ein 'x' ersetzt. 84 |

85 | 86 |

87 | z.B. Steuerung der Helligkeit :- 88 |

89 | 90 |

91 | Die Angabe ist nicht bei allen Scannern gleich. 92 | Demnach müssen Sie probieren, 93 | welche Angabe Ihr Scanner erfordert. 94 | Es kann ein Prozentsatz sein, 95 | oder eine Zahl (z.B. -4..3). 96 |

97 | 98 |

99 | z.B.
100 | --brightness=50%
101 | --brightness 2
102 |

103 | 104 | 105 |

106 | Befehlsfelder 107 |

108 | 109 |

110 | Vorschau :- 111 |

112 | 113 |

114 | Scant den vollständigen Bereich in einer niedrigen Auflösung, 115 | so dass Sie Ihr Dokument ansehen und Ausschnitte auswählen 116 | können. 117 |

118 | 119 | 120 |

121 | Scannen :- 122 |

123 | 124 |

125 | Scant den vorgewählten Bereich und speichert ihn in 126 | der Ausgabedatei (Bild oder Text). 127 |

128 | 129 | 130 |

131 | OCR :- (nur vorhanden wenn 'gocr' installiert ist) 132 |

133 | 134 |

135 | Scant und verwendet OCR, 136 | um den Inhalt in eine ASCII-Textdatei umzuwandeln. 137 |

138 | 139 |

140 | Empfohlen wird Grayscale bei 300dpi oder mehr. 141 |

142 | 143 | 144 |

145 | Zurücksetzen :- 146 |

147 | 148 |

149 | Lädt die Seite neu, 150 | aber veraendert sonst nichts. 151 |

152 | 153 | 154 |

155 | Zurüecksetzen :- 156 |

157 | 158 |

159 | Stellt alle Parameter auf ihre Ausgangswerte zurück und 160 | löscht die Vorschau. 161 |

162 | 163 | 164 |

165 | Scan Befehl 166 |

167 | 168 |

169 | Unten auf der Seite wird die Befehlszeile angezeigt, 170 | mit der der Scan durchgefuehrt wurde. 171 | Dies erlaubt Ihnen, 172 | den Befehl im Falle von Fehlern manuell zu 173 | überprüfen und zu verändern. 174 |

175 | 176 | EOT; 177 | 178 | ?> 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /help/help_1.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | phpSANE: help 9 | 10 | 11 | 12 | 37 | phpSANE: Help 38 | 39 | 40 |

41 | Scan Area 42 |

43 | 44 |

45 | Choosing a page size will set the required page dimensions. 46 |

47 | 48 |

49 | Clicking on the 'preview image' area will set the appropriate 50 | corner (top left or bottom right) to the mouse position. 51 |

52 | 53 | 54 |

55 | Scan Options 56 |

57 | 58 |

59 | Only the most basic options are supported directly, 60 | that give you control over the image quality 61 | (--mode and --resolution) 62 | and the file format type to save the image as. 63 |

64 | 65 |

66 | Extra :- 67 |

68 | 69 |

70 | For your scanner, 71 | the full list of options (from: scanimage -h) is :- 72 |

73 | 74 |

75 |

 76 | {$sane_help}
 77 | 
78 |

79 | 80 | 81 |

82 | Any extra options you want to add to the scan command, 83 | you can add them in this 'extra' field. 84 |

85 | 86 |

87 | NB. Invalid characters are replaced with an 'X'. 88 |

89 | 90 |

91 | eg. To control the brightness :- 92 |

93 | 94 |

95 | The value is not stanard across all scanners, 96 | so you need to see what options your scanner takes. 97 | It may be a percentage, 98 | or a number in a range (eg. -4..3). 99 |

100 | 101 |

102 | eg.
103 | --brightness=50%
104 | --brightness 2
105 |

106 | 107 | 108 |

109 | Action Buttons 110 |

111 | 112 |

113 | Preview :- 114 |

115 | 116 |

117 | Does a scan of the whole area, 118 | at a low resolution and displays it, 119 | so you can view your document and select areas from it. 120 |

121 | 122 | 123 |

124 | Scan :- 125 |

126 | 127 |

128 | Does a scan of the area selected and lets you save the 129 | output file (image or text). 130 |

131 | 132 | 133 |

134 | OCR :- (only available if 'gocr' is installed) 135 |

136 | 137 |

138 | Does a scan and uses OCR to convert the contents into an ASCII text file. 139 |

140 | 141 |

142 | Recommend using Grayscale at 300dpi or above. 143 |

144 | 145 | 146 |

147 | Reset :- 148 |

149 | 150 |

151 | Re-loads the page, 152 | but does nothing else. 153 |

154 | 155 | 156 |

157 | Clean :- 158 |

159 | 160 |

161 | Resets all parameters to their default values and clears the preview. 162 |

163 | 164 | 165 |

166 | Scan Command 167 |

168 | 169 |

170 | At the bottom of the page, 171 | the command line used to perform the scan is displayed. 172 | This allows you to manually check the format of the command 173 | in case of errors. 174 |

175 | 176 | EOT; 177 | 178 | ?> 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /help/help_2.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | phpSANE: help 11 | 12 | '; 13 | 14 | 15 | // Polish Help 16 | // ============ 17 | 18 | $SCANIMAGE = "/usr/bin/scanimage"; 19 | $cmd = $SCANIMAGE . " -h"; 20 | $sane_help = `$cmd`; 21 | unset($cmd); 22 | 23 | $start = strpos($sane_help, "\nOptions specific to device") + 1; 24 | if ($start !== FALSE) 25 | { 26 | $sane_help = substr($sane_help, $start); 27 | } 28 | 29 | $start = strpos($sane_help, "\nType ``scanimage --help"); 30 | if ($start !== FALSE) 31 | { 32 | $sane_help = substr($sane_help, 0, $start); 33 | } 34 | 35 | echo << 38 | phpSANE: Help 39 | 40 | 41 |

42 | Scan Area 43 |

44 | 45 |

46 | Choosing a page size will set the required page dimensions. 47 |

48 | 49 |

50 | Clicking on the 'preview image' area will set the appropriate 51 | corner (top left or bottom right) to the mouse position. 52 |

53 | 54 | 55 |

56 | Scan Options 57 |

58 | 59 |

60 | Only the most basic options are supported directly, 61 | that give you control over the image quality 62 | (--mode and --resolution) 63 | and the file format type to save the image as. 64 |

65 | 66 |

67 | Extra :- 68 |

69 | 70 |

71 | For your scanner, 72 | the full list of options (from: scanimage -h) is :- 73 |

74 | 75 |

76 |

 77 | {$sane_help}
 78 | 
79 |

80 | 81 | 82 |

83 | Any extra options you want to add to the scan command, 84 | you can add them in this 'extra' field. 85 |

86 | 87 |

88 | NB. Invalid characters are replaced with an 'X'. 89 |

90 | 91 |

92 | eg. To control the brightness :- 93 |

94 | 95 |

96 | The value is not stanard across all scanners, 97 | so you need to see what options your scanner takes. 98 | It may be a percentage, 99 | or a number in a range (eg. -4..3). 100 |

101 | 102 |

103 | eg.
104 | --brightness=50%
105 | --brightness 2
106 |

107 | 108 | 109 |

110 | Action Buttons 111 |

112 | 113 |

114 | Preview :- 115 |

116 | 117 |

118 | Does a scan of the whole area, 119 | at a low resolution and displays it, 120 | so you can view your document and select areas from it. 121 |

122 | 123 | 124 |

125 | Scan :- 126 |

127 | 128 |

129 | Does a scan of the area selected and lets you save the 130 | output file (image or text). 131 |

132 | 133 | 134 |

135 | OCR :- (only available if 'gocr' is installed) 136 |

137 | 138 |

139 | Does a scan and uses OCR to convert the contents into an ASCII text file. 140 |

141 | 142 |

143 | Recommend using Grayscale at 300dpi or above. 144 |

145 | 146 | 147 |

148 | Reset :- 149 |

150 | 151 |

152 | Re-loads the page, 153 | but does nothing else. 154 |

155 | 156 | 157 |

158 | Clean :- 159 |

160 | 161 |

162 | Resets all parameters to their default values and clears the preview. 163 |

164 | 165 | 166 |

167 | Scan Command 168 |

169 | 170 |

171 | At the bottom of the page, 172 | the command line used to perform the scan is displayed. 173 | This allows you to manually check the format of the command 174 | in case of errors. 175 |

176 | 177 | EOT; 178 | 179 | ?> 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /help/help_4.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | phpSANE: help 9 | 10 | 11 | 12 | 37 | phpSANE: Помощь 38 | 39 | 40 |

41 | Область сканирования 42 |

43 | 44 |

45 | Установите требуемые размеры сканирования, выбрав формат страницы. 46 |

47 | 48 |

49 | Отметьте требуемую область сканирования, кликнув мышью в окне предварительного просмотра, указав в начале левый верхний угол, затем правый нижний угол требуемой области сканирования. 50 |

51 | 52 | 53 |

54 | Параметры сканирования 55 |

56 | 57 |

58 | Здесь доступны только основные параметры установки качества сканирования (--mode и --resolution), а также формат файла, в котором будет сохранено сканируемое изображение. 59 |

60 | 61 |

62 | Дополнительно :- 63 |

64 | 65 |

66 | Полный список возможных настроек сканирования для Вашего сканера (из: scanimage -h):- 67 |

68 | 69 |

70 |

 71 | {$sane_help}
 72 | 
73 |

74 | 75 | 76 |

77 | Любые дополнительные опции сканирования вы можете ввести в поле "Дополнительные параметры" 78 |

79 | 80 |

81 | NB. Все неподдерживаемые символы заменены на 'X'. 82 |

83 | 84 |

85 | К примеру, для контроля яркости сканирования :- 86 |

87 | 88 |

89 | Данное значение поля не является общим для всех сканеров. 90 | Оно может быть указано как в процентах, так и в определенном номерном диапазоне (например -4..3). 91 |

92 | 93 |

94 | Пример:
95 | --brightness=50%
96 | --brightness 2
97 |

98 | 99 | 100 |

101 | Кнопки действий 102 |

103 | 104 |

105 | Просмотр :- 106 |

107 | 108 |

109 | Отображает в низком разрешении для просмотра всю страницу целиком, для того, чтобы можно было выбрать требуемую область для сканирования. 110 |

111 | 112 | 113 |

114 | Сканировать :- 115 |

116 | 117 |

118 | Сканирует выбранную область и сохраняет ее в файл (графический или текстовый, если выбрано распознавание текста ("OCR")). 119 |

120 | 121 | 122 |

123 | OCR :- (доступно, если установлена программа 'gocr' (поддерживается только английский язык)). 124 |

125 | 126 |

127 | Сканируется, распознается и сохраняется в ASCII текстовый файл. 128 |

129 | 130 |

131 | Рекомендуется использовать Оттенки серого с разрешением 300dpi или выше. 132 |

133 | 134 | 135 |

136 | Сброс :- 137 |

138 | 139 |

140 | Только перечитывание страницы. 141 |

142 | 143 | 144 |

145 | Очистить :- 146 |

147 | 148 |

149 | Сбросить все параметры в значения по умолчанию и очистить область предварительного просмотра. 150 |

151 | 152 | 153 |

154 | Команда сканирования 155 |

156 | 157 |

158 | Внизу страницы отображается командная строка с параметрами сканирования. Это позволяет вручную проверить правильность формата команды в случае ошибок. 159 |

160 | 161 | EOT; 162 | 163 | ?> 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /help/help_6.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | phpSANE: help 9 | 10 | 11 | 12 | 37 | phpSANE: Aide 38 | 39 | 40 |

41 | Aire de numérisation 42 |

43 | 44 |

45 | Choisir le format pour fixer la dimension de la page. 46 |

47 | 48 |

49 | Cliquer sur 'prévisualisation' pour fixer les coins 50 | (haut gauche et bas droit) à la position de la souris. 51 |

52 | 53 | 54 |

55 | Options de numérisation 56 |

57 | 58 |

59 | Seules les options basiques sont supportées directement, 60 | afin de contrôler la qualité de l'image 61 | (--mode et --resolution) 62 | ainsi que le format du fichier à créer. 63 |

64 | 65 |

66 | Extra :- 67 |

68 | 69 |

70 | Pour votre scanner, 71 | la liste complè des options (à partir de : scanimage -h) est :- 72 |

73 | 74 |

75 |

 76 | {$sane_help}
 77 | 
78 |

79 | 80 | 81 |

82 | Chaque option suppl´mentaire que vous voulez utiliser 83 | à la commande de numérisation peut être 84 | ajoutée au champs 'extra'. 85 |

86 | 87 |

88 | NB: Les caractères invalides sont remplac´s par 'X'. 89 |

90 | 91 |

92 | ex: Pour contrôler la luminosité :- 93 |

94 | 95 |

96 | La valeur n'est pas standard selon les scanners, 97 | vous devez donc vous aviser des options que votre scanner utilise. 98 | Ce peut être un pourcentage ou un nombre dans une plage (ex: -4..3). 99 |

100 | 101 |

102 | ex:
103 | --brightness=50%
104 | --brightness 2
105 |

106 | 107 | 108 |

109 | Boutons d'action 110 |

111 | 112 |

113 | Prévisualiser :- 114 |

115 | 116 |

117 | Fait une numérisation en basse résolution 118 | de toute la page et vous donne un aperçu qui permet 119 | de sélectionner l'aire à numériser. 120 |

121 | 122 | 123 |

124 | Numériser :- 125 |

126 | 127 |

128 | Lance la numérisation de l'aire sélectionnée 129 | sous le nom de fichier choisi (image ou text). 130 |

131 | 132 | 133 |

134 | ROC :- (si 'gocr' est installé uniquement) 135 |

136 | 137 |

138 | Numérise et utilise la reconnaisance optique de caractère (ROC) 139 | pour convertir le contenu en fichier text ASCII. 140 |

141 | 142 |

143 | Il est recommandé de numériser en nuances de gris à 300 dpi (ppp). 144 |

145 | 146 | 147 |

148 | Recharger :- 149 |

150 | 151 |

152 | Recharge la page, un point c'est tout. 153 |

154 | 155 | 156 |

157 | Réinitialiser :- 158 |

159 | 160 |

161 | Remet le formulaire aux valeurs par défaut et vide la prévisualisation. 162 |

163 | 164 | 165 |

166 | Commande de numérisation 167 |

168 | 169 |

170 | La ligne de commande utilisée pour lancer la numérisation 171 | est affichée à la fin de la page. 172 | Ceci vous permet de vérifier le format de la commande 173 | en cas d'erreurs. 174 |

175 | 176 | EOT; 177 | 178 | ?> 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /help/help_7.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | phpSANE: help 11 | 12 | '; 13 | 14 | 15 | // Polish Help 16 | // ============ 17 | 18 | $SCANIMAGE = "/usr/bin/scanimage"; 19 | $cmd = $SCANIMAGE . " -h"; 20 | $sane_help = `$cmd`; 21 | unset($cmd); 22 | 23 | $start = strpos($sane_help, "\nOptions specific to device") + 1; 24 | if ($start !== FALSE) 25 | { 26 | $sane_help = substr($sane_help, $start); 27 | } 28 | 29 | $start = strpos($sane_help, "\nType ``scanimage --help"); 30 | if ($start !== FALSE) 31 | { 32 | $sane_help = substr($sane_help, 0, $start); 33 | } 34 | 35 | echo << 38 | phpSANE: Help 39 | 40 | 41 |

42 | Scan Area 43 |

44 | 45 |

46 | Choosing a page size will set the required page dimensions. 47 |

48 | 49 |

50 | Clicking on the 'preview image' area will set the appropriate 51 | corner (top left or bottom right) to the mouse position. 52 |

53 | 54 | 55 |

56 | Scan Options 57 |

58 | 59 |

60 | Only the most basic options are supported directly, 61 | that give you control over the image quality 62 | (--mode and --resolution) 63 | and the file format type to save the image as. 64 |

65 | 66 |

67 | Extra :- 68 |

69 | 70 |

71 | For your scanner, 72 | the full list of options (from: scanimage -h) is :- 73 |

74 | 75 |

76 |

 77 | {$sane_help}
 78 | 
79 |

80 | 81 | 82 |

83 | Any extra options you want to add to the scan command, 84 | you can add them in this 'extra' field. 85 |

86 | 87 |

88 | NB. Invalid characters are replaced with an 'X'. 89 |

90 | 91 |

92 | eg. To control the brightness :- 93 |

94 | 95 |

96 | The value is not stanard across all scanners, 97 | so you need to see what options your scanner takes. 98 | It may be a percentage, 99 | or a number in a range (eg. -4..3). 100 |

101 | 102 |

103 | eg.
104 | --brightness=50%
105 | --brightness 2
106 |

107 | 108 | 109 |

110 | Action Buttons 111 |

112 | 113 |

114 | Preview :- 115 |

116 | 117 |

118 | Does a scan of the whole area, 119 | at a low resolution and displays it, 120 | so you can view your document and select areas from it. 121 |

122 | 123 | 124 |

125 | Scan :- 126 |

127 | 128 |

129 | Does a scan of the area selected and lets you save the 130 | output file (image or text). 131 |

132 | 133 | 134 |

135 | OCR :- (only available if 'gocr' is installed) 136 |

137 | 138 |

139 | Does a scan and uses OCR to convert the contents into an ASCII text file. 140 |

141 | 142 |

143 | Recommend using Grayscale at 300dpi or above. 144 |

145 | 146 | 147 |

148 | Reset :- 149 |

150 | 151 |

152 | Re-loads the page, 153 | but does nothing else. 154 |

155 | 156 | 157 |

158 | Clean :- 159 |

160 | 161 |

162 | Resets all parameters to their default values and clears the preview. 163 |

164 | 165 | 166 |

167 | Scan Command 168 |

169 | 170 |

171 | At the bottom of the page, 172 | the command line used to perform the scan is displayed. 173 | This allows you to manually check the format of the command 174 | in case of errors. 175 |

176 | 177 | EOT; 178 | 179 | ?> 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /help/help_8.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | phpSANE: help 11 | 12 | '; 13 | 14 | 15 | // Polish Help 16 | // ============ 17 | 18 | $SCANIMAGE = "/usr/bin/scanimage"; 19 | $cmd = $SCANIMAGE . " -h"; 20 | $sane_help = `$cmd`; 21 | unset($cmd); 22 | 23 | $start = strpos($sane_help, "\nOptions specific to device") + 1; 24 | if ($start !== FALSE) 25 | { 26 | $sane_help = substr($sane_help, $start); 27 | } 28 | 29 | $start = strpos($sane_help, "\nType ``scanimage --help"); 30 | if ($start !== FALSE) 31 | { 32 | $sane_help = substr($sane_help, 0, $start); 33 | } 34 | 35 | echo << 38 | phpSANE: Help 39 | 40 | 41 |

42 | Scan Area 43 |

44 | 45 |

46 | Choosing a page size will set the required page dimensions. 47 |

48 | 49 |

50 | Clicking on the 'preview image' area will set the appropriate 51 | corner (top left or bottom right) to the mouse position. 52 |

53 | 54 | 55 |

56 | Scan Options 57 |

58 | 59 |

60 | Only the most basic options are supported directly, 61 | that give you control over the image quality 62 | (--mode and --resolution) 63 | and the file format type to save the image as. 64 |

65 | 66 |

67 | Extra :- 68 |

69 | 70 |

71 | For your scanner, 72 | the full list of options (from: scanimage -h) is :- 73 |

74 | 75 |

76 |

 77 | {$sane_help}
 78 | 
79 |

80 | 81 | 82 |

83 | Any extra options you want to add to the scan command, 84 | you can add them in this 'extra' field. 85 |

86 | 87 |

88 | NB. Invalid characters are replaced with an 'X'. 89 |

90 | 91 |

92 | eg. To control the brightness :- 93 |

94 | 95 |

96 | The value is not stanard across all scanners, 97 | so you need to see what options your scanner takes. 98 | It may be a percentage, 99 | or a number in a range (eg. -4..3). 100 |

101 | 102 |

103 | eg.
104 | --brightness=50%
105 | --brightness 2
106 |

107 | 108 | 109 |

110 | Action Buttons 111 |

112 | 113 |

114 | Preview :- 115 |

116 | 117 |

118 | Does a scan of the whole area, 119 | at a low resolution and displays it, 120 | so you can view your document and select areas from it. 121 |

122 | 123 | 124 |

125 | Scan :- 126 |

127 | 128 |

129 | Does a scan of the area selected and lets you save the 130 | output file (image or text). 131 |

132 | 133 | 134 |

135 | OCR :- (only available if 'gocr' is installed) 136 |

137 | 138 |

139 | Does a scan and uses OCR to convert the contents into an ASCII text file. 140 |

141 | 142 |

143 | Recommend using Grayscale at 300dpi or above. 144 |

145 | 146 | 147 |

148 | Reset :- 149 |

150 | 151 |

152 | Re-loads the page, 153 | but does nothing else. 154 |

155 | 156 | 157 |

158 | Clean :- 159 |

160 | 161 |

162 | Resets all parameters to their default values and clears the preview. 163 |

164 | 165 | 166 |

167 | Scan Command 168 |

169 | 170 |

171 | At the bottom of the page, 172 | the command line used to perform the scan is displayed. 173 | This allows you to manually check the format of the command 174 | in case of errors. 175 |

176 | 177 | EOT; 178 | 179 | ?> 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /help/help_9.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | phpSANE: help 11 | 12 | '; 13 | 14 | 15 | // Polish Help 16 | // ============ 17 | 18 | $SCANIMAGE = "/usr/bin/scanimage"; 19 | $cmd = $SCANIMAGE . " -h"; 20 | $sane_help = `$cmd`; 21 | unset($cmd); 22 | 23 | $start = strpos($sane_help, "\nOptions specific to device") + 1; 24 | if ($start !== FALSE) 25 | { 26 | $sane_help = substr($sane_help, $start); 27 | } 28 | 29 | $start = strpos($sane_help, "\nType ``scanimage --help"); 30 | if ($start !== FALSE) 31 | { 32 | $sane_help = substr($sane_help, 0, $start); 33 | } 34 | 35 | echo << 38 | phpSANE: Aiuto 39 | 40 | 41 |

42 | Area di scansione 43 |

44 | 45 |

46 | Scegliendo la il formato della pagina vengono impostate le dimensioni. 47 |

48 | 49 |

50 | Cliccando sull'immagine di anteprima si possono impostare delle dimensioni personalizzate, spostando gli angoli che definiscono l'area. 51 |

52 | 53 | 54 |

55 | Opzioni di scansione 56 |

57 | 58 |

59 | Solo le principali opzioni di base sono supportate, 60 | che danno il controllo sulla qualità dell'immagine (--mode e --resolution) 61 | e il formato del file nel quale memorizzare l'immagine 62 | 63 |

64 | 65 | 107 | 108 | 109 |

110 | Pulsanti 111 |

112 | 113 |

114 | Anteprima 115 |

116 | 117 |

118 | Effettua una scansione di tutta l'area, a bassa risoluzione, e la mostra, per consentire di selezionare il riquadro desiderato. 119 |

120 | 121 | 122 |

123 | Scansiona 124 |

125 | 126 |

127 | Effettua una scansione dell'area selezionata e permette di salvare il file in output, in base al formato scelto. 128 |

129 | 130 | 131 | 161 | 162 | 163 |

164 | Comando di scansione 165 |

166 | 167 |

168 | Nella parte inferiore della pagina viene visualizzata la linea di comando eseguita per effettuare la scansione, facilitando la verifica e la risoluzione di eventuali problemi. 169 |

170 | 171 | EOT; 172 | 173 | ?> 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /images/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | #one year 3 | 4 | Header set Cache-Control "max-age=29030400, public" 5 | 6 | -------------------------------------------------------------------------------- /images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/Thumbs.db -------------------------------------------------------------------------------- /images/btn_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/btn_accept.png -------------------------------------------------------------------------------- /images/btn_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/btn_preview.png -------------------------------------------------------------------------------- /images/filetype_bmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_bmp.png -------------------------------------------------------------------------------- /images/filetype_jpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_jpg.png -------------------------------------------------------------------------------- /images/filetype_other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_other.png -------------------------------------------------------------------------------- /images/filetype_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_pdf.png -------------------------------------------------------------------------------- /images/filetype_png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_png.png -------------------------------------------------------------------------------- /images/filetype_pnm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_pnm.png -------------------------------------------------------------------------------- /images/filetype_tif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_tif.png -------------------------------------------------------------------------------- /images/filetype_txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/filetype_txt.png -------------------------------------------------------------------------------- /images/help_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/help_icon.png -------------------------------------------------------------------------------- /images/lang_cz.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_cz.gif -------------------------------------------------------------------------------- /images/lang_de.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_de.gif -------------------------------------------------------------------------------- /images/lang_en.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_en.gif -------------------------------------------------------------------------------- /images/lang_fi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_fi.gif -------------------------------------------------------------------------------- /images/lang_fr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_fr.gif -------------------------------------------------------------------------------- /images/lang_it.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_it.gif -------------------------------------------------------------------------------- /images/lang_nl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_nl.gif -------------------------------------------------------------------------------- /images/lang_pl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_pl.gif -------------------------------------------------------------------------------- /images/lang_ru.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_ru.gif -------------------------------------------------------------------------------- /images/lang_uk.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/lang_uk.gif -------------------------------------------------------------------------------- /images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/logo.jpg -------------------------------------------------------------------------------- /images/mode_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/mode_color.png -------------------------------------------------------------------------------- /images/mode_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/mode_gray.png -------------------------------------------------------------------------------- /images/mode_lineart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/mode_lineart.png -------------------------------------------------------------------------------- /images/msdropdown_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/msdropdown_arrow.gif -------------------------------------------------------------------------------- /images/msdropdown_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/msdropdown_bg.gif -------------------------------------------------------------------------------- /images/pagesize_a4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/pagesize_a4.png -------------------------------------------------------------------------------- /images/pagesize_a5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/pagesize_a5.png -------------------------------------------------------------------------------- /images/pagesize_a6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/pagesize_a6.png -------------------------------------------------------------------------------- /images/pagesize_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/pagesize_custom.png -------------------------------------------------------------------------------- /images/phpSane_Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/phpSane_Screenshot_1.png -------------------------------------------------------------------------------- /images/phpSane_Screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/phpSane_Screenshot_2.png -------------------------------------------------------------------------------- /images/scan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/scan.jpg -------------------------------------------------------------------------------- /images/source/Hardware-Scanner-2-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/Hardware-Scanner-2-icon.png -------------------------------------------------------------------------------- /images/source/file type/file_icons_version_2_by_jrdn88-dxmw0i.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/file_icons_version_2_by_jrdn88-dxmw0i.zip -------------------------------------------------------------------------------- /images/source/file type/file_icons_version_3_by_jrdn88-d14uaad.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/file_icons_version_3_by_jrdn88-d14uaad.zip -------------------------------------------------------------------------------- /images/source/file type/filetype_bmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_bmp.png -------------------------------------------------------------------------------- /images/source/file type/filetype_jpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_jpg.png -------------------------------------------------------------------------------- /images/source/file type/filetype_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_pdf.png -------------------------------------------------------------------------------- /images/source/file type/filetype_png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_png.png -------------------------------------------------------------------------------- /images/source/file type/filetype_pnm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_pnm.png -------------------------------------------------------------------------------- /images/source/file type/filetype_tif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_tif.png -------------------------------------------------------------------------------- /images/source/file type/filetype_txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/file type/filetype_txt.png -------------------------------------------------------------------------------- /images/source/page size/pagesize_a4.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/page size/pagesize_a4.xcf -------------------------------------------------------------------------------- /images/source/page size/pagesize_a5.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/page size/pagesize_a5.xcf -------------------------------------------------------------------------------- /images/source/page size/pagesize_a6.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/page size/pagesize_a6.xcf -------------------------------------------------------------------------------- /images/source/page size/pagesize_custom.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source/page size/pagesize_custom.xcf -------------------------------------------------------------------------------- /images/source_adf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source_adf.png -------------------------------------------------------------------------------- /images/source_auto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source_auto.png -------------------------------------------------------------------------------- /images/source_flatbed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/source_flatbed.png -------------------------------------------------------------------------------- /images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gawindx/phpSane/caacc582b3017d2ff448dc166f1ac0c2d6d8f9a2/images/spinner.gif -------------------------------------------------------------------------------- /incl/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Order allow,deny 3 | Deny from all 4 | 5 | -------------------------------------------------------------------------------- /incl/config.php: -------------------------------------------------------------------------------- 1 | scanner co-ords 55 | $PREVIEW_SCALE = 2; 56 | 57 | // set the preview image on-screen size 58 | $PREVIEW_WIDTH_PX = $PREVIEW_WIDTH_MM * $PREVIEW_SCALE; 59 | $PREVIEW_HEIGHT_PX = $PREVIEW_HEIGHT_MM * $PREVIEW_SCALE; 60 | 61 | // set the list of page sizes to select from 62 | // ref: page sizes in mm (http://en.wikipedia.org/wiki/Paper_size) 63 | // NB. only pages within your scanner size will be included 64 | $PAGE_SIZE_LIST = array(); 65 | add_page_size('A0', 841, 1189); 66 | add_page_size('A1', 594, 841); 67 | add_page_size('A2', 420, 594); 68 | add_page_size('A3', 297, 420); 69 | add_page_size('A4', 210, 297); 70 | add_page_size('A5', 148, 210); 71 | add_page_size('A6', 105, 148); 72 | //add_page_size('A7', 74, 105); 73 | //add_page_size('A8', 52, 74); 74 | //add_page_size('A9', 37, 52); 75 | //add_page_size('A10', 26, 37); 76 | //add_page_size('US Letter', 216, 279); 77 | //add_page_size('US Legal', 216, 356); 78 | //add_page_size('US Ledger', 432, 279); 79 | //add_page_size('US Tabloid', 279, 432); 80 | $DEFAULT_PAGE_SIZE = 'A4'; 81 | 82 | // enable features 83 | $do_test_mode = false; //fake scanner 84 | $do_btn_clean = false; //for debugging 85 | $do_btn_reset = false; //for debugging 86 | $do_btn_help = true; 87 | $do_brightness = true; 88 | $do_contrast = true; 89 | $do_source = true; 90 | $do_usr_opt = false; 91 | $do_file_name = false; 92 | $do_append_pdf = true; 93 | $do_append_txt = true; 94 | $do_lang_toggle = true; 95 | $do_file_selectbox = true; //multi file selection box 96 | $do_file_delete = true; //delete selected files 97 | $do_file_download = true; //download selected files 98 | $do_file_timezone = false; 99 | $do_file_highlight_new = true; 100 | 101 | 102 | $do_format_pnm = true; 103 | $do_format_jpg = true; 104 | $do_format_tif = true; 105 | $do_format_bmp = true; 106 | $do_format_png = true; 107 | $do_format_txt = true; 108 | $do_format_pdf = true; 109 | 110 | 111 | // END CONFIG ---------------------------------------------------------- 112 | 113 | // system config 114 | // ============= 115 | $SCANIMAGE = "/usr/bin/scanimage"; //scanimage binary (sane) 116 | $GOCR = "/usr/bin/gocr"; //optional ocr binary 117 | $PDFUNITE = "/usr/bin/pdfunite"; //optional PDF merge binary 118 | $PNMTOJPEG = "/usr/bin/pnmtojpeg"; //netpbm pnm to jpeg conversion binary 119 | $PNMTOTIFF = "/usr/bin/pnmtotiff"; //netpbm pnm to tiff conversion binary 120 | $PNMTOBMP = "/usr/bin/ppmtobmp"; //netpbm ppm to bmp conversion binary 121 | $PNMTOPNG = "/usr/bin/pnmtopng"; //netpbm pnm to png conversion binary 122 | $CONVERT = "/usr/bin/convert"; //ImageMagick convert binary 123 | $IDENTIFY = "/usr/bin/identify"; //ImageMagick binary used to test for PDF support 124 | if(php_uname('s') == 'FreeBSD') { 125 | //FreeBSD 126 | $SCANIMAGE = "/usr/local/bin/scanimage"; 127 | $GOCR = "/usr/local/bin/gocr"; 128 | $PDFUNITE = "/usr/local/bin/pdfunite"; 129 | $PNMTOJPEG = "/usr/bin/pnmtojpeg"; 130 | $PNMTOTIFF = "/usr/local/bin/pnmtotiff"; 131 | $PNMTOBMP = "/usr/local/bin/ppmtobmp"; 132 | $PNMTOPNG = "/usr/local/bin/pnmtopng"; 133 | $CONVERT = "/usr/local/bin/convert"; 134 | $IDENTIFY = "/usr/local/bin/identify"; 135 | } 136 | else if(stripos(exec('uname -a'), 'synology') !== FALSE) { 137 | //Synology Disk Station 138 | $SCANIMAGE = "/opt/bin/scanimage"; 139 | $GOCR = "/opt/bin/gocr"; 140 | $PDFUNITE = "/usr/local/bin/pdfunite"; 141 | $PNMTOJPEG = "/usr/local/netpbm/bin/pnmtojpeg"; 142 | $PNMTOTIFF = "/usr/local/netpbm/bin/pnmtotiff"; 143 | $PNMTOBMP = "/usr/local/netpbm/bin/ppmtobmp"; 144 | $PNMTOPNG = "/usr/local/netpbm/bin/pnmtopng"; 145 | $CONVERT = "/opt/bin/convert"; 146 | $IDENTIFY = "/opt/bin/identify"; 147 | } 148 | if(!`ls $GOCR`) $do_format_txt = false; //disable OCR when not available 149 | if(!(`ls $CONVERT` && `ls $IDENTIFY` && `$IDENTIFY -list Format | grep -i pdf`)) $do_format_pdf = false; //disable PDF when not available 150 | if(!`ls $PDFUNITE`) $do_append_pdf = false; //disable PDF books when merge tool is not available 151 | 152 | 153 | 154 | $action_clear=0; 155 | $action_clean_tmp=0; 156 | $action_clean_output=0; 157 | $action_deletefiles=0; 158 | $action_preview=0; 159 | $action_save=0; 160 | $first=1; 161 | 162 | 163 | // first visit and clean/clear options 164 | if (isset($_POST['first'])) $first=$_POST['first']; 165 | if ($first) { 166 | $action_clear = 1; 167 | $action_clean_tmp = 1; 168 | $first = 0; 169 | if(isset($_COOKIE['language_id'])) { 170 | $lang_id = $_COOKIE['language_id']; 171 | } 172 | } 173 | 174 | if(isset($_POST['lang_id'])) $lang_id=$_POST['lang_id']; 175 | if(isset($_POST['append_file'])) $append_file=$_POST['append_file']; 176 | 177 | 178 | // check what button is clicked 179 | if(isset($_POST['action_deletefiles'])) $action_deletefiles=1; 180 | if(isset($_POST['action_preview'])) $action_preview=1; 181 | if(isset($_POST['action_save'])) $action_save=1; 182 | if(isset($_POST['action_reset'])) $action_clear=1; 183 | if(isset($_POST['action_clean'])) { $action_clean_tmp=1; $action_clean_output=1; $action_clear=1; }; 184 | 185 | 186 | // default options (-1 for default) 187 | $sid = time(); 188 | $preview_images = "./images/scan.jpg"; 189 | $page_size = 'A4'; 190 | //$format = "jpg"; 191 | $format = "pdf"; 192 | $mode = "Color"; // Lineart|Gray|Color 193 | $resolution = 300; 194 | $brightness = -1; 195 | $contrast = -1; 196 | $source = -1; 197 | $usr_opt = " " ;//" --jpeg-quality 0"; 198 | $pos_x = 0; 199 | $pos_y = 0; 200 | $geometry_x = 0; 201 | $geometry_y = 0; 202 | $file_name_prefix = -1; 203 | 204 | $resolution_max = 0; 205 | $resolution_min = 0; 206 | $contrast_minimum = 0; 207 | $contrast_maximum = 0; 208 | $brightness_minimum = 0; 209 | $brightness_maximum = 0; 210 | $source_default = ""; 211 | 212 | foreach ($PAGE_SIZE_LIST as $index => $page_values) { 213 | if ($page_values[0] == $DEFAULT_PAGE_SIZE){ 214 | $default_page_width_mm = $page_values[1]; 215 | $default_page_height_mm = $page_values[2]; 216 | 217 | // $pos_x = $PREVIEW_WIDTH_MM - $default_page_width_mm; 218 | $pos_x = 0; 219 | $pos_y = 0; 220 | // $geometry_x = $PREVIEW_WIDTH_MM; 221 | $geometry_x = $PREVIEW_WIDTH_MM - ( $PREVIEW_WIDTH_MM - $default_page_width_mm ); 222 | $geometry_y = $default_page_height_mm; 223 | } 224 | } 225 | 226 | 227 | // user options 228 | if (!$action_clear) { 229 | if(isset($_POST['sid'])) $sid=$_POST['sid']; 230 | if(isset($_POST['preview_images'])) $preview_images=$_POST['preview_images']; 231 | if(isset($_POST['pos_x'])) $pos_x=$_POST['pos_x']; 232 | if(isset($_POST['pos_y'])) $pos_y=$_POST['pos_y']; 233 | if(isset($_POST['geometry_x'])) $geometry_x=$_POST['geometry_x']; 234 | if(isset($_POST['geometry_y'])) $geometry_y=$_POST['geometry_y']; 235 | if(isset($_POST['format'])) $format=$_POST['format']; 236 | if(isset($_POST['mode'])) $mode=$_POST['mode']; 237 | if(isset($_POST['resolution'])) $resolution=$_POST['resolution']; 238 | if(isset($_POST['brightness'])) $brightness=$_POST['brightness']; 239 | if(isset($_POST['source'])) $source=$_POST['source']; 240 | if(isset($_POST['usr_opt'])) $usr_opt=$_POST['usr_opt']; 241 | } 242 | 243 | 244 | // verify usr_opt - keep only valid chars, otherwise replace with an 'X' 245 | $my_usr_opt = ''; 246 | for ($i = 0; $i < strlen($usr_opt); $i++) { 247 | if (preg_match('([0-9]|[a-z]|[A-Z]|[\ \%\+\-_=])', $usr_opt[$i])) { 248 | $my_usr_opt .= $usr_opt[$i]; 249 | } else { 250 | $my_usr_opt .= 'X'; 251 | } 252 | } 253 | $usr_opt = $my_usr_opt; 254 | 255 | 256 | // INTERNAL CONFIG ----------------------------------------------------- 257 | 258 | // scanner device detect 259 | $scanner_ok = false; 260 | if ($do_test_mode) { 261 | $sane_result = "device `plustek:libusb:004:002' is a Plustek OpticPro U24 flatbed scanner"; 262 | } else { 263 | $sane_cmd = $SCAN_NET_SETUP . $SCANIMAGE . " --list-devices | grep 'device' | grep -e '\(scanner\|hpaio\|multi-function\)'"; 264 | $sane_result = exec($sane_cmd); 265 | $sane_result; 266 | unset($sane_cmd); 267 | } 268 | 269 | // get scanner name 270 | $start = strpos($sane_result, "`") + 1; 271 | $length = strpos($sane_result, "'") - $start; 272 | $scanner = "\"".substr($sane_result, $start, $length)."\""; 273 | unset($start); 274 | unset($length); 275 | if ((strlen($scanner) > 2) || $do_test_mode) { 276 | $scanner_ok = true; 277 | } 278 | $start = strpos($sane_result, "is a ") + 5; 279 | $length = strlen($sane_result) - $start; 280 | $scanner_name = str_replace("_", " ", substr($sane_result, $start, $length)); 281 | $scan_output = $scanner_name; 282 | unset($start); 283 | unset($length); 284 | unset($sane_result); 285 | 286 | if($scanner_ok) { 287 | $scanner_known = scanner_known($scanner_name); 288 | // allowed resolutions 289 | if($scanner_known) { 290 | // read scanner configuration from file 291 | $mode_list = get_scanner_mode_options($scanner_name); 292 | $mode_default = get_scanner_mode_default($scanner_name); 293 | $resolution_list = get_scanner_resolution_options($scanner_name); 294 | $resolution_max = (int)end($resolution_list); 295 | $resolution_min = (int)reset($resolution_list); 296 | $resolution_default = get_scanner_resolution_default($scanner_name); 297 | $brightness_supported = strtolower(get_scanner_brightness_supported($scanner_name)) === 'true'; 298 | $brightness_default = (int)get_scanner_brightness_default($scanner_name); 299 | $brightness_minimum = (int)get_scanner_brightness_minimum($scanner_name); 300 | $brightness_maximum = (int)get_scanner_brightness_maximum($scanner_name); 301 | $contrast_supported = strtolower(get_scanner_contrast_supported($scanner_name)) === 'true'; 302 | $contrast_default = (int)get_scanner_contrast_default($scanner_name); 303 | $contrast_minimum = (int)get_scanner_contrast_minimum($scanner_name); 304 | $contrast_maximum = (int)get_scanner_contrast_maximum($scanner_name); 305 | $source_supported = strtolower(get_scanner_source_supported($scanner_name)) === 'true'; 306 | $source_list = get_scanner_source_options($scanner_name); 307 | $source_default = get_scanner_source_default($scanner_name); 308 | } else { 309 | // build configuration from scanimage output 310 | // scanimage call and gather output 311 | $sane_cmd = $SCANIMAGE . " -h -d$scanner"; 312 | $sane_result = `$sane_cmd`; 313 | if ($do_test_mode) { 314 | $sane_result = " --resolution 50..2450dpi [75]\n --mode Lineart|Color|Gray [Color]\n --contrast 0..100 [50]\n --brightness -100..100 [0]\n --source Flatbed|ADF [Flatbed]"; 315 | } 316 | $sane_result_arr = explode("\n", $sane_result); 317 | unset($sane_result); 318 | unset($sane_cmd); 319 | //////// 320 | // brightness 321 | $brightness_supported = false; 322 | $brightness_minimum = 0; 323 | $brightness_maximum = 0; 324 | $brightness_default = 0; 325 | $sane_result_brightness = preg_grep('/--brightness /', $sane_result_arr); 326 | if(count($sane_result_brightness) > 0) { 327 | $brightness_line = end($sane_result_brightness); 328 | if(strpos($brightness_line, 'inactive') === false) { 329 | $brightness_supported = true; 330 | $brightness_minmax = explode('..', preg_replace('/^.*--brightness ([-|0-9..]*)[ \t].*$/iU','$1', $brightness_line)); 331 | $brightness_minimum = $brightness_minmax[0]; 332 | $brightness_maximum = $brightness_minmax[1]; 333 | unset($brightness_minmax); 334 | 335 | preg_match("/\[(.*?)\]/", $brightness_line, $brightness_default_array); 336 | $brightness_default = $brightness_default_array[1]; 337 | unset($brightness_default_array); 338 | } 339 | unset($brightness_line); 340 | } 341 | unset($sane_result_brightness); 342 | //////// 343 | // contrast 344 | $contrast_supported = false; 345 | $contrast_minimum = 0; 346 | $contrast_maximum = 0; 347 | $contrast_default = 0; 348 | $sane_result_contrast = preg_grep('/--contrast /', $sane_result_arr); 349 | if(count($sane_result_contrast) > 0) { 350 | $contrast_line = end($sane_result_contrast); 351 | if(strpos($contrast_line, 'inactive') === false) { 352 | $contrast_supported = true; 353 | $contrast_minmax = explode('..', preg_replace('/^.*--contrast ([-|0-9..]*)[ \t].*$/iU','$1', $contrast_line)); 354 | $contrast_minimum = $contrast_minmax[0]; 355 | $contrast_maximum = $contrast_minmax[1]; 356 | unset($contrast_minmax); 357 | 358 | preg_match("/\[(.*?)\]/", $contrast_line, $contrast_default_array); 359 | $contrast_default = $contrast_default_array[1]; 360 | unset($contrast_default_array); 361 | } 362 | unset($contrast_line); 363 | } 364 | unset($sane_result_contrast); 365 | //////// 366 | // modes 367 | $sane_result_mode = preg_grep('/--mode /', $sane_result_arr); 368 | $sane_result_mode = end($sane_result_mode); 369 | $modes = preg_replace('/^.*--mode ([a-z|]*)[ \t].*$/iU','$1', $sane_result_mode); 370 | $mode_list = explode('|', $modes); 371 | 372 | preg_match("/\[(.*?)\]/", $sane_result_mode, $mode_default_array); 373 | $mode_default = $mode_default_array[1]; 374 | unset($sane_result_mode); 375 | unset($mode_default_array); 376 | //////// 377 | // resolutions 378 | $sane_result_reso = preg_grep('/--resolution /', $sane_result_arr); 379 | $sane_result_reso = end($sane_result_reso); 380 | // get default resolution 381 | preg_match("/\[(.*?)\]/", $sane_result_reso, $resolution_default_array); 382 | $resolution_default = $resolution_default_array[1]; 383 | $start = strpos($sane_result_reso, "n") + 2; 384 | $length = strpos($sane_result_reso, "dpi") - $start; 385 | $list = "" . substr($sane_result_reso, $start,$length) . ""; 386 | //////// 387 | // source 388 | $sane_result_source = preg_grep('/--source /', $sane_result_arr); 389 | $sane_result_source = end($sane_result_source); 390 | $sources = preg_replace('/^.*--source ([a-z|]*)[ \t].*$/iU','$1', $sane_result_source); 391 | if(strpos($sane_result_source, 'inactive') === false) { 392 | $source_supported = true; 393 | $source_list = explode('|', $sources); 394 | 395 | preg_match("/\[(.*?)\]/", $sane_result_source, $source_default_array); 396 | $source_default = $source_default_array[1]; 397 | } 398 | unset($sane_result_source); 399 | unset($source_default_array); 400 | //////// 401 | unset($start); 402 | unset($length); 403 | unset($sane_result_reso); 404 | unset($sane_result_arr); 405 | 406 | // change "|" separated string $list into array of values or generate a range of values. 407 | $length = strpos($list, ".."); 408 | if ($length === false) { 409 | $resolution_list = explode("|" , $list); 410 | $resolution_max = (int)end($resolution_list); 411 | $resolution_min = (int)reset($resolution_list); 412 | } else { 413 | $resolution_list = array(); 414 | $resolution_min = (int)substr($list, 0, $length); 415 | $resolution_max = (int)substr($list, $length + 2); 416 | 417 | // lower resolutions 418 | $list = array( 419 | 10, 20, 30, 40, 50, 60, 72, 75, 80, 90, 420 | 100, 120, 133, 144, 150, 160, 175, 180, 421 | 200, 216, 240, 266, 422 | 300, 320, 350, 360, 423 | 400, 480, 424 | 600, 425 | 720, 426 | 800, 427 | 900, 428 | ); 429 | 430 | foreach ($list as $res) { 431 | if (($res >= $resolution_min) && ($res <= $resolution_max)) { 432 | $resolution_list[] = $res; 433 | } 434 | } 435 | 436 | // higher resolutions 437 | $res = 1000; 438 | while (($res >= $resolution_min) && ($res < $resolution_max)) { 439 | $resolution_list[] = $res; 440 | $res += 200; 441 | } 442 | 443 | $resolution_list[] = $resolution_max; 444 | } 445 | unset($length); 446 | //////// 447 | // save scanner configuration 448 | save_scanner_config($scanner_name, 449 | $mode_list, $mode_default, 450 | $resolution_list, $resolution_default, 451 | $brightness_supported, $brightness_default, $brightness_minimum, $brightness_maximum, 452 | $contrast_supported, $contrast_default, $contrast_minimum, $contrast_maximum, 453 | $source_supported, $source_list, $source_default); 454 | } 455 | 456 | if($resolution == -1 || array_search($resolution_default, $resolution_list) === false) { 457 | $resolution = $resolution_default; 458 | } 459 | 460 | if($mode == -1 || (array_search(strtolower($mode),array_map('strtolower', $mode_list)) === false)) { 461 | $mode = $mode_default; 462 | } 463 | 464 | $do_brightness = $do_brightness && $brightness_supported; //disable brightness option when not available 465 | if($brightness == -1 || (($brightness < $brightness_minimum) || ($brightness > $brightness_maximum))) { 466 | $brightness = $brightness_default; //set to scanimage default when not set or out of range 467 | } 468 | unset($brightness_supported); 469 | 470 | $do_contrast = $do_contrast && $contrast_supported; //disable contrast option when not available 471 | if($contrast == -1 || (($contrast < $contrast_minimum) || ($contrast > $contrast_maximum))) { 472 | $contrast = $contrast_default; //set to scanimage default when not set or out of range 473 | } 474 | unset($contrast_supported); 475 | 476 | $do_source = $do_source && $source_supported; 477 | unset($source_supported); 478 | } 479 | ?> 480 | -------------------------------------------------------------------------------- /incl/files.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 33 | 34 | 35 | 36 | 110 | 111 | 112 |
8 |
    9 | 13 | 14 | 15 | 16 | 17 | 18 |
    19 |
      20 |
    • {$lang[$lang_id][27]}
    • 21 |
    • {$lang[$lang_id][28]}
    • 22 |
    • {$lang[$lang_id][29]}
    • 23 |
    • {$lang[$lang_id][30]}
    • 24 |
    • {$lang[$lang_id][31]}
    • 25 |
    26 | "; 27 | } 28 | if($do_file_delete) echo "
  • "; 29 | if($do_file_download) echo "
  • {$lang[$lang_id][11]}
  • "; 30 | ?> 31 |
32 |
37 | 38 | 39 | 40 | "; 43 | } 44 | echo " 45 | 46 | 47 | 48 | "; 49 | ?> 50 | 51 | 52 | 53 | getMTime()] = $fileinfo->getFilename(); 59 | } 60 | } 61 | krsort($files); 62 | $dirArray = array_values($files); 63 | 64 | //loop through the array of files 65 | for($index=0; $index < count($dirArray); $index++) { 66 | $file_name = $dirArray[$index]; 67 | $file_path = str_replace(" ", "%20", $save_dir.$dirArray[$index]); 68 | $file_size = size_readable(filesize($save_dir . $dirArray[$index])); 69 | $file_modtime = utf8_encode(strftime('%c', filemtime($save_dir . $dirArray[$index]))); 70 | $file_new = $index === 0 && $action_save && $scanner_ok && (time() - filemtime($save_dir . $dirArray[$index]) <= 60); 71 | if(!$do_file_timezone) { 72 | $file_modtime = str_replace(array(' CET', ' CEST'), '', $file_modtime); 73 | } 74 | //file type and category 75 | $file_extention = findexts($dirArray[$index]); 76 | $file_category = ''; 77 | switch ($file_extention){ 78 | case "bmp": $file_extention = $lang[$lang_id][47]; $file_category = "image"; break; 79 | case "jpg": case "jpeg": $file_extention = $lang[$lang_id][44]; $file_category = "image"; break; 80 | case "pdf": $file_extention = $lang[$lang_id][43]; $file_category = "document"; break; 81 | case "png": $file_extention = $lang[$lang_id][48]; $file_category = "image"; break; 82 | case "pnm": $file_extention = $lang[$lang_id][45]; $file_category = "image"; break; 83 | case "tif": case "tiff": $file_extention = $lang[$lang_id][46]; $file_category = "image"; break; 84 | case "txt": $file_extention = $lang[$lang_id][49]; $file_category = "document"; break; 85 | case "": $file_extention = ucwords($lang[$lang_id][8]); break; 86 | default: $file_extention = strtoupper($file_extention)." ".$lang[$lang_id][55]; $file_category = "other"; break; 87 | } 88 | //print file info 89 | echo " "; 94 | if($do_file_download || $do_file_delete) { 95 | echo " 96 | "; 97 | } 98 | echo " 99 | 100 | 101 | 102 | 103 | 104 | \n"; 105 | } 106 | ?> 107 | 108 |
{$lang[$lang_id][51]}{$lang[$lang_id][52]}{$lang[$lang_id][53]}{$lang[$lang_id][54]}
$file_category$file_name$file_extention$file_size$file_modtime
109 |
113 | 114 | 1) ? end($splitFileName) : ''; 119 | } 120 | 121 | /* Return human readable sizes 122 | * 123 | * @author Aidan Lister 124 | * @version 1.3.0 125 | * @link http://aidanlister.com/2004/04/human-readable-file-sizes/ 126 | * @param int $size size in bytes 127 | * @param string $max maximum unit 128 | * @param string $system 'si' for SI, 'bi' for binary prefixes 129 | * @param string $retstring return string format 130 | */ 131 | function size_readable($size, $max = null, $system = 'si', $retstring = '%01.2f %s'){ 132 | // Pick units 133 | $systems['si']['prefix'] = array('B', 'KB', 'MB', 'GB', 'TB', 'PB'); 134 | $systems['si']['size'] = 1000; 135 | $systems['bi']['prefix'] = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'); 136 | $systems['bi']['size'] = 1024; 137 | $sys = isset($systems[$system]) ? $systems[$system] : $systems['si']; 138 | 139 | // Max unit to display 140 | $depth = count($sys['prefix']) - 1; 141 | if ($max && false !== $d = array_search($max, $sys['prefix'])) { 142 | $depth = $d; 143 | } 144 | // Loop 145 | $i = 0; 146 | while ($size >= $sys['size'] && $i < $depth) { 147 | $size /= $sys['size']; 148 | $i++; 149 | } 150 | return sprintf($retstring, $size, $sys['prefix'][$i]); 151 | } 152 | ?> 153 | -------------------------------------------------------------------------------- /incl/functions.php: -------------------------------------------------------------------------------- 1 | $page_name, $page_x, $page_y); 19 | } 20 | } 21 | // --------------------------------------------------------------------- 22 | 23 | 24 | // --------------------------------------------------------------------- 25 | // Scanner configuration file functions 26 | // --------------------------------------------------------------------- 27 | 28 | function sanitize_path($url) { 29 | // everything to lower and no spaces begin or end 30 | $url = strtolower(trim($url)); 31 | 32 | // adding - for spaces and union characters 33 | $find = array(' ', '&', '\r\n', '\n', '+',','); 34 | $url = str_replace ($find, '-', $url); 35 | 36 | //delete and replace rest of special chars 37 | $find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/'); 38 | $repl = array('', '-', ''); 39 | return preg_replace ($find, $repl, $url); 40 | } 41 | 42 | function get_config_path($scanner_name) { 43 | global $scanner_dir; 44 | return $scanner_dir.(sanitize_path($scanner_name)).".ini"; 45 | } 46 | 47 | function scanner_known($scanner_name) { 48 | return file_exists(get_config_path($scanner_name)); 49 | } 50 | 51 | function get_config_option_array($scanner_name, $config_key, $index = 0) { 52 | $config_options = explode('|', get_config_option($scanner_name, $config_key)); 53 | $config_option_string = $config_options[$index]; 54 | return explode(';', $config_option_string); 55 | } 56 | 57 | function get_config_option($scanner_name, $config_key) { 58 | $config_option = ''; 59 | if(scanner_known($scanner_name)) { 60 | $scanner_config = file(get_config_path($scanner_name)); 61 | 62 | $config_option_line = preg_grep("/".$config_key.":/", $scanner_config); 63 | $config_option_line = trim(end($config_option_line)); 64 | 65 | $start = strpos($config_option_line, ":") + 1; 66 | $length = strlen($config_option_line) - $start; 67 | $config_option = "" . substr($config_option_line, $start, $length) . ""; 68 | } 69 | return $config_option; 70 | } 71 | 72 | function get_scanner_resolution_options($scanner_name) { 73 | return get_config_option_array($scanner_name, "resolution"); 74 | } 75 | function get_scanner_resolution_default($scanner_name) { 76 | $mode_info = explode('|', get_config_option($scanner_name, "resolution")); 77 | return $mode_info[1]; 78 | } 79 | 80 | function get_scanner_mode_options($scanner_name) { 81 | return get_config_option_array($scanner_name, "mode"); 82 | } 83 | function get_scanner_mode_default($scanner_name) { 84 | $mode_info = explode('|', get_config_option($scanner_name, "mode")); 85 | return $mode_info[1]; 86 | } 87 | 88 | function get_scanner_brightness_supported($scanner_name) { 89 | $brightness_info = explode('|', get_config_option($scanner_name, "brightness")); 90 | return $brightness_info[0]; 91 | } 92 | function get_scanner_brightness_default($scanner_name) { 93 | $brightness_info = explode('|', get_config_option($scanner_name, "brightness")); 94 | return $brightness_info[1]; 95 | } 96 | function get_scanner_brightness_minimum($scanner_name) { 97 | $brightness_info = explode('|', get_config_option($scanner_name, "brightness")); 98 | return $brightness_info[2]; 99 | } 100 | function get_scanner_brightness_maximum($scanner_name) { 101 | $brightness_info = explode('|', get_config_option($scanner_name, "brightness")); 102 | return $brightness_info[3]; 103 | } 104 | 105 | function get_scanner_contrast_supported($scanner_name) { 106 | $contrast_info = explode('|', get_config_option($scanner_name, "contrast")); 107 | return $contrast_info[0]; 108 | } 109 | function get_scanner_contrast_default($scanner_name) { 110 | $contrast_info = explode('|', get_config_option($scanner_name, "contrast")); 111 | return $contrast_info[1]; 112 | } 113 | function get_scanner_contrast_minimum($scanner_name) { 114 | $contrast_info = explode('|', get_config_option($scanner_name, "contrast")); 115 | return $contrast_info[2]; 116 | } 117 | function get_scanner_contrast_maximum($scanner_name) { 118 | $contrast_info = explode('|', get_config_option($scanner_name, "contrast")); 119 | return $contrast_info[3]; 120 | } 121 | function get_scanner_source_supported($scanner_name) { 122 | $source_info = explode('|', get_config_option($scanner_name, "source")); 123 | return $source_info[0]; 124 | } 125 | function get_scanner_source_options($scanner_name) { 126 | return get_config_option_array($scanner_name, "source",1); 127 | } 128 | function get_scanner_source_default($scanner_name) { 129 | $source_info = explode('|', get_config_option($scanner_name, "source")); 130 | return $source_info[2]; 131 | } 132 | 133 | function save_scanner_config($scanner_name, 134 | $mode_list, $mode_default, 135 | $resolution_list, $resolution_default, 136 | $brightness_supported, $brightness_default, $brightness_minimum, $brightness_maximum, 137 | $contrast_supported, $contrast_default, $contrast_minimum, $contrast_maximum, 138 | $source_supported, $source_list, $source_default ) { 139 | $file_path = get_config_path($scanner_name); 140 | file_put_contents($file_path, "mode:".implode(';', $mode_list)."|{$mode_default}\r\n"); 141 | file_put_contents($file_path, "resolution:".implode(';', $resolution_list)."|{$resolution_default}|\r\n", FILE_APPEND); 142 | file_put_contents($file_path, "brightness:".($brightness_supported ? 'true' : 'false')."|{$brightness_default}|{$brightness_minimum}|{$brightness_maximum}\r\n", FILE_APPEND); 143 | file_put_contents($file_path, "contrast:".($contrast_supported ? 'true' : 'false')."|{$contrast_default}|{$contrast_minimum}|{$contrast_maximum}\r\n", FILE_APPEND); 144 | file_put_contents($file_path, "source:".($source_supported ? 'true' : 'false')."|".implode(';', $source_list)."|{$source_default}\r\n", FILE_APPEND); 145 | } 146 | 147 | // --------------------------------------------------------------------- 148 | // --------------------------------------------------------------------- 149 | 150 | /** 151 | * generates html select dropdown list with options 152 | * if values is two dimensional then adds optgroup too 153 | * 154 | * @param string $name selectbox name and id 155 | * @param array $values options 156 | * @param mixed $selected selected option 157 | * @param array $attributes additonal attributes 158 | * 159 | * @return string html source with selectbox 160 | */ 161 | 162 | function html_selectbox($name, $values, $selected=NULL, $attributes=array()) { 163 | $attr_html = ''; 164 | if(is_array($attributes) && !empty($attributes)){ 165 | foreach ($attributes as $k=>$v){ 166 | $attr_html .= ' '.$k.'="'.$v.'"'; 167 | } 168 | } 169 | $output = '\n"; 186 | return $output; 187 | } 188 | // --------------------------------------------------------------------- 189 | ?> 190 | -------------------------------------------------------------------------------- /incl/menu.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | ".$lang[$lang_id][21]." 8 | 9 | 10 | ".$scan_output." 11 | 12 | 13 | ".$lang[$lang_id][0]." 14 | 15 | 16 | ".$lang[$lang_id][40]." 17 | 18 | 28 | 29 | 30 | 31 | 32 | ".$lang[$lang_id][1]." 33 | 34 | {$lang[$lang_id][5]} 35 | 36 | 37 | ".$lang[$lang_id][2]." 38 | 39 | {$lang[$lang_id][5]} 40 | 41 | 42 | ".$lang[$lang_id][3]." 43 | 44 | {$lang[$lang_id][5]} 45 | 46 | 47 | ".$lang[$lang_id][4]." 48 | 49 | {$lang[$lang_id][5]} 50 | 51 | 52 | ".$lang[$lang_id][9]." 53 | 54 | 55 | ".$lang[$lang_id][10]." 56 | 57 | 66 | 67 | 68 | 69 | 70 | ".$lang[$lang_id][14]." 71 | 72 | 87 | 88 | 89 | 90 | 91 | ".$lang[$lang_id][18]." 92 | \n".html_selectbox('resolution', $resolution_list, $resolution)." 93 | {$lang[$lang_id][6]} 94 | "; 95 | 96 | if ($do_brightness) { 97 | echo " 98 | 99 | ".$lang[$lang_id][22]." 100 | 101 |
102 | 103 | 104 | {$lang[$lang_id][7]} 105 | "; 106 | } 107 | 108 | if ($do_contrast) { 109 | echo " 110 | 111 | ".$lang[$lang_id][23]." 112 | 113 |
114 | 115 | 116 | {$lang[$lang_id][7]} 117 | "; 118 | } 119 | 120 | 121 | 122 | if ($do_source) { 123 | echo " 124 | 125 | ".$lang[$lang_id][61]." 126 | 127 | 151 | 152 | "; 153 | } 154 | 155 | if($do_file_name) { 156 | $filename = ($file_name_prefix !== -1 ? $file_name_prefix : $lang[$lang_id][60]) . date("Y-m-d H.i.s", time()); 157 | echo " 158 | 159 | ".$lang[$lang_id][41]." 160 | 161 | 162 | 163 | "; 164 | } 165 | 166 | if($do_btn_reset || $do_btn_clean) { 167 | echo " 168 | 169 | "; 170 | if ($do_btn_reset) echo " "; 171 | if ($do_btn_clean) echo " "; 172 | echo " 173 | 174 | 175 | "; 176 | } 177 | 178 | echo " 179 | 180 | 181 | 182 | 183 | 184 | 185 | \n"; 186 | -------------------------------------------------------------------------------- /incl/scan.php: -------------------------------------------------------------------------------- 1 | = 0) { 17 | if($pos_x <= $MAX_SCAN_WIDTH_MM) { 18 | $cmd_geometry_l=" -l ".$pos_x."mm"; 19 | } else { 20 | $cmd_geometry_l=" -l ".$MAX_SCAN_WIDTH_MM."mm"; 21 | } 22 | } else { 23 | $lang[$lang_id][1]="".$lang[$lang_id][1].""; 24 | scan_error($scan_output, $error_input, $lang_error); 25 | } 26 | 27 | $cmd_geometry_t=""; 28 | if ($pos_y >= 0) { 29 | if ($pos_y <= $MAX_SCAN_HEIGHT_MM) { 30 | $cmd_geometry_t=" -t ".$pos_y."mm"; 31 | } else { 32 | $cmd_geometry_t=" -t ".$MAX_SCAN_HEIGHT_MM."mm"; 33 | } 34 | } else { 35 | $lang[$lang_id][2]="".$lang[$lang_id][2].""; 36 | scan_error($scan_output, $error_input, $lang_error); 37 | } 38 | 39 | $cmd_geometry_x=""; 40 | $width = $geometry_x; 41 | if (($width >= 0) && $width <= $PREVIEW_WIDTH_MM) { 42 | if($width <= $MAX_SCAN_WIDTH_MM) { 43 | $cmd_geometry_x=" -x ".$width."mm"; 44 | } else { 45 | $cmd_geometry_x=" -x ".$MAX_SCAN_WIDTH_MM."mm"; 46 | } 47 | } else { 48 | $lang[$lang_id][3]="".$lang[$lang_id][3].""; 49 | scan_error($scan_output, $error_input, $lang_error); 50 | } 51 | 52 | $cmd_geometry_y=""; 53 | $height = $geometry_y; 54 | if (($height >= 0) && $height <=$PREVIEW_HEIGHT_MM) { 55 | if($height <= $MAX_SCAN_HEIGHT_MM) { 56 | $cmd_geometry_y=" -y ".$height."mm"; 57 | } else { 58 | $cmd_geometry_y=" -y ".$MAX_SCAN_HEIGHT_MM."mm"; 59 | } 60 | } else { 61 | $lang[$lang_id][4]="".$lang[$lang_id][4].""; 62 | scan_error($scan_output, $error_input, $lang_error); 63 | } 64 | 65 | $cmd_mode=" --mode \"".$mode."\""; 66 | 67 | $cmd_resolution=""; 68 | if (($resolution >= $resolution_min) && ($resolution <= $resolution_max)) { 69 | $cmd_resolution=" --resolution ".$resolution."dpi"; 70 | } else { 71 | $lang[$lang_id][18]="".$lang[$lang_id][18].""; 72 | scan_error($scan_output, $error_input, $lang_error); 73 | } 74 | 75 | $cmd_brightness=""; 76 | if ($do_brightness && (strtolower($mode) != 'lineart')) { 77 | if (($brightness >= $contrast_minimum) && ($brightness <= $contrast_maximum)) { 78 | $cmd_brightness=" --brightness ".$brightness; 79 | } else { 80 | $lang[$lang_id][22]="".$lang[$lang_id][22].""; 81 | scan_error($scan_output, $error_input, $lang_error); 82 | } 83 | } 84 | 85 | $cmd_contrast=""; 86 | if ($do_contrast) { 87 | if (($contrast >= $contrast_minimum) && ($contrast <= $contrast_maximum)) { 88 | $cmd_contrast=" --contrast ".$contrast; 89 | } else { 90 | $lang[$lang_id][23]="".$lang[$lang_id][23].""; 91 | scan_error($scan_output, $error_input, $lang_error); 92 | } 93 | } 94 | 95 | $cmd_source=""; 96 | if ($do_source) { 97 | $cmd_source=" --source ".$source; 98 | if (($source == 'ADF') && ($action_save)) { 99 | if ($format == "txt") { 100 | $cmd_source=$cmd_source." --batch='{$temp_dir}out_".$scan_id."_%d.pnm' --batch-start=10"; 101 | }else{ 102 | $cmd_source=$cmd_source." --format=tiff --batch='{$temp_dir}out_".$scan_id."_%d.tif' --batch-start=10"; 103 | } 104 | } 105 | } 106 | 107 | $cmd_usr_opt=" " . $usr_opt; 108 | 109 | //////////////////////////////////////////////////////////////////////// 110 | // build the device command 111 | 112 | $scan_yes=''; 113 | $cmd_device = ''; 114 | $file_save = ''; 115 | $file_save_image = 0; 116 | $cmd_scan=$SCANIMAGE." -d ".$scanner.$cmd_geometry_l.$cmd_geometry_t.$cmd_geometry_x.$cmd_geometry_y.$cmd_mode.$cmd_resolution.$cmd_brightness.$cmd_contrast.$cmd_source.$cmd_usr_opt; 117 | 118 | if ($error_input == 0){ 119 | if ($action_preview) { 120 | $preview_images = $temp_dir."preview_".$sid.".jpg"; 121 | $cmd_device = $SCANIMAGE." -d ".$scanner." --resolution ".$PREVIEW_DPI."dpi -l 0mm -t 0mm -x ".$MAX_SCAN_WIDTH_MM."mm -y ".$MAX_SCAN_HEIGHT_MM."mm".$cmd_mode.$cmd_brightness.$cmd_contrast.$cmd_source.$cmd_usr_opt." | ".$PNMTOJPEG." --quality=50 > ".$preview_images; 122 | } else if ($action_save) { 123 | $file_save = $save_dir.$_POST['file_name'].".".$format; 124 | if (file_exists($file_save)) { 125 | $file_save=$save_dir.$_POST['file_name']."_".date("Y-m-d H.i.s",time()).".".$format; 126 | } 127 | $file_save_image = 1; 128 | 129 | if ($format == "jpg") { 130 | $cmd_device = $cmd_scan." | {$PNMTOJPEG} --quality=100 > '$file_save'"; 131 | } 132 | if ($format == "pnm") { 133 | $cmd_device = $cmd_scan." > '$file_save'"; 134 | } 135 | if ( ($format == "tif") && ($source =="ADF")){ 136 | $cmd_device = $cmd_scan." && {$CONVERT} '{$temp_dir}out_{$scan_id}_*.tif' -compress jpeg -quality 90 -density {$resolution} '$file_save'"; 137 | }elseif ($format == "tif") { 138 | $cmd_device = $cmd_scan." | {$PNMTOTIFF} > '$file_save'"; 139 | } 140 | if ($format == "bmp") { 141 | $cmd_device = $cmd_scan." | {$PNMTOBMP} > '$file_save'"; 142 | } 143 | if ($format == "png") { 144 | $cmd_device = $cmd_scan." | {$PNMTOPNG} > '$file_save'"; 145 | } 146 | if ( ($format == "pdf") && ($source =="ADF")){ 147 | //$cmd_device = $cmd_scan." | {$CONVERT} pnm:- -compress jpeg -quality 100 -density {$resolution} pdf:- > \"".$file_save."\""; 148 | /* 149 | Bugfix: 150 | convert: unable to read image data `-' @ error/pnm.c/ReadPNMImage/766. 151 | convert: no images defined `pdf:-' @ error/convert.c/ConvertImageCommand/3044. 152 | */ 153 | $cmd_device = $cmd_scan." && {$CONVERT} '{$temp_dir}out_{$scan_id}_*.tif' -compress jpeg -quality 90 -density {$resolution} pdf:- > '$file_save'"; 154 | }elseif ($format == "pdf"){ 155 | //$cmd_device = $cmd_scan." | {$CONVERT} pnm:- -compress jpeg -quality 100 -density {$resolution} pdf:- > \"".$file_save."\""; 156 | /* 157 | Bugfix: 158 | convert: unable to read image data `-' @ error/pnm.c/ReadPNMImage/766. 159 | convert: no images defined `pdf:-' @ error/convert.c/ConvertImageCommand/3044. 160 | */ 161 | $cmd_device = $cmd_scan." | {$CONVERT} - -compress jpeg -quality 100 -density {$resolution} pdf:- > '$file_save'"; 162 | } 163 | if ( ($format == "txt") && ($source =="ADF")){ 164 | $cmd_device = $cmd_scan." && {$CONVERT} '{$temp_dir}out*.pnm' '{$temp_dir}out_single.pnm' | ".$GOCR." '{$temp_dir}out_single.pnm' > '$file_save'"; 165 | }elseif ($format == "txt") { 166 | $cmd_device = $cmd_scan." | ".$GOCR." - > '$file_save'"; 167 | } 168 | } 169 | } 170 | 171 | if ($action_deletefiles && $do_file_delete) { 172 | if(isset($_POST['selected_files'])) { 173 | foreach($_POST['selected_files'] as $selected_file) { 174 | $file_path = $save_dir . $selected_file; 175 | if(is_readable($file_path)) { 176 | unlink($file_path); 177 | } 178 | } 179 | } 180 | } 181 | 182 | //////////////////////////////////////////////////////////////////////// 183 | // perform actions required 184 | if ($cmd_device !== '') { 185 | $scan_yes=`$cmd_device`; 186 | } else { 187 | $cmd_device = $lang[$lang_id][39]; 188 | } 189 | 190 | //merge files 191 | if ($action_save && $append_file !== '') { 192 | $escaped_file_save = str_replace(" ", "\\ ", $file_save); 193 | $escaped_append_file = str_replace(" ", "\\ ", $append_file); 194 | 195 | if ($format == "pdf" && $do_append_pdf) { 196 | //merge pdf files 197 | exec("$PDFUNITE $escaped_append_file $escaped_file_save {$escaped_append_file}_new"); 198 | exec("rm -f $escaped_append_file $escaped_file_save"); 199 | exec("mv {$escaped_append_file}_new $escaped_append_file"); 200 | } else if ($format == "txt" && $do_append_txt) { 201 | //merge txt files 202 | exec("cat $escaped_file_save >> $escaped_append_file"); 203 | exec("rm -f $escaped_file_save"); 204 | } 205 | $file_save = $append_file; 206 | } 207 | 208 | if (($file_save !== '')&&($save_type=='popup')) { 209 | echo "\n"; 212 | } 213 | 214 | //remove files from temp directory older then one day 215 | if ($action_clean_tmp) { 216 | $files = glob($temp_dir."*"); 217 | foreach($files as $file) { 218 | if(is_file($file) && time() - filemtime($file) >= 24*60*60*$keep_save_files_days) { 219 | unlink($file); 220 | } 221 | } 222 | } 223 | 224 | if ($action_clean_output) { 225 | $cmd_clean='rm -f '.$save_dir.'*'; 226 | exec($cmd_clean); 227 | } 228 | ?> 229 | -------------------------------------------------------------------------------- /incl/security.php: -------------------------------------------------------------------------------- 1 | 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | */ 17 | 18 | function validate($value, $constraint, $regex='') { 19 | switch ($constraint) { 20 | case 'empty_or_numeric': 21 | return empty($value) or validate($value, 'numeric'); 22 | case 'filepath': 23 | return (validate($value, 'regex', '/^[a-z0-9 ._\/-]+$/i') 24 | and validate($value, 'inverse_regex', '/\.\./')); 25 | case 'numeric': 26 | return is_numeric($value); 27 | case 'regex': 28 | return preg_match($regex, $value); 29 | case 'inverse_regex': 30 | return ! preg_match($regex, $value); 31 | default: 32 | return FALSE; 33 | } 34 | } 35 | 36 | function valid_or_dead($key, $constraint, $regex='') { 37 | foreach(array($_GET, $_POST, $_SERVER) as $_arr) { 38 | if (!array_key_exists($key, $_arr)) { 39 | continue; 40 | } 41 | $value = $_arr[$key]; 42 | if (!validate($value, $constraint, $regex)) { 43 | die('Input validation of '.$key.' failed!
' 44 | .'Constraint: "'.$constraint.'"
' 45 | .'Value: "'.strip_tags(htmlspecialchars($value)).'"'); 46 | } 47 | } 48 | } 49 | // action 50 | valid_or_dead('action', 'regex', '/[a-z0-9]*/i'); 51 | // brightness 52 | valid_or_dead('brightness', 'empty_or_numeric'); 53 | // contrast 54 | valid_or_dead('contrast', 'empty_or_numeric'); 55 | // depth 56 | valid_or_dead('depth', 'numeric'); 57 | // first 58 | valid_or_dead('first', 'regex', '/^[01]$/i'); 59 | // format 60 | valid_or_dead('format', 'regex', '/^[a-z]+$/i'); 61 | // pos_x 62 | valid_or_dead('pos_x', 'numeric'); 63 | // pos_y 64 | valid_or_dead('pos_y', 'numeric'); 65 | // geometry_x 66 | valid_or_dead('geometry_x', 'numeric'); 67 | // geometry_y 68 | valid_or_dead('geometry_y', 'numeric'); 69 | // lang_id 70 | valid_or_dead('lang_id', 'numeric'); 71 | // mode 72 | valid_or_dead('mode', 'regex', '/^[a-z]+$/i'); 73 | // file_name 74 | valid_or_dead('file_name', 'filepath'); 75 | // preview_images 76 | valid_or_dead('preview_images', 'filepath'); 77 | // resolution 78 | valid_or_dead('resolution', 'regex', '/^(|auto|[0-9]+)$/i'); 79 | // sid 80 | valid_or_dead('sid', 'filepath'); 81 | // usr_opt 82 | valid_or_dead('usr_opt', 'inverse_regex', '(;|&&|\|\||<|>|<<|>>)'); 83 | // file_save 84 | valid_or_dead('file_save', 'filepath'); 85 | // file_save_image 86 | valid_or_dead('first', 'regex', '/^[01]$/i'); 87 | // REMOTE_ADDR 88 | valid_or_dead('REMOTE_ADDR', 'regex', '/^[0-9.:]+$/i'); 89 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /javascript/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | #one year 3 | 4 | Header set Cache-Control "max-age=29030400" 5 | 6 | -------------------------------------------------------------------------------- /javascript/jquery.jcrop.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery.Jcrop.min.js v0.9.12 (build:20130202) 3 | * jQuery Image Cropping Plugin - released under MIT License 4 | * Copyright (c) 2008-2013 Tapmodo Interactive LLC 5 | * https://github.com/tapmodo/Jcrop 6 | */ 7 | (function(a){a.Jcrop=function(b,c){function i(a){return Math.round(a)+"px"}function j(a){return d.baseClass+"-"+a}function k(){return a.fx.step.hasOwnProperty("backgroundColor")}function l(b){var c=a(b).offset();return[c.left,c.top]}function m(a){return[a.pageX-e[0],a.pageY-e[1]]}function n(b){typeof b!="object"&&(b={}),d=a.extend(d,b),a.each(["onChange","onSelect","onRelease","onDblClick"],function(a,b){typeof d[b]!="function"&&(d[b]=function(){})})}function o(a,b,c){e=l(D),bc.setCursor(a==="move"?a:a+"-resize");if(a==="move")return bc.activateHandlers(q(b),v,c);var d=_.getFixed(),f=r(a),g=_.getCorner(r(f));_.setPressed(_.getCorner(f)),_.setCurrent(g),bc.activateHandlers(p(a,d),v,c)}function p(a,b){return function(c){if(!d.aspectRatio)switch(a){case"e":c[1]=b.y2;break;case"w":c[1]=b.y2;break;case"n":c[0]=b.x2;break;case"s":c[0]=b.x2}else switch(a){case"e":c[1]=b.y+1;break;case"w":c[1]=b.y+1;break;case"n":c[0]=b.x+1;break;case"s":c[0]=b.x+1}_.setCurrent(c),bb.update()}}function q(a){var b=a;return bd.watchKeys 8 | (),function(a){_.moveOffset([a[0]-b[0],a[1]-b[1]]),b=a,bb.update()}}function r(a){switch(a){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function s(a){return function(b){return d.disabled?!1:a==="move"&&!d.allowMove?!1:(e=l(D),W=!0,o(a,m(b)),b.stopPropagation(),b.preventDefault(),!1)}}function t(a,b,c){var d=a.width(),e=a.height();d>b&&b>0&&(d=b,e=b/a.width()*a.height()),e>c&&c>0&&(e=c,d=c/a.height()*a.width()),T=a.width()/d,U=a.height()/e,a.width(d).height(e)}function u(a){return{x:a.x*T,y:a.y*U,x2:a.x2*T,y2:a.y2*U,w:a.w*T,h:a.h*U}}function v(a){var b=_.getFixed();b.w>d.minSelect[0]&&b.h>d.minSelect[1]?(bb.enableHandles(),bb.done()):bb.release(),bc.setCursor(d.allowSelect?"crosshair":"default")}function w(a){if(d.disabled)return!1;if(!d.allowSelect)return!1;W=!0,e=l(D),bb.disableHandles(),bc.setCursor("crosshair");var b=m(a);return _.setPressed(b),bb.update(),bc.activateHandlers(x,v,a.type.substring 9 | (0,5)==="touch"),bd.watchKeys(),a.stopPropagation(),a.preventDefault(),!1}function x(a){_.setCurrent(a),bb.update()}function y(){var b=a("
").addClass(j("tracker"));return g&&b.css({opacity:0,backgroundColor:"white"}),b}function be(a){G.removeClass().addClass(j("holder")).addClass(a)}function bf(a,b){function t(){window.setTimeout(u,l)}var c=a[0]/T,e=a[1]/U,f=a[2]/T,g=a[3]/U;if(X)return;var h=_.flipCoords(c,e,f,g),i=_.getFixed(),j=[i.x,i.y,i.x2,i.y2],k=j,l=d.animationDelay,m=h[0]-j[0],n=h[1]-j[1],o=h[2]-j[2],p=h[3]-j[3],q=0,r=d.swingSpeed;c=k[0],e=k[1],f=k[2],g=k[3],bb.animMode(!0);var s,u=function(){return function(){q+=(100-q)/r,k[0]=Math.round(c+q/100*m),k[1]=Math.round(e+q/100*n),k[2]=Math.round(f+q/100*o),k[3]=Math.round(g+q/100*p),q>=99.8&&(q=100),q<100?(bh(k),t()):(bb.done(),bb.animMode(!1),typeof b=="function"&&b.call(bs))}}();t()}function bg(a){bh([a[0]/T,a[1]/U,a[2]/T,a[3]/U]),d.onSelect.call(bs,u(_.getFixed())),bb.enableHandles()}function bh(a){_.setPressed([a[0],a[1]]),_.setCurrent([a[2], 10 | a[3]]),bb.update()}function bi(){return u(_.getFixed())}function bj(){return _.getFixed()}function bk(a){n(a),br()}function bl(){d.disabled=!0,bb.disableHandles(),bb.setCursor("default"),bc.setCursor("default")}function bm(){d.disabled=!1,br()}function bn(){bb.done(),bc.activateHandlers(null,null)}function bo(){G.remove(),A.show(),A.css("visibility","visible"),a(b).removeData("Jcrop")}function bp(a,b){bb.release(),bl();var c=new Image;c.onload=function(){var e=c.width,f=c.height,g=d.boxWidth,h=d.boxHeight;D.width(e).height(f),D.attr("src",a),H.attr("src",a),t(D,g,h),E=D.width(),F=D.height(),H.width(E).height(F),M.width(E+L*2).height(F+L*2),G.width(E).height(F),ba.resize(E,F),bm(),typeof b=="function"&&b.call(bs)},c.src=a}function bq(a,b,c){var e=b||d.bgColor;d.bgFade&&k()&&d.fadeTime&&!c?a.animate({backgroundColor:e},{queue:!1,duration:d.fadeTime}):a.css("backgroundColor",e)}function br(a){d.allowResize?a?bb.enableOnly():bb.enableHandles():bb.disableHandles(),bc.setCursor(d.allowSelect?"crosshair":"default"),bb 11 | .setCursor(d.allowMove?"move":"default"),d.hasOwnProperty("trueSize")&&(T=d.trueSize[0]/E,U=d.trueSize[1]/F),d.hasOwnProperty("setSelect")&&(bg(d.setSelect),bb.done(),delete d.setSelect),ba.refresh(),d.bgColor!=N&&(bq(d.shade?ba.getShades():G,d.shade?d.shadeColor||d.bgColor:d.bgColor),N=d.bgColor),O!=d.bgOpacity&&(O=d.bgOpacity,d.shade?ba.refresh():bb.setBgOpacity(O)),P=d.maxSize[0]||0,Q=d.maxSize[1]||0,R=d.minSize[0]||0,S=d.minSize[1]||0,d.hasOwnProperty("outerImage")&&(D.attr("src",d.outerImage),delete d.outerImage),bb.refresh()}var d=a.extend({},a.Jcrop.defaults),e,f=navigator.userAgent.toLowerCase(),g=/msie/.test(f),h=/msie [1-6]\./.test(f);typeof b!="object"&&(b=a(b)[0]),typeof c!="object"&&(c={}),n(c);var z={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},A=a(b),B=!0;if(b.tagName=="IMG"){if(A[0].width!=0&&A[0].height!=0)A.width(A[0].width),A.height(A[0].height);else{var C=new Image;C.src=A[0].src,A.width(C.width),A.height(C.height)}var D=A.clone().removeAttr("id"). 12 | css(z).show();D.width(A.width()),D.height(A.height()),A.after(D).hide()}else D=A.css(z).show(),B=!1,d.shade===null&&(d.shade=!0);t(D,d.boxWidth,d.boxHeight);var E=D.width(),F=D.height(),G=a("
").width(E).height(F).addClass(j("holder")).css({position:"relative",backgroundColor:d.bgColor}).insertAfter(A).append(D);d.addClass&&G.addClass(d.addClass);var H=a("
"),I=a("
").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),J=a("
").width("100%").height("100%").css("zIndex",320),K=a("
").css({position:"absolute",zIndex:600}).dblclick(function(){var a=_.getFixed();d.onDblClick.call(bs,a)}).insertBefore(D).append(I,J);B&&(H=a("").attr("src",D.attr("src")).css(z).width(E).height(F),I.append(H)),h&&K.css({overflowY:"hidden"});var L=d.boundary,M=y().width(E+L*2).height(F+L*2).css({position:"absolute",top:i(-L),left:i(-L),zIndex:290}).mousedown(w),N=d.bgColor,O=d.bgOpacity,P,Q,R,S,T,U,V=!0,W,X,Y;e=l(D);var Z=function(){function a(){var a={},b=["touchstart" 13 | ,"touchmove","touchend"],c=document.createElement("div"),d;try{for(d=0;da+f&&(f-=f+a),0>b+g&&(g-=g+b),FE&&(r=E,u=Math.abs((r-a)/f),s=k<0?b-u:u+b)):(r=c,u=l/f,s=k<0?b-u:b+u,s<0?(s=0,t=Math.abs((s-b)*f),r=j<0?a-t:t+a):s>F&&(s=F,t=Math.abs(s-b)*f,r=j<0?a-t:t+a)),r>a?(r-ah&&(r=a+h),s>b?s=b+(r-a)/f:s=b-(r-a)/f):rh&&(r=a-h),s>b?s=b+(a-r)/f:s=b-(a-r)/f),r<0?(a-=r,r=0):r>E&&(a-=r-E,r=E),s<0?(b-=s,s=0):s>F&&(b-=s-F,s=F),q(o(a,b,r,s))}function n(a){return a[0]<0&&(a[0]=0),a[1]<0&&(a[1]=0),a[0]>E&&(a[0]=E),a[1]>F&&(a[1]=F),[Math.round(a[0]),Math.round(a[1])]}function o(a,b,c,d){var e=a,f=c,g=b,h=d;return cP&&(c=d>0?a+P:a-P),Q&&Math.abs 15 | (f)>Q&&(e=f>0?b+Q:b-Q),S/U&&Math.abs(f)0?b+S/U:b-S/U),R/T&&Math.abs(d)0?a+R/T:a-R/T),a<0&&(c-=a,a-=a),b<0&&(e-=b,b-=b),c<0&&(a-=c,c-=c),e<0&&(b-=e,e-=e),c>E&&(g=c-E,a-=g,c-=g),e>F&&(g=e-F,b-=g,e-=g),a>E&&(g=a-F,e-=g,b-=g),b>F&&(g=b-F,e-=g,b-=g),q(o(a,b,c,e))}function q(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]}}var a=0,b=0,c=0,e=0,f,g;return{flipCoords:o,setPressed:h,setCurrent:i,getOffset:j,moveOffset:k,getCorner:l,getFixed:m}}(),ba=function(){function f(a,b){e.left.css({height:i(b)}),e.right.css({height:i(b)})}function g(){return h(_.getFixed())}function h(a){e.top.css({left:i(a.x),width:i(a.w),height:i(a.y)}),e.bottom.css({top:i(a.y2),left:i(a.x),width:i(a.w),height:i(F-a.y2)}),e.right.css({left:i(a.x2),width:i(E-a.x2)}),e.left.css({width:i(a.x)})}function j(){return a("
").css({position:"absolute",backgroundColor:d.shadeColor||d.bgColor}).appendTo(c)}function k(){b||(b=!0,c.insertBefore(D),g(),bb.setBgOpacity(1,0,1),H.hide(),l(d.shadeColor||d.bgColor,1),bb. 16 | isAwake()?n(d.bgOpacity,1):n(1,1))}function l(a,b){bq(p(),a,b)}function m(){b&&(c.remove(),H.show(),b=!1,bb.isAwake()?bb.setBgOpacity(d.bgOpacity,1,1):(bb.setBgOpacity(1,1,1),bb.disableHandles()),bq(G,0,1))}function n(a,e){b&&(d.bgFade&&!e?c.animate({opacity:1-a},{queue:!1,duration:d.fadeTime}):c.css({opacity:1-a}))}function o(){d.shade?k():m(),bb.isAwake()&&n(d.bgOpacity)}function p(){return c.children()}var b=!1,c=a("
").css({position:"absolute",zIndex:240,opacity:0}),e={top:j(),left:j().height(F),right:j().height(F),bottom:j()};return{update:g,updateRaw:h,getShades:p,setBgColor:l,enable:k,disable:m,resize:f,refresh:o,opacity:n}}(),bb=function(){function k(b){var c=a("
").css({position:"absolute",opacity:d.borderOpacity}).addClass(j(b));return I.append(c),c}function l(b,c){var d=a("
").mousedown(s(b)).css({cursor:b+"-resize",position:"absolute",zIndex:c}).addClass("ord-"+b);return Z.support&&d.bind("touchstart.jcrop",Z.createDragger(b)),J.append(d),d}function m(a){var b=d.handleSize,e=l(a,c++ 17 | ).css({opacity:d.handleOpacity}).addClass(j("handle"));return b&&e.width(b).height(b),e}function n(a){return l(a,c++).addClass("jcrop-dragbar")}function o(a){var b;for(b=0;b').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),c=a("
").css({position:"absolute",overflow:"hidden"}).append(b);return d.keySupport&&(b.keydown(i).blur(f),h||!d.fixedSupport?(b.css({position:"absolute",left:"-20px"}),c.append(b).insertBefore(D)):b.insertBefore(D)),{watchKeys:e}}();Z.support&&M.bind("touchstart.jcrop",Z.newSelection),J.hide(),br(!0);var bs={setImage:bp,animateTo:bf,setSelect:bg,setOptions:bk,tellSelect:bi,tellScaled:bj,setClass:be,disable:bl,enable:bm,cancel:bn,release:bb.release,destroy:bo,focus:bd.watchKeys,getBounds:function(){return[E*T,F*U]},getWidgetSize:function(){return[E,F]},getScaleFactor:function(){return[T,U]},getOptions:function(){return d},ui:{holder:G,selection:K}};return g&&G.bind("selectstart",function(){return!1}),A.data("Jcrop",bs),bs},a.fn.Jcrop=function(b,c){var d;return this.each(function(){if(a(this).data("Jcrop")){if( 21 | b==="api")return a(this).data("Jcrop");a(this).data("Jcrop").setOptions(b)}else this.tagName=="IMG"?a.Jcrop.Loader(this,function(){a(this).css({display:"block",visibility:"hidden"}),d=a.Jcrop(this,b),a.isFunction(c)&&c.call(d)}):(a(this).css({display:"block",visibility:"hidden"}),d=a.Jcrop(this,b),a.isFunction(c)&&c.call(d))}),this},a.Jcrop.Loader=function(b,c,d){function g(){f.complete?(e.unbind(".jcloader"),a.isFunction(c)&&c.call(f)):window.setTimeout(g,50)}var e=a(b),f=e[0];e.bind("load.jcloader",g).bind("error.jcloader",function(b){e.unbind(".jcloader"),a.isFunction(d)&&d.call(f)}),f.complete&&a.isFunction(c)&&(e.unbind(".jcloader"),c.call(f))},a.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges 22 | :!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}})(jQuery); -------------------------------------------------------------------------------- /javascript/jquery.nouislider.min.js: -------------------------------------------------------------------------------- 1 | (function(f){f.fn.noUiSlider=function(n,r){function s(a,e,c){var g=e.data("setup"),l=g.handles;e=g.settings;g=g.pos;a=0>a?0:100c?c:a):(c=parseFloat(l[0][0].style[g])+e.margin,a=aa[0]?e+Math.abs(a[0]):e-a[0];return 100*e/this._length(a)},from:function(a,e){return 100*e/this._length(a)},is:function(a,e){return e*this._length(a)/100+a[0]},_length:function(a){return a[0]>a[1]?a[0]-a[1]:a[1]-a[0]}},w={handles:2,serialization:{to:["",""],resolution:0.01}};methods={create:function(){return this.each(function(){var a=f.extend(w,n),e=f(this).data("_isnS_", 3 | !0),c=[],g,l,b="",h=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},k=(a.serialization.resolution=a.serialization.resolution||0.01).toString().split("."),q=1==k[0]?0:k[1].length;a.start=h(a.start)?[a.start,0]:a.start;f.each(a,function(b,d){h(d)?a[b]=parseFloat(d):"object"==typeof d&&h(d[0])&&(d[0]=parseFloat(d[0]),h(d[1])&&(d[1]=parseFloat(d[1])));var c=!1;d="undefined"==typeof d?"x":d;switch(b){case "range":case "start":c=2!=d.length||!h(d[0])||!h(d[1]);break;case "handles":c=1>d||2
").children(":last");k=m.to(a.range,a.start[b]);c[b].css(g,k+"%");100==k&&c[b].is(":first-child")&&c[b].css("z-index",2);var k=(1===j?"mousedown":2===j?"MSPointerDown":"touchstart")+".noUiSliderX", 6 | r=(1===j?"mousemove":2===j?"MSPointerMove":"touchmove")+".noUiSlider",v=(1===j?"mouseup":2===j?"MSPointerUp":"touchend")+".noUiSlider";c[b].find("div").on(k,function(b){f("body").bind("selectstart.noUiSlider",function(){return!1});if(!e.hasClass("disabled")){f("body").addClass("TOUCH");var d=f(this).addClass("active").parent(),h=d.add(f(document)).add("body"),k=parseFloat(d[0].style[g]),j=t(b),u=j,n=!1;f(document).on(r,function(b){b.preventDefault();b=t(b);if("x"!=b[0]){b[0]-=j[0];b[1]-=j[1];var p= 7 | [u[0]!=b[0],u[1]!=b[1]],f=k+100*b[l]/(l?e.height():e.width()),f=s(f,e,d);if(p[l]&&f!=n){d.css(g,f+"%").data("input").val(m.is(a.range,f).toFixed(q));var p=a.slide,h=e.data("_n",!0);"function"===typeof p&&p.call(h,void 0);n=f;d.css("z-index",2==c.length&&100==f&&d.is(":first-child")?2:1)}u=b}}).on(v,function(){h.off(".noUiSlider");f("body").removeClass("TOUCH");e.find(".active").removeClass("active").end().data("_n")&&e.data("_n",!1).change()})}}).on("click",function(a){a.stopPropagation()})}if(1== 8 | j)e.on("click",function(b){if(!e.hasClass("disabled")){var d=t(b);b=100*(d[l]-e.offset()[g])/(l?e.height():e.width());d=1').find("input:last").val(k).change(function(a){a.stopPropagation()})):!1==a.serialization.to[b]?c[b].data("input",{val:function(a){if("undefined"!=typeof a)this.handle.data("noUiVal",a);else return this.handle.data("noUiVal")},handle:c[b]}):c[b].data("input",a.serialization.to[b].data("handleNR",b).val(k).change(function(){var a=[null,null];a[f(this).data("handleNR")]=f(this).val();e.val(a)}));f(this).data("setup",{settings:a,handles:c,pos:g,res:q})})},val:function(a){if("undefined"!==typeof a){var e= 10 | "number"==typeof a?[a]:a;return this.each(function(){for(var a=f(this).data("setup"),b=0;b range[1] ? range[0] - range[1] : range[1] - range[0]); 33 | } 34 | } 35 | 36 | // bounce handles of eachother, the edges of the slider 37 | function correct(proposal, slider, handle) { 38 | 39 | var 40 | setup = slider.data('setup'), 41 | handles = setup.handles, 42 | settings = setup.settings, 43 | pos = setup.pos; 44 | 45 | proposal = proposal < 0 ? 0 : proposal > 100 ? 100 : proposal; 46 | 47 | if (settings.handles == 2) { 48 | if (handle.is(':first-child')) { 49 | var other = parseFloat(handles[1][0].style[pos]) - settings.margin; 50 | proposal = proposal > other ? other : proposal; 51 | } else { 52 | var other = parseFloat(handles[0][0].style[pos]) + settings.margin; 53 | proposal = proposal < other ? other : proposal; 54 | } 55 | } 56 | 57 | if (settings.step) { 58 | var per = percentage.from(settings.range, settings.step); 59 | proposal = Math.round(proposal / per) * per; 60 | } 61 | 62 | return proposal; 63 | 64 | } 65 | 66 | // get standarised clientX and clientY 67 | function client(f) { 68 | try { 69 | return [(f.clientX || f.originalEvent.clientX || f.originalEvent.touches[0].clientX), (f.clientY || f.originalEvent.clientY || f.originalEvent.touches[0].clientY)]; 70 | } catch (e) { 71 | return ['x', 'y']; 72 | } 73 | } 74 | 75 | // get native inline style value in % 76 | function place(handle, pos) { 77 | return parseFloat(handle[0].style[pos]); 78 | } 79 | 80 | // simplified defaults 81 | var defaults = { 82 | handles : 2, 83 | serialization : { 84 | to : ['', ''], 85 | resolution : 0.01 86 | } 87 | }; 88 | 89 | // contains all methods 90 | methods = { 91 | create : function () { 92 | 93 | return this.each(function () { 94 | 95 | // set handle to position 96 | function setHandle(handle, to, slider) { 97 | handle.css(pos, to + '%').data('input').val(percentage.is(settings.range, to).toFixed(res)); 98 | } 99 | 100 | var 101 | settings = $.extend(defaults, options), 102 | // handles 103 | handlehtml = '
', 104 | // save this to variable, // allows identification 105 | slider = $(this).data('_isnS_', true), 106 | // array of handles 107 | handles = [], 108 | // the way the handles are positioned for this slider, top/left 109 | pos, 110 | // for quick orientation testing and array matching 111 | orientation, 112 | // append classes 113 | classes = "", 114 | // tests numerical 115 | num = function (e) { 116 | return !isNaN(parseFloat(e)) && isFinite(e); 117 | }, 118 | // counts decimals in serialization, sets default 119 | split = (settings.serialization.resolution = settings.serialization.resolution || 0.01).toString().split('.'), 120 | res = split[0] == 1 ? 0 : split[1].length; 121 | 122 | settings.start = num(settings.start) ? [settings.start, 0] : settings.start; 123 | 124 | // logs bad input values, if possible 125 | $.each(settings, function (a, b) { 126 | 127 | if (num(b)) { 128 | settings[a] = parseFloat(b); 129 | } else if (typeof b == "object" && num(b[0])) { 130 | b[0] = parseFloat(b[0]); 131 | if (num(b[1])) { 132 | b[1] = parseFloat(b[1]); 133 | } 134 | } 135 | 136 | var e = false; 137 | b = typeof b == "undefined" ? "x" : b; 138 | 139 | switch (a) { 140 | case 'range': 141 | case 'start': 142 | e = b.length != 2 || !num(b[0]) || !num(b[1]); 143 | break; 144 | case 'handles': 145 | e = (b < 1 || b > 2 || !num(b)); 146 | break; 147 | case 'connect': 148 | e = b != "lower" && b != "upper" && typeof b != "boolean"; 149 | break; 150 | case 'orientation': 151 | e = (b != "vertical" && b != "horizontal"); 152 | break; 153 | case 'margin': 154 | case 'step': 155 | e = typeof b != "undefined" && !num(b); 156 | break; 157 | case 'serialization': 158 | e = typeof b != "object" || !num(b.resolution) || (typeof b.to == 'object' && b.to.length < settings.handles); 159 | break; 160 | case 'slide': 161 | e = typeof b != "function"; 162 | break; 163 | } 164 | 165 | if (e && console) { 166 | console.error('Bad input for ' + a + ' on slider:', slider); 167 | } 168 | 169 | }); 170 | 171 | settings.margin = settings.margin ? percentage.from(settings.range, settings.margin) : 0; 172 | 173 | // tests serialization to be strings or jQuery objects 174 | if (settings.serialization.to instanceof jQuery || typeof settings.serialization.to == 'string' || settings.serialization.to === false) { 175 | settings.serialization.to = [settings.serialization.to]; 176 | } 177 | 178 | if (settings.orientation == "vertical") { 179 | classes += "vertical"; 180 | pos = 'top'; 181 | orientation = 1; 182 | } else { 183 | classes += "horizontal"; 184 | pos = 'left'; 185 | orientation = 0; 186 | } 187 | 188 | classes += settings.connect ? settings.connect == "lower" ? " connect lower" : " connect" : ""; 189 | 190 | slider.addClass(classes); 191 | 192 | for (var i = 0; i < settings.handles; i++) { 193 | 194 | handles[i] = slider.append(handlehtml).children(':last'); 195 | var setTo = percentage.to(settings.range, settings.start[i]); 196 | handles[i].css(pos, setTo + '%'); 197 | if (setTo == 100 && handles[i].is(':first-child')) { 198 | handles[i].css('z-index', 2); 199 | } 200 | 201 | var bind = '.noUiSlider', 202 | onEvent = (EVENT === 1 ? 'mousedown' : EVENT === 2 ? 'MSPointerDown' : 'touchstart') + bind + 'X', 203 | moveEvent = (EVENT === 1 ? 'mousemove' : EVENT === 2 ? 'MSPointerMove' : 'touchmove') + bind, 204 | offEvent = (EVENT === 1 ? 'mouseup' : EVENT === 2 ? 'MSPointerUp' : 'touchend') + bind 205 | 206 | handles[i].find('div').on(onEvent, function (e) { 207 | 208 | $('body').bind('selectstart' + bind, function () { 209 | return false; 210 | }); 211 | 212 | if (!slider.hasClass('disabled')) { 213 | 214 | $('body').addClass('TOUCH'); 215 | 216 | var handle = $(this).addClass('active').parent(), 217 | unbind = handle.add($(document)).add('body'), 218 | originalPosition = parseFloat(handle[0].style[pos]), 219 | originalClick = client(e), 220 | previousClick = originalClick, 221 | previousProposal = false; 222 | 223 | $(document).on(moveEvent, function (f) { 224 | 225 | f.preventDefault(); 226 | 227 | var currentClick = client(f); 228 | 229 | if (currentClick[0] == "x") { 230 | return; 231 | } 232 | 233 | currentClick[0] -= originalClick[0]; 234 | currentClick[1] -= originalClick[1]; 235 | 236 | var movement = [ 237 | previousClick[0] != currentClick[0], previousClick[1] != currentClick[1] 238 | ], 239 | proposal = originalPosition + ((currentClick[orientation] * 100) / (orientation ? slider.height() : slider.width())); 240 | proposal = correct(proposal, slider, handle); 241 | 242 | if (movement[orientation] && proposal != previousProposal) { 243 | handle.css(pos, proposal + '%').data('input').val(percentage.is(settings.range, proposal).toFixed(res)); 244 | call(settings.slide, slider.data('_n', true)); 245 | previousProposal = proposal; 246 | handle.css('z-index', handles.length == 2 && proposal == 100 && handle.is(':first-child') ? 2 : 1); 247 | } 248 | 249 | previousClick = currentClick; 250 | 251 | }).on(offEvent, function () { 252 | 253 | unbind.off(bind); 254 | $('body').removeClass('TOUCH'); 255 | if (slider.find('.active').removeClass('active').end().data('_n')) { 256 | slider.data('_n', false).change(); 257 | } 258 | 259 | }); 260 | 261 | } 262 | }).on('click', function (e) { 263 | e.stopPropagation(); 264 | }); 265 | 266 | } 267 | 268 | if (EVENT == 1) { 269 | slider.on('click', function (f) { 270 | if (!slider.hasClass('disabled')) { 271 | var currentClick = client(f), 272 | proposal = ((currentClick[orientation] - slider.offset()[pos]) * 100) / (orientation ? slider.height() : slider.width()), 273 | handle = handles.length > 1 ? (currentClick[orientation] < (handles[0].offset()[pos] + handles[1].offset()[pos]) / 2 ? handles[0] : handles[1]) : handles[0]; 274 | setHandle(handle, correct(proposal, slider, handle), slider); 275 | call(settings.slide, slider); 276 | slider.change(); 277 | } 278 | }); 279 | } 280 | 281 | for (var i = 0; i < handles.length; i++) { 282 | var val = percentage.is(settings.range, place(handles[i], pos)).toFixed(res); 283 | if (typeof settings.serialization.to[i] == 'string') { 284 | handles[i].data('input', 285 | slider.append('').find('input:last') 286 | .val(val) 287 | .change(function (a) { 288 | a.stopPropagation(); 289 | })); 290 | } else if (settings.serialization.to[i] == false) { 291 | handles[i].data('input', { 292 | val : function (a) { 293 | if (typeof a != 'undefined') { 294 | this.handle.data('noUiVal', a); 295 | } else { 296 | return this.handle.data('noUiVal'); 297 | } 298 | }, 299 | handle : handles[i] 300 | }); 301 | } else { 302 | handles[i].data('input', settings.serialization.to[i].data('handleNR', i).val(val).change(function () { 303 | var arr = [null, null]; 304 | arr[$(this).data('handleNR')] = $(this).val(); 305 | slider.val(arr); 306 | })); 307 | } 308 | } 309 | 310 | $(this).data('setup', { 311 | settings : settings, 312 | handles : handles, 313 | pos : pos, 314 | res : res 315 | }); 316 | 317 | }); 318 | }, 319 | val : function () { 320 | 321 | if (typeof arguments[0] !== 'undefined') { 322 | 323 | var val = typeof arguments[0] == 'number' ? [arguments[0]] : arguments[0]; 324 | 325 | return this.each(function () { 326 | 327 | var setup = $(this).data('setup'); 328 | 329 | for (var i = 0; i < setup.handles.length; i++) { 330 | if (val[i] != null) { 331 | var proposal = correct(percentage.to(setup.settings.range, val[i]), $(this), setup.handles[i]); 332 | setup.handles[i].css(setup.pos, proposal + '%').data('input').val(percentage.is(setup.settings.range, proposal).toFixed(setup.res)); 333 | } 334 | } 335 | }); 336 | 337 | } else { 338 | 339 | var handles = $(this).data('setup').handles, 340 | re = []; 341 | for (var i = 0; i < handles.length; i++) { 342 | re.push(parseFloat(handles[i].data('input').val())); 343 | } 344 | return re.length == 1 ? re[0] : re; 345 | 346 | } 347 | }, 348 | disabled : function () { 349 | return flag ? $(this).addClass('disabled') : $(this).removeClass('disabled'); 350 | } 351 | } 352 | 353 | // remap the native/current val function to noUiSlider 354 | var $_val = jQuery.fn.val; 355 | 356 | jQuery.fn.val = function () { 357 | return this.data('_isnS_') ? methods.val.apply(this, arguments) : $_val.apply(this, arguments); 358 | } 359 | 360 | return options == "disabled" ? methods.disabled.apply(this) : methods.create.apply(this); 361 | 362 | } 363 | 364 | })(jQuery); 365 | -------------------------------------------------------------------------------- /phpsane.php: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /save.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Save 11 | 12 | '; 13 | 14 | 15 | include("incl/security.php"); 16 | include("incl/language.php"); 17 | 18 | $file_save = $_GET['file_save']; 19 | $file_save_image = $_GET['file_save_image']; 20 | $lang_id = $_GET['lang_id']; 21 | 22 | 23 | if ($file_save_image) { 24 | echo " 25 |

26 | "; 27 | } else { 28 | // my_pre my_mono 29 | echo "\t

\n"; 30 | include($file_save); 31 | echo "\n\t


\n"; 32 | } 33 | 34 | echo " 35 |
".$file_save." 36 |

37 | 38 |

39 | ".$lang[$lang_id][35]." 40 |

41 | 42 |

43 | 44 |

45 | 46 | 47 | \n"; 48 | 49 | ?> 50 | --------------------------------------------------------------------------------