A simple angularJS module for client side image operations (resizing, croping, rotating)
Example .controller('myController', ['$scope','imgCOP',function( $scope, imgCOP ) { //Do stuff }
imgCOP.rotate(originalImg,degrees,function(base64Url)){
//Do stuff
};
imgCOP.resize(originalImg, displayWidth, displayHeight, function(blob){
//Do stuff
});
imgCOP.crop(originalImg,A,D,size,function(blob){
//Do stuff
};
- Add image-canvas-operator.js & base64-to-blob.js to your index.html file.
- Add "image-canvas-operator" as a module dependency
- Invoke imgCOP with angularJS dependencies injection
- Reduce the number of conversion between blob and base64
- Rewrite the b64 to blob conversion
- Add stuff
- Clean stuff