-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
65 lines (46 loc) · 1.75 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Scanner2web home
----------------
Scanner2web is simple web application to make your scanner available across network.
It is written in pure wsgi, and will run on any wsgi-capable server.
You just need to install it on linux or unix machine with scanner, and give other people
web address to use.
Requirements
------------
* python3, for running the scanner2web itself.
* scanimage (from sane), for interacting with scanner.
* convert (from imagemagick), for on-the-fly convertions to png.
Checking:
$ python3 --version
Should produce something like 'Python 3.4.3'
$ scanimage > image.pnm && file image.pnm
Should produce something like 'Netpbm PPM "rawbits" image data, size = ....'
$ scanimage | convert pnm:- png:image.png && file image.png
Should produce something like 'image.png: PNG image data, ...'
Installation
------------
* download all files in this repo
$ git clone <path-to-this-repo> # for example
* Run any wsgi server, with main.py as application.
If you are short on time, you can just run:
$ ./serve.py
It will host scanner2web on :8080 on all IP interfaces.
Urls
----
/ - for the main page itself
/script.js - for the script file
/style.css - for styles
/image.png - returns the last scanned image.
/rescan - triggers a rescan
No other URLS are available regardless of files in scanner2web directory.
So feel free to store any other files in it.
Files used
----------
serve.py - simple wsgi server.
main.py - scanner2web app
script.js - javascript for browser
style.css - styles for browser
index.html - main page
rescan.html - returned to javascript-free browsers on '/rescan' request
image.png - [temporary file] stores last scanned image
image.lock - [temporary file] prevents data races.
No other files are used.