vectory 0.7.2 → 0.7.3

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
  SHA256:
3
- metadata.gz: 55fbd240e8b8c5e4409e73d720e752c502a1d0700617aa8889c7dca337be989b
4
- data.tar.gz: 51a18f30f14a783c9f249a1b8664bf5767f10eb8f7a85aed3d87ca06d4d8d00e
3
+ metadata.gz: d7e5cf52ef253c6c347b08de4933cec1766c28c018bfc7db7cec90389d136f84
4
+ data.tar.gz: 88874bb762defd6629019da70230e1bcad31a8421bd5687d90b6bae5f456ffc6
5
5
  SHA512:
6
- metadata.gz: 239f4a3ef419cc72978ee7300867b66978e86f5154918b0a537397ef0ac2a3b1726ac91132c2673c637335c871fb4acecf88a26ff952f26fcd32177208dcb8b8
7
- data.tar.gz: 79c93b9aea448ca971a9d4f531a3de7377601f771ee7e8830258cea8a27b5bccd3b9271a743550e84a4e0682fb77ce84e969129a5c6ff4a17faee3c53a087a17
6
+ metadata.gz: e25ab6e9f1e7ff9f61f4f525e4116b31d1f5a7649579abcd304efff9dd1e6b31afcd57d1b317ef8bec884359d201ea3f99b8aa6157707c6586e46729a80dc94f
7
+ data.tar.gz: ed47e2375f1f01140b88a014b1ec03f73571cf461f957793b35d6d34b52d4dd4cc82701186e016482e27fd5d2807e36893354d8a7c81e97d1763fab8a6b87fed
data/README.adoc CHANGED
@@ -27,7 +27,7 @@ Vectory relies on the following software to be installed:
27
27
  * https://inkscape.org[Inkscape]
28
28
  * https://www.ghostscript.com/[Ghostscript]
29
29
 
30
- NOTE: Inkscape 1.3.1 does not work properly with EPS/PS on Windows. To avoid
30
+ NOTE: Inkscape 1.3.1+ does not work properly with EPS/PS on Windows. To avoid
31
31
  this issue, the 1.3.0 version of Inkscape can be used.
32
32
 
33
33
 
@@ -2,10 +2,12 @@ require "image_size"
2
2
 
3
3
  module Vectory
4
4
  class ImageResize
5
+ BORDER_WIDTH = 2
6
+
5
7
  def call(img, path, maxheight, maxwidth)
6
8
  s, realsize = get_image_size(img, path)
7
9
  img.name == "svg" && !img["viewBox"] && s[0] && s[1] and
8
- img["viewBox"] = "0 0 #{s[0]} #{s[1]}"
10
+ img["viewBox"] = viewbox(s)
9
11
  s, skip = image_dont_resize(s, realsize)
10
12
  skip and return s
11
13
  s = image_size_fillin(s, realsize)
@@ -20,6 +22,13 @@ module Vectory
20
22
 
21
23
  private
22
24
 
25
+ def viewbox(dimensions)
26
+ width = dimensions[0] + BORDER_WIDTH
27
+ height = dimensions[1] + BORDER_WIDTH
28
+
29
+ "0 0 #{width} #{height}"
30
+ end
31
+
23
32
  def image_dont_resize(dim, realsize)
24
33
  dim.nil? and return [[nil, nil], true]
25
34
  realsize.nil? and return [dim, true]
@@ -33,6 +33,7 @@ module Vectory
33
33
  def execute(cmd)
34
34
  result = Capture.with_timeout(cmd,
35
35
  timeout: @timeout,
36
+ signal: :KILL, # only KILL works on Windows
36
37
  kill_after: @timeout)
37
38
  @stdout = result[:stdout]
38
39
  @stderr = result[:stderr]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vectory
4
- VERSION = "0.7.2"
4
+ VERSION = "0.7.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vectory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-15 00:00:00.000000000 Z
11
+ date: 2024-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: emf2svg