5 |
|
|
6 |
form= cgi.FieldStorage() |
form= cgi.FieldStorage() |
7 |
|
|
8 |
width, height= 570, 570 # Image size |
# Image size |
9 |
|
if form.has_key('width'): |
10 |
|
width=atoi(form['width'].value) |
11 |
|
else: |
12 |
|
width= 570 |
13 |
|
if form.has_key('height'): |
14 |
|
height=atoi(form['height'].value) |
15 |
|
else: |
16 |
|
height= 570 |
17 |
|
|
18 |
xmax, ymax = width-1, height-1 # Coordinate maximums |
xmax, ymax = width-1, height-1 # Coordinate maximums |
19 |
|
|
20 |
inx=max(0, min(atoi(form['image.x'].value), xmax)) |
inx=max(0, min(atoi(form['image.x'].value), xmax)) |