polysize-rails 0.0.4.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffb2b1df6f1ab9277f788f653a47cb93ded167de
4
- data.tar.gz: b76963b047e9918255b214566d2d5de754637b50
3
+ metadata.gz: 93e2046d59c9e618966c13dea46121f19b3dacb0
4
+ data.tar.gz: b1badf8a7199c0ce7c441eea3982a8a9c0da55d4
5
5
  SHA512:
6
- metadata.gz: a55f26d9b2a1b98aaa8972b415f61d6787789a8b8a3fa24515fafd01b67d7cbc825f0f675d94d62ad9cc402c8fef12f65f636c193a3003ac5c4a61336d73a174
7
- data.tar.gz: 75f87a90f4acc87a3277af8ffe9176525875bfe9f193fb2b744402a6dac9191c4bf7609eb99c3fed974d6f2f5b1f5c25121090836f03179bf19d5fee17dd38a3
6
+ metadata.gz: 9c306b45de37284513114ec38eaff48fa2dd9a3c9e470e4c71052f5c6935095310605eeb003e9b2df3d227bdf1a7c60b8cec2cc8d2787c528b737796f8ee9010
7
+ data.tar.gz: 6be7a50ece0f134ce081dc718aed4b475a77e293d544d06831b0e7229a72f491548c9bf3430ba64c5b82dc4b9bbddfdd2de3b2a54552b387b1ed3e0011575013
@@ -1,3 +1,3 @@
1
1
  module PolysizeRails
2
- VERSION = "0.0.4.2"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -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) == 'number') bounds = [bounds, 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 = img.height / img.width * bounds[1];
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 = img.height / img.width * bounds[1];
79
+ h = w / imgRatio;
80
80
  } else {
81
81
  w = bounds[0];
82
82
  h = bounds[1];
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polysize-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Waltman II