为了处理垂直显示的图像,我使用[exifInfo.orientation = "ROTATE_XXX";]。exifInfo属于Exif API。如何在Exif API中使用Tizen Web Application?,而我单击“有关如何使用Exif的更多信息,请参见Exif指南”。在developer.tizen.org/ko/development/api-references/web-application上,这个页面什么也没有显示。
发布于 2017-05-16 08:54:12
Tizen使您能够访问和修改JPEG文件中的EXIF信息。Exif API对于Tizen移动和可穿戴配置文件都是强制性的,这意味着它支持所有的移动和可穿戴。设备。Tizen模拟器支持所有强制性API。
使用:
var fileURI = "";
var myNewExif = new tizen.ExifInformation();
function getSuccess(exifInfo)
{
console.log(exifInfo.orientation);
console.log(exifInfo.userComment);
console.log(exifInfo.gpsLocation);
}
function resolveSuccess(file)
{
fileURI = file.toURI();
console.log("Successfully resolved file: " + file.toURI());
function onSaveSuccess()
{
console.log("Successfully saved EXIF information to JPEG file");
}
function onSaveError(error)
{
console.log("Error occurred:" + error.name + " with message:" + error.message);
}
myNewExif.uri = file.toURI();
myNewExif.orientation = "ROTATE_90";
myNewExif.userComment = "Photo taken on Golden Bridge in Sanfrancisco";
myNewExif.gpsLocation = new tizen.SimpleCoordinates(50.086447, 14.411856);
tizen.exif.saveExifInfo(myNewExif, onSaveSuccess, onSaveError);
tizen.exif.getExifInfo(fileURI, getSuccess);
}
function resolveFail(error)
{
console.log("resolve() error occurred: " + error.name + " with message: " + error.message);
}
tizen.filesystem.resolve("images/image1.jpg", resolveSuccess, resolveFail);在config.xml中添加这些特权
<tizen:privilege name="http://tizen.org/privilege/content.read"/>
<tizen:privilege name="http://tizen.org/privilege/content.write"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>https://stackoverflow.com/questions/43992384
复制相似问题