vectory 0.7.2 → 0.7.3
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 +4 -4
- data/README.adoc +1 -1
- data/lib/vectory/image_resize.rb +10 -1
- data/lib/vectory/system_call.rb +1 -0
- data/lib/vectory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7e5cf52ef253c6c347b08de4933cec1766c28c018bfc7db7cec90389d136f84
|
4
|
+
data.tar.gz: 88874bb762defd6629019da70230e1bcad31a8421bd5687d90b6bae5f456ffc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/vectory/image_resize.rb
CHANGED
@@ -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"] =
|
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]
|
data/lib/vectory/system_call.rb
CHANGED
data/lib/vectory/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emf2svg
|