{ "id": "170364", "key": "TIMOB-25527", "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": null, "resolutiondate": null, "created": "2017-11-17T12:40:44.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2017-11-30T15:27:19.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "\r\nThe Sample Code is here: https://www.dropbox.com/s/j0duneeypnzk3z8/AndroidPictureToImageBug.zip?dl=0\r\n\r\nIn Android, using Titanium 6.3.0, I cannot toImage an ImageView with an image blob set. I was able to do this in versions prior to 6.3.0. I have attached the sample code.\r\n\r\nThe end result of the code should be a watermarked camera image. When the toImage() result of the below function is set to the image attribute of an ImageView on the index.xml, the appear appears white or gray with a distorted Label.\r\n\r\n\r\nfunction getViewWithLogoOverlay_Android(imgCompressedBlob)\r\n{\r\n\t//create image with EZSmiles logo\r\n\tvar imgView = Ti.UI.createImageView();\r\n\timgView.width = Ti.UI.FILL;\r\n\timgView.height = Ti.UI.FILL;\r\n\timgView.image = imgCompressedBlob;\r\n\timgView.defaultImage = imgCompressedBlob;\r\n\timgView.backgroundColor = 'transparent';\r\n\t\r\n\timgView.addEventListener(\"load\", function() {\r\n\t\t\r\n\t\tconsole.log(\"helllooooo HELLLOOOOO\");\r\n\t\t\r\n\t}); \r\n\t\r\n\tvar imgLogo1 = Ti.UI.createLabel();\r\n\timgLogo1.color = \"#e2e2e2\";\r\n\timgLogo1.opacity = .5;\r\n\timgLogo1.text = \"Powered By\";\r\n\timgLogo1.font = {\r\n\t\tfontFamily: 'Nunito-Regular',\r\n\t\tfontSize: 12\r\n\t};\r\n\t\r\n\tvar imgLogo = Ti.UI.createLabel();\r\n\timgLogo.color = \"#e2e2e2\";\r\n\timgLogo.opacity = .5;\r\n\timgLogo.text = \"EZSmiles\";\r\n\timgLogo.font = {\r\n\t\tfontFamily: 'Nunito-Regular',\r\n\t\tfontSize: 24\r\n\t};\r\n\t\r\n\tvar imgViewColl = Ti.UI.createView();\r\n\timgViewColl.width = Ti.UI.SIZE;\r\n\timgViewColl.height = Ti.UI.SIZE;\r\n\timgViewColl.layout = \"vertical\";\r\n\timgViewColl.left = \"10%\";\r\n\timgViewColl.top = \"75%\";\r\n\timgViewColl.add(imgLogo1);\r\n\timgViewColl.add(imgLogo);\r\n\t\r\n\t\r\n\tvar templateView = Ti.UI.createView();\r\n\ttemplateView.width = \"100%\";\r\n\ttemplateView.height = \"100%\";\r\n\t\r\n\ttemplateView.add(imgView);\r\n\ttemplateView.add(imgViewColl);\r\n\t\r\n\treturn templateView.toImage();\r\n}\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "ANDROID - Camera picture blob ImageView toImage", "creator": { "name": "jjoseph", "key": "jjoseph", "displayName": "Johnson Joseph", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jjoseph", "key": "jjoseph", "displayName": "Johnson Joseph", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Axway Appcelerator Studio, build: 4.10.0.201709271713\r\n(c) Copyright 2017 by Axway. All Rights Reserved.\r\n\r\nBuild: jenkins-appcelerator-studio-titanium_studio-master-60 (master)\r\nDate: 27 September 2017, 17:13:33\r\n\r\n\r\nAppcelerator Command-Line Interface, version 6.3.0\r\nCopyright (c) 2014-2017, Appcelerator, Inc. All Rights Reserved.\r\n\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.12.6\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 16.0GB\r\n\r\nNode.js\r\n Node.js Version = 6.10.3\r\n npm Version = 3.10.10\r\n\r\nAppcelerator CLI\r\n Installer = 4.2.10\r\n Core Package = 6.3.0\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\n node-appc Version = 0.2.41\r\n\r\nTitanium SDKs\r\n 6.3.0.v20171018084007\r\n Version = 6.3.0\r\n Install Location = /Users/johnsonjoseph/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.v20171018084007\r\n Platforms = iphone, android, mobileweb\r\n git Hash = ffd91bc\r\n git Timestamp = 10/18/2017 15:46\r\n node-appc Version = 0.2.43\r\n 6.3.0.GA\r\n Version = 6.3.0\r\n Install Location = /Users/johnsonjoseph/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA\r\n Platforms = iphone, android, mobileweb\r\n git Hash = 3620088\r\n git Timestamp = 11/1/2017 01:20\r\n node-appc Version = 0.2.43\r\n\r\n\r\n", "comment": { "comments": [ { "id": "431121", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~jjoseph] Hello! Have you had any trouble with the same code on iOS after switching SDK versions ?", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-11-21T19:13:20.000+0000", "updated": "2017-11-21T19:13:34.000+0000" }, { "id": "431122", "author": { "name": "jjoseph", "key": "jjoseph", "displayName": "Johnson Joseph", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No, I don't. It works properly in iOS in 6.3.0", "updateAuthor": { "name": "jjoseph", "key": "jjoseph", "displayName": "Johnson Joseph", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-21T19:20:44.000+0000", "updated": "2017-11-21T19:21:09.000+0000" }, { "id": "431160", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~jjoseph] Recent changes for layout handling (in 6.2.0) have caused that. It is a conflict between the templateView and ImgView dimensions - both have relative values and templateView does not have a parent to use as a base. Workaround for that would be to set the dimensions of imgView to:\r\n{code:java}\r\nvar imgView = Ti.UI.createImageView();\r\nimgView.width = Ti.UI.SIZE;\r\nimgView.height = Ti.UI.SIZE;\r\n{code}\r\nso they are based on the content of the image source.\r\nLet me know if that works out for you. ", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-11-22T12:49:51.000+0000", "updated": "2017-11-22T12:49:51.000+0000" }, { "id": "431165", "author": { "name": "jjoseph", "key": "jjoseph", "displayName": "Johnson Joseph", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This worked! Thank you for the quick response on this. Very much appreciated.", "updateAuthor": { "name": "jjoseph", "key": "jjoseph", "displayName": "Johnson Joseph", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-22T15:55:16.000+0000", "updated": "2017-11-22T15:55:16.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }