I’m assuming this:
@app.route("/image/<pic>")
def pict(pic):
if not exists(pic):
print(f'DEBUG: Error: no such file as {pic}')
return f"FileExistsError: {pic} doesn't exist in server's database"
print('DEBUG: returned an image')
print(f"DEBUG: image: {pic}")
return f"<title>image</title><p><img src={pic} alt = 'image'></p>"
Is the code that is resulting in the faulty images, could you print pic
and show me what it outputs when you go to an image?
The pic is the image path you entered
Such as if you go /image/boom.png then pic=‘boom.png’
I think the problem might just be that the images aren’t hosted. (I don’t know Flask so I don’t know how this works.) The images are all in the root directory, but Flask isn’t serving them, so you can’t access them from the web via /image.extension
. That said, the images seem to appear when you go to /ascii/image.extenionsion
so I dunno. Does my theory have any merit or is it not this?
Well ascii/image is transferring the image to ascii code, so it is not using img in html. Thats not an image they are texts
When I visit your site, I can view the images (I tried several) with no problem. If you are still experiencing a problem, I recommend you do as others suggested and perform a cache refresh (Ctrl + F5 will work in several browsers). Also, are you opening your site in a new tab/window? Flask Repls don’t always display properly in the webview. I have one that is blank in the webview but works just fine everywhere else. It could be that the webview is your problem.
Well, cache refresh doesn’t work for some reason, I think it is because Im on mobile and therefore cache refresh works differently.
Trying to use picture element
the actual image is probably invalid