polysize-rails 0.0.4.2 → 0.0.5
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/lib/polysize-rails/version.rb +1 -1
- data/vendor/assets/javascripts/polysize.js +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93e2046d59c9e618966c13dea46121f19b3dacb0
|
4
|
+
data.tar.gz: b1badf8a7199c0ce7c441eea3982a8a9c0da55d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c306b45de37284513114ec38eaff48fa2dd9a3c9e470e4c71052f5c6935095310605eeb003e9b2df3d227bdf1a7c60b8cec2cc8d2787c528b737796f8ee9010
|
7
|
+
data.tar.gz: 6be7a50ece0f134ce081dc718aed4b475a77e293d544d06831b0e7229a72f491548c9bf3430ba64c5b82dc4b9bbddfdd2de3b2a54552b387b1ed3e0011575013
|
@@ -17,7 +17,7 @@ window.Polysize = (function() {
|
|
17
17
|
return alert(
|
18
18
|
'Invalid function call. Polysize expects 3 or 4 arguments.');
|
19
19
|
}
|
20
|
-
if (typeof(bounds)
|
20
|
+
if (typeof(bounds) === 'number') bounds = [bounds, bounds];
|
21
21
|
|
22
22
|
reader.onload = (function (f) { return function (e) {
|
23
23
|
var img = new Image();
|
@@ -59,10 +59,10 @@ window.Polysize = (function() {
|
|
59
59
|
case 'fit':
|
60
60
|
if (imgRatio > newRatio) {
|
61
61
|
w = bounds[0];
|
62
|
-
h =
|
62
|
+
h = w / imgRatio;
|
63
63
|
} else if (imgRatio < newRatio) {
|
64
|
-
w = img.width / img.height * bounds[0];
|
65
64
|
h = bounds[1];
|
65
|
+
w = h * imgRatio;
|
66
66
|
} else {
|
67
67
|
w = bounds[0];
|
68
68
|
h = bounds[1];
|
@@ -72,11 +72,11 @@ window.Polysize = (function() {
|
|
72
72
|
// crop by default
|
73
73
|
default:
|
74
74
|
if (imgRatio > newRatio) {
|
75
|
-
w = img.width / img.height * bounds[0];
|
76
75
|
h = bounds[1];
|
76
|
+
w = h * imgRatio;
|
77
77
|
} else if (imgRatio < newRatio) {
|
78
78
|
w = bounds[0];
|
79
|
-
h =
|
79
|
+
h = w / imgRatio;
|
80
80
|
} else {
|
81
81
|
w = bounds[0];
|
82
82
|
h = bounds[1];
|