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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/format_parser/version.rb +1 -1
- data/lib/parsers/dpx_parser.rb +13 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c39f9a0aae6e1474bbe2e3ff845ebf6c349e042510a4e8049384bfcdb7506c33
|
4
|
+
data.tar.gz: 604732d31301b227844649b82b3c4e13aa5dddcab1158cfea51abc7998ebd26e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189c3e155e868475ce45cbd4576f2d381452b74a1718962f9a306915837d415ccb699b5e8bb0c84b282013890a6a1b4a4e873227525154e577b39e9c6e7f31d9
|
7
|
+
data.tar.gz: c300a554bb9c2328abafe79ca560de504b6684e96a4a97b698bc8c555085bd0a423792965cb1d323306108be47bf7e238af3bc0e44bb858c0af5aaef9d45546e
|
data/CHANGELOG.md
CHANGED
data/lib/parsers/dpx_parser.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
+
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-
|
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.
|
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
|