{ "id": "174969", "key": "TIMOB-27872", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-08-11T13:13:50.000+0000", "created": "2020-04-29T16:21:18.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "blob", "exif", "jpeg", "orientation" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-08-11T13:13:50.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nWhen a Titanium blob references a non-file type, such as a byte buffer or \"content://\" URL, then the blob's {{imageAs*()}} methods will ignore a JPEG's EXIF orientation setting.\r\n\r\nThis affects the following methods:\r\n* {{Blob.imageAsCropped()}}\r\n* {{Blob.imageAsResized()}}\r\n* {{Blob.imageAsThumbnail()}}\r\n* {{Blob.imageWithAlpha()}}\r\n* {{Blob.imageWithRoundedCorner()}}\r\n* {{Blob.imageWithTransparentBorder()}}\r\n\r\n*Steps to reproduce:*\r\n# Build the attached [^DownloadImageBlobTest.js] on Android.\r\n# Tap on the \"Download\" button. (Requires Internet access.)\r\n# Tap on \"JPEG - EXIF Rotate 90\" in option dialog.\r\n# Notice that the displayed resized image is not upright. (This is the bug.\r\n# Do the same with all of the other \"EXIF\" options in the dialog. They all have this issue.\r\n", "attachment": [ { "id": "67353", "filename": "DownloadImageBlobTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-02T01:07:16.000+0000", "size": 2688, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Blob imageAsX() methods ignore EXIF orientation if not wrapping a file", "creator": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MacOS Catalina: 10.15.5 Beta\r\nXcode: 11.4\r\nJava Version: 1.8.0_131\r\nAndroid NDK: 21.1.6273396-beta2\r\nNode.js: 10.16.3\r\n\"\"NPM\":\"5.0.0-1\",\"CLI\":\"8.0.0-master.10\"\"\r\nPixel Xl 10.0", "closedSprints": [ { "id": 1194, "state": "closed", "name": "2020 Sprint 9", "startDate": "2020-04-24T17:09:51.572Z", "endDate": "2020-05-08T17:09:00.000Z", "completeDate": "2020-05-08T15:40:07.869Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455307", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It's an issue with blobs that do *not* wrap a file system path. That is, blobs which wrap a \"content://\" URL (like in above test case) or when the blobs wraps an in-memory image.\r\n\r\n*Solution:*\r\nIn our {{TiBlob.java}} code, we have method calls to {{TiImageHelper.getOrientation()}} which fetch the EXIF orientation from a JPEG. Instead of passing a file path to it, we should pass an {{InputStream}} to it instead.\r\nhttps://github.com/jquick-axway/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-29T19:04:31.000+0000", "updated": "2020-04-29T19:04:31.000+0000" }, { "id": "455330", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Below is [~smohammed]'s original ticket summary. Th below can reproduce this issue when taking a camera shot on a Pixel XL device and then calling {{imageAsResized()}}. Not all devices can reproduce it this way though since some camera will always save the photo in the upright position... and some won't and will write the orientation to the JPEG's EXIF data instead.\r\n\r\n*+Test Case:+*\r\n*index.js*\r\n{code:java}\r\n_.delay(function() {\r\n\tTitanium.Media.showCamera({\r\n\t\tsuccess: function(e) {\r\n\t\t\tvar start = new Date().getTime();\r\n\t\t\tvar blob = e.media;\r\n\t\t\tvar w = e.media.width;\r\n\t\t\tvar h = e.media.height;\r\n\t\t\tvar r = h / w;\r\n\t\t\tw = 350;\r\n\t\t\th = 300;\r\n\t\t\tblob = blob.imageAsResized(w, h);\r\n\t\t\t$.img.image = blob;\r\n\t\t\tvar end = new Date().getTime();\r\n\t\t\tconsole.log(end - start);\r\n \r\n\t\t\tconsole.log(e.media.width, e.media.height);\r\n\t\t\tconsole.log(blob.width, blob.height);\r\n\t\t},\r\n\t\tcancel: function() {},\r\n\t\terror: function(error) {},\r\n\t\tmediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n}, 4000);\r\n \r\n$.index.open();\r\n{code}\r\n\r\n*index.xml*\r\n{code:java}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\n*Test Steps*\r\n# Download SDK version 9.0.2.GA\r\n# Create an alloy application\r\n# Copy the test case above \r\n# Make sure camera permissions are enabled\r\n# Run the application on a Pixel XL\r\n# Take a picture in portrait mode \r\n# Check log for the orientation (width, height) \r\n\r\n*Expected result*\r\nConsole should log the correct orientation (350, 300) in this case\r\n\r\n*Actual result*\r\nThe orientation is flipped and displayed as (300, 350)", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-02T01:14:57.000+0000", "updated": "2020-05-02T01:14:57.000+0000" }, { "id": "455331", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11679", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-02T01:39:14.000+0000", "updated": "2020-05-02T01:39:14.000+0000" }, { "id": "455518", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-20T03:15:55.000+0000", "updated": "2020-05-20T03:15:55.000+0000" }, { "id": "455533", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.1.0 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-05-21T12:34:06.000+0000", "updated": "2020-05-21T12:34:06.000+0000" }, { "id": "456405", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Improvement verified in SDK version {{9.1.0.v20200810120239}}.\r\n\r\n*Test and other information can be found at:*\r\nhttps://github.com/appcelerator/titanium_mobile/pull/11679", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-11T13:13:41.000+0000", "updated": "2020-08-11T13:13:41.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }