ignacio-chiazzo/ruby_whatsapp_sdk

Support Image/webp

renatovico opened this issue · 2 comments

Describe the bug
When receive a image/webp (sticker eg) the download medias doesn't work

To Reproduce

  1. Send a sticker image
  2. Try download :)

Expected behavior
Download happened

Additional context

I Made a ugly monkey patch

WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES = WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES.dup
WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES.push("image/webp")
WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES.freeze


WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES = WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES.dup
WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES.push("image/webp")
WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES.freeze

and all worked :)

Hi! Thanks for reporting. We definitely need to add support for webp for stickers.

It's in the Whatsapp documentation too.

Screenshot 2023-07-23 at 7 15 24 PM

Do you want to open a PR for that? We need:

If not, I can write it. Thanks for reporting the issue!

of course i do!