@Nullable
  private Pair<Integer, Integer> readWebPImageSize() {
    final InputStream stream = getInputStream();
    if (stream == null) {
      return null;
    }

    final Pair<Integer, Integer> dimensions = WebpUtil.getSize(stream);
    if (dimensions != null) {
      mWidth = dimensions.component1();
      mHeight = dimensions.component2();
    }
    return dimensions;
  }
We get the size from a WebP image
imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/EncodedImage.java