Summary
I have a database with a bunch of images stored as LONGBLOB (MySQL). I’d like to display those images via st.image() without storing them locally. I’ve Googled stuff here and there and came to the conclusion that BytesIO and TIL must be used, but I couldn’t get along with those libraries, really…
Additional info
I tried to query the image from the database and stupidly pass it (that is <class ‘bytes’> data type) directly to the st.image(), which resulted in the following error:
UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000002432FCF03B0>
I, then, tried to use TIL and its Image.open() function and that didn’t work out either…
AttributeError: 'bytes' object has no attribute 'read'
Looking for help!