obf 0.6.29 → 0.6.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/obf/external.rb +9 -6
- data/lib/obf/utils.rb +0 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69c154d2e11fec6d5cb7c58b72d02cb1f5581b13
|
4
|
+
data.tar.gz: aeef062d222835392d16f2681f3cd956ac941b83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24cbd9fe728c3190144cb9a301a5d0923594243aa605ce7ed8c09c71cea2829594087d607523bc569df8a379798d09f6842fcd151eb6fdaa9cd1a511921557d
|
7
|
+
data.tar.gz: b7a2853bbdc5940155b2d7bb68e997430591c4193788525380897cd394dd12f2ded977fc9db35c598f51cc466435bf3c992854c728b50125260ef384c50528e5
|
data/lib/obf/external.rb
CHANGED
@@ -113,19 +113,22 @@ module OBF::External
|
|
113
113
|
else
|
114
114
|
image_fetch = OBF::Utils.image_raw(image['data'] || image['url'])
|
115
115
|
if image_fetch
|
116
|
+
if !image['content_type'] || !image['width'] || !image['height']
|
117
|
+
attrs = OBF::Utils.image_attrs(image_fetch['data'])
|
118
|
+
image['content_type'] ||= image_fetch['content_type'] || attrs['content_type']
|
119
|
+
image['width'] ||= attrs['width']
|
120
|
+
image['height'] ||= attrs['height']
|
121
|
+
end
|
116
122
|
zip_path = "images/image_#{image['id']}#{image_fetch['extension']}"
|
117
123
|
path_hash['images'] ||= {}
|
118
124
|
path_hash['images'][image['id']] = {
|
119
125
|
'path' => zip_path,
|
120
|
-
'content_type' =>
|
121
|
-
'width' =>
|
122
|
-
'height' =>
|
126
|
+
'content_type' => image['content_type'],
|
127
|
+
'width' => image['width'],
|
128
|
+
'height' => image['height']
|
123
129
|
}
|
124
130
|
path_hash['zip'].add(zip_path, image_fetch['data'])
|
125
131
|
image['path'] = zip_path
|
126
|
-
image['content_type'] ||= image_fetch['content_type']
|
127
|
-
image['width'] ||= image_fetch['width']
|
128
|
-
image['height'] ||= image_fetch['height']
|
129
132
|
end
|
130
133
|
end
|
131
134
|
end
|
data/lib/obf/utils.rb
CHANGED
@@ -25,12 +25,6 @@ module OBF::Utils
|
|
25
25
|
'data' => data,
|
26
26
|
'extension' => extension
|
27
27
|
}
|
28
|
-
if content_type && content_type.match(/^image/)
|
29
|
-
attrs = image_attrs(data, extension)
|
30
|
-
res['content_type'] ||= attrs['content_type']
|
31
|
-
res['width'] ||= attrs['width']
|
32
|
-
res['height'] ||= attrs['height']
|
33
|
-
end
|
34
28
|
res
|
35
29
|
end
|
36
30
|
|