Hi, I have been trying to upload a image from the static/images folder into the print job report using the editable jinja2 template provided in the print job history plugin. However no image appears no matter what I try to do, only the alt text appears. I have attached the code I tried to use in the jinja2 template to import the image below.
Hi thank you for the reply. I tried moving the image to the octopi static file and trying again but to no avail. I forgot to include this in the post but there is already a image being imported into the report from the plugin's static file somehow using another function. The function is made to insert the picture taken by a raspberry pi camera at the end of the print into the report. However since there is no camera attached to my Rpi (as I am running a development version on my windows laptop), it imports a "no image found" picture from the plugin's static folder into the report. The specific code is attached below:
You might have to poke around in the developer tools in the browser to see exactly what the output of this template ends up being to work out what is wrong. You can use the 'Elements' tab for this, by right clicking and pressing 'inspect'.
Hi thanks for the reply. I checked my code again and you were right, I forgot the quotes and changed it. I tested the code again to no avail. I then changed the image in the octopi's static folder to another png file and the image was somehow successfully imported into the template. Hence @jneilliii was actually right in stating that it was looking for the image in the octopi's static folder. However would it be possible to change it to look at the plugin's static folder instead? I have attached the inspect element image below with the picture imported into the report.
does the image show up anywhere else in the UI, like in a job list somewhere? seeing what it is there would help reverse engineer the path, or I guess we would just look at the print job history code to see if there are any blueprint routes for displaying image. I suspect there is.
Hi thanks for the reply. I tried looking into the source code to try and reverse engineer how its uploading the image from the plugin static folder but I couldn't really understand the calling function. I did put the source code relating to this in my previous reply, apologies I think I may have not explained properly that it was the source code. I have attached the related code below again.
However I suspect that there is another block of code for when there is no snapshot taken by the Rpi camera to insert the "No image found" picture from the plugin's static folder. I unfortunately can't locate this code.