{ "id": "81139", "key": "TIMOB-5443", "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": "12081", "description": "", "name": "Sprint 2011-41", "archived": true, "released": true, "releaseDate": "2011-10-17" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-10-14T14:50:30.000+0000", "created": "2011-10-05T12:08:04.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "attachment", "bug", "email", "emaildialog", "image", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-02T22:20:46.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3.Problem\r\nWhile sending the image files as a attachment using EmailDialog the receive image is empty. \r\n\r\nh3.Reproducible Steps\r\n1. Execute the project that was attached\r\n2. Install the application to some iOS device\r\n3. Send an email to you\r\n4. Check your inbox - the image received is empty\r\n\r\nh3.Sample Code\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nwin1.open();\r\nvar emailDialog = Titanium.UI.createEmailDialog();\r\n\r\nemailDialog.subject = 'Take a look at this great app I found!';\r\n\r\nemailDialog.toRecipients = [];\r\n\r\nemailDialog.messageBody = \"u\";\r\n\r\nvar f = Ti.Filesystem.getFile('off.png');\r\n\r\n\r\nif(f.exists())\r\n\r\n{\r\n\r\nemailDialog.addAttachment(f);\r\n\r\n}\r\n\r\nelse\r\n\r\n{\r\n\r\nemailDialog.messageBody = \"test\";\r\n\r\n}\r\n\r\nemailDialog.open();\r\n{code}\r\n\r\nh3.Associated HelpDesk Ticket\r\nhttp://appc.me/c/APP-353882", "attachment": [ { "id": "23325", "filename": "emaildialog.zip", "author": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-05T12:08:04.000+0000", "size": 2877242, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: EmailDialog not sending attachments", "creator": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 4.3, SDK 1.7.2 and 1.8.0.v20110915133349", "comment": { "comments": [ { "id": "169248", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is not a problem on our SDK, This happens as the PNG files in the resources folder are being transfered to iOS device ,the build process compresses the file for optimization and as a result of which any PNG file in the app's resources folder that you may send as a email attachment won't show up on a computer , but can be seen through any iOS device. \r\n\r\nNOTE : THIS ONLY HAPPENS FOR PNG FILES AND NO OTHER TYPES OF FILE HAVE ANY PROBLEM ... AND HAPPENS FOR PNG FILES SHIPPED ALONG WITH THE APP, IT SHOULDN'T CREATE A PROBLEM IF YOU ARE TYRING TO SEND A PNG FILE FROM THE PHOTO LIBRARY INSIDE THE PHONE. \r\n", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-13T13:38:59.000+0000", "updated": "2011-10-14T09:39:08.000+0000" }, { "id": "169295", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "blog post that explains the whole process . http://iphonedevelopment.blogspot.com/2008/10/iphone-optimized-pngs.html", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-14T09:10:49.000+0000", "updated": "2011-10-14T09:10:49.000+0000" }, { "id": "169298", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Further commentary: To turn off the png compression would be a speed hit to the app in general, possibly to file size as well, and is generally frowned upon. Emailing resources that were compiled into the app is the exception, not the norm.\r\n\r\nSolutions:\r\n1) Save the png under a different extension so it doesn't get compressed at build time\r\n2) Use a different file type\r\n3) Open the png, resize it to itself, and save the new, uncompressed image and send that.\r\n\r\nAll of these solutions to this odd edge case can be done completely in javascript.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-14T09:45:55.000+0000", "updated": "2011-10-14T09:45:55.000+0000" }, { "id": "169324", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "//workaround code :\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nwin1.open();\r\n\r\nvar emailDialog = Titanium.UI.createEmailDialog();\r\n\r\nemailDialog.subject = 'Take a look at this great app I found!';\r\nemailDialog.toRecipients = [];\r\nemailDialog.messageBody = \"u\";\r\n\r\n//var f = Ti.Filesystem.getFile('off.png'); <- Remove this line\r\n\r\nvar file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'convert.PNG'); //<-- insert\r\nfile.write(Ti.UI.createImageView({image:'off.PNG',}).toImage()); //<-- insert\r\n\r\nif(f.exists())\r\n{\r\n emailDialog.addAttachment(f);\r\n}\r\nelse\r\n{\r\n emailDialog.messageBody = \"test\";\r\n}\r\nemailDialog.open();\r\n", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-14T14:36:33.000+0000", "updated": "2011-10-14T14:36:33.000+0000" }, { "id": "169325", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a known issue with the way Apple preprocesses PNG files for inclusion into an app. Use the workaround in the ticket for png files from the Resources directory.", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-14T14:50:30.000+0000", "updated": "2011-10-14T14:50:30.000+0000" }, { "id": "408591", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-02T22:20:46.000+0000", "updated": "2017-03-02T22:20:46.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }