cropper_rails 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSIONS.md +1 -0
- data/lib/cropper_rails/version.rb +2 -2
- data/vendor/assets/javascripts/cropper.js +53 -48
- data/vendor/assets/stylesheets/cropper.css +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 582b46f8725bd29fe8a8162bf0c74d5954803c5811a3e6d19a0c3ad4e9d9c3c3
|
4
|
+
data.tar.gz: 83aa2d33544e6afa0125da8dc5a1c7e26dcbcd5d470e641253fc49383782454b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be615203f8efbc328614ed19fe7240ee99ee4b29b514190e503fe2bea9736aae0cce878f9af7faf9161a22e01b3c685d148bc453fe78974409844bd1a1c6ddac
|
7
|
+
data.tar.gz: ca64d45a21a3ab2b108ff44663e1b3d384f7c609204ea997f1c458872f5645afc5991f08dea92d2cb2817db813b807af6d4e32beaf36abc0691a8f4039efa0bb
|
data/VERSIONS.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
/*!
|
2
|
-
* Cropper.js v1.4.
|
2
|
+
* Cropper.js v1.4.3
|
3
3
|
* https://fengyuanchen.github.io/cropperjs
|
4
4
|
*
|
5
5
|
* Copyright 2015-present Chen Fengyuan
|
6
6
|
* Released under the MIT license
|
7
7
|
*
|
8
|
-
* Date: 2018-10-
|
8
|
+
* Date: 2018-10-24T13:07:15.032Z
|
9
9
|
*/
|
10
10
|
|
11
11
|
(function (global, factory) {
|
@@ -999,69 +999,74 @@
|
|
999
999
|
|
1000
1000
|
function resetAndGetOrientation(arrayBuffer) {
|
1001
1001
|
var dataView = new DataView(arrayBuffer);
|
1002
|
-
var orientation;
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
|
1013
|
-
app1Start = offset;
|
1014
|
-
break;
|
1015
|
-
}
|
1002
|
+
var orientation; // Ignores range error when the image does not have correct Exif information
|
1003
|
+
|
1004
|
+
try {
|
1005
|
+
var littleEndian;
|
1006
|
+
var app1Start;
|
1007
|
+
var ifdStart; // Only handle JPEG image (start by 0xFFD8)
|
1008
|
+
|
1009
|
+
if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
|
1010
|
+
var length = dataView.byteLength;
|
1011
|
+
var offset = 2;
|
1016
1012
|
|
1017
|
-
offset
|
1013
|
+
while (offset + 1 < length) {
|
1014
|
+
if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
|
1015
|
+
app1Start = offset;
|
1016
|
+
break;
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
offset += 1;
|
1020
|
+
}
|
1018
1021
|
}
|
1019
|
-
}
|
1020
1022
|
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1023
|
+
if (app1Start) {
|
1024
|
+
var exifIDCode = app1Start + 4;
|
1025
|
+
var tiffOffset = app1Start + 10;
|
1024
1026
|
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1027
|
+
if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
|
1028
|
+
var endianness = dataView.getUint16(tiffOffset);
|
1029
|
+
littleEndian = endianness === 0x4949;
|
1028
1030
|
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1031
|
+
if (littleEndian || endianness === 0x4D4D
|
1032
|
+
/* bigEndian */
|
1033
|
+
) {
|
1034
|
+
if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
|
1035
|
+
var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
|
1034
1036
|
|
1035
|
-
|
1036
|
-
|
1037
|
+
if (firstIFDOffset >= 0x00000008) {
|
1038
|
+
ifdStart = tiffOffset + firstIFDOffset;
|
1039
|
+
}
|
1037
1040
|
}
|
1038
1041
|
}
|
1039
|
-
|
1042
|
+
}
|
1040
1043
|
}
|
1041
|
-
}
|
1042
1044
|
|
1043
|
-
|
1044
|
-
|
1045
|
+
if (ifdStart) {
|
1046
|
+
var _length = dataView.getUint16(ifdStart, littleEndian);
|
1045
1047
|
|
1046
|
-
|
1048
|
+
var _offset;
|
1047
1049
|
|
1048
|
-
|
1050
|
+
var i;
|
1049
1051
|
|
1050
|
-
|
1051
|
-
|
1052
|
+
for (i = 0; i < _length; i += 1) {
|
1053
|
+
_offset = ifdStart + i * 12 + 2;
|
1052
1054
|
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1055
|
+
if (dataView.getUint16(_offset, littleEndian) === 0x0112
|
1056
|
+
/* Orientation */
|
1057
|
+
) {
|
1058
|
+
// 8 is the offset of the current tag's value
|
1059
|
+
_offset += 8; // Get the original orientation value
|
1058
1060
|
|
1059
|
-
|
1061
|
+
orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
|
1060
1062
|
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1063
|
+
dataView.setUint16(_offset, 1, littleEndian);
|
1064
|
+
break;
|
1065
|
+
}
|
1066
|
+
}
|
1064
1067
|
}
|
1068
|
+
} catch (e) {
|
1069
|
+
orientation = 1;
|
1065
1070
|
}
|
1066
1071
|
|
1067
1072
|
return orientation;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/*!
|
2
|
-
* Cropper.js v1.4.
|
2
|
+
* Cropper.js v1.4.3
|
3
3
|
* https://fengyuanchen.github.io/cropperjs
|
4
4
|
*
|
5
5
|
* Copyright 2015-present Chen Fengyuan
|
6
6
|
* Released under the MIT license
|
7
7
|
*
|
8
|
-
* Date: 2018-10-
|
8
|
+
* Date: 2018-10-24T13:07:11.429Z
|
9
9
|
*/
|
10
10
|
|
11
11
|
.cropper-container {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cropper_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- D1ceWard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|