Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5740] openPhotoGallery - in some devices the returned image stream nativepath is empty (question)

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDone
Resolution Date2018-05-17T09:39:06.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsmedia, question
Reporterboaz@e-drivetech.com
AssigneeRene Pot
Created2018-05-17T08:05:52.000+0000
Updated2018-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?

Comments

  1. Rene Pot 2018-05-17

    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.
  2. Joshua Quick 2018-05-18

    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 the mimeType property is the way to go.

JSON Source