0

I'm trying to use cropper js to crop a image from url

but it is returning a 'Access-Control-Allow-Origin' error

var $img = $('<img/>');

$img.attr({src: src}).load(function () {
    $container.html($img);
    $container.css({maxWidth: 100});
    $container.css({maxHeight: 100});
    $img.cropper({
        cropBoxResizable: false,
        aspectRatio: 100 / 100,
        minCropBoxWidth: 100,
        minCropBoxHeight: 100,
        dragMode: 'move',
        fillColor: '#fff',
        crop: function (e) {
            $('.coords').val(e.x + ',' + e.y + ',' + e.width + ',' + e.height);
        }
    });
});
SpaceDogCS
  • 2,808
  • 3
  • 20
  • 49

0 Answers0