mirror of
https://github.com/e1ven/Robohash.git
synced 2025-06-23 21:35:02 +00:00
allow webp
This commit is contained in:
parent
b1d1084798
commit
5d7895f5d2
@ -65,7 +65,7 @@ class Robohash:
|
|||||||
# We'll remove them from the string before hashing.
|
# We'll remove them from the string before hashing.
|
||||||
# This ensures that /Bear.png and /Bear.bmp will send back the same image, in different formats.
|
# This ensures that /Bear.png and /Bear.bmp will send back the same image, in different formats.
|
||||||
|
|
||||||
if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri')):
|
if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri','.webp')):
|
||||||
format_str = string[string.rfind('.') + 1:]
|
format_str = string[string.rfind('.') + 1:]
|
||||||
if format_str.lower() == 'jpg':
|
if format_str.lower() == 'jpg':
|
||||||
format_str = 'jpeg'
|
format_str = 'jpeg'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user