Foliotek / Croppie

A Javascript Image Cropper
http://foliotek.github.io/Croppie
MIT License
2.58k stars 884 forks source link

How to add Image effect? #663

Open KamilCwiertnia opened 5 years ago

KamilCwiertnia commented 5 years ago

Hello. I have a problem with croppie plugin. I have a integration with Dropzone plugin. I want to add effect on copped image (sepia, blur, etc.) My integration: https://itnext.io/integrating-dropzone-with-javascript-image-cropper-optimise-image-upload-e22b12ac0d8a

...
    var cat = modal.attr('data-cat');
    if(cat == '20x20') {
    var width = 760;
    var height = 760;
    }
    else if(cat == '20x30') {
    var width = 1136;
    var height = 760;
    }
    croppie.result({
    type: 'blob',
    size: {
    width: width,
    height: height,
    }
    }).then(function(blob) {
    console.log(blob.dataURL);
    myDropZone.createThumbnail(
    blob,
    myDropZone.options.thumbnailWidth,
    myDropZone.options.thumbnailHeight,
    myDropZone.options.thumbnailMethod,
    false,
    function(dataURL) {

    myDropZone.emit('thumbnail', file, dataURL);
    done(blob);
    });

    editor.parentNode.removeChild(editor);
    });
...