zpng 0.3.1 → 0.4.0

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
  SHA256:
3
- metadata.gz: 7909c0ed35207a38e524d833cab5a276d4a6bd12a9d0da1fccdaaed7f8b1b6d0
4
- data.tar.gz: 3815143dbacb0dfa1b74b49da1b246b59ac71b4f2d003c9374559490407e6579
3
+ metadata.gz: 24abc68e64e96c4df6b0626ce0f393a4de8e1363551f5a3deed4f77af3cf8402
4
+ data.tar.gz: ece0c993df0a99091a542f7db3f7ad95975eccffbf915d15f8d692ff83d7fdfe
5
5
  SHA512:
6
- metadata.gz: 9657e50157d516cfa97cb493dcf5fae871154327cfd7a0fc5ba0636196c90d54df6f4d197946c234d765bab8767198ed808360a355353f128e08b1c0b22b8186
7
- data.tar.gz: 3daff9279bb060b6cdd31a0690a4e3d171b67236c036e74ac8bc7bcd51701e047aa1c2a2dcb14390cbbff5cb911d77b3d44cdd327a394d9f16115f06e4e33fbf
6
+ metadata.gz: 2716d2d131a293f5aeb04c8ef0d8b7423b41adfedb05507b8fec063a6d02b16e8ff5f652f6461e3114e05eb7210cf62b85898ab57e93aa798bb7477a09043f61
7
+ data.tar.gz: 8bd1800562ec76857d7164099e112224516d9f9fb11b4bb7a428f39e583b3820ac33f00ecd12569d1fe4ded091ae9d20cbc7c42e327370dec5d663fd0bd26a18
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem 'rainbow'
9
9
  group :development do
10
10
  gem "rspec", "~> 3.9.0"
11
11
  gem "rspec-its", "~> 1.3.0"
12
- gem "bundler", "~> 2.1.4"
13
- gem "jeweler", "~> 2.3.9"
12
+ gem "bundler", "~> 2.2.3"
13
+ gem "juwelier"
14
14
  gem "what_methods"
15
15
  end
data/Gemfile.lock CHANGED
@@ -1,60 +1,90 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.4.0)
4
+ addressable (2.8.0)
5
+ public_suffix (>= 2.0.2, < 5.0)
5
6
  builder (3.2.4)
6
7
  descendants_tracker (0.0.4)
7
8
  thread_safe (~> 0.3, >= 0.3.1)
8
- diff-lcs (1.3)
9
- faraday (0.9.2)
9
+ diff-lcs (1.5.0)
10
+ faraday (1.9.3)
11
+ faraday-em_http (~> 1.0)
12
+ faraday-em_synchrony (~> 1.0)
13
+ faraday-excon (~> 1.1)
14
+ faraday-httpclient (~> 1.0)
15
+ faraday-multipart (~> 1.0)
16
+ faraday-net_http (~> 1.0)
17
+ faraday-net_http_persistent (~> 1.0)
18
+ faraday-patron (~> 1.0)
19
+ faraday-rack (~> 1.0)
20
+ faraday-retry (~> 1.0)
21
+ ruby2_keywords (>= 0.0.4)
22
+ faraday-em_http (1.0.0)
23
+ faraday-em_synchrony (1.0.0)
24
+ faraday-excon (1.1.0)
25
+ faraday-httpclient (1.0.1)
26
+ faraday-multipart (1.0.3)
10
27
  multipart-post (>= 1.2, < 3)
11
- git (1.5.0)
12
- github_api (0.16.0)
13
- addressable (~> 2.4.0)
28
+ faraday-net_http (1.0.1)
29
+ faraday-net_http_persistent (1.2.0)
30
+ faraday-patron (1.0.0)
31
+ faraday-rack (1.0.0)
32
+ faraday-retry (1.0.3)
33
+ git (1.10.2)
34
+ rchardet (~> 1.8)
35
+ github_api (0.19.0)
36
+ addressable (~> 2.4)
14
37
  descendants_tracker (~> 0.0.4)
15
- faraday (~> 0.8, < 0.10)
16
- hashie (>= 3.4)
17
- mime-types (>= 1.16, < 3.0)
38
+ faraday (>= 0.8, < 2)
39
+ hashie (~> 3.5, >= 3.5.2)
18
40
  oauth2 (~> 1.0)
19
- hashie (4.0.0)
41
+ hashie (3.6.0)
20
42
  highline (2.0.3)
21
- jeweler (2.3.9)
43
+ juwelier (2.4.9)
22
44
  builder
23
45
  bundler
24
- git (>= 1.2.5)
25
- github_api (~> 0.16.0)
26
- highline (>= 1.6.15)
27
- nokogiri (>= 1.5.10)
46
+ git
47
+ github_api
48
+ highline
49
+ kamelcase (~> 0)
50
+ nokogiri
28
51
  psych
29
52
  rake
30
53
  rdoc
31
54
  semver2
32
- jwt (2.2.1)
33
- mime-types (2.99.3)
34
- mini_portile2 (2.4.0)
35
- multi_json (1.14.1)
55
+ jwt (2.3.0)
56
+ kamelcase (0.0.2)
57
+ semver2 (~> 3)
58
+ mini_portile2 (2.7.1)
59
+ multi_json (1.15.0)
36
60
  multi_xml (0.6.0)
37
61
  multipart-post (2.1.1)
38
- nokogiri (1.10.7)
39
- mini_portile2 (~> 2.4.0)
40
- oauth2 (1.4.2)
62
+ nokogiri (1.13.1)
63
+ mini_portile2 (~> 2.7.0)
64
+ racc (~> 1.4)
65
+ oauth2 (1.4.7)
41
66
  faraday (>= 0.8, < 2.0)
42
67
  jwt (>= 1.0, < 3.0)
43
68
  multi_json (~> 1.3)
44
69
  multi_xml (~> 0.5)
45
70
  rack (>= 1.2, < 3)
46
- psych (3.1.0)
47
- rack (2.1.1)
48
- rainbow (3.0.0)
49
- rake (13.0.1)
50
- rdoc (6.2.1)
71
+ psych (4.0.3)
72
+ stringio
73
+ public_suffix (4.0.6)
74
+ racc (1.6.0)
75
+ rack (2.2.3)
76
+ rainbow (3.1.1)
77
+ rake (13.0.6)
78
+ rchardet (1.8.0)
79
+ rdoc (6.4.0)
80
+ psych (>= 4.0.0)
51
81
  rspec (3.9.0)
52
82
  rspec-core (~> 3.9.0)
53
83
  rspec-expectations (~> 3.9.0)
54
84
  rspec-mocks (~> 3.9.0)
55
- rspec-core (3.9.1)
56
- rspec-support (~> 3.9.1)
57
- rspec-expectations (3.9.0)
85
+ rspec-core (3.9.3)
86
+ rspec-support (~> 3.9.3)
87
+ rspec-expectations (3.9.4)
58
88
  diff-lcs (>= 1.2.0, < 2.0)
59
89
  rspec-support (~> 3.9.0)
60
90
  rspec-its (1.3.0)
@@ -63,8 +93,10 @@ GEM
63
93
  rspec-mocks (3.9.1)
64
94
  diff-lcs (>= 1.2.0, < 2.0)
65
95
  rspec-support (~> 3.9.0)
66
- rspec-support (3.9.2)
96
+ rspec-support (3.9.4)
97
+ ruby2_keywords (0.0.5)
67
98
  semver2 (3.4.2)
99
+ stringio (3.0.1)
68
100
  thread_safe (0.3.6)
69
101
  what_methods (1.0.1)
70
102
 
@@ -72,12 +104,12 @@ PLATFORMS
72
104
  ruby
73
105
 
74
106
  DEPENDENCIES
75
- bundler (~> 2.1.4)
76
- jeweler (~> 2.3.9)
107
+ bundler (~> 2.2.3)
108
+ juwelier
77
109
  rainbow
78
110
  rspec (~> 3.9.0)
79
111
  rspec-its (~> 1.3.0)
80
112
  what_methods
81
113
 
82
114
  BUNDLED WITH
83
- 2.1.4
115
+ 2.2.32
data/README.md CHANGED
@@ -36,8 +36,10 @@ Usage
36
36
 
37
37
  -C, --crop GEOMETRY crop image, {WIDTH}x{HEIGHT}+{X}+{Y},
38
38
  puts results on stdout unless --ascii given
39
+ -R, --rebuild NEW_FILENAME rebuild image, useful in restoring borked images
39
40
 
40
41
  -A, --ascii Try to convert image to ASCII (works best with monochrome images)
42
+ --ascii-string STRING Use specific string to map pixels to ASCII characters
41
43
  -N, --ansi Try to display image as ANSI colored text
42
44
  -2, --256 Try to display image as 256-colored text
43
45
  -W, --wide Use 2 horizontal characters per one pixel
