avv2word 1.1.23 → 1.1.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16107f41142f5bd0d540898e3045adf72e754bcf23d479e13dde8e8df69ef180
4
- data.tar.gz: 9e050fefa3afeded8fc481c0961686764a64027204434a4df3b9abfc2c2c4fb9
3
+ metadata.gz: 5adcd0d32263c2586dfe65607921889a80110b94f8fe85c78f6871250c70b266
4
+ data.tar.gz: 15e76efc594d918ec0c6b5f91294c88fd33e35ca553bd68bc9aafb417cb84b90
5
5
  SHA512:
6
- metadata.gz: eeafd2f7fc91a1e8d92e05dbd4bed38c4f862796391b7f6956bb70d4d3805197289ff723fac14cb9bfc8af150d3cd9c94470e492e245deb69169770a721f5f15
7
- data.tar.gz: 0d43755c9f7fdfc6734a7e84b48d6021fd336709d9375a1ec36c60bb60e387037c73671b5363e9fc210f90c6abf9b8cd4b6ef65d1fffaee8bbcb4c8e7dd72578
6
+ metadata.gz: b51a33290a1b68f97b212f5b40787fb8cffb75405fd5894b19cb6fb92f4875ae0cea28c9043106a9c86cca3e3af73015830f74e1b60a9ec9366145fb47f58fa1
7
+ data.tar.gz: 49e3e3ec00a6dbf879491f02384a0c11c13708e908fdbcbcc841d94443e0a453d9b154475c89a69ec0fd1fb6dadf6e0647b160306e89cd197ff0138a31eed098
@@ -22,8 +22,13 @@ module Avv2word
22
22
  img_path = "tmp_imgs/image#{i+1}.#{ext}"
23
23
  File.open(img_path,"wb"){|f| f.write Base64.decode64(img_data)}
24
24
  img_elm.attributes["src"].value = img_path
25
- match_dimensions = %x( file #{img_path} ).match(/, (?<x>\d+) ?x ?(?<y>\d+),/)
26
- img_elm["style"] = "width:#{match_dimensions[:x].to_i*resize}px;height:#{match_dimensions[:y].to_i*resize}px"
25
+
26
+ match_dimensions = %x( identify #{img_path} ).match(/(?<x>\d+)x(?<y>\d+)/)
27
+ if match_dimensions
28
+ img_elm["style"] = "width:#{match_dimensions[:x].to_i*resize}px;height:#{match_dimensions[:y].to_i*resize}px"
29
+ else
30
+ img_elm["style"] = "width:100px;height:100px"
31
+ end
27
32
  # img_elm["style"] = "width:100.5px;height:100.5px"
28
33
  # alt: style="width:350px;height:150px"
29
34
  # alt: img_elm["data-width"] = "236px"
Binary file
@@ -1,3 +1,3 @@
1
1
  module Avv2word
2
- VERSION = '1.1.23'
2
+ VERSION = '1.1.24'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avv2word
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.23
4
+ version: 1.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marián Bilas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-12 00:00:00.000000000 Z
11
+ date: 2019-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack