obf 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/TimesNewRoman.ttf +0 -0
- data/lib/obf/pdf.rb +2 -0
- data/lib/obf/utils.rb +10 -7
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d72d3a1108db429d2a7298c3ba99f5c745a28f
|
4
|
+
data.tar.gz: 853f4bacc4dd3f7b6d92d50fe7f01c8aedf9b0f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca8ccd678f89aeb58f302b4965b87e76f68cc52f7996560ecbe77a2b2fc917be9627d78ec055e6aead76e7955d830eec098989ae978737fffd265491da55e69d
|
7
|
+
data.tar.gz: e8c10fd75ec8ed098b28f6488c3f3c7e13b305279bda8a200762d263863803203ffcf55b18dd3b6ff0380062107ba156b7b1a97358ce96fc796c3bb364f3412d
|
Binary file
|
data/lib/obf/pdf.rb
CHANGED
data/lib/obf/utils.rb
CHANGED
@@ -157,17 +157,20 @@ module OBF::Utils
|
|
157
157
|
return nil
|
158
158
|
end
|
159
159
|
file.close
|
160
|
-
if extension && ['image/jpeg', 'image/jpg'
|
160
|
+
if extension && ['image/jpeg', 'image/jpg'].include?(image['content_type']) && image['width'] && image['width'] < 1000 && image['width'] == image['height']
|
161
161
|
# png files need to be converted to make sure they don't have a transparent bg, or
|
162
162
|
# else performance takes a huge hit.
|
163
|
-
`cp #{file.path} #{file.path}
|
164
|
-
"#{file.path}
|
163
|
+
`cp #{file.path} #{file.path}#{extension}`
|
164
|
+
"#{file.path}#{extension}"
|
165
165
|
else
|
166
|
-
# TODO: maybe convert to jpg instead of png?
|
167
|
-
# see https://github.com/prawnpdf/prawn/issues/324
|
168
|
-
# in that case, fill the image with a white background, perhaps?
|
169
166
|
background ||= 'white'
|
170
|
-
|
167
|
+
size = 400
|
168
|
+
if image['content_type'] && image['content_type'].match(/svg/) && background != 'white'
|
169
|
+
`convert -background none -density 300 -resize #{size}x#{size} -gravity center -extent #{size}x#{size} #{file.path} #{file.path}.png`
|
170
|
+
`convert #{file.path}.png -density 300 -resize #{size}x#{size} -background "#{background}" -gravity center -extent #{size}x#{size} #{file.path}.jpg`
|
171
|
+
else
|
172
|
+
`convert #{file.path} -density 300 -resize #{size}x#{size} -background "#{background}" -gravity center -extent #{size}x#{size} #{file.path}.jpg`
|
173
|
+
end
|
171
174
|
"#{file.path}.jpg"
|
172
175
|
end
|
173
176
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Whitmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -145,6 +145,7 @@ extra_rdoc_files:
|
|
145
145
|
files:
|
146
146
|
- LICENSE
|
147
147
|
- README.md
|
148
|
+
- lib/TimesNewRoman.ttf
|
148
149
|
- lib/obf.rb
|
149
150
|
- lib/obf/avz.rb
|
150
151
|
- lib/obf/external.rb
|