@@ -52,7 +54,7 @@ Usage
52
54
 
53
55
  [.] image size 35x35, 24bpp, COLOR_RGB
54
56
  [.] uncompressed imagedata size = 3710 bytes
55
- [.] <Chunk #00 IHDR size= 13, crc=91bb240e, color=2, compression=0, depth=8, filter=0, height=35, interlace=0, width=35> CRC OK
57
+ [.] <Chunk #00 IHDR size= 13, crc=91bb240e, color=2, compression=0, depth=8, filter=0, height=35, interlace=0, offset=8, width=35> CRC OK
56
58
  [.] <Chunk #01 sRGB size= 1, crc=aece1ce9 > CRC OK
57
59
  [.] <Chunk #02 IDAT size= 399, crc=59790716 > CRC OK
58
60
  [.] <Chunk #03 IEND size= 0, crc=ae426082 > CRC OK
@@ -66,7 +68,7 @@ Usage
66
68
  01 ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 |................|
67
69
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 3678 bytes
68
70
 
69
- [.] <Chunk #00 IHDR size= 13, crc=91bb240e, color=2, compression=0, depth=8, filter=0, height=35, idx=0, interlace=0, width=35> CRC OK
71
+ [.] <Chunk #00 IHDR size= 13, crc=91bb240e, color=2, compression=0, depth=8, filter=0, height=35, idx=0, interlace=0, offset=8, width=35> CRC OK
70
72
  00 00 00 23 00 00 00 23 08 02 00 00 00 |...#...#..... |
71
73
 
72
74
  [.] <Chunk #01 sRGB size= 1, crc=aece1ce9 > CRC OK
@@ -84,7 +86,7 @@ Usage
84
86
 
85
87
  # zpng --chunks qr_aux_chunks.png
86
88
 
87
- [.] <Chunk #00 IHDR size= 13, crc=36a28ef4, color=0, compression=0, depth=1, filter=0, height=35, interlace=0, width=35> CRC OK
89
+ [.] <Chunk #00 IHDR size= 13, crc=36a28ef4, color=0, compression=0, depth=1, filter=0, height=35, interlace=0, offset=8, width=35> CRC OK
88
90
  [.] <Chunk #01 gAMA size= 4, crc=0bfc6105 > CRC OK
89
91
  [.] <Chunk #02 sRGB size= 1, crc=aece1ce9 > CRC OK
90
92
  [.] <Chunk #03 cHRM size= 32, crc=9cba513c > CRC OK
data/Rakefile CHANGED
@@ -11,8 +11,8 @@ rescue Bundler::BundlerError => e
11
11
  end
12
12
  require 'rake'
13
13
 
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
14
+ require 'juwelier'
15
+ Juwelier::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
17
  gem.name = "zpng"
18
18
  gem.homepage = "http://github.com/zed-0xff/zpng"
@@ -25,7 +25,7 @@ Jeweler::Tasks.new do |gem|
25
25
  gem.files.include "lib/**/*.rb"
26
26
  # dependencies defined in Gemfile
27
27
  end
28
- Jeweler::RubygemsDotOrgTasks.new
28
+ Juwelier::RubygemsDotOrgTasks.new
29
29
 
30
30
  require 'rspec/core'
31
31
  require 'rspec/core/rake_task'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
data/lib/zpng/chunk.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  module ZPNG
2
2
  class Chunk
3
- attr_accessor :size, :type, :data, :crc, :idx
3
+ attr_accessor :size, :type, :data, :crc, :idx, :offset
4
+
5
+ KNOWN_TYPES = %w'IHDR PLTE IDAT IEND cHRM gAMA iCCP sBIT sRGB bKGD hIST tRNS pHYs sPLT tIME iTXt tEXt zTXt'
6
+ VALID_SIZE_RANGE = 0..((2**31)-1)
4
7
 
5
8
  include DeepCopyable
6
9
 
@@ -10,21 +13,27 @@ module ZPNG
10
13
  begin
11
14
  if const_defined?(type.upcase)
12
15
  klass = const_get(type.upcase)
13
- klass.new(io)
14
- else
15
- Chunk.new(io)
16
+ return klass.new(io)
16
17
  end
17
18
  rescue NameError
18
19
  # invalid chunk type?
19
- Chunk.new(io)
20
20
  end
21
+ # putting this out of rescue makes better non-confusing exception messages
22
+ # if exception occurs somewhere in Chunk.new
23
+ Chunk.new(io)
21
24
  end
22
25
 
23
26
  def initialize x = {}
24
27
  if x.respond_to?(:read)
25
28
  # IO
29
+ @offset = x.tell
26
30
  @size, @type = x.read(8).unpack('Na4')
27
- @data = x.read(size)
31
+ begin
32
+ @data = x.read(size)
33
+ rescue Errno::EINVAL
34
+ # TODO: show warning?
35
+ @data = x.read if size > VALID_SIZE_RANGE.end
36
+ end
28
37
  @crc = x.read(4).to_s.unpack('N').first
29
38
  elsif x.respond_to?(:[])
30
39
  # Hash
@@ -66,6 +75,22 @@ module ZPNG
66
75
  expected_crc == crc
67
76
  end
68
77
 
78
+ def check checks = {type: true, crc: true, size: true}
79
+ checks.each do |check_type, check_mode|
80
+ case check_type
81
+ when :type
82
+ return false if check_mode != KNOWN_TYPES.include?(self.type)
83
+ when :crc
84
+ return false if check_mode != crc_ok?
85
+ when :size
86
+ return false if check_mode != VALID_SIZE_RANGE.include?(self.size)
87
+ end
88
+ end
89
+ true
90
+ end
91
+
92
+ def valid?; check; end
93
+
69
94
  def fix_crc!
70
95
  @crc = Zlib.crc32(data, Zlib.crc32(type))
71
96
  end
data/lib/zpng/cli.rb CHANGED
@@ -52,6 +52,10 @@ module ZPNG
52
52
  @actions << [:crop, x]
53
53
  end
54
54
 
55
+ opts.on "-R", "--rebuild NEW_FILENAME", "rebuild image, useful in restoring borked images" do |x|
56
+ @actions << [:rebuild, x]
57
+ end
58
+
55
59
  opts.separator ""
56
60
  opts.on "-A", '--ascii', 'Try to convert image to ASCII (works best with monochrome images)' do
57
61
  @actions << :ascii
@@ -137,6 +141,10 @@ module ZPNG
137
141
  print @img.export unless @actions.include?(:ascii)
138
142
  end
139
143
 
144
+ def rebuild fname
145
+ File.binwrite(fname, @img.export)
146
+ end
147
+
140
148
  def load_file fname
141
149
  @img = Image.load fname, :verbose => @options[:verbose]+1
142
150
  end
data/lib/zpng/image.rb CHANGED
@@ -108,11 +108,43 @@ module ZPNG
108
108
  end
109
109
  end
110
110
 
111
+ HEUR_CHUNK_SIZE_RANGE = -16..16
112
+
113
+ # assume previous chunk size is not right, try to iterate over neighbour data
114
+ def _apply_heuristics io, prev_chunk, chunk
115
+ prev_pos = io.tell
116
+ HEUR_CHUNK_SIZE_RANGE.each do |delta|
117
+ next if delta == 0
118
+ next if prev_chunk.data.size + delta < 0
119
+ io.seek(chunk.offset+delta, IO::SEEK_SET)
120
+ potential_chunk = Chunk.new(io)
121
+ if potential_chunk.valid?
122
+ STDERR.puts "[!] heuristics: found invalid chunk at offset #{chunk.offset}, but valid one at #{chunk.offset+delta}. using latter".red
123
+ if delta > 0
124
+ io.seek(chunk.offset, IO::SEEK_SET)
125
+ data = io.read(delta)
126
+ STDERR.puts "[!] #{delta} extra bytes of data: #{data.inspect}".red
127
+ else
128
+ io.seek(chunk.offset+delta, IO::SEEK_SET)
129
+ end
130
+ return true
131
+ end
132
+ end
133
+ false
134
+ end
135
+
111
136
  def _read_png io
137
+ prev_chunk = nil
112
138
  while !io.eof?
113
139
  chunk = Chunk.from_stream(io)
140
+ # heuristics
141
+ if prev_chunk && prev_chunk.check(type: true, crc: false) &&
142
+ chunk.check(type: false, crc: false) && chunk.data
143
+ redo if _apply_heuristics(io, prev_chunk, chunk)
144
+ end
114
145
  chunk.idx = @chunks.size
115
146
  @chunks << chunk
147
+ prev_chunk = chunk
116
148
  break if chunk.is_a?(Chunk::IEND)
117
149
  end
118
150
  end
@@ -137,7 +169,7 @@ module ZPNG
137
169
  unless io.eof?
138
170
  offset = io.tell
