vectory 0.7.5 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vectory/image_resize.rb +10 -1
- 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: 4766f919c6d0611e918d6f98bc2c5da4da95fb5399990b4e3884cff0b364f149
|
4
|
+
data.tar.gz: 2716d9cbbe94669080f8ba64063d41c1d1abeef7165409811d486c5ab2a9823e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dce04edf8b7f050236a5c7e73a3f3923e0ce7ef87745600ad68a8bcbcaff1665ce5fa362201848a8a1a681179191f50f62be650f71ba7dd00494756c178e22f0
|
7
|
+
data.tar.gz: 1ec04a35841dc06e62b5e44baeac1cbe7eccd38f5f4b910ebf282b0e58709f00fff0110ffc29f544a9c5a3711a7bab1a2a35324bdbc03a78943a6afa90638c7b
|
data/lib/vectory/image_resize.rb
CHANGED
@@ -15,13 +15,22 @@ module Vectory
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def get_image_size(img, path)
|
18
|
-
|
18
|
+
detected = detect_size(path)
|
19
|
+
realsize = detected if detected
|
19
20
|
s = image_size_interpret(img, realsize || [nil, nil])
|
20
21
|
image_size_zeroes_complete(s, realsize)
|
21
22
|
end
|
22
23
|
|
23
24
|
private
|
24
25
|
|
26
|
+
def detect_size(path)
|
27
|
+
size = ImageSize.path(path).size
|
28
|
+
return unless size
|
29
|
+
return if size.all? { |x| x.nil? || x.zero? }
|
30
|
+
|
31
|
+
size
|
32
|
+
end
|
33
|
+
|
25
34
|
def viewbox(dimensions)
|
26
35
|
width = dimensions[0] + BORDER_WIDTH
|
27
36
|
height = dimensions[1] + BORDER_WIDTH
|
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.7
|
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-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emf2svg
|