mupdf 1.0.3 → 1.0.4

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: 30427fb29d23f8bc2a555d17ae7efd5c605cb4aaf43fc73e47d6ff208bb268ac
4
- data.tar.gz: 767cfd14a5cf828e77cbc5db6e0bacb3ad1f7345fa3d479d46df25e99588d66c
3
+ metadata.gz: 3608937cd01b6b8c0d1fca5b0c6be8752f759c88401ed981759d22fce2f2bfa2
4
+ data.tar.gz: bc2f3f9fe2be26b9c141a865566ca8a264cd563cb30922bd418a8eae1706deb6
5
5
  SHA512:
6
- metadata.gz: a6c7811a6bf8194162022aeee62c53229e178205f28bee46f25a23766b71e5ae2f518c0b8693005c3cd96cc2134cc5c65dcd9f4991e59088ab4c2c15761ab5f4
7
- data.tar.gz: '09902f5f9492c357967d609750b4c1dcfe1a9a39c112c9efd2c642cdaec979760e89ce777adbbb4068a4660aa5fa28dc6bd7e0ba82cf473c1aa0cbd4a71780ad'
6
+ metadata.gz: f7ad8f8b720cd13d53c1bdc1ec70e9c67a6cb3bdeedd7d999004bb379ca2de732aa6ced8c7d96bb1b7d232c32aa45593a478090c2ef07a181f8df0319dcaf33e
7
+ data.tar.gz: b6296bb3c59ae8a0c439e56ec68e0319ee9f84b806dc00ea9ccaef8f0584e8f89c9f6f8ac6b86ed194a8edd2597d92f229f6aeac6b004da90be98655eebc47c2
data/lib/mupdf/box.rb CHANGED
@@ -3,26 +3,26 @@
3
3
  module MuPDF
4
4
  # A bounding box for a PDF (e.g. media / crop / bleed / trim).
5
5
  class Box
6
- REGEX = /l="(?<l>\d+)" b="(?<b>\d+)" r="(?<r>\d+)" t="(?<t>\d+)"/
6
+ REGEX = /l="(?<l>\d+.?\d*)" b="(?<b>\d+.?\d*)" r="(?<r>\d+.?\d*)" t="(?<t>\d+.?\d*)"/
7
7
 
8
8
  # @!attribute l
9
- # @return [String] The left coordinate.
9
+ # @return [BigDecimal] The left coordinate.
10
10
  attr_reader :l
11
11
 
12
12
  # @!attribute b
13
- # @return [String] The bottom coordinate.
13
+ # @return [BigDecimal] The bottom coordinate.
14
14
  attr_reader :b
15
15
 
16
16
  # @!attribute r
17
- # @return [String] The right coordinate.
17
+ # @return [BigDecimal] The right coordinate.
18
18
  attr_reader :r
19
19
 
20
20
  # @!attribute t
21
- # @return [String] The top coordinate.
21
+ # @return [BigDecimal] The top coordinate.
22
22
  attr_reader :t
23
23
 
24
24
  # @!attribute kind
25
- # @return [Symbol] The kind of box.
25
+ # @return [BigDecimal] The kind of box.
26
26
  attr_reader :kind
27
27
 
28
28
  # @param text [String]
@@ -34,18 +34,18 @@ module MuPDF
34
34
  return unless match
35
35
 
36
36
  new(
37
- l: Integer(match[:l]),
38
- b: Integer(match[:b]),
39
- r: Integer(match[:r]),
40
- t: Integer(match[:t]),
37
+ l: BigDecimal(match[:l]),
38
+ b: BigDecimal(match[:b]),
39
+ r: BigDecimal(match[:r]),
40
+ t: BigDecimal(match[:t]),
41
41
  kind:
42
42
  )
43
43
  end
44
44
 
45
- # @param l [Integer]
46
- # @param b [Integer]
47
- # @param r [Integer]
48
- # @param t [Integer]
45
+ # @param l [BigDecimal]
46
+ # @param b [BigDecimal]
47
+ # @param r [BigDecimal]
48
+ # @param t [BigDecimal]
49
49
  # @param kind [Symbol] optional
50
50
  def initialize(l:, b:, r:, t:, kind: nil)
51
51
  @l = l
@@ -60,12 +60,12 @@ module MuPDF
60
60
  "#<#{self.class.name} l=#{l} b=#{b} r=#{r} t=#{t} kind=#{kind}>"
61
61
  end
62
62
 
63
- # @return [Integer]
63
+ # @return [BigDecimal]
64
64
  def width
65
65
  @r - @l
66
66
  end
67
67
 
68
- # @return [Integer]
68
+ # @return [BigDecimal]
69
69
  def height
70
70
  @t - @b
71
71
  end
data/lib/mupdf/page.rb CHANGED
@@ -120,12 +120,12 @@ module MuPDF
120
120
  "#<#{self.class.name} number=#{@number} width=#{width} height=#{height}>"
121
121
  end
122
122
 
123
- # @return [Integer, nil]
123
+ # @return [BigDecimal, nil]
124
124
  def width
125
125
  @media_box&.width
126
126
  end
127
127
 
128
- # @return [Integer, nil]
128
+ # @return [BigDecimal, nil]
129
129
  def height
130
130
  @media_box&.height
131
131
  end
data/lib/mupdf/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuPDF
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  end
data/lib/mupdf.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'bigdecimal'
3
4
  require 'open3'
4
5
  require 'zeitwerk'
5
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mupdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bigdecimal
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: open3
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -62,8 +76,8 @@ licenses:
62
76
  metadata:
63
77
  rubygems_mfa_required: 'true'
64
78
  homepage_uri: https://github.com/ksylvest/mupdf
65
- source_code_uri: https://github.com/ksylvest/mupdf/tree/v1.0.3
66
- changelog_uri: https://github.com/ksylvest/mupdf/releases/tag/v1.0.3
79
+ source_code_uri: https://github.com/ksylvest/mupdf/tree/v1.0.4
80
+ changelog_uri: https://github.com/ksylvest/mupdf/releases/tag/v1.0.4
67
81
  documentation_uri: https://mupdf.ksylvest.com/
68
82
  post_install_message:
69
83
  rdoc_options: []