origami 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/origami/graphics/colors.rb +2 -2
- data/lib/origami/graphics/xobject.rb +3 -3
- data/lib/origami/linearization.rb +1 -1
- data/lib/origami/name.rb +1 -0
- data/lib/origami/obfuscation.rb +1 -1
- data/lib/origami/page.rb +1 -1
- data/lib/origami/trailer.rb +6 -5
- data/lib/origami/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747446efde7ffefe478ec34908b8555b3a5e2596
|
4
|
+
data.tar.gz: 8d92eb219be13b1070e421a6570c587a16fb9a68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3f3997e8181f448f74e9a2bc84855652b71b4ea66a2ede9f1b3f8cc696eb77e82c72f436cc430c838972e43cab0566ce52bf6c8fb0fd0ebee47889a2ff3de9f
|
7
|
+
data.tar.gz: e8895bcc5b5b4ae96bcb24d66b4befea45cf2068493814859092f2b56b25dd3d9467df3fcd72b73a6cbbb835e2cae8910a0725f3c85b042127d14aef1c57fa80
|
@@ -203,11 +203,11 @@ module Origami
|
|
203
203
|
insn 'sc', '*' do |canvas, *c| canvas.gs.set_nonstroking_color(c) end
|
204
204
|
|
205
205
|
insn 'G', Real do |canvas, c|
|
206
|
-
canvas.gs.set_stroking_color([c], Graphics::Color::
|
206
|
+
canvas.gs.set_stroking_color([c], Graphics::Color::Space::DEVICE_GRAY)
|
207
207
|
end
|
208
208
|
|
209
209
|
insn 'g', Real do |canvas, c|
|
210
|
-
canvas.gs.set_nonstroking_color([c], Graphics::Color::
|
210
|
+
canvas.gs.set_nonstroking_color([c], Graphics::Color::Space::DEVICE_GRAY)
|
211
211
|
end
|
212
212
|
|
213
213
|
insn 'RG', Real, Real, Real do |canvas, r, g, b|
|
@@ -666,15 +666,15 @@ module Origami
|
|
666
666
|
|
667
667
|
raise ArgumentError, "Missing file format" if format.nil?
|
668
668
|
case format.downcase
|
669
|
-
when 'jpg', 'jpeg', 'jpe', 'jif', 'jfif', 'jfi'
|
669
|
+
when '.jpg', 'jpeg', '.jpe', '.jif', '.jfif', '.jfi'
|
670
670
|
image.setFilter :DCTDecode
|
671
671
|
image.encoded_data = data
|
672
672
|
|
673
|
-
when 'jp2','jpx','j2k','jpf','jpm','mj2'
|
673
|
+
when '.jp2','.jpx','.j2k','.jpf','.jpm','.mj2'
|
674
674
|
image.setFilter :JPXDecode
|
675
675
|
image.encoded_data = data
|
676
676
|
|
677
|
-
when 'jb2', 'jbig', 'jbig2'
|
677
|
+
when '.jb2', '.jbig', '.jbig2'
|
678
678
|
image.setFilter :JBIG2Decode
|
679
679
|
image.encoded_data = data
|
680
680
|
else
|
@@ -63,7 +63,7 @@ module Origami
|
|
63
63
|
last_trailer = (@revisions.last.trailer ||= Trailer.new)
|
64
64
|
last_trailer.dictionary ||= Dictionary.new
|
65
65
|
|
66
|
-
if prev_trailer.
|
66
|
+
if prev_trailer.dictionary?
|
67
67
|
last_trailer.dictionary =
|
68
68
|
last_trailer.dictionary.merge(prev_trailer.dictionary)
|
69
69
|
else
|
data/lib/origami/name.rb
CHANGED
data/lib/origami/obfuscation.rb
CHANGED
data/lib/origami/page.rb
CHANGED
@@ -163,7 +163,7 @@ module Origami
|
|
163
163
|
target = self.is_a?(Resources) ? self : (self.Resources ||= Resources.new)
|
164
164
|
|
165
165
|
rsrc_dict = (target[type] and target[type].solve) || (target[type] = Dictionary.new)
|
166
|
-
rsrc_dict[name] = rsrc
|
166
|
+
rsrc_dict[name.to_sym] = rsrc
|
167
167
|
|
168
168
|
name
|
169
169
|
end
|
data/lib/origami/trailer.rb
CHANGED
@@ -30,7 +30,7 @@ module Origami
|
|
30
30
|
#
|
31
31
|
# First look for a standard trailer dictionary
|
32
32
|
#
|
33
|
-
if @revisions.last.trailer.
|
33
|
+
if @revisions.last.trailer.dictionary?
|
34
34
|
trl = @revisions.last.trailer
|
35
35
|
|
36
36
|
#
|
@@ -54,7 +54,7 @@ module Origami
|
|
54
54
|
def trailer_key(attr) #:nodoc:
|
55
55
|
|
56
56
|
@revisions.reverse_each do |rev|
|
57
|
-
if rev.trailer.
|
57
|
+
if rev.trailer.dictionary? and not rev.trailer[attr].nil?
|
58
58
|
return rev.trailer[attr].solve
|
59
59
|
elsif rev.has_xrefstm?
|
60
60
|
xrefstm = rev.xrefstm
|
@@ -136,10 +136,11 @@ module Origami
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def [](key)
|
139
|
-
@dictionary[key] if
|
139
|
+
@dictionary[key] if dictionary?
|
140
140
|
end
|
141
141
|
|
142
142
|
def []=(key,val)
|
143
|
+
self.dictionary = Dictionary.new unless dictionary?
|
143
144
|
@dictionary[key] = val
|
144
145
|
end
|
145
146
|
|
@@ -148,7 +149,7 @@ module Origami
|
|
148
149
|
@dictionary = dict
|
149
150
|
end
|
150
151
|
|
151
|
-
def
|
152
|
+
def dictionary?
|
152
153
|
not @dictionary.nil?
|
153
154
|
end
|
154
155
|
|
@@ -157,7 +158,7 @@ module Origami
|
|
157
158
|
#
|
158
159
|
def to_s
|
159
160
|
content = ""
|
160
|
-
if self.
|
161
|
+
if self.dictionary?
|
161
162
|
content << TOKENS.first << EOL << @dictionary.to_s << EOL
|
162
163
|
end
|
163
164
|
|
data/lib/origami/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origami
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Delugré
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
requirements:
|
226
226
|
- gtk2 to run the graphical interface
|
227
227
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.6.
|
228
|
+
rubygems_version: 2.6.11
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: Ruby framework to manipulate PDF documents
|