Skip to content

Allow GIFs to be chosen on all API levels

akwizgran requested to merge allow-gifs into master

This branch allows GIFs to be chosen as image attachments and profile pictures on all API levels. Previously they were only allowed on API >= 24. As far as I can tell, this was meant to work around a platform bug in BitmapFactory.decodeStream() that meant GIFs weren't scaled as requested when loading them into bitmaps. However, I've tested that the image compression code can compress large GIFs despite this bug without causing an OOM. I did manage to create a 2000 * 2000 pixel GIF that couldn't be compressed to 32 KB, but this was handled safely in the same way as an invalid image, without an OOM.

On all API levels, our current image compression code converts animated GIFs into static images. This probably isn't what users want, but I think it's better than not letting them choose animated or static GIFs at all.

Merge request reports