139
171
  @extradata << io.read
140
- puts "[?] #{@extradata.last.size} bytes of extra data after image end (IEND), offset = 0x#{offset.to_s(16)}".red if @verbose >= 1
172
+ STDERR.puts "[?] #{@extradata.last.size} bytes of extra data after image end (IEND), offset = 0x#{offset.to_s(16)}".red if @verbose >= 1
141
173
  end
142
174
  end
143
175
 
@@ -250,16 +282,16 @@ module ZPNG
250
282
  r << zi.inflate(pos==0 ? data : data[pos..-1])
251
283
  if zi.total_in < data.size
252
284
  @extradata << data[zi.total_in..-1]
253
- puts "[?] #{@extradata.last.size} bytes of extra data after zlib stream".red if @verbose >= 1
285
+ STDERR.puts "[?] #{@extradata.last.size} bytes of extra data after zlib stream".red if @verbose >= 1
254
286
  end
255
287
  # decompress OK
256
288
  rescue Zlib::BufError
257
289
  # tried to decompress, but got EOF - need more data
258
- puts "[!] #{$!.inspect}".red if @verbose >= -1
290
+ STDERR.puts "[!] #{$!.inspect}".red if @verbose >= -1
259
291
  # collect any remaining data in decompress buffer
260
292
  r << zi.flush_next_out
261
293
  rescue Zlib::DataError
262
- puts "[!] #{$!.inspect}".red if @verbose >= -1
294
+ STDERR.puts "[!] #{$!.inspect}".red if @verbose >= -1
263
295
  #p [pos, zi.total_in, zi.total_out, data.size, r.size]
264
296
  r << zi.flush_next_out
265
297
  # XXX TODO try to skip error and continue
@@ -273,7 +305,7 @@ module ZPNG
273
305
  # pos = 0
274
306
  # retry if pos < data.size
275
307
  rescue Zlib::NeedDict
276
- puts "[!] #{$!.inspect}".red if @verbose >= -1
308
+ STDERR.puts "[!] #{$!.inspect}".red if @verbose >= -1
277
309
  # collect any remaining data in decompress buffer
278
310
  r << zi.flush_next_out
279
311
  end
@@ -288,7 +320,7 @@ module ZPNG
288
320
  def imagedata
289
321
  @imagedata ||=
290
322
  begin
291
- puts "[?] no image header, assuming non-interlaced RGB".yellow unless header
323
+ STDERR.puts "[?] no image header, assuming non-interlaced RGB".yellow unless header
292
324
  data = _imagedata
293
325
  (data && data.size > 0) ? _safe_inflate(data) : ''
294
326
  end
@@ -7,6 +7,8 @@ module ZPNG
7
7
  FILTER_AVERAGE = 3
8
8
  FILTER_PAETH = 4
9
9
 
10
+ VALID_FILTERS = FILTER_NONE..FILTER_PAETH
11
+
10
12
  attr_accessor :image, :idx, :filter, :offset, :bpp
11
13
  attr_writer :decoded_bytes
12
14
 
@@ -44,6 +46,10 @@ module ZPNG
44
46
  !@filter
45
47
  end
46
48
 
49
+ def valid_filter?
50
+ VALID_FILTERS.include?(@filter)
51
+ end
52
+
47
53
  # total scanline size in bytes, INCLUDING leading 'filter' byte
48
54
  def size
49
55
  @size ||=
@@ -286,7 +292,10 @@ module ZPNG
286
292
  )
287
293
  end
288
294
 
289
- else raise "invalid ScanLine filter #{@filter}"
295
+ else
296
+ STDERR.puts "[!] #{self.class}: ##@idx: invalid filter #@filter, assuming FILTER_NONE".red
297
+ s = raw
298
+ raise
290
299
  end
291
300
 
292
301
  s
@@ -16,7 +16,7 @@ module PNGSuite
16
16
  end
17
17
  require 'open-uri'
18
18
  puts "[.] fetching PNG test-suite from #{PNG_SUITE_URL} .. "
19
- data = open(PNG_SUITE_URL).read
19
+ data = URI.open(PNG_SUITE_URL).read
20
20
 
21
21
  fname = File.join(dir, "png_suite.tgz")
22
22
  File.binwrite fname, data
