format_parser 0.25.4 → 0.25.5

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: 379af5330f9b9521b278e5fe54821398ea2a5a58d4ac9881bcc5f30021446c2a
4
- data.tar.gz: 71da3110186c0c8fce731fc2adb05fbcbcc829ab9c6fe67b4934dc8d69fa093c
3
+ metadata.gz: c39f9a0aae6e1474bbe2e3ff845ebf6c349e042510a4e8049384bfcdb7506c33
4
+ data.tar.gz: 604732d31301b227844649b82b3c4e13aa5dddcab1158cfea51abc7998ebd26e
5
5
  SHA512:
6
- metadata.gz: 5a9a99547baa58e3e693c8e24cc84af0d1e6598403dbed9473b885531e7c067b51c5aac4cc411ddc3f7d114b7987b470eb81554422553e6b346fc42b98a50789
7
- data.tar.gz: 851b0c4fad434140e641077c01e6d46f463c8aab7b85d35a85ba0729c2913bd978a35e7ab0608d4cb8d5e2e2f13761a00078b98948290c3b3203953a9cba7c03
6
+ metadata.gz: 189c3e155e868475ce45cbd4576f2d381452b74a1718962f9a306915837d415ccb699b5e8bb0c84b282013890a6a1b4a4e873227525154e577b39e9c6e7f31d9
7
+ data.tar.gz: c300a554bb9c2328abafe79ca560de504b6684e96a4a97b698bc8c555085bd0a423792965cb1d323306108be47bf7e238af3bc0e44bb858c0af5aaef9d45546e
@@ -1,3 +1,6 @@
1
+ ## 0.25.5
2
+ * DPX: Fix DPXParser to support images without aspect ratio
3
+
1
4
  ## 0.25.4
2
5
  * MP3: Fix MP3Parser to return nil for TIFF files
3
6
  * Add support to ruby 2.7
@@ -1,3 +1,3 @@
1
1
  module FormatParser
2
- VERSION = '0.25.4'
2
+ VERSION = '0.25.5'
3
3
  end
@@ -35,18 +35,23 @@ class FormatParser::DPXParser
35
35
  w = dpx_structure.fetch(:image).fetch(:pixels_per_line)
36
36
  h = dpx_structure.fetch(:image).fetch(:lines_per_element)
37
37
 
38
+ display_w = w
39
+ display_h = h
40
+
38
41
  pixel_aspect_w = dpx_structure.fetch(:orientation).fetch(:horizontal_pixel_aspect)
39
42
  pixel_aspect_h = dpx_structure.fetch(:orientation).fetch(:vertical_pixel_aspect)
40
- pixel_aspect = pixel_aspect_w / pixel_aspect_h.to_f
41
43
 
42
- image_aspect = w / h.to_f * pixel_aspect
44
+ # Find display height and width based on aspect only if the file structure has pixel aspects
45
+ if pixel_aspect_h != 0 && pixel_aspect_w != 0
46
+ pixel_aspect = pixel_aspect_w / pixel_aspect_h.to_f
43
47
 
44
- display_w = w
45
- display_h = h
46
- if image_aspect > 1
47
- display_h = (display_w / image_aspect).round
48
- else
49
- display_w = (display_h * image_aspect).round
48
+ image_aspect = w / h.to_f * pixel_aspect
49
+
50
+ if image_aspect > 1
51
+ display_h = (display_w / image_aspect).round
52
+ else
53
+ display_w = (display_h * image_aspect).round
54
+ end
50
55
  end
51
56
 
52
57
  FormatParser::Image.new(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: format_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.4
4
+ version: 0.25.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-12-09 00:00:00.000000000 Z
12
+ date: 2020-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ks
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.1.4
295
+ rubygems_version: 3.0.3
296
296
  signing_key:
297
297
  specification_version: 4
298
298
  summary: A library for efficient parsing of file metadata