Problem
When 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
).
Therefore, no image functions are usable (width, height, resize etc).
Test case
Insert your test case here
Logs
Insert any output or errors here
Proposed Solution
In 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.
+ (NSString *)mimeTypeForExtension:(NSString *)ext
{
[Mimetypes initialize];
NSString *result=[mimeTypeFromExtensionDict objectForKey:[[ext pathExtension] lowercaseString]];
if (result == nil){
result = @"application/octet-stream";
}
return result;
}
Thanks for raising this ticket. In 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). Furthermore, 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. Thanks in advance for your cooperation. Cheers
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. If 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. Thank you