[AC-5740] openPhotoGallery - in some devices the returned image stream nativepath is empty (question)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Done |
Resolution Date | 2018-05-17T09:39:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | media, question |
Reporter | boaz@e-drivetech.com |
Assignee | Rene Pot |
Created | 2018-05-17T08:05:52.000+0000 |
Updated | 2018-05-18T01:08:01.000+0000 |
Description
SDK version 5.5 (cant upgrade to a new version)
openPhotoGallery api
Is there a recommended way to get the file extension from the retunded e.media stream of data?
Extensions are unreliable. You should check the mimetype. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Blob-property-mimeType Since this is more of a question than a bug, I'm going to resolve this issue right away also, unless you think there really is a bug then I can reopen it. ps: I recommend asking the community these kind of questions. There is a slack community on tislack.org and stackoverflow is a good go-to as well when using the titanium tag.
Rene is correct. You can't rely on
nativePath
. Especially if the photo comes from the cloud, because we don't have direct file access to the photo... because it might not be stored on SD. Fetching themimeType
property is the way to go.