diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java b/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java index d07f45c9f30..18832fab85a 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java @@ -59,6 +59,7 @@ public class TiBlob extends KrollProxy private int height; private int uprightWidth; private int uprightHeight; + private Object rotation; // This handles the memory cache of images. private final TiBlobLruCache mMemoryCache = TiBlobLruCache.getInstance(); @@ -74,6 +75,7 @@ private TiBlob(int type, Object data, String mimetype) this.height = 0; this.uprightWidth = 0; this.uprightHeight = 0; + this.rotation = KrollRuntime.UNDEFINED; } /** @@ -239,6 +241,7 @@ public void loadBitmapInfo() this.height = opts.outHeight; int rotation = getImageOrientation(); + this.rotation = rotation; if ((rotation == 90) || (rotation == 270)) { this.uprightWidth = opts.outHeight; this.uprightHeight = opts.outWidth; @@ -411,6 +414,12 @@ public int getUprightWidth() return this.uprightWidth; } + @Kroll.getProperty + public Object getRotation() + { + return this.rotation; + } + @Kroll.getProperty public int getSize() { diff --git a/apidoc/Titanium/Blob.yml b/apidoc/Titanium/Blob.yml index 1a11dc10039..9e3fbd8c6c3 100644 --- a/apidoc/Titanium/Blob.yml +++ b/apidoc/Titanium/Blob.yml @@ -142,6 +142,13 @@ properties: since: {android: "7.2.0", iphone: "0.9.0", ipad: "0.9.0", macos: "9.2.0"} permission: read-only + - name: rotation + type: Number + summary: EXIF rotation of the image if available. Can be `undefined` if no orientation was found. + platforms: [android] + since: {android: "12.3.0"} + permission: read-only + methods: - name: toString returns: