1

How save the animated WebP Image into Android local storage?. I Wrote code to download webp images to Android local storage it is working fine to download static webp images but the problem comes into the picture when I tried to download the animated webp image. Only the first frame from the image gets saved

public void saveImage(Bitmap finaBitmap, String name, String identifier) {
    String root = rootPath + File.separator + identifier;
    File myDir = new File(root);
    myDir.mkdirs();
    File file = new File(myDir, name);
    if (file.exists()) file.delete();
    try {
        FileOutputStream out = new FileOutputStream(file);
        finalBitmap.compress(Bitmap.CompressFormat.WEBP, 90, out);
        out.flush();
        out.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Jz Another Dev
  • 123
  • 2
  • 10

0 Answers0