문제 설명
Aviary/Creative SDK 이미지 편집기로 이미지 교체 (Replace image with Aviary/Creative SDK Image Editor)
저는 프로젝트에 Aviary 이미지 편집기를 사용하고 있습니다. 모든 것이 작동하지만 "저장" 버튼이 아닙니다.
현재 편집 이미지를 저장하거나 바꿀 수 없습니다. 열 수 있습니다.
지원은 실제로 도움이 되지 않으며 답변을 받는 데 몇 주가 걸립니다.
저는 표준 예시
참조 솔루션
방법 1:
Aviary replaced by the Creative SDK Image Editor
Please note that Aviary was acquired by Adobe in 2014 and is now part of The Creative SDK. All versions of Aviary are now outdated and have been replaced by the Creative SDK Image Editor.
Receiving the edited image
As you note, when you click Save, you will receive the edited image in the form of an Amazon URL. This link only exists on the Amazon server for 72 hours, so you will want to do something with it.
Replacing an img
element's source
As a basic example, you can use the returned Amazon URL to replace an image element's source inside of the Aviary.Feather
configuration object's onSave
method.
var featherEditor = new Aviary.Feather({
apiKey: '<YOUR_KEY_HERE>',
onSave: function(imageID, newURL) {
currentImage.src = newURL; // `currentImage` is a DOM image element
featherEditor.close();
},
onError: function(errorObj) {
console.log(errorObj.code);
console.log(errorObj.message);
console.log(errorObj.args);
}
});
Inside of onSave
, we're saying here to replace currentImage
's source with the newURL
that comes back from Amazon.
Somewhere in your script, you would need to define what this currentImage
is. For example, if you are using jQuery, you might write something like:
var currentImage = $('#editable‑image')[0];
Note that we use the 0th element here in order to get the actual DOM element, not the jQuery object.
This is just one example, but you could do it several ways.
Example repo
Have a look at this example repo using jQuery for further details.
(by stefjoe、Ash Ryan Arnwine)