obf 0.6.21 → 0.6.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/utils.rb +12 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03b9f2c5c9bf032340aaef0f589345218ff1935e
4
- data.tar.gz: 0ded6c478c227820dfb01e8e517f365dc2f8bce2
3
+ metadata.gz: 71e30f866a01995e08ca6c519b7a80799ef40d02
4
+ data.tar.gz: 6625177ac355eec234625152fac7abbacaff4515
5
5
  SHA512:
6
- metadata.gz: 4b2c2d8fcc92ef4411bf0f3606d011683a55cecbd1ee195d2a244b8349aac3bb62ea3a2436b0e20a65804f430dd2d78c41205d1d268302821bdc2801b5542a87
7
- data.tar.gz: e0bcfef45b79fc50b214ccb3113e85392509e804e5878208d1873d6fc3eaf69183000881c5b881e8509869a4c2419e59a21e536def093459a1f4729fb90e8ea0
6
+ metadata.gz: 8dc5b6b126eac50c4dc1051760b00519b7868a68b04dc165ad8eb1a3f29e02a326165de638891c1ae2049d5b467f389e81d6fc1b56c4bdbdd7beb67c79aa53fb
7
+ data.tar.gz: 7260b87077c93b60ecc73ecf918dbab60ca09ea385c8df55ed6b3ff41e6228a2149fca2ae474ac2f492773247ce1d9cfb4ffdb71632bc6780c6bcb52bac306f8
@@ -26,7 +26,10 @@ module OBF::Utils
26
26
  'extension' => extension
27
27
  }
28
28
  if content_type && content_type.match(/^image/)
29
- res = image_attrs(data).merge(res)
29
+ attrs = image_attrs(data)
30
+ res['content_type'] ||= attrs['content_type']
31
+ res['width'] ||= attrs['width']
32
+ res['height'] ||= attrs['height']
30
33
  end
31
34
  res
32
35
  end
@@ -107,7 +110,10 @@ module OBF::Utils
107
110
  'data' => File.read(url),
108
111
  'content_type' => types[0] && types[0].to_s
109
112
  }
110
- image = image_attrs(url).merge(image)
113
+ attrs = image_attrs(url)
114
+ image['content_type'] ||= attrs['content_type']
115
+ image['width'] ||= attrs['width']
116
+ image['height'] ||= attrs['height']
111
117
  end
112
118
  return nil unless image
113
119
  str = "data:" + image['content_type']
@@ -335,7 +341,10 @@ module OBF::Utils
335
341
  file.binmode
336
342
  file.write raw
337
343
  file.close
338
- attrs = (OBF::Utils.image_attrs(file.path) || {}).merge(attrs)
344
+ more_attrs = OBF::Utils.image_attrs(file.path)
345
+ attrs['content_type'] ||= more_attrs['content_type']
346
+ attrs['width'] ||= more_attrs['width']
347
+ attrs['height'] ||= more_attrs['height']
339
348
  end
340
349
  attrs
341
350
  end
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.21
4
+ version: 0.6.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer