multi_exiftool 0.11.0 → 0.12.0

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: ca498fb96cf61bd299f2c0d8b7219ad540e9a5b8cbc760c1244ad7d860d5acb2
4
- data.tar.gz: adb0634ba2229c3b8c570ebc027a7ded120b8f94f1889cfaca5604aa3e40ec09
3
+ metadata.gz: 317f91ac28f2791341c7c6354e996545c80f08fb7100607460295ae55c38d463
4
+ data.tar.gz: d98f7b7a4a0cca8e0ce2e18f1b718ef7227412a31ff5e9b8f3d4685077d97221
5
5
  SHA512:
6
- metadata.gz: dc19963fce64259c8c9a2d62b475c9f19fa52c34d092b09c81e4770c882bc6abd26010c5b912e4ab94554f87765219c5216e06c4f6bd98690db3ed860656bd3d
7
- data.tar.gz: 259ecd2569794568dc10115403426b2deab1bf789fd45809ed0c8f1bcb136b98413757906ee691a65fac5f34413d7adac587784618233519f18a0b45d6fedd20
6
+ metadata.gz: 292b732d0940abb55c9dccebadfb8976767891ad33fb865e982689fd0b4a617590b95b195d1144831d073374357f68823dd51a4875962ef0374b0803753adf46
7
+ data.tar.gz: b1d1c48bfdf082f7f79ebf5f5b2feefd0e661fcfb2aebc23b73cfec25606e195b2c989c5e36b05e57257e56ddbb0b0b5fef452ed3a07cb7479508062bc302fbe
@@ -1,33 +1,34 @@
1
- personal_ws-1.1 en 32
2
- utc
3
- UTC
4
- szTheory
5
- janfri
6
- multi
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
- Gemfile
12
- sublicense
13
- tmpdir
14
- ExifTool
16
+ dir
15
17
  exiftool
18
+ filenames
19
+ gemspec
20
+ gittycat
16
21
  gmail
17
- ok
18
- timestamps
22
+ janfri
19
23
  jpg
20
- refactoring
21
- NONINFRINGEMENT
22
- Gitorious
23
- MyConversion
24
- gemspec
25
- Friedrich
24
+ multi
25
+ ok
26
26
  prepend
27
- filenames
28
- PartOfSet
29
- README
30
- stdin
31
- Coenen
27
+ refactoring
32
28
  stderr
33
- gittycat
29
+ stdin
30
+ sublicense
31
+ szTheory
32
+ timestamps
33
+ tmpdir
34
+ utc
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 0.12.0
2
+ Implement Values#respond_to_missing?.
3
+ Improve documentation and fix example code.
4
+
1
5
  0.11.0
2
6
  New method Values#has_tag? to check if a tag is present.
3
7
  Handle invalid values for timestamps and rationals: Timestamps where month or
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2009-2017 Jan Friedrich
3
+ Copyright (c) 2009-2019 Jan Friedrich
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 reader.errors.empty?
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 shows.
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>
@@ -7,7 +7,7 @@ require_relative 'multi_exiftool/writer'
7
7
 
8
8
  module MultiExiftool
9
9
 
10
- VERSION = '0.11.0'
10
+ VERSION = '0.12.0'
11
11
 
12
12
  @exiftool_command = 'exiftool'
13
13
 
@@ -37,8 +37,8 @@ module MultiExiftool
37
37
  convert(unified_tag, @values[unified_tag])
38
38
  end
39
39
 
40
- # Convert values on the basis of tag name and value. It is calles each time
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
- # Generate a hash representation of this instance
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
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: multi_exiftool 0.11.0 ruby lib
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.11.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 = "2018-08-22"
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 = "2.7.6"
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
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
31
- s.add_development_dependency(%q<rake>, [">= 0"])
32
- s.add_development_dependency(%q<rim>, ["~> 2.17"])
33
- s.add_development_dependency(%q<contest>, ["~> 0.1"])
34
- s.add_development_dependency(%q<test-unit>, [">= 0"])
35
- s.add_development_dependency(%q<regtest>, ["~> 2"])
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"])
@@ -4,7 +4,7 @@ result:
4
4
  - - !ruby/object:MultiExiftool::Values
5
5
  values:
6
6
  sourcefile: regtest/test.jpg
7
- exiftoolversion: 11.01
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 Sigma Lens
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: Minolta AF 28-135mm F4-4.5
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
@@ -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
- assert_equal ['File not found: non_existing_file'], @reader.errors
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
- assert_equal ['File not found: xxx'], @reader.errors
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
 
@@ -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.11.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: 2018-08-22 00:00:00.000000000 Z
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
- rubyforge_project:
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).