开发者

Set image filename using Phonegap

开发者 https://www.devze.com 2023-04-02 15:02 出处:网络
I have begun putting together an application using phonegap. I have completed the core functionality whereas the user will be able to take a photo, the app will allow them to see some location data an

I have begun putting together an application using phonegap. I have completed the core functionality whereas the user will be able to take a photo, the app will allow them to see some location data and I would like to name the photo based off the location data rather than the default time stamp.

Is it possible to somehow change the filename that Android /开发者_JAVA百科 iOS will output their photos? Do I need to somehow rename the file after it is saved?


This post will get what you need to do as far as saving the file. Basically in add this code to your onsuccess for the take photo.

Android - Phonegap - How to get the file name of the picture taken

Also make sure that the destination type is file_uri or it will not work.

  var options = { quality: 50, destinationType: Camera.DestinationType.FILE_URI};
  navigator.camera.getPicture(onPhotoDataSuccess, onFail, options);
0

精彩评论

暂无评论...
验证码 换一张
取 消