import os

from flask import Flask, abort, send_file

app = Flask(__name__)


@app.route("/<path:filename>/")
def get_image(filename):
    if not os.path.isfile(filename):
        abort(404)
    return send_file(filename)


if __name__ == "__main__":
    app.run()

@@ -35,16 +35,25 @@
 , abort,
+ request,
  send_fi
@@ -54,16 +54,139 @@
 end_file
+%0Afrom webargs.flaskparser import use_kwargs%0A%0Afrom fields import image_args%0Afrom utils import create_image, get_new_filename
 %0A%0Aapp = 
@@ -235,10 +235,55 @@
 ame%3E
-/
 %22
+, strict_slashes=False)%0A@use_kwargs(image_args
 )%0Ade
@@ -298,24 +298,34 @@
 age(filename
+, **kwargs
 ):%0A    if no
@@ -371,16 +371,102 @@
 rt(404)%0A
+    new_filename = get_new_filename(request)%0A    if os.path.isfile(new_filename):%0A    
     retu
@@ -474,24 +474,28 @@
 n send_file(
+new_
 filename)%0A%0A%0A
@@ -492,16 +492,125 @@
 lename)%0A
+    if create_image(filename, new_filename, **kwargs):%0A        return send_file(new_filename)%0A    abort(500)%0A
 %0A%0Aif __n

add image logic to controller