BlueBubblesApp / bluebubbles-app

A cross-platform app ecosystem, bringing iMessage to Android, PC (Windows, Linux, & even macOS), and Web!
https://bluebubbles.app
Apache License 2.0
753 stars 103 forks source link

Handling .avif files #2499

Open devsfan1830 opened 1 year ago

devsfan1830 commented 1 year ago

The other day someone sent me an image file with the extension .avif. It arrived on the mac as an attachment and the bluebubbles app presented a blank bubble. Upon downloading the file, my phone cannot open it. MacOS however can open and view it. It seems android cannot read these files natively. Perhaps an on the fly conversion by the server is necessary. My friend likely saved the image off a website and sent it to me so I think this is a rarely used file type but I was asked to open a ticket for tracking. Let me know if I need to provide anything.

zlshames commented 1 year ago

Transferring this to the client app repo. This isn't a server issue, but rather, a phone/client issue. There is a plugin to view AVIF files using Flutter, so even if your phone can't view it, you'll be able to view it in the BB Android App:

https://pub.dev/packages/flutter_avif

As far as implementation goes on the client side, it seems pretty straightforward. It looks like we can just detect the file extension, and use AvifImage instead of the default Image class to load the image.