Basic handler for diff rendering

image-binary-support
dgtlmoon 3 years ago
parent 7a66b69158
commit 86fc9d669f

@ -801,6 +801,16 @@ def changedetection_app(config=None, datastore_o=None):
logs=notification_debug_log if len(notification_debug_log) else ["No errors or warnings detected"]) logs=notification_debug_log if len(notification_debug_log) else ["No errors or warnings detected"])
return output return output
# render an image which contains the diff of two images
@app.route("/diff/image/<string:uuid>/<string:first_date>/<string:second_date>")
def render_diff_image(uuid, first_date, second_date):
from flask import make_response
resp = make_response("xxxxx")
resp.headers['Content-Type'] = 'image/jpeg'
return resp
@app.route("/api/<string:uuid>/snapshot/current", methods=['GET']) @app.route("/api/<string:uuid>/snapshot/current", methods=['GET'])
@login_required @login_required
def api_snapshot(uuid): def api_snapshot(uuid):

@ -23,7 +23,7 @@
</div> </div>
<div id="diff-ui"> <div id="diff-ui">
<img src="{{ url_for('render_diff_image', uuid=uuid, first_date=versions[0], second_date=current_previous_version) }}" />
</div> </div>

Loading…
Cancel
Save