【问题标题】:Adobe Creative SDK - Web based image editorAdobe Creative SDK - 基于 Web 的图像编辑器
【发布时间】:2016-04-20 13:50:18
【问题描述】:

有人用过 Adob​​e Creative SDK 吗?我注册了我的网站并收到了 api 密钥并插入了我的网页。这非常简单,基本上是复制他们的示例并使用我自己的图像,除了我不断收到以下错误:

“加载提供给 'url' 配置键的图像 URI 时出现问题。请验证 URI 是否可公开访问,并且图像是受支持的格式。”

我没有运气检查 Adob​​e 网站,我正在使用一个 354 x 384 的小图像。

代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Aviary Test</title>

<!-- Load Feather code -->
<script type="text/javascript" src="http://feather.aviary.com/imaging/v3/editor.js"></script>

<!-- Instantiate Feather -->
<script type='text/javascript'>
var featherEditor = new Aviary.Feather({
apiKey: 'MY KEY',
theme: 'dark', // Check out our new 'light' and 'dark' themes!
tools: 'all',
appendTo: '',
onSave: function(imageID, newURL) {
    var img = document.getElementById(imageID);
    img.src = newURL;
},
onError: function(errorObj) {
    alert(errorObj.message);
}
});
function launchEditor(id, src) {
featherEditor.launch({
    image: id,
    url: src
});
return false;
}
</script>

</head>

<body>

<div id='injection_site'></div>

<img id='image1' src='desert.jpg'/>

<!-- Add an edit button, passing the HTML id of the image and the public URL of the image -->
<p><input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('image1', 'Desert.jpg');" /></p>

</body>
</html>

【问题讨论】:

    标签: html adobe


    【解决方案1】:

    我也有同样的问题。

    一切正常,但是当您尝试从其他位置加载图像时,您会收到“加载提供给 'url' 配置键的图像 uri 时出现问题”错误。

    我的网站如下所示:

    • full(全尺寸图片文件夹)
    • 拇指(文件夹)
    • index.html

    你可以在这里看到错误:http://koffid.nl/memetests/sdk2/

    当您使用编辑照片按钮时,该按钮使用图像的外部 URL,它可以工作。 当您单击使用我的文件结构而不是按钮的图像时,会显示错误。

    所以这不起作用:

    &lt;img id='image1' src='thumb/feather_thumb.jpg' value='Edit photo' onclick="return launchEditor('image1', 'full/feather_default.jpg');" /&gt;&lt;/p&gt;

    这确实有效:

    &lt;p&gt;&lt;input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('image1', 'http://images.aviary.com/imagesv5/feather_default.jpg');" /&gt;&lt;/p&gt;

    【讨论】:

    • 这是预期的行为,只需使用 js 将您的域 + 路径附加到您的文件。
    【解决方案2】:

    你不能使用相对url,你需要传递图片的完整url,即。 http://example.com/images/myimage.jpg

    【讨论】:

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