zpng 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -6
- data/Gemfile.lock +32 -34
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/zpng/adam7_decoder.rb +12 -11
- data/lib/zpng/chunk.rb +33 -7
- data/lib/zpng/cli.rb +9 -3
- data/lib/zpng/image.rb +3 -3
- data/spec/adam7_spec.rb +3 -9
- data/spec/bad_samples_spec.rb +2 -0
- data/spec/create_image_spec.rb +3 -2
- data/spec/support/png_suite.rb +1 -1
- data/zpng.gemspec +10 -33
- metadata +12 -59
- data/samples/bad/000000.png +0 -0
- data/samples/bad/149511457-47db5096-662d-4221-84f9-1c2a0e20e323.png +0 -0
- data/samples/bad/b1.png +0 -0
- data/samples/captcha_4bpp.png +0 -0
- data/samples/cats.png +0 -0
- data/samples/itxt.png +0 -0
- data/samples/modify.rb +0 -20
- data/samples/mouse.bmp +0 -0
- data/samples/mouse.png +0 -0
- data/samples/mouse17.bmp +0 -0
- data/samples/mouse17.png +0 -0
- data/samples/qr_aux_chunks.png +0 -0
- data/samples/qr_bw.png +0 -0
- data/samples/qr_gray_alpha.png +0 -0
- data/samples/qr_grayscale.png +0 -0
- data/samples/qr_plte.png +0 -0
- data/samples/qr_plte_bw.png +0 -0
- data/samples/qr_rgb.png +0 -0
- data/samples/qr_rgba.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b35d6d1f87f6a32f1de261d07be9a5670cad8892fdf8033a46c6189ac60c6c5
|
4
|
+
data.tar.gz: 584811c71db552f0b07f701f324b3e359d101c7650c975280f6c529cc8ecb246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e22d560929ca762532c078ac6ab7732788032ec58e86d20156c35169f0ebf44c498b69069adcb563b70ab8f770aa20116c5c5da4e9bd2847a716c504bc164c5f
|
7
|
+
data.tar.gz: b34d79aa9ca9b1c4bfa8770ca59c463eff6155687e27891f143b19fc142e07c914e1d7412f51446bacb6ba637b3879c9e662c06cb0003b51fff4d102b2ec5d8c
|
data/Gemfile
CHANGED
@@ -2,14 +2,12 @@ source "http://rubygems.org"
|
|
2
2
|
# Add dependencies required to use your gem here.
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
|
-
gem 'rainbow'
|
5
|
+
gem 'rainbow', '~> 3.1.1'
|
6
6
|
|
7
7
|
# Add dependencies to develop your gem here.
|
8
8
|
# Include everything needed to run rake, tests, features, etc.
|
9
9
|
group :development do
|
10
|
-
gem "rspec",
|
11
|
-
gem "rspec-its",
|
12
|
-
gem "
|
13
|
-
gem "juwelier"
|
14
|
-
gem "what_methods"
|
10
|
+
gem "rspec", '~> 3.11.0'
|
11
|
+
gem "rspec-its", '~> 1.3.0'
|
12
|
+
gem "juwelier", '~> 2.4.9'
|
15
13
|
end
|
data/Gemfile.lock
CHANGED
@@ -7,7 +7,7 @@ GEM
|
|
7
7
|
descendants_tracker (0.0.4)
|
8
8
|
thread_safe (~> 0.3, >= 0.3.1)
|
9
9
|
diff-lcs (1.5.0)
|
10
|
-
faraday (1.
|
10
|
+
faraday (1.10.0)
|
11
11
|
faraday-em_http (~> 1.0)
|
12
12
|
faraday-em_synchrony (~> 1.0)
|
13
13
|
faraday-excon (~> 1.1)
|
@@ -23,14 +23,15 @@ GEM
|
|
23
23
|
faraday-em_synchrony (1.0.0)
|
24
24
|
faraday-excon (1.1.0)
|
25
25
|
faraday-httpclient (1.0.1)
|
26
|
-
faraday-multipart (1.0.
|
27
|
-
multipart-post (
|
26
|
+
faraday-multipart (1.0.4)
|
27
|
+
multipart-post (~> 2)
|
28
28
|
faraday-net_http (1.0.1)
|
29
29
|
faraday-net_http_persistent (1.2.0)
|
30
30
|
faraday-patron (1.0.0)
|
31
31
|
faraday-rack (1.0.0)
|
32
32
|
faraday-retry (1.0.3)
|
33
|
-
git (1.
|
33
|
+
git (1.13.1)
|
34
|
+
addressable (~> 2.8)
|
34
35
|
rchardet (~> 1.8)
|
35
36
|
github_api (0.19.0)
|
36
37
|
addressable (~> 2.4)
|
@@ -52,64 +53,61 @@ GEM
|
|
52
53
|
rake
|
53
54
|
rdoc
|
54
55
|
semver2
|
55
|
-
jwt (2.
|
56
|
+
jwt (2.4.1)
|
56
57
|
kamelcase (0.0.2)
|
57
58
|
semver2 (~> 3)
|
58
|
-
mini_portile2 (2.8.
|
59
|
+
mini_portile2 (2.8.1)
|
59
60
|
multi_json (1.15.0)
|
60
61
|
multi_xml (0.6.0)
|
61
|
-
multipart-post (2.
|
62
|
-
nokogiri (1.
|
62
|
+
multipart-post (2.2.3)
|
63
|
+
nokogiri (1.14.2)
|
63
64
|
mini_portile2 (~> 2.8.0)
|
64
65
|
racc (~> 1.4)
|
65
|
-
oauth2 (1.4.
|
66
|
-
faraday (>= 0.
|
66
|
+
oauth2 (1.4.11)
|
67
|
+
faraday (>= 0.17.3, < 3.0)
|
67
68
|
jwt (>= 1.0, < 3.0)
|
68
69
|
multi_json (~> 1.3)
|
69
70
|
multi_xml (~> 0.5)
|
70
|
-
rack (>= 1.2, <
|
71
|
-
psych (4.0.
|
71
|
+
rack (>= 1.2, < 4)
|
72
|
+
psych (4.0.4)
|
72
73
|
stringio
|
73
|
-
public_suffix (4.0.
|
74
|
-
racc (1.6.
|
75
|
-
rack (
|
74
|
+
public_suffix (4.0.7)
|
75
|
+
racc (1.6.2)
|
76
|
+
rack (3.0.4.1)
|
76
77
|
rainbow (3.1.1)
|
77
78
|
rake (13.0.6)
|
78
79
|
rchardet (1.8.0)
|
79
80
|
rdoc (6.4.0)
|
80
81
|
psych (>= 4.0.0)
|
81
|
-
rspec (3.
|
82
|
-
rspec-core (~> 3.
|
83
|
-
rspec-expectations (~> 3.
|
84
|
-
rspec-mocks (~> 3.
|
85
|
-
rspec-core (3.
|
86
|
-
rspec-support (~> 3.
|
87
|
-
rspec-expectations (3.
|
82
|
+
rspec (3.11.0)
|
83
|
+
rspec-core (~> 3.11.0)
|
84
|
+
rspec-expectations (~> 3.11.0)
|
85
|
+
rspec-mocks (~> 3.11.0)
|
86
|
+
rspec-core (3.11.0)
|
87
|
+
rspec-support (~> 3.11.0)
|
88
|
+
rspec-expectations (3.11.0)
|
88
89
|
diff-lcs (>= 1.2.0, < 2.0)
|
89
|
-
rspec-support (~> 3.
|
90
|
+
rspec-support (~> 3.11.0)
|
90
91
|
rspec-its (1.3.0)
|
91
92
|
rspec-core (>= 3.0.0)
|
92
93
|
rspec-expectations (>= 3.0.0)
|
93
|
-
rspec-mocks (3.
|
94
|
+
rspec-mocks (3.11.1)
|
94
95
|
diff-lcs (>= 1.2.0, < 2.0)
|
95
|
-
rspec-support (~> 3.
|
96
|
-
rspec-support (3.
|
96
|
+
rspec-support (~> 3.11.0)
|
97
|
+
rspec-support (3.11.0)
|
97
98
|
ruby2_keywords (0.0.5)
|
98
99
|
semver2 (3.4.2)
|
99
|
-
stringio (3.0.
|
100
|
+
stringio (3.0.2)
|
100
101
|
thread_safe (0.3.6)
|
101
|
-
what_methods (1.0.1)
|
102
102
|
|
103
103
|
PLATFORMS
|
104
104
|
ruby
|
105
105
|
|
106
106
|
DEPENDENCIES
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
rspec (~> 3.9.0)
|
107
|
+
juwelier (~> 2.4.9)
|
108
|
+
rainbow (~> 3.1.1)
|
109
|
+
rspec (~> 3.11.0)
|
111
110
|
rspec-its (~> 1.3.0)
|
112
|
-
what_methods
|
113
111
|
|
114
112
|
BUNDLED WITH
|
115
|
-
2.
|
113
|
+
2.3.12
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/zpng/adam7_decoder.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
module ZPNG
|
2
2
|
class Adam7Decoder
|
3
|
-
attr_accessor :
|
3
|
+
attr_accessor :bpp
|
4
4
|
attr_reader :scanlines_count
|
5
5
|
|
6
6
|
# http://en.wikipedia.org/wiki/Adam7_algorithm#Passes
|
7
|
-
def initialize
|
8
|
-
@
|
7
|
+
def initialize width, height, bpp
|
8
|
+
@bpp = bpp
|
9
|
+
raise "Invalid BPP #{@bpp.inspect}" if @bpp.to_i == 0
|
9
10
|
@widths = [
|
10
|
-
[(
|
11
|
-
[((
|
12
|
-
[(
|
13
|
-
[((
|
14
|
-
[(
|
15
|
-
[((
|
16
|
-
[
|
11
|
+
[(width/8.0).ceil] * (height/8.0).ceil, # pass1
|
12
|
+
[((width-4)/8.0).ceil] * (height/8.0).ceil, # pass2
|
13
|
+
[(width/4.0).ceil] * ((height-4)/8.0).ceil, # pass3
|
14
|
+
[((width-2)/4.0).ceil] * (height/4.0).ceil, # pass4
|
15
|
+
[(width/2.0).ceil] * ((height-2)/4.0).ceil, # pass5
|
16
|
+
[((width-1)/2.0).ceil] * (height/2.0).ceil, # pass6
|
17
|
+
[width] * ((height-1)/2.0).ceil # pass7
|
17
18
|
].map{ |x| x == [0] ? [] : x }
|
18
19
|
@scanlines_count = 0
|
19
20
|
# two leading zeroes added specially for convert_coords() code readability
|
@@ -28,7 +29,7 @@ module ZPNG
|
|
28
29
|
|
29
30
|
# scanline size in bytes, INCLUDING leading filter byte
|
30
31
|
def scanline_size idx
|
31
|
-
(scanline_width(idx) *
|
32
|
+
(scanline_width(idx) * bpp / 8.0).ceil + 1
|
32
33
|
end
|
33
34
|
|
34
35
|
# scanline offset in imagedata
|
data/lib/zpng/chunk.rb
CHANGED
@@ -51,10 +51,10 @@ module ZPNG
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def export
|
54
|
+
def export( fix_crc: true )
|
55
55
|
@data = self.export_data # virtual
|
56
56
|
@size = @data.size # XXX hmm.. is it always is?
|
57
|
-
fix_crc!
|
57
|
+
fix_crc! if fix_crc
|
58
58
|
[@size,@type].pack('Na4') + @data + [@crc].pack('N')
|
59
59
|
end
|
60
60
|
|
@@ -98,6 +98,9 @@ module ZPNG
|
|
98
98
|
class IHDR < Chunk
|
99
99
|
attr_accessor :width, :height, :depth, :color, :compression, :filter, :interlace
|
100
100
|
|
101
|
+
SIZE = 13
|
102
|
+
FORMAT = 'NNC5'
|
103
|
+
|
101
104
|
PALETTE_USED = 1
|
102
105
|
COLOR_USED = 2
|
103
106
|
ALPHA_USED = 4
|
@@ -130,8 +133,6 @@ module ZPNG
|
|
130
133
|
COLOR_RGBA => [ 8, 16 ],
|
131
134
|
}
|
132
135
|
|
133
|
-
FORMAT = 'NNC5'
|
134
|
-
|
135
136
|
def initialize x
|
136
137
|
super
|
137
138
|
vars = %w'width height depth color compression filter interlace' # order is important
|
@@ -173,7 +174,7 @@ module ZPNG
|
|
173
174
|
@filter ||= 0
|
174
175
|
@interlace ||= 0
|
175
176
|
|
176
|
-
unless ALLOWED_DEPTHS[@color]
|
177
|
+
unless ALLOWED_DEPTHS[@color]&.include?(@depth)
|
177
178
|
raise "[!] invalid color mode (#{@color.inspect}) / bit depth (#{@depth.inspect}) combination"
|
178
179
|
end
|
179
180
|
end
|
@@ -190,7 +191,8 @@ module ZPNG
|
|
190
191
|
|
191
192
|
# bits per pixel
|
192
193
|
def bpp
|
193
|
-
SAMPLES_PER_COLOR[@color]
|
194
|
+
spc = SAMPLES_PER_COLOR[@color]
|
195
|
+
spc ? spc * depth : nil
|
194
196
|
end
|
195
197
|
|
196
198
|
def color_used?
|
@@ -275,8 +277,32 @@ module ZPNG
|
|
275
277
|
alias :<< :find_or_add
|
276
278
|
end
|
277
279
|
|
280
|
+
class CHRM < Chunk
|
281
|
+
SIZE = 32
|
282
|
+
end
|
283
|
+
|
284
|
+
class GAMA < Chunk
|
285
|
+
SIZE = 4
|
286
|
+
end
|
287
|
+
|
278
288
|
class IDAT < Chunk; end
|
279
|
-
|
289
|
+
|
290
|
+
class TIME < Chunk
|
291
|
+
SIZE = 7
|
292
|
+
end
|
293
|
+
|
294
|
+
class IEND < Chunk
|
295
|
+
SIZE = 4
|
296
|
+
end
|
297
|
+
|
298
|
+
class PHYS < Chunk
|
299
|
+
SIZE = 9
|
300
|
+
end
|
301
|
+
|
302
|
+
class SRGB < Chunk
|
303
|
+
SIZE = 1
|
304
|
+
end
|
305
|
+
|
280
306
|
class TRNS < Chunk; end
|
281
307
|
|
282
308
|
end
|
data/lib/zpng/cli.rb
CHANGED
@@ -179,13 +179,15 @@ module ZPNG
|
|
179
179
|
color = %w'COLOR_GRAYSCALE COLOR_RGB COLOR_INDEXED COLOR_GRAY_ALPHA COLOR_RGBA'.find do |k|
|
180
180
|
@img.hdr.color == ZPNG.const_get(k)
|
181
181
|
end
|
182
|
-
puts "[.] image size #{@img.width || '?'}x#{@img.height || '?'}, #{@img.bpp}bpp, #{color}"
|
182
|
+
puts "[.] image size #{@img.width || '?'}x#{@img.height || '?'}, #{@img.bpp || '?'}bpp, #{color}"
|
183
183
|
puts "[.] palette = #{@img.palette}" if @img.palette
|
184
|
-
puts "[.] uncompressed imagedata size = #{@img.imagedata_size} bytes"
|
184
|
+
puts "[.] uncompressed imagedata size = #{@img.imagedata_size || '?'} bytes"
|
185
185
|
_conditional_hexdump(@img.imagedata, 3) if @options[:verbose] > 0
|
186
186
|
end
|
187
187
|
|
188
188
|
def _conditional_hexdump data, v2 = 2
|
189
|
+
return unless data
|
190
|
+
|
189
191
|
if @options[:verbose] <= 0
|
190
192
|
# do nothing
|
191
193
|
elsif @options[:verbose] < v2
|
@@ -221,7 +223,11 @@ module ZPNG
|
|
221
223
|
end
|
222
224
|
puts "[.] #{chunk.inspect(@options[:verbose]).sub(chunk.type, colored_type)} #{colored_crc}"
|
223
225
|
|
224
|
-
|
226
|
+
if @options[:verbose] >= 3
|
227
|
+
_conditional_hexdump(chunk.export(fix_crc: false))
|
228
|
+
else
|
229
|
+
_conditional_hexdump(chunk.data)
|
230
|
+
end
|
225
231
|
end
|
226
232
|
end
|
227
233
|
|
data/lib/zpng/image.rb
CHANGED
@@ -62,7 +62,7 @@ module ZPNG
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def adam7
|
65
|
-
@adam7 ||= Adam7Decoder.new(
|
65
|
+
@adam7 ||= Adam7Decoder.new(width, height, bpp)
|
66
66
|
end
|
67
67
|
|
68
68
|
class << self
|
@@ -119,7 +119,7 @@ module ZPNG
|
|
119
119
|
io.seek(chunk.offset+delta, IO::SEEK_SET)
|
120
120
|
potential_chunk = Chunk.new(io)
|
121
121
|
if potential_chunk.valid?
|
122
|
-
STDERR.puts "[!] heuristics: found invalid chunk at offset #{chunk.offset}, but valid
|
122
|
+
STDERR.puts "[!] heuristics: found invalid #{chunk.type.inspect} chunk at offset #{chunk.offset}, but valid #{potential_chunk.type.inspect} at #{chunk.offset+delta}. using latter".red
|
123
123
|
if delta > 0
|
124
124
|
io.seek(chunk.offset, IO::SEEK_SET)
|
125
125
|
data = io.read(delta)
|
@@ -330,7 +330,7 @@ module ZPNG
|
|
330
330
|
if new_image?
|
331
331
|
@scanlines.map(&:size).inject(&:+)
|
332
332
|
else
|
333
|
-
imagedata
|
333
|
+
imagedata&.size
|
334
334
|
end
|
335
335
|
end
|
336
336
|
|
data/spec/adam7_spec.rb
CHANGED
@@ -13,9 +13,7 @@ describe ZPNG::Adam7Decoder do
|
|
13
13
|
}.each do |dims, slw|
|
14
14
|
it "should be right for #{dims} image" do
|
15
15
|
w,h = dims.split('x').map(&:to_i)
|
16
|
-
|
17
|
-
allow(img).to receive_messages(:width => w, :height => h)
|
18
|
-
adam7 = ZPNG::Adam7Decoder.new(img)
|
16
|
+
adam7 = ZPNG::Adam7Decoder.new(w, h, 8)
|
19
17
|
slw.size.times.map{ |i| adam7.scanline_width(i) }.should == slw
|
20
18
|
end
|
21
19
|
end
|
@@ -34,9 +32,7 @@ describe ZPNG::Adam7Decoder do
|
|
34
32
|
}.each do |dims, n|
|
35
33
|
it "should be right for #{dims} image" do
|
36
34
|
w,h = dims.split('x').map(&:to_i)
|
37
|
-
|
38
|
-
allow(img).to receive_messages(:width => w, :height => h)
|
39
|
-
adam7 = ZPNG::Adam7Decoder.new(img)
|
35
|
+
adam7 = ZPNG::Adam7Decoder.new(w, h, 8)
|
40
36
|
adam7.scanlines_count.should == n
|
41
37
|
end
|
42
38
|
end
|
@@ -54,9 +50,7 @@ describe ZPNG::Adam7Decoder do
|
|
54
50
|
}.each do |dims, pst|
|
55
51
|
it "should be right for #{dims} image" do
|
56
52
|
w,h = dims.split('x').map(&:to_i)
|
57
|
-
|
58
|
-
allow(img).to receive_messages(:width => w, :height => h)
|
59
|
-
adam7 = ZPNG::Adam7Decoder.new(img)
|
53
|
+
adam7 = ZPNG::Adam7Decoder.new(w, h, 8)
|
60
54
|
adam7.instance_variable_get("@pass_starts").should == pst
|
61
55
|
end
|
62
56
|
end
|
data/spec/bad_samples_spec.rb
CHANGED
@@ -15,6 +15,7 @@ each_sample("bad/*.png") do |fname|
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should access 1st pixel" do
|
18
|
+
skip "no BPP" unless @img.bpp
|
18
19
|
@img[0,0].should be_instance_of(ZPNG::Color)
|
19
20
|
end
|
20
21
|
|
@@ -31,6 +32,7 @@ each_sample("bad/*.png") do |fname|
|
|
31
32
|
end
|
32
33
|
|
33
34
|
it "shows scanlines" do
|
35
|
+
skip "no BPP" unless @img.bpp
|
34
36
|
orig_stdout, out = $stdout, ""
|
35
37
|
begin
|
36
38
|
$stdout = StringIO.new(out)
|
data/spec/create_image_spec.rb
CHANGED
@@ -32,8 +32,9 @@ describe Image do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
describe "new( :bpp => 16, :color => true )" do
|
35
|
-
|
36
|
-
|
35
|
+
it "raises error" do
|
36
|
+
lambda { _new_img(16,true) }.should raise_error(RuntimeError)
|
37
|
+
end
|
37
38
|
end
|
38
39
|
|
39
40
|
describe "new( :bpp => 24, :color => false )" do
|
data/spec/support/png_suite.rb
CHANGED
data/zpng.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: zpng 0.4.
|
5
|
+
# stub: zpng 0.4.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "zpng".freeze
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.4"
|
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 = "
|
14
|
+
s.date = "2023-02-14"
|
15
15
|
s.email = "zed.0xff@gmail.com".freeze
|
16
16
|
s.executables = ["zpng".freeze]
|
17
17
|
s.extra_rdoc_files = [
|
@@ -51,25 +51,6 @@ Gem::Specification.new do |s|
|
|
51
51
|
"lib/zpng/text_chunk.rb",
|
52
52
|
"misc/chars.png",
|
53
53
|
"misc/gen_ascii_map.rb",
|
54
|
-
"samples/bad/000000.png",
|
55
|
-
"samples/bad/149511457-47db5096-662d-4221-84f9-1c2a0e20e323.png",
|
56
|
-
"samples/bad/b1.png",
|
57
|
-
"samples/captcha_4bpp.png",
|
58
|
-
"samples/cats.png",
|
59
|
-
"samples/itxt.png",
|
60
|
-
"samples/modify.rb",
|
61
|
-
"samples/mouse.bmp",
|
62
|
-
"samples/mouse.png",
|
63
|
-
"samples/mouse17.bmp",
|
64
|
-
"samples/mouse17.png",
|
65
|
-
"samples/qr_aux_chunks.png",
|
66
|
-
"samples/qr_bw.png",
|
67
|
-
"samples/qr_gray_alpha.png",
|
68
|
-
"samples/qr_grayscale.png",
|
69
|
-
"samples/qr_plte.png",
|
70
|
-
"samples/qr_plte_bw.png",
|
71
|
-
"samples/qr_rgb.png",
|
72
|
-
"samples/qr_rgba.png",
|
73
54
|
"spec/adam7_spec.rb",
|
74
55
|
"spec/alpha_spec.rb",
|
75
56
|
"spec/ascii_spec.rb",
|
@@ -95,7 +76,7 @@ Gem::Specification.new do |s|
|
|
95
76
|
]
|
96
77
|
s.homepage = "http://github.com/zed-0xff/zpng".freeze
|
97
78
|
s.licenses = ["MIT".freeze]
|
98
|
-
s.rubygems_version = "3.
|
79
|
+
s.rubygems_version = "3.3.7".freeze
|
99
80
|
s.summary = "pure ruby PNG file manipulation & validation".freeze
|
100
81
|
|
101
82
|
if s.respond_to? :specification_version then
|
@@ -103,19 +84,15 @@ Gem::Specification.new do |s|
|
|
103
84
|
end
|
104
85
|
|
105
86
|
if s.respond_to? :add_runtime_dependency then
|
106
|
-
s.add_runtime_dependency(%q<rainbow>.freeze, ["
|
107
|
-
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.
|
87
|
+
s.add_runtime_dependency(%q<rainbow>.freeze, ["~> 3.1.1"])
|
88
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.11.0"])
|
108
89
|
s.add_development_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
109
|
-
s.add_development_dependency(%q<
|
110
|
-
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
111
|
-
s.add_development_dependency(%q<what_methods>.freeze, [">= 0"])
|
90
|
+
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
|
112
91
|
else
|
113
|
-
s.add_dependency(%q<rainbow>.freeze, ["
|
114
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.
|
92
|
+
s.add_dependency(%q<rainbow>.freeze, ["~> 3.1.1"])
|
93
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.11.0"])
|
115
94
|
s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
116
|
-
s.add_dependency(%q<
|
117
|
-
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
118
|
-
s.add_dependency(%q<what_methods>.freeze, [">= 0"])
|
95
|
+
s.add_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
|
119
96
|
end
|
120
97
|
end
|
121
98
|
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zpng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey "Zed" Zaikin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 3.11.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 3.11.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec-its
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,47 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.3.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: juwelier
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: 2.4.9
|
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.
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: juwelier
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: what_methods
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
68
|
+
version: 2.4.9
|
97
69
|
description:
|
98
70
|
email: zed.0xff@gmail.com
|
99
71
|
executables:
|
@@ -135,25 +107,6 @@ files:
|
|
135
107
|
- lib/zpng/text_chunk.rb
|
136
108
|
- misc/chars.png
|
137
109
|
- misc/gen_ascii_map.rb
|
138
|
-
- samples/bad/000000.png
|
139
|
-
- samples/bad/149511457-47db5096-662d-4221-84f9-1c2a0e20e323.png
|
140
|
-
- samples/bad/b1.png
|
141
|
-
- samples/captcha_4bpp.png
|
142
|
-
- samples/cats.png
|
143
|
-
- samples/itxt.png
|
144
|
-
- samples/modify.rb
|
145
|
-
- samples/mouse.bmp
|
146
|
-
- samples/mouse.png
|
147
|
-
- samples/mouse17.bmp
|
148
|
-
- samples/mouse17.png
|
149
|
-
- samples/qr_aux_chunks.png
|
150
|
-
- samples/qr_bw.png
|
151
|
-
- samples/qr_gray_alpha.png
|
152
|
-
- samples/qr_grayscale.png
|
153
|
-
- samples/qr_plte.png
|
154
|
-
- samples/qr_plte_bw.png
|
155
|
-
- samples/qr_rgb.png
|
156
|
-
- samples/qr_rgba.png
|
157
110
|
- spec/adam7_spec.rb
|
158
111
|
- spec/alpha_spec.rb
|
159
112
|
- spec/ascii_spec.rb
|
@@ -195,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
148
|
- !ruby/object:Gem::Version
|
196
149
|
version: '0'
|
197
150
|
requirements: []
|
198
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.3.7
|
199
152
|
signing_key:
|
200
153
|
specification_version: 4
|
201
154
|
summary: pure ruby PNG file manipulation & validation
|
data/samples/bad/000000.png
DELETED
Binary file
|
Binary file
|
data/samples/bad/b1.png
DELETED
Binary file
|
data/samples/captcha_4bpp.png
DELETED
Binary file
|
data/samples/cats.png
DELETED
Binary file
|
data/samples/itxt.png
DELETED
Binary file
|
data/samples/modify.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'zpng'
|
3
|
-
include ZPNG
|
4
|
-
|
5
|
-
img = Image.new(File.join(File.dirname(__FILE__),"http.png"))
|
6
|
-
|
7
|
-
puts "[.] original:"
|
8
|
-
puts img.to_s
|
9
|
-
puts
|
10
|
-
|
11
|
-
img.width.times do |x|
|
12
|
-
img[x,0] = (x % 2 == 0) ? Color::WHITE : Color::BLACK
|
13
|
-
end
|
14
|
-
|
15
|
-
puts "[.] modified:"
|
16
|
-
puts img.to_s
|
17
|
-
|
18
|
-
File.open("http-modified.png","wb") do |f|
|
19
|
-
f << img.export
|
20
|
-
end
|
data/samples/mouse.bmp
DELETED
Binary file
|
data/samples/mouse.png
DELETED
Binary file
|
data/samples/mouse17.bmp
DELETED
Binary file
|
data/samples/mouse17.png
DELETED
Binary file
|
data/samples/qr_aux_chunks.png
DELETED
Binary file
|
data/samples/qr_bw.png
DELETED
Binary file
|
data/samples/qr_gray_alpha.png
DELETED
Binary file
|
data/samples/qr_grayscale.png
DELETED
Binary file
|
data/samples/qr_plte.png
DELETED
Binary file
|
data/samples/qr_plte_bw.png
DELETED
Binary file
|
data/samples/qr_rgb.png
DELETED
Binary file
|
data/samples/qr_rgba.png
DELETED
Binary file
|