It seems that Bitmap compressions is making animated WEBP files static or something else that when I use them as animated stickers files I get an error from WhatsApp that there is a problem with this sticker pack. That error does not occur if I use static webp by setting the animated _sticker flag to false. Then those same animated WEBP files get accepted by WhatsApp as a static sticker pack. After looking at all codes I stuck in the method where WEBP get compressed and saved. I should confirm if those WEBP files still contain multiple frames. How to check the frame count or check if the file is animated or static after compressed/saved?
public static void Save(Bitmap bitmap1, String name1, String folder) {
File dir = new File(path + "/" + folder).mkdirs();
File file = new File(dir, name1);
if (file.exists())
file.delete();
try {
FileOutputStream ops = new FileOutputStream(file);
Bitmap1.compress(Bitmap.CompressFormat.WEBP, 90, ops);
ops.flush();
ops.close();
} catch (Exception e) {
e.printStackTrace();
}
}