i'm using angularjs , need apply watermark programatelly in images calling js function. have is:
<figure><img class="watermark" ng-src="{{applywatermark(img.url)}}"></figure>
so, need call function applywatermark (not implemented yet) , return img watermark, i'm not sure how can build function. should return image? can provide me example how can this?
edit:
i did this, it's not working:
$(function applywatermark(image) { watermark([image, 'watermark.png']) .image(watermark.image.lowerright()) .then(function (img) { return img }); })
any idea?
using watermark.js:
watermark(['/img/forest.jpg', '/img/logo.png']) .image(watermark.image.lowerright(0.5)) // or lowerright() no opacity .then(function (img) { document.getelementbyid('alpha-image').appendchild(img); });
if doesn't work you, maybe try this:
$.ajax({ url: 'http://www.example.com/your-image.jpg', type: 'head', error: function() { // file isn't found }, success: function() { // file found! watermarkage. } });
to test if image exists before processing.
Comments
Post a Comment