首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Tizen Web应用程序中使用Exif API

如何在Tizen Web应用程序中使用Exif API
EN

Stack Overflow用户
提问于 2017-05-16 04:16:18
回答 1查看 89关注 0票数 0

为了处理垂直显示的图像,我使用[exifInfo.orientation = "ROTATE_XXX";]exifInfo属于Exif API。如何在Exif API中使用Tizen Web Application?,而我单击“有关如何使用Exif的更多信息,请参见Exif指南”。在developer.tizen.org/ko/development/api-references/web-application上,这个页面什么也没有显示。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-16 08:54:12

Tizen使您能够访问和修改JPEG文件中的EXIF信息。Exif API对于Tizen移动和可穿戴配置文件都是强制性的,这意味着它支持所有的移动和可穿戴。设备。Tizen模拟器支持所有强制性API。

使用:

代码语言:javascript
复制
    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中添加这些特权

代码语言:javascript
复制
<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"/>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43992384

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档