def user_page(uname = None): #if util. ---this will check if the uname exists if util.getUser(uname) == None: flash("That's not a user") return redirect('/events') else: username = escape(session['username']) udict = util.getUser(username) pdict = util.getUser(uname) pic = util.getPicture (udict['uname']) if request.method=="POST": print(request.form["rating"]) return render_template('user.html', udict = udict, pdict=pdict, profile = pic)
def editPic(): print("Here") username = session['username'] if request.method == "POST": x1 = request.form['x1'] x2 = request.form['x2'] y1 = request.form['y1'] y2 = request.form['y2'] print("Weird stuff") picture = util.getPicture (username) original = Image.open(picture) width, height = original.size # Get dimensions cropped_example = original.crop((x1, y1, x2, y2)) cropped_example.show() ''' picture = util.getPicture (username) image = cv2.imread(picture) cropped = image[y1:y2, x1:x2] cv2.imwrite(picture, cropped) ''' print("Complete") return redirect('/personal')
def personal(thing = None): username = escape(session['username']) udict = util.getUser(username) pic = util.getPicture (udict['uname']) print pic return render_template('personal.html', udict=udict, change=thing, profile = pic)
def p(): username = escape(session['username']) picture = util.getPicture (session['username']) return render_template('personal.html', udict=util.getUser(username), change = "Null", profile = picture)