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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4844080c44e64e78225fbbcbc9130f327ef3f07f835bc7a00074d218940fdbe7
4
- data.tar.gz: 9679739fb40b7f96480ca411a53afa6abcb0a92364fa3ea7db572508c35a873d
3
+ metadata.gz: 582b46f8725bd29fe8a8162bf0c74d5954803c5811a3e6d19a0c3ad4e9d9c3c3
4
+ data.tar.gz: 83aa2d33544e6afa0125da8dc5a1c7e26dcbcd5d470e641253fc49383782454b
5
5
  SHA512:
6
- metadata.gz: ab94defbf2d9129e4dabc30a79c72264a9e8b1c5314a8123765c0ac9d1a0bb1627da02336ffcc4f0a8e7e5fb74e18263269a986eccc19564b3146fd37832823c
7
- data.tar.gz: e3cb6c68edaa47f92ddf7f43c45a904ff3af127aacd0006c015d92b53106dd6987ef0e102aa8ac02eb796193157055cf07cb79b441583f10b95951d83a30790e
6
+ metadata.gz: be615203f8efbc328614ed19fe7240ee99ee4b29b514190e503fe2bea9736aae0cce878f9af7faf9161a22e01b3c685d148bc453fe78974409844bd1a1c6ddac
7
+ data.tar.gz: ca64d45a21a3ab2b108ff44663e1b3d384f7c609204ea997f1c458872f5645afc5991f08dea92d2cb2817db813b807af6d4e32beaf36abc0691a8f4039efa0bb
@@ -2,5 +2,6 @@
2
2
 
3
3
  | Gem | Cropper.js | jQuery Cropper |
4
4
  |--------|------------|----------------|
5
+ | 1.0.2 | 1.4.3 | 1.0.0 |
5
6
  | 1.0.1 | 1.4.2 | 1.0.0 |
6
7
  | 1.0.0 | 1.4.1 | 1.0.0 |
@@ -1,7 +1,7 @@
1
1
  module Cropper
2
2
  module Rails
3
- VERSION = '1.0.1'.freeze
4
- CROPPER_VERSION = '1.4.2'.freeze
3
+ VERSION = '1.0.2'.freeze
4
+ CROPPER_VERSION = '1.4.3'.freeze
5
5
  JQUERY_CROPPER_VERSION = '1.0.0'.freeze
6
6
  end
7
7
  end
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Cropper.js v1.4.2
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-15T13:27:01.969Z
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
- var littleEndian;
1004
- var app1Start;
1005
- var ifdStart; // Only handle JPEG image (start by 0xFFD8)
1006
-
1007
- if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
1008
- var length = dataView.byteLength;
1009
- var offset = 2;
1010
-
1011
- while (offset < length) {
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 += 1;
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
- if (app1Start) {
1022
- var exifIDCode = app1Start + 4;
1023
- var tiffOffset = app1Start + 10;
1023
+ if (app1Start) {
1024
+ var exifIDCode = app1Start + 4;
1025
+ var tiffOffset = app1Start + 10;
1024
1026
 
1025
- if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
1026
- var endianness = dataView.getUint16(tiffOffset);
1027
- littleEndian = endianness === 0x4949;
1027
+ if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
1028
+ var endianness = dataView.getUint16(tiffOffset);
1029
+ littleEndian = endianness === 0x4949;
1028
1030
 
1029
- if (littleEndian || endianness === 0x4D4D
1030
- /* bigEndian */
1031
- ) {
1032
- if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
1033
- var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
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
- if (firstIFDOffset >= 0x00000008) {
1036
- ifdStart = tiffOffset + firstIFDOffset;
1037
+ if (firstIFDOffset >= 0x00000008) {
1038
+ ifdStart = tiffOffset + firstIFDOffset;
1039
+ }
1037
1040
  }
1038
1041
  }
1039
- }
1042
+ }
1040
1043
  }
1041
- }
1042
1044
 
1043
- if (ifdStart) {
1044
- var _length = dataView.getUint16(ifdStart, littleEndian);
1045
+ if (ifdStart) {
1046
+ var _length = dataView.getUint16(ifdStart, littleEndian);
1045
1047
 
1046
- var _offset;
1048
+ var _offset;
1047
1049
 
1048
- var i;
1050
+ var i;
1049
1051
 
1050
- for (i = 0; i < _length; i += 1) {
1051
- _offset = ifdStart + i * 12 + 2;
1052
+ for (i = 0; i < _length; i += 1) {
1053
+ _offset = ifdStart + i * 12 + 2;
1052
1054
 
1053
- if (dataView.getUint16(_offset, littleEndian) === 0x0112
1054
- /* Orientation */
1055
- ) {
1056
- // 8 is the offset of the current tag's value
1057
- _offset += 8; // Get the original orientation value
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
- orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
1061
+ orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
1060
1062
 
1061
- dataView.setUint16(_offset, 1, littleEndian);
1062
- break;
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
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-15T13:26:58.111Z
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.1
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-17 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails