obf 0.6.29 → 0.6.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb28de2c0b80cad68df21fd3a3a775919612e0ec
4
- data.tar.gz: c3494f0256523fa5c657c9c530f7b2b68b4a5367
3
+ metadata.gz: 69c154d2e11fec6d5cb7c58b72d02cb1f5581b13
4
+ data.tar.gz: aeef062d222835392d16f2681f3cd956ac941b83
5
5
  SHA512:
6
- metadata.gz: 1769142acdfcf9fd289d1c6b219600975bb25ce8413b92347e4ddba30e52de4e3d417b72411b001d7d966e63a1ce18da438eeee11ff384afea84ef6f65c518d4
7
- data.tar.gz: 2f4ba3dd445f35bb78029a0871c8fcb3e5e814d6db8ab3204cb94cd656287791986a2b7c57c70960da0e0b071bf0f69b41809732b9ee2aa58c88c8ef47692f3c
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' => image_fetch['content_type'],
121
- 'width' => image_fetch['width'],
122
- 'height' => image_fetch['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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.29
4
+ version: 0.6.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer