mr-image
mr-image copied to clipboard
Bug: selector.crop() doesn't update if image is changed.
Markup:
<button ng-click="toggle()">Toggle image</button>
<button ng-click="crop()">Crop</button>
<div mr-image mr-max-width="600" mr-src="img.src" mr-selector="selector"></div>
Controller:
$scope.selector = {};
$scope.img = {src: "foo/bar.jpg"}
$scope.crop = function() {
$scope.cropped = $scope.selector.crop();
console.log($scope.cropped);
}
$scope.toggle = function() {
$scope.img.src = "foo/baz.jpg"
}
Steps to reproduce:
- crop image 1
- save the base64 output from the console
- click toggle, so that image is switched (display updates properly)
- crop image 2
- save the base64 output from the console
- generate the images from the given base64 encodings (use this converter for example)
You'll see that the 2nd crop is from the image 1.