diff options
Diffstat (limited to 'im/cgi-bin')
| -rw-r--r-- | im/cgi-bin/.gallery.cgi.swo | bin | 20480 -> 0 bytes | |||
| -rw-r--r-- | im/cgi-bin/.gallery.cgi.swp | bin | 36864 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/.gallery.cgi.un~ | bin | 59038 -> 0 bytes | |||
| -rw-r--r-- | im/cgi-bin/.imditherconf.cgi.swo | bin | 12288 -> 0 bytes | |||
| -rw-r--r-- | im/cgi-bin/.imditherconf.cgi.swp | bin | 12288 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/.imditherconf.cgi.un~ | bin | 51229 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/.queryTest.cgi.un~ | bin | 7485 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/.test.cgi.un~ | bin | 519 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/1.png | bin | 2482 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/db.py | 29 | ||||
| -rwxr-xr-x | im/cgi-bin/db.pyc | bin | 1515 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/downloader.py | 114 | ||||
| -rwxr-xr-x | im/cgi-bin/downloader.pyc | bin | 2923 -> 0 bytes | |||
| -rwxr-xr-x | im/cgi-bin/gallery.cgi | 474 | ||||
| -rwxr-xr-x | im/cgi-bin/imdither.cgi | 145 | ||||
| -rwxr-xr-x | im/cgi-bin/imditherconf.cgi | 23 | ||||
| -rwxr-xr-x | im/cgi-bin/queryTest.cgi | 9 | ||||
| -rwxr-xr-x | im/cgi-bin/test.cgi | 49 |
18 files changed, 0 insertions, 843 deletions
diff --git a/im/cgi-bin/.gallery.cgi.swo b/im/cgi-bin/.gallery.cgi.swo Binary files differdeleted file mode 100644 index 8e49f67..0000000 --- a/im/cgi-bin/.gallery.cgi.swo +++ /dev/null diff --git a/im/cgi-bin/.gallery.cgi.swp b/im/cgi-bin/.gallery.cgi.swp Binary files differdeleted file mode 100644 index f1e8117..0000000 --- a/im/cgi-bin/.gallery.cgi.swp +++ /dev/null diff --git a/im/cgi-bin/.gallery.cgi.un~ b/im/cgi-bin/.gallery.cgi.un~ Binary files differdeleted file mode 100755 index 0720bde..0000000 --- a/im/cgi-bin/.gallery.cgi.un~ +++ /dev/null diff --git a/im/cgi-bin/.imditherconf.cgi.swo b/im/cgi-bin/.imditherconf.cgi.swo Binary files differdeleted file mode 100644 index 1bbf2e2..0000000 --- a/im/cgi-bin/.imditherconf.cgi.swo +++ /dev/null diff --git a/im/cgi-bin/.imditherconf.cgi.swp b/im/cgi-bin/.imditherconf.cgi.swp Binary files differdeleted file mode 100644 index 7de91b5..0000000 --- a/im/cgi-bin/.imditherconf.cgi.swp +++ /dev/null diff --git a/im/cgi-bin/.imditherconf.cgi.un~ b/im/cgi-bin/.imditherconf.cgi.un~ Binary files differdeleted file mode 100755 index bef4dd6..0000000 --- a/im/cgi-bin/.imditherconf.cgi.un~ +++ /dev/null diff --git a/im/cgi-bin/.queryTest.cgi.un~ b/im/cgi-bin/.queryTest.cgi.un~ Binary files differdeleted file mode 100755 index 31f6494..0000000 --- a/im/cgi-bin/.queryTest.cgi.un~ +++ /dev/null diff --git a/im/cgi-bin/.test.cgi.un~ b/im/cgi-bin/.test.cgi.un~ Binary files differdeleted file mode 100755 index 769e9af..0000000 --- a/im/cgi-bin/.test.cgi.un~ +++ /dev/null diff --git a/im/cgi-bin/1.png b/im/cgi-bin/1.png Binary files differdeleted file mode 100755 index e98ec53..0000000 --- a/im/cgi-bin/1.png +++ /dev/null diff --git a/im/cgi-bin/db.py b/im/cgi-bin/db.py deleted file mode 100755 index 4da7b83..0000000 --- a/im/cgi-bin/db.py +++ /dev/null @@ -1,29 +0,0 @@ -import MySQLdb -import time - -def now (): - return int(time.mktime(time.localtime())) -class db: - def __init__ (self): - self.conn = None - self.cursor = None - self.connect() - - def connect (self): - self.conn = MySQLdb.connect (host = "127.0.0.1", - user = "asdfus", - passwd = "gTYgT&M6q", - db = "asdfus") - self.cursor = self.conn.cursor () - - def execute (self,sql,args=()): - try: - self.cursor.execute(sql,args) - except MySQLdb.Error, e: - print "Error %d: %s" % (e.args[0], e.args[1]) - # sys.exit (1) - self.connect() - self.cursor.execute(sql,args) - - def lastinsertid (self): - return DB.conn.insert_id() diff --git a/im/cgi-bin/db.pyc b/im/cgi-bin/db.pyc Binary files differdeleted file mode 100755 index 6347826..0000000 --- a/im/cgi-bin/db.pyc +++ /dev/null diff --git a/im/cgi-bin/downloader.py b/im/cgi-bin/downloader.py deleted file mode 100755 index 7083b11..0000000 --- a/im/cgi-bin/downloader.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/python -import random -import urllib, urllib2 -urlopen = urllib2.urlopen -Request = urllib2.Request -import sys - -MAX_SIZE = 1024 * 1024 * 1.2 - -###___this somewhat poorly written program basically performs a get request -#you can specify three arguments, the url, the destination path and the filename#that you'll want your file to be called -#these can be specified as argument values from the commandline or as -#values in the mainfunction which is downloader.download(url,filename,destination) -#the destination and filename arguments are optional - - - -url = "" -destination = "" -filename = "" - -def argval(): - global destination - global url - global filename - stuff = sys.argv - lenstuff = len(stuff) - if lenstuff >= 4: - getvalues() - if lenstuff ==3: - print str(lenstuff) - url = sys.argv[-2] - filename = sys.argv[-1] - if lenstuff ==2: - url = sys.argv[-1] - destination = "" - partz = url.split('/') - filename = partz[-1] - if lenstuff ==1: - print 'please provide url' - return None - return url - -def getvalues(): - global url - global destination - global filename - url = sys.argv[-3] - destination = sys.argv[-1] - filename = sys.argv[-2] - if len(filename) == 0: - partz = url.split('/') - filename = partz[-1] - if filename == "" or filename == None: - partz = url.split('/') - filename = partz[-1] - return url - -def browser_request (url,data=None): - headers = { - 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)', - 'Accept': '*/*', - } - try: - req = Request(url, data, headers) - response = urlopen(req) - return response - except: - print "ERROR" - sys.stdout.write('there is a problem with the url or an I/O error') - return None - sys.exit() - - -def download(url, filename="",destination=""): - response = browser_request(url) - rawimg = response.read() - if len(rawimg) == 0: - print error("got zero-length file") - sys.stdout.write("file did not exist or was zero-length") - sys.exit() - if len(rawimg) > MAX_SIZE and "asdf.us" not in url: - error = "file too big: max size " + str(MAX_SIZE/1024) + " KB / " + filename + " is " + str(len(rawimg)/1024) + " KB" - print error - sys.stdout.write(error) - sys.exit() - if filename == "": - partz = url.split('/') - filename = partz[-1] - path = "" - if destination == "" or destination == '': - path = filename - else: - path = destination+filename - f = open(path, "w") - f.write(rawimg) - print 'success' - f.close() - finalitems = {} - finalitems['url'] = url - finalitems['filename'] = filename - finalitems['destination'] = destination - return finalitems - -def downloader(): - global url - global destination - global filename - argval() - finalitems = download(url, filename, destination) - return finalitems - -if __name__ == '__main__': - downloader() diff --git a/im/cgi-bin/downloader.pyc b/im/cgi-bin/downloader.pyc Binary files differdeleted file mode 100755 index 91ba5b0..0000000 --- a/im/cgi-bin/downloader.pyc +++ /dev/null diff --git a/im/cgi-bin/gallery.cgi b/im/cgi-bin/gallery.cgi deleted file mode 100755 index 0f762eb..0000000 --- a/im/cgi-bin/gallery.cgi +++ /dev/null @@ -1,474 +0,0 @@ -#!/usr/bin/python -import os -import cgi -import re - -import random - -import db -db = db.db() - -BASE_HREF = "http://i.asdf.us/im/" -PARAMLIST = "addr start limit name interface random" -LIMIT = 20 - -def get_params (paramlist): - paramkeys = paramlist.split() - form = {} - try: - qs = os.environ['QUERY_STRING'] - except: - qs = "" - if len(qs): - pairs = qs.replace("&", "&").split("&") - for pair in pairs: - k,v = pair.split("=", 1) - form[k] = v - params = {} - for key in paramkeys: - if key in form: - params[key] = sanitize(form[key]) - else: - params[key] = None - return params -def sanitize (str): - return re.sub(r'\W+', '', str) -def get_files (params): - sql = "SELECT * FROM im_cmd " - args = [] - where = [] - - if params['start'] is not None: - where.append("id < %s") - args.append(params['start']) - if params['name'] is not None: - where.append("name=%s") - args.append(params['name']) - if len(where): - sql += "WHERE " - sql += " AND ".join(where) - sql += " " - - if params['random'] is not None: - sql += "ORDER BY RAND() " - else: - sql += "ORDER BY id DESC " - sql += "LIMIT %s" - - if params['limit'] is not None: - args.append( int(params['limit']) ) - else: - args.append( LIMIT ) - db.execute(sql, args) - rows = db.cursor.fetchall () - return rows - -def is_image (img): - if "jpeg" in img: - return True - if "jpg" in img: - return True - if "gif" in img: - return True - if "png" in img: - return True - return False - - -params = get_params(PARAMLIST) - -titlephrase = random.choice([ - 'Keep on pickin\' on..', - 'Pickolaus Pickleby by Charles Pickens!', - 'You pick potato and I pick potahto...', - 'Take your piq!', - 'Show em what you got', - 'I sure know how to pick \'em', - 'Jus pick somethin already!', - 'You can\'t pick your friends...', - 'Select your image my liege', - 'There\'s a time to choose...', - 'gimme a choice! gimme lil\' choice-a-that...', - 'You choose you lose', - 'novels by James CHOICE...', - 'Choose away, chooser-man...', - ]) - -print "Content-type: text/html" -print "Pragma: no-cache" -print -print """ - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> -<head> -""" -print "<title>"+titlephrase+"</title>" -print""" -<style type="text/css"> -html,body{width:100%;height:100%;} - """ -if params['interface'] is not None and params['interface'] == "off": - print """ -body - { - background-color: white; - padding: 0; margin: 0; - } -#images - { - margin: 12px 0 0 8px; - } -div, div img - { - padding: 0; margin: 0; - margin-left: -4px; - margin-top: -4px; - } -""" -else: - print """ -body - { - background-color: #eee; - background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.32, rgb(245,238,235)), color-stop(0.66, rgb(252,252,252))); - background-image: -moz-linear-gradient( center bottom, rgb(245,238,235) 32%, rgb(252,252,252) 66%); overflow-y: scroll; - } -""" -print """ -html - { - padding-bottom: 200px; - } -#images - { - width: 100%; - } -#images div - { - width: 200px; - display: inline-block; - } -div img - { - max-width: 200px; - max-height: 200px; - border: 0; - } -#dump - { - position: fixed; - left: 0; - bottom: 10px; - padding: 10px; - width: 100%; - border-bottom: 2px solid #000; - background-color: #f8f8f8; - border-top: 1px solid #888; - } -#dump #rebus - { - clear: right; - width: 90%; - max-height: 700px; - overflow-y: scroll; - background-color: #fff; - padding-bottom: 5px; - border-bottom: 1px solid #ddd; - margin-bottom: 5px; - } -#dump #rebus img - { - display: inline; - max-width: 400px; - max-height: 400px; - margin-right: -4px; - } -#dump #urlz - { - width: 90%; - font-size: 15px; - } -#help - { - position: fixed; - top: 10px; - right: 10px; - cursor: pointer; - text-align: right; - font-family: sans-serif; - } -#help b - { - padding: 5px; - background-color: #f8f4fb; - display: block; - max-width: 160px; - text-align: right; - } -#help b:hover - { - color: cyan; - - } -#help #keys - { - clear: both; - background-color: #f8f8f8; - padding: 5px; - display: none; - width: 120px; - font-size: 12px; - } -#nextpage - { - position: fixed; - right: 160px; - font-family: sans-serif; - top: 10px; - padding: 5px; - background-color: rgba(255,255,255,0.7); - } -#nextpage a - { - color: #33f; - } -.rtlink - { - display: block; - width: 100%; - text-align: right; - } -#d_clip_container - { - display: inline-block; - } -#d_clip_button, #clear - { - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; - color: #333; - font-size: 13px; - line-height: 13px; - text-align: center; - margin: 2px; padding: 5px; - display: inline-block; - border-top: 1px solid #888; - border-left: 1px solid #888; - border-right: 1px solid #555; - border-bottom: 1px solid #333; - background-image: linear-gradient(bottom, rgb(235,235,235) 0%, rgb(250,250,250) 53%); - background-image: -o-linear-gradient(bottom, rgb(235,235,235) 0%, rgb(250,250,250) 53%); - background-image: -moz-linear-gradient(bottom, rgb(235,235,235) 0%, rgb(250,250,250) 53%); - background-image: -webkit-linear-gradient(bottom, rgb(235,235,235) 0%, rgb(250,250,250) 53%); - background-image: -ms-linear-gradient(bottom, rgb(235,235,235) 0%, rgb(250,250,250) 53%); - background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(235,235,235)), color-stop(0.53, rgb(250,250,250))); - } -#d_clip_button.hover, #clear:hover - { - color: #555; - background-image: linear-gradient(bottom, rgb(245,240,245) 0%, rgb(255,255,255) 78%); - background-image: -o-linear-gradient(bottom, rgb(245,240,245) 0%, rgb(255,255,255) 78%); - background-image: -moz-linear-gradient(bottom, rgb(245,240,245) 0%, rgb(255,255,255) 78%); - background-image: -webkit-linear-gradient(bottom, rgb(245,240,245) 0%, rgb(255,255,255) 78%); - background-image: -ms-linear-gradient(bottom, rgb(245,240,245) 0%, rgb(255,255,255) 78%); - background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(245,240,245)), color-stop(0.78, rgb(255,255,255))); - } -#d_clip_button.active, #clear:active - { - color: #111; - border-top: 1px solid #333; - border-left: 1px solid #555; - border-right: 1px solid #555; - border-bottom: 1px solid #333; - background-image: linear-gradient(bottom, rgb(194,194,194) 0%, rgb(235,235,235) 53%); - background-image: -o-linear-gradient(bottom, rgb(194,194,194) 0%, rgb(235,235,235) 53%); - background-image: -moz-linear-gradient(bottom, rgb(194,194,194) 0%, rgb(235,235,235) 53%); - background-image: -webkit-linear-gradient(bottom, rgb(194,194,194) 0%, rgb(235,235,235) 53%); - background-image: -ms-linear-gradient(bottom, rgb(194,194,194) 0%, rgb(235,235,235) 53%); - background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(194,194,194)), color-stop(0.53, rgb(235,235,235))); - } -</style> - -</head> -<body> -<div id="help"> - <b>key controls</b> - <div id="keys"> - ESC toggle<br/> - C clear<br/> - R reverse<br/> - BACKSPACE delete<br/> - LEFT ARROW newer<br/> - RIGHT ARROW older<br/> - </div> -</div> -<div id="dump"> - <div id="rebus"></div> - <input id="urlz" type="text" /> - <div id="d_clip_container" style="position:relative"> - <div id="d_clip_button">copy</div> - </div> - <button id="clear">clear</button> -</div> -<div id="images"> -""" - - -files = get_files(params) -count = 0 -for f in files: - # url = BASE_HREF + f.replace(" ","%20") - url = BASE_HREF + f[5] + "/" + f[7] - print "<div><img src='%s'/></div>" % (url) -print "</div>" - -lowest_id = files[-1][0] -previous_id = lowest_id + (LIMIT * 2) -back = ["start=%d" % lowest_id, "limit=%d" % LIMIT] -newer = ["start=%d" % previous_id, "limit=%d" % LIMIT] -random_time = [] -if params['name'] is not None: - back.append("name=%s" % params['name']) - newer.append("name=%s" % params['name']) - random_time.append("name=%s" % params['name']) - -newer_QS = "&".join(newer) -back_QS = "&".join(back) -random_time_QS = "&".join(back) -print "<div id='nextpage'>" -print "<a href='?%s'>← newer</a>" % newer_QS; -print "|" -print "<a href='/im/'>editor</a>" -print "|" -print "<a href='?random=1%s'>random</a>" % random_time_QS; -print "|" -print "<a href='?%s'>older →</a>" % back_QS; -print "</div>" -print """ -</body> -<script type="text/javascript"></script> -<script type="text/javascript" src="/js/jquery.js"></script> -<script type="text/javascript" src="/js/ZeroClipboard.js"></script> -<script type="text/javascript" src="http://asdf.us/js/pbembed.js"></script> -<script type="text/javascript"> -ZeroClipboard.setMoviePath( 'http://asdf.us/swf/ZeroClipboard10.swf' ); -var clip = new ZeroClipboard.Client(); -clip.glue( 'd_clip_button' ); -var Dump = - { - pick: function () - { - Dump.pickUrl( $(this).attr("src") ) - }, - pickUrl: function (url) - { - $("#rebus").append ($ ("<img>").attr ("src", url)) - $("#rebus").show() - var theDump = $("#urlz").val() + " " + url - $("#urlz").val( theDump ) - clip.setText( theDump ) - return false - }, - clear: function () - { - $("#rebus").html("") - $("#urlz").val("") - clip.setText("") - }, - backspace: function () - { - $("#rebus img:last").remove() - var urllist = $("#urlz").val().split(" ") - urllist.pop() - $("#urlz").val( urllist.join(" ") ) - }, - reverse: function () - { - urllist = $("#urlz").val().split(" ") - Dump.clear() - for (i in urllist.reverse()) - if (urllist[i]) - Dump.pickUrl(urllist[i]) - }, - showNewer: function() - { - window.location.href = '?"""+newer_QS+"""' - }, - showOlder: function() - { - window.location.href = '?"""+back_QS+"""' - } - } -var Main = - { - editing: false, - kp: function (event) - { - console.log(event.keyCode); - switch (event.keyCode) - { - // BS - case 8: - if (! Main.editing) - Dump.backspace() - return false - // C - case 67: - if (! Main.editing) - Dump.clear() - break - // R - case 82: - if (! Main.editing) - Dump.reverse() - break - // ESC - case 27: - // H - case 72: - if (! Main.editing) - $("#rebus").toggle() - break - // LEFT ARROW - case 37: - if (! Main.editing) - Dump.showNewer() - break - // RIGHT ARROW - case 39: - if (! Main.editing) - Dump.showOlder() - break - } - return true - }, - poll: function () - { - }, - pollCallback: function () - { - }, - init: function () - { - $(document).keydown(Main.kp) - $("#urlz").focus(function(){ Main.editing = true }) - $("#urlz").blur(function(){ Main.editing = false }) - $("#clear").live("click", Dump.clear) - $("#help").click(function(){ $("#keys").toggle() }) - $("div img").live("click", Dump.pick) - Dump.clear() - } - } -""" -if params['interface'] is not None and params['interface'] == "off": - print """ -$("#nextpage,#help,#dump").hide() -$("body").css({"margin": 0, "padding": 0, "overflow": hidden, "background-color": white}) -""" -else: - print "Main.init()" -print """ -</script> -</html> -""" - diff --git a/im/cgi-bin/imdither.cgi b/im/cgi-bin/imdither.cgi deleted file mode 100755 index 29837ed..0000000 --- a/im/cgi-bin/imdither.cgi +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/python - -import downloader -import time -import re -import cgi -from subprocess import Popen, PIPE, call -from os import stat, path, makedirs -import sys -import sha -BASE_DIR = "" -OTHER_BASE = "" -#BASE_DIR = "/var/www/asdf.us/httpdocs/im/" -#OTHER_BASE = "http://asdf.us/im/" - -print "Content-Type: text/html" -print "" -print "" - -NAMETAG = "imDither" - -MAIN_DIRECTORY = "" -#BIN_CONVERT = "/usr/bin/convert" -#BIN_IDENTIFY = "/usr/bin/identify" -#BIN_COMPOSITE = "/usr/bin/composite" -BIN_CONVERT = "convert" -BIN_IDENTIFY = "identify" -BIN_COMPOSITE = "composite" - -NOW = str(int(time.time())) -MAX_LENGTH_BEFORE_ABRIDGED = 30 -ABBREVIATION = "xx_abridged__" - -################################### -### DEFAULT VALUES HERE -params = { - "url" : "http://asdf.us/im/10/friedeggstresstoy_1321140711_1322282769_pepper.gif", - "ditherType" : "1.png", - "username" : "pepper", - "formatType" : "png", -} -################################### - -form = cgi.FieldStorage() -if form: - for key, value in form.iteritems(): - formValues[key] = params[key] #CHECKME - -class Utils: - def file_size (self, imgFile): - return stat(imgFile)[6] - - def imageDimensions(self, thefile): - ident = Popen([BIN_IDENTIFY, thefile], stdout=PIPE).communicate()[0] - parts = ident.split(" ") - return parts[2].split("x") - - def hash_dir(self, s): - """get a random number-letter pair""" - return sha.new(s).hexdigest()[:2] - - def hexdir(self): - """create a random path name""" - directoryName = utils.hash_dir(NOW) - - dirs = [ - BASE_DIR+directoryName+'/', - OTHER_BASE+directoryName+'/', - ] - ################################### - if not path.exists(directoryName): - makedirs(directoryName) - - - return dirs - - def makeOriginalName(self, params, canvas_type="", nametag_part=""): - if not nametag_part: - nametag_part = NAMETAG - if not canvas_type: - canvastype = params["formatType"] - filename = '%s_%s_%s.%s' % (nametag_part, NOW, params["username"], canvas_type) - return filename - - def sanitize (self,string): - """strip out all non-word characters""" - return re.sub(r'\W+', '', string) - - def makeNameFromFilename(self, params): - parts = params["url"].split("?")[0].split('/') - filename = parts[-1] - name, extension = filename.split('.') - if len(extension) >= 5: - sys.stdout.write('the file is not an image or any standard format') - sys.exit() - if len(name)> MAX_LENGTH_BEFORE_ABRIDGED: - name = ABBREVIATION - sanitized = self.sanitize(name) - thefilename = "%s_%s_%s_%s.%s" % (NAMETAG, NOW, sanitized, params["username"], extension) - return thefilename - -utils = Utils(); - - -class Dither: - def makeCanvas(self, thefile): - call([BIN_CONVERT,"-size", self.dimensions[0]+"x"+self.dimensions[1],"canvas:transparent", thefile]) - def makeMask(self, themask, thedither, thebackground): - """ composite -tile DITHERNAME BACKGROUNDNAME MASKNAME """ - call([BIN_COMPOSITE,"-tile",thedither,thebackground,themask]) - #convert thebg.gif -compose Dst_In null: thefile.gif -matte -layers composite new.gif - call([BIN_CONVERT,themask,"-compose","Dst_In","null:",self.privatepath+self.mainfile,"-matte","-layers","composite",themask]) - # os.system("rm "+thebackground) - def fuseMask(self, themask, theimage): - call([BIN_COMPOSITE,theimage,"-compose","Pin_Light",themask,theimage]) - # os.system("rm "+themask) - def __init__(self, url, thedither, username): - self.mainfile = utils.makeNameFromFilename(params) - filepaths = utils.hexdir() - self.privatepath = filepaths[0] - self.publicpath = filepaths[1] - downloader.download(url, self.mainfile, self.privatepath) - - parts = self.mainfile.split('.') - print parts - if "gif" in parts[-1]: - canvastype = "gif" - else: - canvastype = "png" - - self.canvasfile = "/tmp/"+utils.makeOriginalName(params, canvastype, "canvasfile") - self.dimensions = utils.imageDimensions(self.privatepath+self.mainfile) - self.makeCanvas(self.canvasfile) - self.theMask = "/tmp/"+utils.makeOriginalName(params, canvastype, "maskfile") - #good up to here - self.makeMask(self.theMask, thedither, self.canvasfile) - self.fuseMask(self.theMask, self.privatepath+self.mainfile) - #self.mainfile = self.mainfile.replace(, do something with s3) - print self.privatepath+self.mainfile - print utils.file_size(self.privatepath+self.mainfile) - print 'width: '+self.dimensions[0]+'px' - print 'height: '+self.dimensions[1]+'px' - -if __name__ == "__main__": - newImage = Dither(params["url"], params["ditherType"], params["username"]) diff --git a/im/cgi-bin/imditherconf.cgi b/im/cgi-bin/imditherconf.cgi deleted file mode 100755 index 8e7b7f2..0000000 --- a/im/cgi-bin/imditherconf.cgi +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -from subprocess import * -import re -print "Content-type: text/html\n\n" -DITHERDIR = "/home/pepper/im/imdither/dithers"; - - -def get_ditherfiles(): - filesString = Popen(["ls", DITHERDIR], stdout=PIPE).communicate()[0] - files = filesString.split("\n"); - #javascript = "var ditherfiles = [" - javascript = "[" - for i in files: - if not i: - continue - javascript += "\"%s\", " % (i); - - javascript = javascript[:-2] - javascript += "]"; - return javascript -print get_ditherfiles(); - diff --git a/im/cgi-bin/queryTest.cgi b/im/cgi-bin/queryTest.cgi deleted file mode 100755 index 5e6d573..0000000 --- a/im/cgi-bin/queryTest.cgi +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/perl - -use CGI; -my $cgi = new CGI; -print $cgi->header('text/html'); -print "what's up doc"; -#print( $cgi->param( "test" )); - - diff --git a/im/cgi-bin/test.cgi b/im/cgi-bin/test.cgi deleted file mode 100755 index 1159090..0000000 --- a/im/cgi-bin/test.cgi +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/perl - -print "Content-Type: text/html\r\n\r\nHello, world!\n"; -open MYFILE, ">/home8/basedxco/public_html/TESTFILE" or die $!; - - - -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -print MYFILE "this is a test!!!!"; -close(MYFILE); |
