dist/js/cropjs.js
function() {
            if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
                return;
            }

            var body = document.getElementsByTagName('body');
            var canvas = document.createElement('canvas');
            var ctx = canvas.getContext('2d');

            canvas.style.display = 'none';
            body[0].appendChild(canvas);

            canvas.width = this._image.w;
            canvas.height = this._image.h;
            canvas.style.width = this._image.w + 'px';
            canvas.style.height = this._image.h + 'px';

            ctx.drawImage(
                this._image.image,
                0, 0,
                this._image.w, this._image.h
            );

            var imageData = ctx.getImageData(0, 0, this._image.w, this._image.h);

            // Cleanup references
            ctx = null;
            body[0].removeChild(canvas);
            canvas = null;
            body[0] = null;
            body = null;

            return imageData;
        }
function() {
            if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
                return;
            }

            var body = document.getElementsByTagName('body');
            var canvas = document.createElement('canvas');
            var ctx = canvas.getContext('2d');

            canvas.style.display = 'none';
            body[0].appendChild(canvas);

            canvas.width = this._image.w;
            canvas.height = this._image.h;
            canvas.style.width = this._image.w + 'px';
            canvas.style.height = this._image.h + 'px';

            ctx.drawImage(
                this._image.image,
                0, 0,
                this._image.w, this._image.h
            );

            var imageData = ctx.getImageData(0, 0, this._image.w, this._image.h);

            // Cleanup references
            ctx = null;
            body[0].removeChild(canvas);
            canvas = null;
            body[0] = null;
            body = null;

            return imageData;
        }
function ( ) { if ( ! this . _image instanceof IMSoftcrop . Image || ! this . _image . ready ) { return ; } var body = document . getElementsByTagName ( 'body' ) ; var canvas = document . createElement ( 'canvas' ) ; var ctx = canvas . getContext ( '2d' ) ; canvas . style . display = 'none' ; body [ 0 ] . appendChild ( canvas ) ; canvas . width = this . _image . w ; canvas . height = this . _image . h ; canvas . style . width = this . _image . w + 'px' ; canvas . style . height = this . _image . h + 'px' ; ctx . drawImage ( this . _image . image , 0 , 0 , this . _image . w , this . _image . h ) ; var imageData = ctx . getImageData ( 0 , 0 , this . _image . w , this . _image . h ) ; // Cleanup references ctx = null ; body [ 0 ] . removeChild ( canvas ) ; canvas = null ; body [ 0 ] = null ; body = null ; return imageData ; }
Create temporary canvas in image size and extract image data
@returns {ImageData}
Create temporary canvas in image size and extract image data