Skip to content

Commit

Permalink
release: 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Jan 3, 2018
1 parent 553fe5b commit 583b763
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 40 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.2 (Jan 3, 2018)

- Fix incorrect image natural sizes in iOS Safari (#279).

## 1.2.1 (Dec 17, 2017)

- Add `style` field to `package.json`.
Expand Down
20 changes: 14 additions & 6 deletions dist/cropper.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper.js v1.2.1
* Cropper.js v1.2.2
* https://github.com/fengyuanchen/cropperjs
*
* Copyright (c) 2015-2017 Chen Fengyuan
* Copyright (c) 2015-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-17T10:34:04.181Z
* Date: 2018-01-03T13:27:18.062Z
*/

'use strict';
Expand Down Expand Up @@ -826,12 +826,20 @@ function getImageNaturalSizes(image, callback) {

newImage.onload = function () {
callback(newImage.width, newImage.height);
body.removeChild(newImage);

if (!IS_SAFARI_OR_UIWEBVIEW) {
body.removeChild(newImage);
}
};

newImage.src = image.src;
newImage.style.cssText = 'position: absolute; top: 0; left: 0; z-index: -1; opacity: 0;';
body.appendChild(newImage);

// iOS Safari will convert the image automatically
// with its orientation once append it into DOM (#279)
if (!IS_SAFARI_OR_UIWEBVIEW) {
newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
body.appendChild(newImage);
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions dist/cropper.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper.js v1.2.1
* Cropper.js v1.2.2
* https://github.com/fengyuanchen/cropperjs
*
* Copyright (c) 2015-2017 Chen Fengyuan
* Copyright (c) 2015-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-17T10:33:56.588Z
* Date: 2018-01-03T13:26:29.610Z
*/

.cropper-container {
Expand Down
20 changes: 14 additions & 6 deletions dist/cropper.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper.js v1.2.1
* Cropper.js v1.2.2
* https://github.com/fengyuanchen/cropperjs
*
* Copyright (c) 2015-2017 Chen Fengyuan
* Copyright (c) 2015-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-17T10:34:04.181Z
* Date: 2018-01-03T13:27:18.062Z
*/

var WINDOW = typeof window !== 'undefined' ? window : {};
Expand Down Expand Up @@ -824,12 +824,20 @@ function getImageNaturalSizes(image, callback) {

newImage.onload = function () {
callback(newImage.width, newImage.height);
body.removeChild(newImage);

if (!IS_SAFARI_OR_UIWEBVIEW) {
body.removeChild(newImage);
}
};

newImage.src = image.src;
newImage.style.cssText = 'position: absolute; top: 0; left: 0; z-index: -1; opacity: 0;';
body.appendChild(newImage);

// iOS Safari will convert the image automatically
// with its orientation once append it into DOM (#279)
if (!IS_SAFARI_OR_UIWEBVIEW) {
newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
body.appendChild(newImage);
}
}

/**
Expand Down
20 changes: 14 additions & 6 deletions dist/cropper.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper.js v1.2.1
* Cropper.js v1.2.2
* https://github.com/fengyuanchen/cropperjs
*
* Copyright (c) 2015-2017 Chen Fengyuan
* Copyright (c) 2015-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-17T10:34:04.181Z
* Date: 2018-01-03T13:27:18.062Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -830,12 +830,20 @@ function getImageNaturalSizes(image, callback) {

newImage.onload = function () {
callback(newImage.width, newImage.height);
body.removeChild(newImage);

if (!IS_SAFARI_OR_UIWEBVIEW) {
body.removeChild(newImage);
}
};

newImage.src = image.src;
newImage.style.cssText = 'position: absolute; top: 0; left: 0; z-index: -1; opacity: 0;';
body.appendChild(newImage);

// iOS Safari will convert the image automatically
// with its orientation once append it into DOM (#279)
if (!IS_SAFARI_OR_UIWEBVIEW) {
newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
body.appendChild(newImage);
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions dist/cropper.min.css

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

8 changes: 4 additions & 4 deletions dist/cropper.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/css/cropper.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper.js v1.2.1
* Cropper.js v1.2.2
* https://github.com/fengyuanchen/cropperjs
*
* Copyright (c) 2015-2017 Chen Fengyuan
* Copyright (c) 2015-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-17T10:33:56.588Z
* Date: 2018-01-03T13:26:29.610Z
*/

.cropper-container {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>Cropper.js <small class="h6">v1.2.0</small></h1>
<h1>Cropper.js <small class="h6">v1.2.2</small></h1>
<p class="lead">JavaScript image cropper.</p>
</div>
<div class="col-md">
Expand Down
20 changes: 14 additions & 6 deletions docs/js/cropper.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Cropper.js v1.2.1
* Cropper.js v1.2.2
* https://github.com/fengyuanchen/cropperjs
*
* Copyright (c) 2015-2017 Chen Fengyuan
* Copyright (c) 2015-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-17T10:34:04.181Z
* Date: 2018-01-03T13:27:18.062Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -830,12 +830,20 @@ function getImageNaturalSizes(image, callback) {

newImage.onload = function () {
callback(newImage.width, newImage.height);
body.removeChild(newImage);

if (!IS_SAFARI_OR_UIWEBVIEW) {
body.removeChild(newImage);
}
};

newImage.src = image.src;
newImage.style.cssText = 'position: absolute; top: 0; left: 0; z-index: -1; opacity: 0;';
body.appendChild(newImage);

// iOS Safari will convert the image automatically
// with its orientation once append it into DOM (#279)
if (!IS_SAFARI_OR_UIWEBVIEW) {
newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
body.appendChild(newImage);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cropperjs",
"description": "JavaScript image cropper.",
"version": "1.2.1",
"version": "1.2.2",
"main": "dist/cropper.common.js",
"module": "dist/cropper.esm.js",
"browser": "dist/cropper.js",
Expand Down

0 comments on commit 583b763

Please sign in to comment.