{ "id": "87018", "key": "TIMOB-8481", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-09-06T14:13:44.000+0000", "created": "2012-02-27T10:51:19.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "api" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-28T07:24:30.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": "h2. Problem\r\nReturned values relative to Width or Height of a blob representing an image, are 0.\r\n\r\nh2.Test Case\r\n{code:title=app.js|borderStyle=solid}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'gray'\r\n});\r\n\r\n\r\nTi.Media.openPhotoGallery({\r\n success: function(e) {\r\n alert('e.media.width:' + e.media.width +\r\n '\\n e.media.height:' + e.media.height +\r\n '\\n e.media.mimeType:' + e.media.mimeType);\r\n }\r\n});\r\n\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\nValues displayed: \r\nW/TiAPI ( 5241): e.media.height: 0\r\nW/TiAPI ( 5241): e.media.width: 0\r\nW/TiAPI ( 5241): e.media.mimeType: image/jpeg\r\n\r\nCustomer have opened a question on the developer q&a:\r\nhttp://developer.appcelerator.com/question/132278/timediaopenphotogallery-image-properties-on-android", "attachment": [], "flagged": false, "summary": "Android: blob representing an image has height and width properties always 0", "creator": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* OSX\r\n* Titanium SDK 1.8.1, 1.8.2, 2.0.0 CI\r\n* Android 2.3.4\r\n* V8 runtime", "comment": { "comments": [ { "id": "184558", "author": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I just tried the code in sdk version 2.0.0.v20120227100134 and the issue is still there.", "updateAuthor": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-28T16:31:57.000+0000", "updated": "2012-02-28T16:31:57.000+0000" }, { "id": "184840", "author": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ran the code above using the just released sdk 1.8.2. It still returns 0 for the blob height and width when the mime type is an image.", "updateAuthor": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-01T16:02:57.000+0000", "updated": "2012-03-01T16:02:57.000+0000" }, { "id": "185109", "author": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have a client waiting for an update to their application that I can't complete until this is working.", "updateAuthor": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-05T17:44:23.000+0000", "updated": "2012-03-05T17:44:23.000+0000" }, { "id": "188773", "author": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I've stumbled upon the exact same problem. The blob containing the image does have a size and a correct mime-type (image/jpeg), but the width and height are both equal to 0.\r\n\r\nEnvironment:\r\nAndroid 2.3.3\r\nV8 runtime\r\nTitanium SDK 1.8.2\r\nMac OS X 10.6.8\r\n\r\nI was unable to check this on an actual Android phone, but the Simulator suffered from this issue.\r\n\r\n", "updateAuthor": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-03-27T04:35:05.000+0000", "updated": "2012-03-27T04:35:05.000+0000" }, { "id": "189432", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-01T23:46:57.000+0000", "updated": "2012-04-01T23:46:57.000+0000" }, { "id": "189986", "author": { "name": "zpapp", "key": "zpapp", "displayName": "Zsombor Papp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Perhaps this goes without saying, but the problem is also present when the image data is simply loaded from a file.\r\n\r\nOn the other hand, the blob returned by the ImageFactory module's imageAsResized function does have the width/height set properly. It's probably a huge waste of resources, but I ended up using this function as a workaround. Did anyone find a lighter weight workaround?", "updateAuthor": { "name": "zpapp", "key": "zpapp", "displayName": "Zsombor Papp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T10:24:49.000+0000", "updated": "2012-04-05T10:24:49.000+0000" }, { "id": "190074", "author": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I haven't figured out a work around for this. Do you have some sample code for using the imageAsResized function to get the width/height?", "updateAuthor": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T15:16:10.000+0000", "updated": "2012-04-05T15:16:10.000+0000" }, { "id": "190081", "author": { "name": "zpapp", "key": "zpapp", "displayName": "Zsombor Papp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sample code:\r\n\r\n var ImageFactory = require('ti.imagefactory');\r\n var imageBlob = ImageFactory.imageAsResized(photoFile.read(), {});\r\n\r\nObviously photoFile.read() can be replaced with any blob holding image data; this is just my usecase (that second line used to be imageBlob = photoFile.read()).", "updateAuthor": { "name": "zpapp", "key": "zpapp", "displayName": "Zsombor Papp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T15:28:18.000+0000", "updated": "2012-04-05T15:28:45.000+0000" }, { "id": "190545", "author": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Thanks for the interim solution Zsombor! Unfortunately it crashes my app on our Android device (seems to be a problem with allocating memory). It runs perfectly in the Emulator though..\r\n\r\nI finally got my hands on a brand new Android device (HTC Wildfire S), running Android 2.3.3.\r\nI can now confirm that this problem occurs both when selecting photo's from the gallery and when making a new photo using the device's camera.\r\n\r\nI hope someone is going to give this problem some attention, because this problem makes uploading images from an Android phone near impossible!\r\n\r\n---\r\n\r\nQuick update: Using the compress-method from the ImageFactory didn't crash my device and also yielded a blob with width/height-properties.\r\n\r\nI currently use the following code:\r\nevent.media = ImageFactory.compress(event.media, 0.8);\r\n\r\nBtw: ImageFactory is a freely downloadable module, made by the Appcelerator team: https://marketplace.appcelerator.com/apps/1184/reviews", "updateAuthor": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-04-11T05:51:07.000+0000", "updated": "2012-04-11T08:35:53.000+0000" }, { "id": "190581", "author": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for the work around advice Zsombor and Ronald. I am able to get the dimensions of an image by using the ImageFactory compress method:\r\n\r\nvar img = ImageFactory.compress(event.media, 1.0);\r\n\r\nHopefully, this bug will get fixed soon and I can remove this work-around.\r\n", "updateAuthor": { "name": "dcash", "key": "dcash", "displayName": "Dan Cash", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-11T10:20:39.000+0000", "updated": "2012-04-11T10:20:39.000+0000" }, { "id": "195601", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested with 2.0.1GA2 on a Samsung Galaxy S2, issue still exists.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-05-22T10:50:07.000+0000", "updated": "2012-05-22T10:50:07.000+0000" }, { "id": "200362", "author": { "name": "deminetix", "key": "deminetix", "displayName": "Ash Connell", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank god, I spent 4 hours looking for a way to resize images and when I finally found ImageFactory and then couldn't get an image blobs' width, i was going to shoot myself.\r\n\r\nDan Cash's method works a charm:\r\n\r\nvar img = ImageFactory.compress(event.media, 1.0);", "updateAuthor": { "name": "deminetix", "key": "deminetix", "displayName": "Ash Connell", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T11:46:13.000+0000", "updated": "2012-06-26T11:46:13.000+0000" }, { "id": "217867", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can't reproduce on SDK version 3.0 with\r\nSamsung Galaxy S2 (AT&T) Android 2.3, or\r\nwith Samsung Galaxy S3 (Sprint) Android 4.0.", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-06T14:12:23.000+0000", "updated": "2012-09-06T14:12:23.000+0000" }, { "id": "217937", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Ash, Dan, Ronald, Zsombor - Please update this ticket if you can reproduce this issue with the latest release (master; 3.0.0).", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-06T21:11:11.000+0000", "updated": "2012-09-06T21:11:11.000+0000" }, { "id": "415921", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as I am unable to reproduce this issue with the following environment;\r\nPixel (7.1)\r\nMacOS 10.11.6 (15G31)\r\nStudio 4.8.1.201612050850\r\nTi SDK 6.0.3 GA\r\nAppc NPM 4.2.8\r\nAppc CLI 6.1.0\r\nTi CLI 5.0.11\r\nAlloy 1.9.5\r\nArrow 1.10.1\r\nXcode 8.2 (8C38)\r\nNode v4.6.0\r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-27T20:24:01.000+0000", "updated": "2017-03-27T20:24:01.000+0000" }, { "id": "448673", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "body": "This issue is happening again on SDK 8. Downloaded images always return height and width 0 when trying to access it through blob.height and blob.width.\r\n\r\nSeen on SDK 8.1.0.v20190510141905.", "updateAuthor": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2019-05-28T07:24:30.000+0000", "updated": "2019-05-28T07:24:30.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }