mirror of https://github.com/CIRCL/lookyloo
parent
12697964ce
commit
64d1ed785b
|
@ -377,7 +377,11 @@ def redirects(tree_uuid: str):
|
||||||
|
|
||||||
@app.route('/tree/<string:tree_uuid>/image', methods=['GET'])
|
@app.route('/tree/<string:tree_uuid>/image', methods=['GET'])
|
||||||
def image(tree_uuid: str):
|
def image(tree_uuid: str):
|
||||||
to_return = lookyloo.get_screenshot(tree_uuid)
|
max_width = request.args.get('width')
|
||||||
|
if max_width:
|
||||||
|
to_return = lookyloo.get_screenshot_thumbnail(tree_uuid, width=int(max_width))
|
||||||
|
else:
|
||||||
|
to_return = lookyloo.get_screenshot(tree_uuid)
|
||||||
return send_file(to_return, mimetype='image/png',
|
return send_file(to_return, mimetype='image/png',
|
||||||
as_attachment=True, attachment_filename='image.png')
|
as_attachment=True, attachment_filename='image.png')
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,7 @@
|
||||||
<div class="modal-dialog modal-xl" role="document">
|
<div class="modal-dialog modal-xl" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="screenshotModalLabel">Details of the capture at the time it happened</h5>
|
<h5 class="modal-title" id="detailsModalLabel">Details of the capture at the time it happened</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -396,18 +396,19 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<center>
|
<center>
|
||||||
{% if screenshot_size > 10 * 1024 * 1024 %}
|
{% set screenshot_too_big = screenshot_size > 10 * 1024 * 1024 %}
|
||||||
Image too big ({{ sizeof_fmt(screenshot_size) }}) to display in the browser, <a href="{{ url_for('image', tree_uuid=tree_uuid) }}" role="button">click here to download it</a>.
|
{% if screenshot_too_big %}
|
||||||
{% else %}
|
Image too big ({{ sizeof_fmt(screenshot_size) }}) to display in the browser, the screenshot below is cropped.
|
||||||
<a href="{{ url_for('image', tree_uuid=tree_uuid) }}" role="button" class="btn btn-info">Download screenshot</a>
|
|
||||||
{% if blur_screenshot %}
|
|
||||||
<button type="button" class="btn btn-info" onclick="$('#screenshot').removeClass('blur')"> Unblur screenshot</button>
|
|
||||||
{% endif %}
|
|
||||||
</br>
|
</br>
|
||||||
</hr>
|
|
||||||
</br>
|
|
||||||
<img src="{{ url_for('image', tree_uuid=tree_uuid) }}" class="img-fluid {{ 'blur' if blur_screenshot else '' }}" id="screenshot"/>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if blur_screenshot %}
|
||||||
|
<button type="button" class="btn btn-info" onclick="$('#screenshot').removeClass('blur')">Unblur</button>
|
||||||
|
{% endif %}
|
||||||
|
<a href="{{ url_for('image', tree_uuid=tree_uuid) }}" role="button" class="btn btn-info">Download</a>
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
<img src="{{ url_for('image', tree_uuid=tree_uuid, width=1024 if screenshot_too_big else '') }}" class="img-fluid {{ 'blur' if blur_screenshot else '' }}" id="screenshot"/>
|
||||||
|
</br>
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
Loading…
Reference in New Issue