krypton-byte / neonize

whatsapp automation library, written in python
http://krypton-byte.me/neonize/
Apache License 2.0
46 stars 10 forks source link

Can't send sticker with .webp extension #29

Open galihmrd opened 1 month ago

galihmrd commented 1 month ago

Logs:

app[worker.1]: Exception ignored on calling ctypes callback function: <bound method Event.execute of <neonize.events.Event object at 0x7fbe5f20f560>>
2024-05-28T21:04:06.840274+00:00 app[worker.1]: Traceback (most recent call last):
2024-05-28T21:04:06.840276+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/events.py", line 129, in execute
2024-05-28T21:04:06.840423+00:00 app[worker.1]:     self.list_func[code](binary, size)
2024-05-28T21:04:06.840456+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/events.py", line 149, in serialization
2024-05-28T21:04:06.840544+00:00 app[worker.1]:     f(self.client, event.FromString(ctypes.string_at(binary, size)))
2024-05-28T21:04:06.840574+00:00 app[worker.1]:   File "/app/main.py", line 39, in on_message
2024-05-28T21:04:06.840662+00:00 app[worker.1]:     message_handler(client, message)
2024-05-28T21:04:06.840686+00:00 app[worker.1]:   File "/app/src/modules/handler.py", line 51, in message_handler
2024-05-28T21:04:06.840744+00:00 app[worker.1]:     Func.tele_to_wa_sticker(client, msg)
2024-05-28T21:04:06.840768+00:00 app[worker.1]:   File "/app/src/modules/func.py", line 314, in tele_to_wa_sticker
2024-05-28T21:04:06.840892+00:00 app[worker.1]:     client.send_sticker(
2024-05-28T21:04:06.840902+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/client.py", line 733, in send_sticker
2024-05-28T21:04:06.841103+00:00 app[worker.1]:     self.build_sticker_message(file, quoted, name, packname),
2024-05-28T21:04:06.841328+00:00 app[worker.1]:     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-28T21:04:06.841337+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/client.py", line 683, in build_sticker_message
2024-05-28T21:04:06.841489+00:00 app[worker.1]:     img = Image.open(io_save)
2024-05-28T21:04:06.841597+00:00 app[worker.1]:           ^^^^^^^^^^^^^^^^^^^
2024-05-28T21:04:06.841619+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/PIL/Image.py", line 3339, in open
2024-05-28T21:04:06.842207+00:00 app[worker.1]:     raise UnidentifiedImageError(msg)
2024-05-28T21:04:06.842239+00:00 app[worker.1]: PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fbe5f3ef1f0>
krypton-byte commented 1 month ago

Are you sure that the file you want to turn into a sticker is an image file? According to your log, the Pillow library couldn't detect it as an image file.

galihmrd commented 1 month ago

Are you sure that the file you want to turn into a sticker is an image file? According to your log, the Pillow library couldn't detect it as an image file.

Yes, that's an image file, But when I send with the same code but with .webm extension, it works

galihmrd commented 1 month ago

Are you sure that the file you want to turn into a sticker is an image file? According to your log, the Pillow library couldn't detect it as an image file.

Yes, that's an image file, But when I send with the same code but with .webm extension, it works

IMG_20240529_105558