Skip to content

Commit

Permalink
BugFix > Don't use CrossOrigin for local images
Browse files Browse the repository at this point in the history
  • Loading branch information
alexk111 committed Nov 20, 2014
1 parent 6f93550 commit d244d01
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-img-crop",
"version": "0.3.0",
"version": "0.3.1",
"authors": [
"Alex Kaul <alexkaul@googlemail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion compile/minified/ng-img-crop.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions compile/unminified/ng-img-crop.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* ngImgCrop v0.3.0
* ngImgCrop v0.3.1
* https://github.com/alexk111/ngImgCrop
*
* Copyright (c) 2014 Alex Kaul
* License: MIT
*
* Generated at Sunday, November 16th, 2014, 6:44:28 PM
* Generated at Thursday, November 20th, 2014, 9:12:38 AM
*/
(function() {
'use strict';
Expand Down Expand Up @@ -787,7 +787,9 @@ crop.factory('cropHost', ['$document', 'cropAreaCircle', 'cropAreaSquare', funct
events.trigger('image-updated');
if(!!imageSource) {
var newImage = new Image();
newImage.crossOrigin = 'anonymous';
if(imageSource.substring(0,4).toLowerCase()==='http') {
newImage.crossOrigin = 'anonymous';
}
newImage.onload = function(){
events.trigger('load-done');
image=newImage;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"name": "ng-img-crop",
"prettyName": "ngImgCrop",
"version": "0.3.0",
"version": "0.3.1",
"description": "Image crop directive for AngularJS",
"license": "MIT",
"homepage": "https://github.com/alexk111/ngImgCrop",
Expand Down
4 changes: 3 additions & 1 deletion source/js/classes/crop-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ crop.factory('cropHost', ['$document', 'cropAreaCircle', 'cropAreaSquare', funct
events.trigger('image-updated');
if(!!imageSource) {
var newImage = new Image();
newImage.crossOrigin = 'anonymous';
if(imageSource.substring(0,4).toLowerCase()==='http') {
newImage.crossOrigin = 'anonymous';
}
newImage.onload = function(){
events.trigger('load-done');
image=newImage;
Expand Down

0 comments on commit d244d01

Please sign in to comment.