format_parser 0.18.0 → 0.19.0
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 +4 -4
- data/.gitignore +51 -8
- data/.travis.yml +5 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/lib/format_parser/version.rb +1 -1
- data/lib/parsers/tiff_parser.rb +2 -2
- data/spec/parsers/tiff_parser_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdd060f6f792e1cf8247b53474deaccfd532a04501652f42e6e044945705b813
|
4
|
+
data.tar.gz: 85e23ed33775ec5424f6a8daa5a3bdaf4bd9347be983b10b740ec4283295abed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 553b087703215029a13a2b7e1070012f2509cebb6b2607957e75e6d44105b91b886a0efdd2b75e6af185fe124294eee7edd001d613d19022930701168d79e754
|
7
|
+
data.tar.gz: 93aa2c2d76b98d2c593d0bfd72e89601cab80af236d572afe1271c379e831b490c896c6517a72a7127a6547be4e577ad7af9413c7b46df4714f855201d9a5cf2
|
data/.gitignore
CHANGED
@@ -1,13 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
/_yardoc/
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
5
4
|
/coverage/
|
6
|
-
/
|
5
|
+
/InstalledFiles
|
7
6
|
/pkg/
|
8
7
|
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
9
11
|
/tmp/
|
10
|
-
*.gem
|
11
12
|
|
12
|
-
#
|
13
|
-
.
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
# Ignore Byebug command history file.
|
17
|
+
.byebug_history
|
18
|
+
|
19
|
+
## Specific to RubyMotion:
|
20
|
+
.dat*
|
21
|
+
.repl_history
|
22
|
+
build/
|
23
|
+
*.bridgesupport
|
24
|
+
build-iPhoneOS/
|
25
|
+
build-iPhoneSimulator/
|
26
|
+
|
27
|
+
## Specific to RubyMotion (use of CocoaPods):
|
28
|
+
#
|
29
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
+
#
|
33
|
+
# vendor/Pods/
|
34
|
+
|
35
|
+
## Documentation cache and generated files:
|
36
|
+
/.yardoc/
|
37
|
+
/_yardoc/
|
38
|
+
/doc/
|
39
|
+
/rdoc/
|
40
|
+
|
41
|
+
## Environment normalization:
|
42
|
+
/.bundle/
|
43
|
+
/vendor/bundle
|
44
|
+
/lib/bundler/man/
|
45
|
+
|
46
|
+
# for a library or gem, you might want to ignore these files since the code is
|
47
|
+
# intended to run in multiple environments; otherwise, check them in:
|
48
|
+
Gemfile.lock
|
49
|
+
.ruby-version
|
50
|
+
.ruby-gemset
|
51
|
+
|
52
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
+
.rvmrc
|
54
|
+
|
55
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
56
|
+
# .rubocop-https?--*
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.19.0
|
2
|
+
* Improve handling of Sony ARW files (make sure the width/height is correctly recognized)
|
3
|
+
* Update Travis matrix and gitignore
|
4
|
+
|
1
5
|
## 0.18.0
|
2
6
|
* Mark m4v as one of the filename extensions likely to parse via the MOOV parser
|
3
7
|
* Adopt [Hippocratic license v. 1.2](https://firstdonoharm.dev/version/1/2/license.html)
|
data/README.md
CHANGED
@@ -164,6 +164,9 @@ Unless specified otherwise in this section the fixture files are MIT licensed an
|
|
164
164
|
- `Shinbutsureijoushuincho.tiff` is obtained from Wikimedia Commons and is Creative Commons licensed
|
165
165
|
- `IMG_9266_*.tif` and all it's variations were created by the project maintainers
|
166
166
|
|
167
|
+
### ARW
|
168
|
+
- ARW example is downloaded from http://www.rawsamples.ch/ and is Creative Common Licensed.
|
169
|
+
|
167
170
|
### ZIP
|
168
171
|
- The .zip fixture files have been created by the project maintainers
|
169
172
|
|
data/lib/parsers/tiff_parser.rb
CHANGED
@@ -22,8 +22,8 @@ class FormatParser::TIFFParser
|
|
22
22
|
exif_data = exif_from_tiff_io(io)
|
23
23
|
return unless exif_data
|
24
24
|
|
25
|
-
w = exif_data.
|
26
|
-
h = exif_data.
|
25
|
+
w = exif_data.width || exif_data.pixel_x_dimension
|
26
|
+
h = exif_data.height || exif_data.pixel_y_dimension
|
27
27
|
|
28
28
|
FormatParser::Image.new(
|
29
29
|
format: :tif,
|
@@ -47,6 +47,17 @@ describe FormatParser::TIFFParser do
|
|
47
47
|
expect(parsed.intrinsics[:exif]).not_to be_nil
|
48
48
|
end
|
49
49
|
|
50
|
+
it 'correctly extracts dimensions for a Sony ARW fixture' do
|
51
|
+
arw_path = fixtures_dir + '/ARW/RAW_SONY_ILCE-7RM2.ARW'
|
52
|
+
|
53
|
+
parsed = subject.call(File.open(arw_path, 'rb'))
|
54
|
+
|
55
|
+
expect(parsed).not_to be_nil
|
56
|
+
expect(parsed.width_px).to eq(7952)
|
57
|
+
expect(parsed.height_px).to eq(5304)
|
58
|
+
expect(parsed.intrinsics[:exif]).not_to be_nil
|
59
|
+
end
|
60
|
+
|
50
61
|
describe 'correctly extracts dimensions from various TIFF flavors of the same file' do
|
51
62
|
Dir.glob(fixtures_dir + '/TIFF/IMG_9266*.tif').each do |tiff_path|
|
52
63
|
it "is able to parse #{File.basename(tiff_path)}" do
|
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.
|
4
|
+
version: 0.19.0
|
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: 2019-
|
12
|
+
date: 2019-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ks
|