zsteg 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/zsteg-mask +8 -0
- data/bin/zsteg-reflow +8 -0
- data/lib/zsteg/cli/cli.rb +13 -1
- data/spec/zlib_spec.rb +19 -3
- data/zsteg.gemspec +2 -2
- metadata +1 -1
- data/bin/zsteg-mask +0 -1
- data/bin/zsteg-reflow +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb1bb907e034ed5fc54f9febcf4cdd78f6de91af843adf94ffd03d0a8be3aac1
|
4
|
+
data.tar.gz: b5cf9a4fd08d72129954628dca764be23528402ad82e608f5f36f96825b1437d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f0532dd0e6e6bdce7dbdb9a769738f6964ce0033344f659b4447fe0af03ee7e128e89cfe1ab967edc6c4d65a2b836a4b3951320187444036a4260fee2bb79ff
|
7
|
+
data.tar.gz: 69908330b837fbbc32a3f358c478756a7341361cfce99a62922c00a0a29c6c0941396ae5785977e9d4249df1b6506ff2ae17e93ef1cbe862ae61e8e5f40715fb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/bin/zsteg-mask
ADDED
data/bin/zsteg-reflow
ADDED
data/lib/zsteg/cli/cli.rb
CHANGED
@@ -209,6 +209,8 @@ module ZSteg
|
|
209
209
|
h[:order] = x
|
210
210
|
when 'prime'
|
211
211
|
h[:prime] = true
|
212
|
+
when 'zlib'
|
213
|
+
h[:zlib] = true
|
212
214
|
else
|
213
215
|
raise "uknown param #{x.inspect}"
|
214
216
|
end
|
@@ -227,6 +229,8 @@ module ZSteg
|
|
227
229
|
# zlib stream may contain extradata
|
228
230
|
@img.imagedata
|
229
231
|
@img.extradata[$1.to_i]
|
232
|
+
when /imagedata/
|
233
|
+
@img.imagedata
|
230
234
|
else
|
231
235
|
h = decode_param_string name
|
232
236
|
h[:limit] = @options[:limit] if @options[:limit] != Checker::DEFAULT_LIMIT
|
@@ -242,7 +246,15 @@ module ZSteg
|
|
242
246
|
end
|
243
247
|
|
244
248
|
def extract name
|
245
|
-
|
249
|
+
data = _extract_data(name)
|
250
|
+
if name['zlib']
|
251
|
+
if r = Checker::Zlib.check_data(data)
|
252
|
+
data = r.data
|
253
|
+
else
|
254
|
+
raise "cannot decompress with zlib"
|
255
|
+
end
|
256
|
+
end
|
257
|
+
print data
|
246
258
|
end
|
247
259
|
|
248
260
|
end
|
data/spec/zlib_spec.rb
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
sample("ndh2k12_sp113.bmp") do |fname|
|
4
|
+
describe fname do
|
5
|
+
subject{ cli(fname, "-o", "all") }
|
6
|
+
it { should include("%PDF-1.4") }
|
7
|
+
|
8
|
+
describe "--extract" do
|
9
|
+
subject{ cli(fname, "--extract b1,rgb,lsb,yx") }
|
10
|
+
|
11
|
+
it { should_not include "%PDF-1.4" }
|
12
|
+
it { subject.size.should == 546750 }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "--extract zlib" do
|
16
|
+
subject{ cli(fname, "--extract b1,rgb,lsb,yx,zlib") }
|
17
|
+
|
18
|
+
it { should include "%PDF-1.4" }
|
19
|
+
it { subject.size.should == 202383 }
|
20
|
+
end
|
21
|
+
end
|
6
22
|
end
|
data/zsteg.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: zsteg 0.2.
|
5
|
+
# stub: zsteg 0.2.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "zsteg".freeze
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.1"
|
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]
|
metadata
CHANGED
data/bin/zsteg-mask
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
bin/zsteg
|
data/bin/zsteg-reflow
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
bin/zsteg
|