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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a6c18ba7c79e9fe87d1a9ccdd8456e250b85d91e4955c9d84487a1b0d13d30e
4
- data.tar.gz: 710be6d71399fc7cfc0dcd18b016edb6f4fa4ab5587b5af9dec0c011e7cdc31b
3
+ metadata.gz: 4766f919c6d0611e918d6f98bc2c5da4da95fb5399990b4e3884cff0b364f149
4
+ data.tar.gz: 2716d9cbbe94669080f8ba64063d41c1d1abeef7165409811d486c5ab2a9823e
5
5
  SHA512:
6
- metadata.gz: 0b78ec2bbaaeff9a1de40cb3b259b6dec8530b867c25bda9a9c2f593649f6ce1e8d825a9b3d9e534ba68b5a6188d4b99dfa7a8997b81e5815c547b950a60531d
7
- data.tar.gz: 7d3d896903020a026a6d2da467e8a23f996a69b0fc5033ca7a6c6741a41ebb19330702b1d68c896deca84f44db69f37fc38ce7cd4e8d6aa27297e412aa3b3fdb
6
+ metadata.gz: dce04edf8b7f050236a5c7e73a3f3923e0ce7ef87745600ad68a8bcbcaff1665ce5fa362201848a8a1a681179191f50f62be650f71ba7dd00494756c178e22f0
7
+ data.tar.gz: 1ec04a35841dc06e62b5e44baeac1cbe7eccd38f5f4b910ebf282b0e58709f00fff0110ffc29f544a9c5a3711a7bab1a2a35324bdbc03a78943a6afa90638c7b
@@ -15,13 +15,22 @@ module Vectory
15
15
  end
16
16
 
17
17
  def get_image_size(img, path)
18
- realsize = ImageSize.path(path).size
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vectory
4
- VERSION = "0.7.5"
4
+ VERSION = "0.7.7"
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.5
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-04-23 00:00:00.000000000 Z
11
+ date: 2024-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: emf2svg