html2odt 0.4.1 → 0.4.2

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: 883a33e08df2745c4afa57bd2fd23a2a4c4e3f76
4
- data.tar.gz: cb9a2173acab8ff2eddd484203f63e45057ab818
3
+ metadata.gz: df8d84152bdb9bd084049457e5d4b7873947ea7d
4
+ data.tar.gz: 61d994a96bc8b0a0d6f98ffb10802c2b80422447
5
5
  SHA512:
6
- metadata.gz: 7abbb4fc43d195024c03588cbdc949ff05ddeb47021ae43da4ed78ee571adbeba192da6a48dfd37b64828549b2b9d3c164d91119b0202f7d00816eacfea9216e
7
- data.tar.gz: bc8c047d0a2f986c8f31d40b7b68ef5efd4302cff537d4e24288400886e0421492b4a8ef2c9e06de4332c150752ecc7bf15ed0143d22eb947ec141d3eeb65ab6
6
+ metadata.gz: b3096708a2dd8854a36be52da95ae61848c51ddde69e3fbee23b326790aa93ec2e97f37f93dda0108b26480cba0a8cb3d979d0acc9d5d36a7bf8420bcce62a6f
7
+ data.tar.gz: 112d12a289eb3cab46a4404c2b51799cd99a42d90a406b109acf23bedfa1a7f203d838b9e19f11c74ecb1bf7dd8ab860dc96175b1b88d85e4213ff1a01af2ad9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.4.2 - 2017-12-15
2
+
3
+ Try harder to determine image dimensions.
4
+
1
5
  # v0.4.1 - 2017-09-19
2
6
 
3
7
  Add support for nokogiri 1.8 in adition to the currently supported versions
@@ -34,11 +34,22 @@ class Html2Odt::Image
34
34
 
35
35
  if reader.type
36
36
  @type = reader.type
37
+
38
+ # for some files, peek doesn't seem to do the trick and width/height
39
+ # stay nil. According to
40
+ # https://github.com/sstephenson/dimensions#reading-dimensions-from-a-stream
41
+ # the dimensions get initialized 'once enough of the file' has been
42
+ # read, so we do that.
43
+ #
44
+ while reader.width.nil?
45
+ break unless io.read(8192)
46
+ end
47
+
37
48
  @width = reader.width
38
49
  @height = reader.height
39
50
  @angle = reader.angle
40
51
 
41
- @valid = true
52
+ @valid = not(@width.nil? or @height.nil?)
42
53
  else
43
54
  @valid = false
44
55
  end
@@ -1,3 +1,3 @@
1
1
  module Html2Odt
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html2odt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregor Schmidt (Planio)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-19 00:00:00.000000000 Z
11
+ date: 2017-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dimensions