multi_exiftool 0.11.0 → 0.12.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/.aspell.pws +27 -26
- data/Changelog +4 -0
- data/LICENSE +1 -1
- data/README.md +7 -2
- data/lib/multi_exiftool.rb +1 -1
- data/lib/multi_exiftool/values.rb +6 -3
- data/multi_exiftool.gemspec +11 -17
- data/regtest/read_all_tags.yml +3 -3
- data/test/test_reader.rb +10 -2
- data/test/test_values.rb +20 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 317f91ac28f2791341c7c6354e996545c80f08fb7100607460295ae55c38d463
|
4
|
+
data.tar.gz: d98f7b7a4a0cca8e0ce2e18f1b718ef7227412a31ff5e9b8f3d4685077d97221
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 292b732d0940abb55c9dccebadfb8976767891ad33fb865e982689fd0b4a617590b95b195d1144831d073374357f68823dd51a4875962ef0374b0803753adf46
|
7
|
+
data.tar.gz: b1d1c48bfdf082f7f79ebf5f5b2feefd0e661fcfb2aebc23b73cfec25606e195b2c989c5e36b05e57257e56ddbb0b0b5fef452ed3a07cb7479508062bc302fbe
|
data/.aspell.pws
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
personal_ws-1.1 en
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
dir
|
8
|
-
MultiExiftool
|
1
|
+
personal_ws-1.1 en 33
|
2
|
+
Coenen
|
3
|
+
ExifTool
|
4
|
+
Friedrich
|
5
|
+
Gemfile
|
6
|
+
Gitorious
|
9
7
|
MERCHANTABILITY
|
8
|
+
MultiExiftool
|
9
|
+
MyConversion
|
10
|
+
NONINFRINGEMENT
|
11
|
+
PartOfSet
|
12
|
+
README
|
13
|
+
SemVer
|
14
|
+
SemVerTag
|
10
15
|
api
|
11
|
-
|
12
|
-
sublicense
|
13
|
-
tmpdir
|
14
|
-
ExifTool
|
16
|
+
dir
|
15
17
|
exiftool
|
18
|
+
filenames
|
19
|
+
gemspec
|
20
|
+
gittycat
|
16
21
|
gmail
|
17
|
-
|
18
|
-
timestamps
|
22
|
+
janfri
|
19
23
|
jpg
|
20
|
-
|
21
|
-
|
22
|
-
Gitorious
|
23
|
-
MyConversion
|
24
|
-
gemspec
|
25
|
-
Friedrich
|
24
|
+
multi
|
25
|
+
ok
|
26
26
|
prepend
|
27
|
-
|
28
|
-
PartOfSet
|
29
|
-
README
|
30
|
-
stdin
|
31
|
-
Coenen
|
27
|
+
refactoring
|
32
28
|
stderr
|
33
|
-
|
29
|
+
stdin
|
30
|
+
sublicense
|
31
|
+
szTheory
|
32
|
+
timestamps
|
33
|
+
tmpdir
|
34
|
+
utc
|
data/Changelog
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
# Functional approach
|
30
30
|
results, errors = MultiExiftool.read(Dir['*.jpg'])
|
31
|
-
unless
|
31
|
+
unless errors.empty?
|
32
32
|
$stderr.puts reader.errors
|
33
33
|
end
|
34
34
|
results.each do |values|
|
@@ -94,7 +94,7 @@ following conversions are implemented at the moment:
|
|
94
94
|
* values of form "n/m" => Rational except PartOfSet and Track
|
95
95
|
|
96
96
|
The conversion is done in the method Values#convert. So you can change it's
|
97
|
-
behaviour as following examples
|
97
|
+
behaviour as following examples show.
|
98
98
|
|
99
99
|
### Example 1
|
100
100
|
|
@@ -178,6 +178,11 @@ or
|
|
178
178
|
https://bitbucket.org/janfri/multi_exiftool
|
179
179
|
feel free to contribute!
|
180
180
|
|
181
|
+
## Versioning
|
182
|
+
|
183
|
+
MultiExiftool follows [Semantic Versioning](https://semver.org/), both SemVer and
|
184
|
+
SemVerTag.
|
185
|
+
|
181
186
|
## Author
|
182
187
|
|
183
188
|
Jan Friedrich <janfri26gmail.com>
|
data/lib/multi_exiftool.rb
CHANGED
@@ -37,8 +37,8 @@ module MultiExiftool
|
|
37
37
|
convert(unified_tag, @values[unified_tag])
|
38
38
|
end
|
39
39
|
|
40
|
-
#
|
41
|
-
# a value is fethed from a Values instance.
|
40
|
+
# Converts values on the basis of unified tag name and value. It is called
|
41
|
+
# each time a value is fethed from a Values instance.
|
42
42
|
# @return (maybe) converted value
|
43
43
|
def convert tag, val
|
44
44
|
return val unless val.kind_of?(String)
|
@@ -75,7 +75,7 @@ module MultiExiftool
|
|
75
75
|
@values.keys.map {|tag| Values.tag_map[tag]}
|
76
76
|
end
|
77
77
|
|
78
|
-
#
|
78
|
+
# Generates a hash representation of this instance
|
79
79
|
# with original tag names es keys and converted
|
80
80
|
# values as values
|
81
81
|
def to_h
|
@@ -112,6 +112,9 @@ module MultiExiftool
|
|
112
112
|
res
|
113
113
|
end
|
114
114
|
|
115
|
+
def respond_to_missing? tag, *args
|
116
|
+
has_tag?(tag) || super
|
117
|
+
end
|
115
118
|
end
|
116
119
|
|
117
120
|
end
|
data/multi_exiftool.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: multi_exiftool 0.
|
2
|
+
# stub: multi_exiftool 0.12.0 ruby lib
|
3
3
|
#
|
4
4
|
# This file is automatically generated by rim.
|
5
5
|
# PLEASE DO NOT EDIT IT DIRECTLY!
|
@@ -7,12 +7,12 @@
|
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "multi_exiftool"
|
10
|
-
s.version = "0.
|
10
|
+
s.version = "0.12.0"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
s.authors = ["Jan Friedrich"]
|
15
|
-
s.date = "
|
15
|
+
s.date = "2020-01-02"
|
16
16
|
s.description = "This library a is wrapper for the ExifTool command-line application (http://www.sno.phy.queensu.ca/~phil/exiftool) written by Phil Harvey. It is designed for dealing with multiple files at once by creating commands to call exiftool with various arguments, call it and parsing the results."
|
17
17
|
s.email = "janfri26@gmail.com"
|
18
18
|
s.files = ["./.aspell.pws", "Changelog", "Gemfile", "LICENSE", "README.md", "Rakefile", "lib/multi_exiftool", "lib/multi_exiftool.rb", "lib/multi_exiftool/executable.rb", "lib/multi_exiftool/reader.rb", "lib/multi_exiftool/values.rb", "lib/multi_exiftool/writer.rb", "multi_exiftool.gemspec", "regtest/read_all_tags.rb", "regtest/read_all_tags.yml", "regtest/test.jpg", "test/data", "test/data/a.jpg", "test/data/b.jpg", "test/data/c.jpg", "test/helper.rb", "test/test_executable.rb", "test/test_exiftool_stuff.rb", "test/test_functional_api.rb", "test/test_reader.rb", "test/test_values.rb", "test/test_values_using_groups.rb", "test/test_writer.rb", "test/test_writer_groups.rb"]
|
@@ -21,25 +21,19 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.post_install_message = "\n+-----------------------------------------------------------------------+\n| Please ensure you have installed exiftool version 7.65 or higher and |\n| it's found in your PATH (Try \"exiftool -ver\" on your commandline). |\n| For more details see |\n| http://www.sno.phy.queensu.ca/~phil/exiftool/install.html |\n+-----------------------------------------------------------------------+\n "
|
22
22
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
|
23
23
|
s.requirements = ["exiftool, version 7.65 or higher"]
|
24
|
-
s.rubygems_version = "
|
24
|
+
s.rubygems_version = "3.1.2"
|
25
25
|
s.summary = "This library is a wrapper for the ExifTool command-line application (http://www.sno.phy.queensu.ca/~phil/exiftool)."
|
26
26
|
|
27
27
|
if s.respond_to? :specification_version then
|
28
28
|
s.specification_version = 4
|
29
|
+
end
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
else
|
37
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
38
|
-
s.add_dependency(%q<rim>, ["~> 2.17"])
|
39
|
-
s.add_dependency(%q<contest>, ["~> 0.1"])
|
40
|
-
s.add_dependency(%q<test-unit>, [">= 0"])
|
41
|
-
s.add_dependency(%q<regtest>, ["~> 2"])
|
42
|
-
end
|
31
|
+
if s.respond_to? :add_runtime_dependency then
|
32
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
33
|
+
s.add_development_dependency(%q<rim>, ["~> 2.17"])
|
34
|
+
s.add_development_dependency(%q<contest>, ["~> 0.1"])
|
35
|
+
s.add_development_dependency(%q<test-unit>, [">= 0"])
|
36
|
+
s.add_development_dependency(%q<regtest>, ["~> 2"])
|
43
37
|
else
|
44
38
|
s.add_dependency(%q<rake>, [">= 0"])
|
45
39
|
s.add_dependency(%q<rim>, ["~> 2.17"])
|
data/regtest/read_all_tags.yml
CHANGED
@@ -4,7 +4,7 @@ result:
|
|
4
4
|
- - !ruby/object:MultiExiftool::Values
|
5
5
|
values:
|
6
6
|
sourcefile: regtest/test.jpg
|
7
|
-
exiftoolversion: 11.
|
7
|
+
exiftoolversion: 11.7
|
8
8
|
filename: test.jpg
|
9
9
|
directory: regtest
|
10
10
|
filesize: 43 kB
|
@@ -64,7 +64,7 @@ result:
|
|
64
64
|
imagestabilization: 'On'
|
65
65
|
zonematching: ISO Setting Used
|
66
66
|
colortemperature: 0
|
67
|
-
lenstype: Minolta AF 28-135mm F4-4.5 or
|
67
|
+
lenstype: Minolta AF 28-135mm F4-4.5 or Other Lens
|
68
68
|
usercomment: ''
|
69
69
|
flashpixversion: '0100'
|
70
70
|
colorspace: sRGB
|
@@ -99,7 +99,7 @@ result:
|
|
99
99
|
ycbcrsubsampling: YCbCr4:2:0 (2 2)
|
100
100
|
aperture: 9.5
|
101
101
|
imagesize: 1x1
|
102
|
-
lensid:
|
102
|
+
lensid: Tokina AT-X 242 AF 24-200mm F3.5-5.6
|
103
103
|
megapixels: 1.0e-06
|
104
104
|
scalefactor35efl: 1.5
|
105
105
|
shutterspeed: 1/60
|
data/test/test_reader.rb
CHANGED
@@ -101,7 +101,11 @@ class TestReader < Test::Unit::TestCase
|
|
101
101
|
@reader.filenames = %w(non_existing_file)
|
102
102
|
res = @reader.read
|
103
103
|
assert_equal [], res
|
104
|
-
|
104
|
+
if MultiExiftool.exiftool_version < 11.10
|
105
|
+
assert_equal ['File not found: non_existing_file'], @reader.errors
|
106
|
+
else
|
107
|
+
assert_equal ['Error: File not found - non_existing_file'], @reader.errors
|
108
|
+
end
|
105
109
|
end
|
106
110
|
end
|
107
111
|
|
@@ -111,7 +115,11 @@ class TestReader < Test::Unit::TestCase
|
|
111
115
|
@reader.tags = %w(fnumber foo)
|
112
116
|
res = @reader.read
|
113
117
|
assert_equal [5.6], res.map {|e| e['FNumber']}
|
114
|
-
|
118
|
+
if MultiExiftool.exiftool_version < 11.10
|
119
|
+
assert_equal ['File not found: xxx'], @reader.errors
|
120
|
+
else
|
121
|
+
assert_equal ['Error: File not found - xxx'], @reader.errors
|
122
|
+
end
|
115
123
|
end
|
116
124
|
end
|
117
125
|
|
data/test/test_values.rb
CHANGED
@@ -173,4 +173,24 @@ class TestValues < Test::Unit::TestCase
|
|
173
173
|
|
174
174
|
end
|
175
175
|
|
176
|
+
context 'respond_to_missing?' do
|
177
|
+
|
178
|
+
setup do
|
179
|
+
hash = {'FNumber' => 8, 'Author' => 'janfri'}
|
180
|
+
@values = MultiExiftool::Values.new(hash)
|
181
|
+
end
|
182
|
+
|
183
|
+
test 'existing keys' do
|
184
|
+
[:fnumber, :f_number, :FNumber, 'fnumber', 'f_number', 'FNumber', :author, :Author, 'author', 'Author'].each do |t|
|
185
|
+
assert_true @values.respond_to? t
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
test 'non existing key' do
|
190
|
+
['iso', 'ISO', :iso, :ISO].each do |t|
|
191
|
+
assert_false @values.respond_to? t
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
176
196
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_exiftool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Friedrich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -141,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements:
|
143
143
|
- exiftool, version 7.65 or higher
|
144
|
-
|
145
|
-
rubygems_version: 2.7.6
|
144
|
+
rubygems_version: 3.1.2
|
146
145
|
signing_key:
|
147
146
|
specification_version: 4
|
148
147
|
summary: This library is a wrapper for the ExifTool command-line application (http://www.sno.phy.queensu.ca/~phil/exiftool).
|