首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >禽鸟图片编辑器hack

禽鸟图片编辑器hack
EN

Stack Overflow用户
提问于 2013-01-16 05:18:12
回答 1查看 4.9K关注 0票数 3

我正在使用鸟类照片编辑器,我希望用户使用自己的照片,而不是编写PHP。因此,我创建了一个代码,以便用户放置图像的url,然后他们可以在那里编辑它,代码是

代码语言:javascript
复制
$(function() {
 $('#imgsrc').hide();
  $('#edit').hide();
$('#sub_img').click(function(e) {
  e.preventDefault();
     var grant= $('#photo_url').val();
   $('#imgsrc').attr('src', grant).show();
   $('#edit').show();
 });
});

尽管我得到了这个错误

There was a problem loading your image provided by URI to theurlconfig key. Either you typed the address wrong, it's not reachable by the public (and our service at http://featherservices.aviary.com/), or it doesn't really exist. Or maybe YOU don't and this is all just a dream. WAKE UP!

Aviary的代码是

代码语言:javascript
复制
<div id="photo_edit">
 <!-- Load Feather code -->
  <script type="text/javascript" src="http://feather.aviary.com/js/feather.js"></script>
 <div id='injection_site'></div>

  <input type="text" id="photo_url" placeholder="URL of Image"/>
     <button id="sub_img">Submit Image</button>

    <img id="imgsrc" src=""/>
      <!-- Instantiate Feather -->
 <script type="text/javascript">
   var featherEditor = new Aviary.Feather({
   apiKey: 'LuucZHMFU0yLQSnGBgAqsg',
   apiVersion: 2,
   tools: 'enhance,resize,crop,contrast,sharpness,text,whiten,effects,orientation,warmth,brightness,saturation,draw,redeye,blemish',
   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>

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

以前有没有人用过这个程序?这只是一个技巧,我不想使用PHP作为主机镜像。如果可能的话,它应该只作为一个使用url的图像编辑器?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-22 20:22:08

如果您允许用户从各种web资源上载文件。

您可以尝试使用Filepicker.io插件来实现上传功能。

https://developers.filepicker.io/docs/web/

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14347110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档