Skip to content
Snippets Groups Projects
Commit fd3e4cfc authored by Nico Vermaas's avatar Nico Vermaas
Browse files

reverting base64 mechanism

parent 82882eca
No related branches found
No related tags found
1 merge request!291Sdc 935 better plots
Pipeline #47755 passed
...@@ -712,11 +712,11 @@ def construct_inspectionplots(task,source='task_id'): ...@@ -712,11 +712,11 @@ def construct_inspectionplots(task,source='task_id'):
if basename.endswith('png'): if basename.endswith('png'):
# retrieve the url and add the binary data to the html # retrieve the url and add the binary data to the html
response = requests.get(url) # response = requests.get(url)
content_as_string = base64.b64encode(response.content).decode("utf-8") # content_as_string = base64.b64encode(response.content).decode("utf-8")
img_html = '<img width="800" src = "data:image/png;base64,' + content_as_string + '">' # img_html = '<img width="800" src = "data:image/png;base64,' + content_as_string + '">'
results += '<tr><td><a href="' + url + '" alt="' + basename + '" target="_blank">' + img_html + '</a></td></tr>' #results += '<tr><td><a href="' + url + '" alt="' + basename + '" target="_blank">' + img_html + '</a></td></tr>'
#results += '<tr><td><a href="' + url + '" target="_blank"><img width="800" src="' + url + '" alt="' + basename + '"/></a></td></tr>' results += '<tr><td><a href="' + url + '" target="_blank"><img width="800" src="' + url + '" alt="' + basename + '"/></a></td></tr>'
plot_files.append(basename) plot_files.append(basename)
...@@ -755,12 +755,13 @@ def construct_inspectionplots(task,source='task_id'): ...@@ -755,12 +755,13 @@ def construct_inspectionplots(task,source='task_id'):
if basename.endswith('png'): if basename.endswith('png'):
# retrieve the url and add the binary data to the html # retrieve the url and add the binary data to the html
response = requests.get(url) # response = requests.get(url)
content_as_string = base64.b64encode(response.content).decode("utf-8") # content_as_string = base64.b64encode(response.content).decode("utf-8")
img_html = '<img width="800" src = "data:image/png;base64,' + content_as_string + '">' # img_html = '<img width="800" src = "data:image/png;base64,' + content_as_string + '">'
# results += '<tr><td><a href="' + url + '" alt="'+basename+'" target="_blank">' + img_html+ '</a></td></tr>'
results += '<tr><td><a href="' + url + '" target="_blank"><img width="800" src="' + url + '" alt="'+basename+'"/></a></td></tr>'
# results += '<tr><td><a href="' + url + '" target="_blank"><img width="800" src="' + url + '" alt="'+basename+'"/></a></td></tr>'
results += '<tr><td><a href="' + url + '" alt="'+basename+'" target="_blank">' + img_html+ '</a></td></tr>'
plot_files.append(plot_file) plot_files.append(plot_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment