{ "id": "84848", "key": "TIMOB-8626", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "2012-01-12T23:59:22.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "tc-more-info" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:36.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem\r\n\r\nWhen reading a file using {{Ti.Filesystem.getFile()}}, followed by {{file.read()}}, the resultant TiBlob object will not be initialized as an image if the filename has a non-lowercase extension (e.g. {{image.JPG}}).\r\n\r\nTherefore, no image functions are usable (width, height, resize etc).\r\n\r\nh2. Test case\r\n\r\nInsert your test case here\r\n\r\nh2. Logs\r\n\r\nInsert any output or errors here\r\n\r\nh2. Proposed Solution\r\n\r\nIn Mimetypes.m, perform a lowercase conversion for the extension. However, I am not certain if there is a reason to keep case sensitivity for MIME type extensions.\r\n\r\n{code:lang=none}\r\n+ (NSString *)mimeTypeForExtension:(NSString *)ext\r\n{\r\n\t[Mimetypes initialize];\r\n\tNSString *result=[mimeTypeFromExtensionDict objectForKey:[[ext pathExtension] lowercaseString]];\r\n\tif (result == nil){\r\n\t\tresult = @\"application/octet-stream\";\r\n\t}\r\n\treturn result;\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Filesystem - TiBlob image Mimetype not correctly set when extension not lowercase", "creator": { "name": "munhon", "key": "munhon", "displayName": "MunHon Chan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "munhon", "key": "munhon", "displayName": "MunHon Chan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium Mobile 1.8.0.1\r\n* iOS - what version?\r\n", "comment": { "comments": [ { "id": "179326", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thanks for raising this ticket.\r\n\r\nIn order for me to escalate it to the core team, all the fields must be complete. Please check it against the [JIRA Ticket Checklist|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist], and add any missing information. For the description field, you can use [this template|https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template] as a starting point (simply copy and paste it).\r\n\r\nFurthermore, we must be able to reproduce the issue in order to accept it, and so a test case must be included and run without modification, as per the [Creating a Test Case|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase] section.\r\n\r\nThanks in advance for your cooperation.\r\n\r\nCheers", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-15T08:57:45.000+0000", "updated": "2012-01-15T08:57:45.000+0000" }, { "id": "179327", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thank you for including the solution in this ticket. Please see [How to Contribute Code|https://wiki.appcelerator.org/display/guides/How+to+Contribute+Code] to allow us to accept it.\r\nIf you have [signed the CLA|https://wiki.appcelerator.org/display/guides/How+to+Contribute+Code#HowtoContributeCode-SigningtheContributorsLicenseAgreement%28CLA%29], please add a comment containing your github user id.\r\n\r\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-15T09:05:18.000+0000", "updated": "2012-01-15T09:05:18.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }