Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
Release v2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed May 28, 2016
1 parent 00428be commit 9154759
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 21 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog


## 2.3.1 (May 28, 2016)

- Improved the rotate and scale transform behaviour (#633, idea by afeibus).
- Improved the `getCroppedCanvas` method to return the whole canvas if it is not cropped (#666, PR by @vinnymac).
- Check cross origin setting when load image by XMLHTTPRequest (#669)


## 2.3.0 (Feb 22, 2016)

- Added a new parameter to the `replace` method for applying filters.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
dist/
├── cropper.css ( 5 KB)
├── cropper.min.css ( 4 KB)
├── cropper.js (77 KB)
└── cropper.min.js (27 KB)
├── cropper.js (79 KB)
└── cropper.min.js (28 KB)
```


Expand Down Expand Up @@ -843,7 +843,7 @@ Change the crop box position and size with new data.
- Rotated image: requires [CSS3 2D Transforms](http://caniuse.com/transforms2d) support (IE 9+).
- Cross-origin image: requires HTML5 [CORS settings attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) support (IE 11+).

Get a canvas drawn the cropped image.
Get a canvas drawn the cropped image. If it is not cropped, then returns the whole canvas.

> After then, you can display the canvas as an image directly, or use [HTMLCanvasElement.toDataURL](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL) to get a Data URL, or use [HTMLCanvasElement.toBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) to get a blob and upload it to server with [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) if the browser supports these APIs.
Expand Down
4 changes: 2 additions & 2 deletions dist/cropper.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper v2.3.0
* Cropper v2.3.1
* https://github.com/fengyuanchen/cropper
*
* Copyright (c) 2014-2016 Fengyuan Chen and contributors
* Released under the MIT license
*
* Date: 2016-02-22T02:13:13.332Z
* Date: 2016-05-28T14:47:08.528Z
*/
.cropper-container {
font-size: 0;
Expand Down
23 changes: 16 additions & 7 deletions dist/cropper.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper v2.3.0
* Cropper v2.3.1
* https://github.com/fengyuanchen/cropper
*
* Copyright (c) 2014-2016 Fengyuan Chen and contributors
* Released under the MIT license
*
* Date: 2016-02-22T02:13:13.332Z
* Date: 2016-05-28T14:47:08.528Z
*/

(function (factory) {
Expand Down Expand Up @@ -178,14 +178,15 @@
var scaleX = options.scaleX;
var scaleY = options.scaleY;

if (isNumber(rotate)) {
transforms.push('rotate(' + rotate + 'deg)');
}

// Scale should come first before rotate (#633)
if (isNumber(scaleX) && isNumber(scaleY)) {
transforms.push('scale(' + scaleX + ',' + scaleY + ')');
}

if (isNumber(rotate)) {
transforms.push('rotate(' + rotate + 'deg)');
}

return transforms.length ? transforms.join(' ') : 'none';
}

Expand Down Expand Up @@ -514,6 +515,10 @@
read(this.response);
};

if (options.checkCrossOrigin && isCrossOriginURL(url) && $this.prop('crossOrigin')) {
url = addTimestamp(url);
}

xhr.open('get', url);
xhr.responseType = 'arraybuffer';
xhr.send();
Expand Down Expand Up @@ -2661,10 +2666,14 @@
var context;
var data;

if (!this.isBuilt || !this.isCropped || !SUPPORT_CANVAS) {
if (!this.isBuilt || !SUPPORT_CANVAS) {
return;
}

if (!this.isCropped) {
return getSourceCanvas(this.$clone[0], this.image);
}

if (!$.isPlainObject(options)) {
options = {};
}
Expand Down
4 changes: 2 additions & 2 deletions dist/cropper.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/cropper.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
<nav class="collapse navbar-collapse" id="navbar-collapse" role="navigation">
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/fengyuanchen/cropper/tree/v2.3.0/README.md">Docs</a></li>
<li><a href="https://github.com/fengyuanchen/cropper/tree/v2.3.1/README.md">Docs</a></li>
<li><a href="https://github.com/fengyuanchen/cropper">GitHub</a></li>
<li><a href="https://fengyuanchen.github.io/">More</a></li>
<li><a href="http://chenfengyuan.com">About</a></li>
Expand All @@ -53,7 +53,7 @@
<!-- Jumbotron -->
<div class="jumbotron docs-jumbotron">
<div class="container">
<h1>Cropper <small class="version">v2.3.0</small></h1>
<h1>Cropper <small class="version">v2.3.1</small></h1>
<p class="lead">A simple jQuery image cropping plugin.</p>
<div class="docs-carbonads-container">
<div class="docs-carbonads">
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cropper",
"description": "A simple jQuery image cropping plugin.",
"version": "2.3.0",
"version": "2.3.1",
"main": "dist/cropper.js",
"license": "MIT",
"repository": "fengyuanchen/cropper",
Expand Down Expand Up @@ -37,7 +37,7 @@
"gulp-autoprefixer": "^3.1.0",
"gulp-concat": "^2.6.0",
"gulp-csscomb": "^3.0.6",
"gulp-csslint": "^0.2.2",
"gulp-csslint": "^0.3.0",
"gulp-htmlcomb": "^0.1.0",
"gulp-jscs": "^3.0.2",
"gulp-jshint": "^1.12.0",
Expand Down

0 comments on commit 9154759

Please sign in to comment.