summaryrefslogtreecommitdiff
path: root/impattern/im/cgi-bin/imweb/downImg
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-02-13 02:41:42 -0800
committeryo mama <pepper@scannerjammer.com>2015-02-13 02:41:42 -0800
commit64f41d53728a966f10aef6d7ffbc00853d754300 (patch)
tree082f17db25c61f66aec87dc47fbc208cb17ca168 /impattern/im/cgi-bin/imweb/downImg
parentfab0563ff31365c2396f7353679c8239aed3ce8b (diff)
fixed some basics
Diffstat (limited to 'impattern/im/cgi-bin/imweb/downImg')
-rwxr-xr-ximpattern/im/cgi-bin/imweb/downImg55
1 files changed, 0 insertions, 55 deletions
diff --git a/impattern/im/cgi-bin/imweb/downImg b/impattern/im/cgi-bin/imweb/downImg
deleted file mode 100755
index d029477..0000000
--- a/impattern/im/cgi-bin/imweb/downImg
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-
-import cgi
-import downloader
-import fieldstorager
-import sys
-import os
-#import gifchooser
-
-#BASE_DIR = "/var/www/asdf.us/httpdocs/imweb/"
-BASE_DIR = ""
-PARAM_LIST = "texture heightmap"
-#BIN_CONVERT = "/usr/bin/convert"
-BIN_CONVERT = "convert"
-
-print "Content-type: text/plain"
-print ""
-
-form = cgi.FieldStorage()
-newvalues = fieldstorager.fieldstorage(PARAM_LIST, form)
-thekeys = PARAM_LIST.split()
-for key in thekeys:
- globals()[key] = newvalues[key]
-########################################################
-#test with values here
-texture = "http://i.asdf.us/im/f3/imBreak_1327641897_clifford_1327640637_pepper.png"
-heightmap = "http://dump.fm/images/20120127/1327645413657-dumpfm-pepper-topcomments.png"
-#######################################################
-def uploadit(pictureUrl):
- if len(pictureUrl) > 3 and "." in pictureUrl:
- imageparts = pictureUrl.split('.')
- filetype = imageparts[-1]
- if "?" in filetype:
- theparts = filetype.split('?')
- filetype = theparts[0]
- if pictureUrl == texture:
- imagename = "Texture"
- if pictureUrl == heightmap:
- imagename = "Heightmap"
- if "png" in pictureUrl.lower() or "jpg" in pictureUrl.lower() or "jpeg" in pictureUrl.lower() or "gif" in pictureUrl.lower():
- downloader.download(pictureUrl, (imagename+"."+filetype), BASE_DIR)
- firstfile = BASE_DIR+imagename+"."+filetype
- endfile = BASE_DIR+imagename+"."+"jpg"
- os.system(BIN_CONVERT+" -resize 256x256\! "+firstfile+" "+endfile)
- if pictureUrl == "Heightmap":
- os.system(BIN_CONVERT+" colorspace -gray "+" "+endfile+" "+endfile)
- os.system("rm heightmap.png heightmap.gif texture.png texture.gif")
- print "upload"+imagename+" successful"
- return endfile
- else:
- print "This is not an acceptable image format for "+imagename
- return
-uploadit(texture)
-uploadit(heightmap)
-sys.exit()