@Override
  public AnimatedDrawableFrameInfo getFrameInfo(int frameNumber) {
    WebPFrame frame = getFrame(frameNumber);
    try {
      return new AnimatedDrawableFrameInfo(
          frameNumber,
          frame.getXOffset(),
          frame.getYOffset(),
          frame.getWidth(),
          frame.getHeight(),
          frame.isBlendWithPreviousFrame()
              ? BlendOperation.BLEND_WITH_PREVIOUS
              : BlendOperation.NO_BLEND,
          frame.shouldDisposeToBackgroundColor()
              ? DisposalMethod.DISPOSE_TO_BACKGROUND
              : DisposalMethod.DISPOSE_DO_NOT);
    } finally {
      frame.dispose();
    }
  }
Creates a {@link WebPImage} from a ByteBuffer containing the image. This will throw if it fails
to create.

@param byteBuffer the ByteBuffer containing the image
animated-webp/src/main/java/com/facebook/animated/webp/WebPImage.java