Add ImageInfo to BaseCloseableImage
@@ -18,7 +18,9 @@ import javax.annotation.Nullable;
/** A simple wrapper around an image that implements {@link Closeable} */
@Nullsafe(Nullsafe.Mode.LOCAL)
-public abstract class BaseCloseableImage implements CloseableImage {
+public abstract class BaseCloseableImage implements CloseableImage, ImageInfo {
+ public static boolean sCreateImageInfo;
+
private Map<String, Object> mExtras = new HashMap<>();
/* Extras we want to set to the image */
@@ -86,6 +88,9 @@ public abstract class BaseCloseableImage implements CloseableImage {
@Override
public ImageInfo getImageInfo() {
+ if (!sCreateImageInfo) {
+ return this;
+ }
if (mCacheImageInfo == null) {
mCacheImageInfo =
new MutableImageInfo(getWidth(), getHeight(), getQualityInfo(), getExtras());