data/zpng.gemspec CHANGED
@@ -1,17 +1,17 @@
1
- # Generated by jeweler
1
+ # Generated by juwelier
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: zpng 0.3.1 ruby lib
5
+ # stub: zpng 0.4.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "zpng".freeze
9
- s.version = "0.3.1"
9
+ s.version = "0.4.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Andrey \"Zed\" Zaikin".freeze]
14
- s.date = "2020-01-15"
14
+ s.date = "2022-01-31"
15
15
  s.email = "zed.0xff@gmail.com".freeze
16
16
  s.executables = ["zpng".freeze]
17
17
  s.extra_rdoc_files = [
@@ -52,6 +52,7 @@ Gem::Specification.new do |s|
52
52
  "misc/chars.png",
53
53
  "misc/gen_ascii_map.rb",
54
54
  "samples/bad/000000.png",
55
+ "samples/bad/149511457-47db5096-662d-4221-84f9-1c2a0e20e323.png",
55
56
  "samples/bad/b1.png",
56
57
  "samples/captcha_4bpp.png",
57
58
  "samples/cats.png",
@@ -94,33 +95,26 @@ Gem::Specification.new do |s|
94
95
  ]
95
96
  s.homepage = "http://github.com/zed-0xff/zpng".freeze
96
97
  s.licenses = ["MIT".freeze]
97
- s.rubygems_version = "2.7.6".freeze
98
+ s.rubygems_version = "3.2.32".freeze
98
99
  s.summary = "pure ruby PNG file manipulation & validation".freeze
99
100
 
100
101
  if s.respond_to? :specification_version then
101
102
  s.specification_version = 4
103
+ end
102
104
 
103
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
104
- s.add_runtime_dependency(%q<rainbow>.freeze, [">= 0"])
105
- s.add_development_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
106
- s.add_development_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
107
- s.add_development_dependency(%q<bundler>.freeze, ["~> 2.1.4"])
108
- s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
109
- s.add_development_dependency(%q<what_methods>.freeze, [">= 0"])
110
- else
111
- s.add_dependency(%q<rainbow>.freeze, [">= 0"])
112
- s.add_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
113
- s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
114
- s.add_dependency(%q<bundler>.freeze, ["~> 2.1.4"])
115
- s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
116
- s.add_dependency(%q<what_methods>.freeze, [">= 0"])
117
- end
105
+ if s.respond_to? :add_runtime_dependency then
106
+ s.add_runtime_dependency(%q<rainbow>.freeze, [">= 0"])
107
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
108
+ s.add_development_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
109
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 2.2.3"])
110
+ s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
111
+ s.add_development_dependency(%q<what_methods>.freeze, [">= 0"])
118
112
  else
119
113
  s.add_dependency(%q<rainbow>.freeze, [">= 0"])
120
114
  s.add_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
121
115
  s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
122
- s.add_dependency(%q<bundler>.freeze, ["~> 2.1.4"])
123
- s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
116
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.2.3"])
117
+ s.add_dependency(%q<juwelier>.freeze, [">= 0"])
124
118
  s.add_dependency(%q<what_methods>.freeze, [">= 0"])
125
119
  end
126
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zpng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "Zed" Zaikin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.1.4
61
+ version: 2.2.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.1.4
68
+ version: 2.2.3
69
69
  - !ruby/object:Gem::Dependency
70
- name: jeweler
70
+ name: juwelier
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.3.9
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.3.9
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: what_methods
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description:
97
+ description:
98
98
  email: zed.0xff@gmail.com
99
99
  executables:
100
100
  - zpng
@@ -136,6 +136,7 @@ files:
136
136
  - misc/chars.png
137
137
  - misc/gen_ascii_map.rb
138
138
  - samples/bad/000000.png
139
+ - samples/bad/149511457-47db5096-662d-4221-84f9-1c2a0e20e323.png
139
140
  - samples/bad/b1.png
140
141
  - samples/captcha_4bpp.png
141
142
  - samples/cats.png
@@ -179,7 +180,7 @@ homepage: http://github.com/zed-0xff/zpng
179
180
  licenses:
180
181
  - MIT
181
182
  metadata: {}
182
- post_install_message:
183
+ post_install_message:
183
184
  rdoc_options: []
184
185
  require_paths:
185
186
  - lib
@@ -194,9 +195,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
195
  - !ruby/object:Gem::Version
195
196
  version: '0'
196
197
  requirements: []
197
- rubyforge_project:
198
- rubygems_version: 2.7.6
199
- signing_key:
198
+ rubygems_version: 3.2.32
199
+ signing_key:
200
200
  specification_version: 4
201
201
  summary: pure ruby PNG file manipulation & validation
202
202
  test_files: []