深夜,在我的系绳尽头:
结合 Creative SDK 编辑通过工作流程中的上一页上传到服务器的照片 -
我已经尝试了 SDK 文档中的每一个参数,以找出保持加载的图像处于活动状态以进行预览编辑的故障所在,但按顺序,
- 插件初始化(onLoad -> Ok)
- 图像加载(onReady -> Ok)
- 等待图标旋转,然后
- 图像从编辑窗口消失
onError() 没有选择这个。
编辑正在运行,onSave() 触发,我可以将图像(通过 AJaX 发送 adobe URL)复制到我的网站空间上的指定位置(文件输出),但是没有实时预览。此外,图像不会像我的脚本中硬编码的那样更新原始图像,并且它会给出一个错误,就像关闭时未保存(isDirty)一样。
我的网站空间覆盖了 SSL 证书,但尝试通过 http 和 https - nada 加载具有相对和绝对 URL 的图像。
我根据文档调用版本 3,但人们说尝试版本 4.3.1.29 ..?
我想用这个编辑器进行实时图像编辑,但只需要它来进行裁剪、调整亮度、对比度、旋转等,目前它正在工作,但是“盲目”——有人遇到过这个吗?我该如何解决它......?:)
这是源代码,几乎与文档中指定的一样,但在“onSave()”时使用了有效的 AJaX 调用:
<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',
displayImageSize: 'true',
appendTo: '',
onSave: function(imageID, newURL) {
var img = document.getElementById("image1");
img.src = newURL;
var ph = document.getElementById("new_image_placeholder_div");
ph.innerHTML = '<img src="'+img.src+'" height="100">';
var xmlhttp_c;
if (window.XMLHttpRequest){xmlhttp_c=new XMLHttpRequest();} else {
xmlhttp_c=new ActiveXObject("Microsoft.XMLHTTP");}
alert("Passing the URL "+newURL+" to the PHP page...");
xmlhttp_c.open("GET", "feather_save_handler.php?newURL="+encodeURI(newURL), true);
xmlhttp_c.onreadystatechange=function() { if (xmlhttp_c.readyState==4 && xmlhttp_c.status==200) {
alert(xmlhttp_c.responseText);
alert("Saved!");
} else {
}
}
xmlhttp_c.send();
// end save AJaX call..
},
onError: function(errorObj) {
alert(errorObj.args);
}
});
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
</script>
该功能从表单按钮启动:
<form name="feather_editor" onSubmit="no_submit();">
<input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('image1', 'http://mywebsitename.com/image_name.jpg');" >
</form>