tinyimg 0.1.3 → 0.1.4

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: d6c767cf7d39a737f942dc653bed088967678c01
4
- data.tar.gz: 872f0520067cb5ff2d529f3d5595a5f48771e578
3
+ metadata.gz: 5c78967e8d009c48624f294022767f9ae638aac1
4
+ data.tar.gz: ad732e2833692887729f60ce0bcf1f7c8f29ef02
5
5
  SHA512:
6
- metadata.gz: ebdfdef6986a4d77a18d62de00d391751d78c51530d86bf63f6f69c66574c45ad82d1b1df603add2375168f12ae02f4d954217083f4111593c4cea0bf1f922bf
7
- data.tar.gz: 53babb3f77c2c543d48f5c6bb24cbf9a058ec598fc56075d5afdae04417e0ab49adcbba1980ba07a938cf4aae98c3aa239004a95970e0c8362fcb6ff050dd7f3
6
+ metadata.gz: 4417c46de9733d20b4091408e815c13eafccd55ce4e14519c65aacf9ea269c8a010993f3a83559448b1185674aff87bc4bca9cfab1c80bdc498063a0baa1c464
7
+ data.tar.gz: 81bd7334ef275c6f31ac5d0b2c50a478d71255f0495066d428973ff075b6a52c688798b7c4904981948e444469b2fd3be41c13392e949352860bd6674a01e0c0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tinyimg (0.1.1)
4
+ tinyimg (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -29,4 +29,4 @@ DEPENDENCIES
29
29
  tinyimg!
30
30
 
31
31
  BUNDLED WITH
32
- 1.10.6
32
+ 1.15.4
@@ -45,16 +45,22 @@ VALUE load_from_string(VALUE self, VALUE input, VALUE type)
45
45
  {
46
46
  gdImagePtr image;
47
47
  ID type_id;
48
+ long input_length;
48
49
 
49
50
  Check_Type(input, T_STRING);
50
51
  Check_Type(type, T_SYMBOL);
51
52
  type_id = SYM2ID(type);
52
53
 
54
+ input_length = RSTRING_LEN(input);
55
+ if (input_length >= 1L << 31) {
56
+ rb_raise(get_error_class(self), "input must be less than 2GB in length");
57
+ }
58
+
53
59
  if (type_id == rb_intern("png")) {
54
- image = gdImageCreateFromPngPtr(RSTRING_LEN(input), RSTRING_PTR(input));
60
+ image = gdImageCreateFromPngPtr((int)input_length, RSTRING_PTR(input));
55
61
  }
56
62
  else if (type_id == rb_intern("jpeg")) {
57
- image = gdImageCreateFromJpegPtr(RSTRING_LEN(input), RSTRING_PTR(input));
63
+ image = gdImageCreateFromJpegPtr((int)input_length, RSTRING_PTR(input));
58
64
  }
59
65
  else {
60
66
  rb_raise(get_error_class(self), "type must be a supported image type");
@@ -27,7 +27,7 @@ class Tinyimg
27
27
 
28
28
  def resize!(*args)
29
29
  case args.map(&:class)
30
- when [Fixnum, Fixnum]
30
+ when [Integer, Integer]
31
31
  resize_exact!(*args)
32
32
  when [Hash]
33
33
  width, height = convert_hash_to_exact_dimensions(args.first)
@@ -164,7 +164,7 @@ class Tinyimg
164
164
  raise Error, "expected either :width or :height or both keys"
165
165
  end
166
166
 
167
- if opts.values.any? { |v| !v.is_a?(Fixnum) }
167
+ if opts.values.any? { |v| !v.is_a?(Integer) }
168
168
  raise Error, ":width and :height values must be integers"
169
169
  end
170
170
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'tinyimg'
3
- gem.version = '0.1.3'
3
+ gem.version = '0.1.4'
4
4
  gem.summary = "Tiny and fast JPEG/PNG cropping and resizing"
5
5
  gem.description = "Convert between JPEG/PNG, crop and resize images, either all in memory or via disk. Only requires libgd to function."
6
6
  gem.has_rdoc = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinyimg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-27 00:00:00.000000000 Z
11
+ date: 2017-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  requirements: []
66
66
  rubyforge_project:
67
- rubygems_version: 2.5.1
67
+ rubygems_version: 2.6.8
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Tiny and fast JPEG/PNG cropping and resizing