mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-20 13:28:20 +02:00
* Use material avatar in timeline avatar * Load default profile image from static file * Include base64 image in squeak display entry response * Got default profile image working
12 lines
302 B
Python
12 lines
302 B
Python
import base64
|
|
|
|
from pkg_resources import resource_stream
|
|
|
|
|
|
def load_default_profile_image():
|
|
return resource_stream(__name__, 'default_profile_image.jpg').read()
|
|
|
|
|
|
def bytes_to_base64_string(data: bytes) -> str:
|
|
encoded_string = base64.b64encode(data)
|
|
return encoded_string.decode('utf-8')
|