pdftoimage 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 382ac5bc0e37e99acc44c9b7b40883ca8ca0a7b72595229e460fd4c0d4f6ee27
4
- data.tar.gz: 6163c9afa9cc35a3bf6231af43eaf7ee1a5ae490c946b886f2904f63af2af9b6
3
+ metadata.gz: 49d730ba2e60a1739e81b4158aeb42b8bfe268fed0b18ad8f88c3e9cdc3995e1
4
+ data.tar.gz: 64331b1a215d1052998b098544e7c5cd78b97c98bb95e67a14760f05e5e077f3
5
5
  SHA512:
6
- metadata.gz: 640b7bbd60b1a15db121c27c1d56b360dbb509c6cdce62d525ed3ea8aceeed3e67ee359eae9db350e0d031c06b178ad5723cc29990075b96f762ad075627c614
7
- data.tar.gz: 76a9559c9e50853022d5ef8748f1a0733bd065e5a832e47d3cb5106f8825b9860b786d5c1d87edb495fa511f62efc55b41b089e947bae3fc39c7e3dcd6ef4599
6
+ metadata.gz: ce38c3fe89d03d06d07e8a79fa06a0783ea93d503db36ecdd60b3499420a2a5a87ef2e7ef067da022d1005ee1fffb8ca243590a24e93fee7c653ec4eb4d40f09
7
+ data.tar.gz: 26c1da0877e0ec19495e5893f8d5ab234ca69f4b697df8affe03a082fc6208390bd19ca340d53ff545e0c65a0eec18a1aa5748b42aee37e7142222077c1ddc4b
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com).
6
6
 
7
+ ## [0.3.3] - 2026-12-03
8
+
9
+ ### Fixed
10
+ - Correctly parse fractional page dimensions reported by `pdfinfo` when calculating pixel dimensions (#21) — thanks @Baplar
11
+
12
+ ## [0.3.2] - 2026-06-27
13
+
14
+ ### Changed
15
+ - Relaxed the `mini_magick` dependency from `~> 4.0` to `>= 4.0, < 6` (#20)
16
+
7
17
  ## [0.3.1] - 2026-03-21
8
18
 
9
19
  ### Added
@@ -26,17 +36,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).
26
36
  ## [0.2.1] - 2025-04-08
27
37
 
28
38
  ### Fixed
29
- - "Error determining page count" (#13)
30
- - Updated shellwords dependency to 0.2.0+ (#7)
39
+ - "Error determining page count" (#13) — thanks @abramovks
40
+ - Updated shellwords dependency to 0.2.0+ (#7) — thanks @ivanFigurenko
31
41
 
32
42
  ## [0.2.0] - 2023-04-20
33
43
 
34
44
  ### Fixed
35
- - Use of deprecated `File.exists?` method (#4)
36
- - File paths are now escaped to properly handle spaces and special characters (#3)
45
+ - Use of deprecated `File.exists?` method (#4) — thanks @Thornolf
46
+ - File paths are now escaped to properly handle spaces and special characters (#3) — thanks @drnic
37
47
 
38
48
  ### Added
39
- - Specifying dpi resolution is now supported (#5)
49
+ - Specifying dpi resolution is now supported (#5) — thanks @lehf
40
50
 
41
51
  ## [0.1.7] - 2018-05-01
42
52
 
@@ -1,4 +1,4 @@
1
1
  module PDFToImage
2
2
  # pdftoimage version
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.3"
4
4
  end
data/lib/pdftoimage.rb CHANGED
@@ -85,15 +85,15 @@ module PDFToImage
85
85
  cmd = "pdfinfo -f #{page} -l #{page} #{Shellwords.escape(filename)} | grep -a Page"
86
86
  output = exec(cmd)
87
87
 
88
- matches = /^Page.*?size:.*?(\d+).*?(\d+)/.match(output)
88
+ matches = /^Page.*?size:\D*?(?<width>\d+(?:\.\d+)?)\D*?(?<height>\d+(?:\.\d+)?)/.match(output)
89
89
  if matches.nil?
90
90
  raise PDFError, "Unable to determine page size."
91
91
  end
92
92
 
93
93
  scale = 2.08333333333333333
94
94
  dimension = {
95
- width: (matches[1].to_i * scale).to_i,
96
- height: (matches[2].to_i * scale).to_i
95
+ width: (matches[:width].to_f * scale).to_i,
96
+ height: (matches[:height].to_f * scale).to_i
97
97
  }
98
98
 
99
99
  dimension
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdftoimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Flynn
@@ -27,16 +27,22 @@ dependencies:
27
27
  name: mini_magick
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - "~>"
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4.0'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '6'
33
36
  type: :runtime
34
37
  prerelease: false
35
38
  version_requirements: !ruby/object:Gem::Requirement
36
39
  requirements:
37
- - - "~>"
40
+ - - ">="
38
41
  - !ruby/object:Gem::Version
39
42
  version: '4.0'
43
+ - - "<"
44
+ - !ruby/object:Gem::Version
45
+ version: '6'
40
46
  description: A ruby gem for converting PDF documents into a series of images. This
41
47
  module is based off poppler_utils and ImageMagick.
42
48
  email: rob@thingerly.com