You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to import any Telegram Sticker Pack with an animated sticker results in this error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/REDACTED/stickerpicker/.venv/bin/sticker-import", line 8, in
sys.exit(cmd())
^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 161, in cmd
asyncio.get_event_loop().run_until_complete(main(parser.parse_args()))
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 153, in main
await reupload_pack(client, pack, args.output_dir)
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 84, in reupload_pack
reuploaded_documents[document.id] = await reupload_document(client, document)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 36, in reupload_document
data, width, height = util.convert_image(data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/lib/util.py", line 28, in convert_image
image: Image.Image = Image.open(BytesIO(data)).convert("RGBA")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/PIL/Image.py", line 3498, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x74c06caf7600>
After quickly looking into the code, i think there may be a way to fix this.
Animated Telegram Stickers use the WEBM format which apparently isn't compatible with the image conversion library used here.
Maybe we can convert WEBM to another format like GIF with FFMpeg? Or maybe we can change the image conversion library to another one that supports WEBM.
Attempting to import any Telegram Sticker Pack with an animated sticker results in this error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/REDACTED/stickerpicker/.venv/bin/sticker-import", line 8, in
sys.exit(cmd())
^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 161, in cmd
asyncio.get_event_loop().run_until_complete(main(parser.parse_args()))
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 153, in main
await reupload_pack(client, pack, args.output_dir)
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 84, in reupload_pack
reuploaded_documents[document.id] = await reupload_document(client, document)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/stickerimport.py", line 36, in reupload_document
data, width, height = util.convert_image(data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/sticker/lib/util.py", line 28, in convert_image
image: Image.Image = Image.open(BytesIO(data)).convert("RGBA")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/stickerpicker/.venv/lib/python3.12/site-packages/PIL/Image.py", line 3498, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x74c06caf7600>
The sticker pack i tried is this one: https://t.me/addstickers/precure2
The text was updated successfully, but these errors were encountered: