{"error ":["无效的图像URL"]}与任意集成

{"errors":["Invalid image URL"]} with aviary integration

本文关键字:quot 集成 URL 任意 无效 error 图像      更新时间:2023-09-26

我正在与Aviary进行图像编辑集成。下面是html代码

<body>
 <a href="#" onclick="return launchEditor('editableimage1','http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg');">
 <img id="editableimage1" src="http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg"/></a>
    <br>
    <form id="myform" action="" method="post">
<input id="hf" type="hidden" name="url">
<input type="submit" value="Save" />
</form>
<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,
         theme: 'light',
        tools: ['draw','text'],
        onSave: function(imageID, newURL) {
            var img = document.getElementById(imageID);
            img.src = newURL;
            console.log('newURL '+newURL);
            document.getElementById("hf").value=newURL;
            featherEditor.close();
            //document.forms["myform"].submit();
        }
    });
    function launchEditor(id, src) {
        featherEditor.launch({
            image: id,
            url: src
        });
        return false;
    }
</script>                         
 </body>

打开上面的html:

  1. 将渲染图像
  2. 点击图片后,图像编辑工具将打开并显示图片。

但是如果我将url替换为任何其他图像url比如http://ipaddress:8080/ImageCheck/imgjsp.jsp它实际上在浏览器中呈现图像

  1. 图像将被渲染。
  2. 单击图像,图像编辑工具立即打开并关闭,错误为{"errors":["Invalid image URL"]}。工具无法从我的UrL获取图像到其服务器进行编辑。

"http://ipaddress:8080/ImageCheck/imgjsp.jsp"answers"http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg"之间的区别是什么使工具的行为不同?感谢您的帮助

我们也得到了同样的错误,我做了一些搜索,发现了这个:https://creativesdk.zendesk.com/hc/en-us/articles/202903359-Migrating-from-the-Aviary-SDK-to-the-Adobe-Creative-SDK-Beta

看起来Aviary已经更新了他们的API

是http://ipaddress:8080/ImageCheck/imgjsp.jsp指向本地ip?根据https://creativesdk.adobe.com/docs/web/#/articles/gettingstarted/index.html, "要求该位置的图像是公开可用的,因为我们的服务器必须下载它。"。

另一方面,我们可以传递base64编码的图像作为url参数的值。这样,就不需要先存储实际的图像。(当使用高分辨率版本的Aviary图像工具时,这种方法不适合我们)。