【问题标题】:Aviary (Abode Creative SDK) and local developmentAviary(Abode Creative SDK)和本地开发
【发布时间】:2018-02-01 01:38:16
【问题描述】:

我一直在尝试从 localhost 编辑照片。我尝试用 base64 编码我的照片,但仍然失败。

考虑到 Aviary.Feather 已初始化并在生产中运行良好,这是我的代码示例:

var success = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD.....";
$("#imageEditor").attr("data-id", id);
$("#imageEditor").attr("src", success);
imageEditor.launch({
    image: "imageEditor",
    url: success,
    hiresUrl: success
});

它返回错误:

ERROR_SAVING_HI_RES:{code:18,message:"There was a problem saving your photo."}

【问题讨论】:

    标签: aviary adobecreativesdk


    【解决方案1】:

    这就是我在本地环境中设置 Aviary 图像编辑器插件的方式:

    <!DOCTYPE html>
    <html>
      <head>
        <title>Image Editor2</title>
      </head>
      <body>
        <!-- Load widget code -->
        <script type="text/javascript" src="http://feather.aviary.com/js/feather.js"></script>
        <!-- Instantiate the widget -->
        <script type="text/javascript">
    
          var featherEditor = new Aviary.Feather({
            apiKey: '1234567',
            apiVersion: 3,
            tools: ['draw', 'stickers'],
            onSave: function(imageID, newURL) {
              var img = document.getElementById(imageID);
              img.src = newURL;
            }
          });
    
          function launchEditor(id, src) {
            featherEditor.launch({
              image: id,
              url: src
            });
            return false;
          }
        </script>                         
    
        <!-- Add an edit button, passing the HTML id of the image
        and the public URL to the image -->
        <a href="#" onclick="return launchEditor('editableimage1','/goat.jpg');">Edit!</a>
        <!-- original line of HTML here: -->
        <img id="editableimage1" src="http://example.com/public/images/goat.jpg"/>
      </body>
    </html>
    

    参考

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-18
      • 2016-07-23
      • 1970-01-01
      • 1970-01-01
      • 2017-11-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多