multi_exiftool 0.17.1 → 0.18.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: 2da035005cfd8b951a7cc60ecd7e1675ab9652d020f3b067ac6a3c8cd656f5a4
4
- data.tar.gz: 913ebcb588e47bbd3a0d3ea7f8cfadba69cfd996be7508b1348f59833f719f3c
3
+ metadata.gz: f5e0da6a6777fec53fcab69c4b0820b6c4ed0de051f52f6954c0b4ed77aed3d3
4
+ data.tar.gz: 1f5990491326fd50822a5b53ff0fd7e772e5ee778a870a789baaf9d714b15246
5
5
  SHA512:
6
- metadata.gz: 29779137c5f5b6a4548373955f10b6ed0621001e0dcebc5779d79023a54ed35189f3bd52a29f910f2be6b88204bb77ae7084d59e7db3ac3e2058b618f875a025
7
- data.tar.gz: 731d597e9d15160b8b3c0fed87e287f5d33ef3cb2f11184f1d16d8fe13e1a5bee0eecde4c1d49cddfe293d42f4da79d6865ceb37b8833198919f5bbee9e78260
6
+ metadata.gz: d0eb9046eaeed06017ce13fce678d00243ffb79c17cc4592b3ad4d41e79ec38e903e09432a9857db79c27e61ac34aa1c45086d9f3b6b09db3b15b72015be2d87
7
+ data.tar.gz: faf64b4908f2ed242d32e3d80920628b10a3618c021a643be158d80463f79561c0d0a798ef3eb356ec44ba47384d5bb3976b1b3e0f4b36c8d0dd8fa379590e31
data/Changelog CHANGED
@@ -1,3 +1,8 @@
1
+ 0.18.0
2
+ Adapt handling of errors. Only lines in STDERR which starts with "Error:" or
3
+ "Warning:" are now interpreted as error messages. Therefore ExifTool 11.10 is
4
+ now the minimal supported version.
5
+
1
6
  0.17.1
2
7
  Maintenance release: update Ruby versions for CI.
3
8
 
data/README.md CHANGED
@@ -199,12 +199,9 @@ The method Values#convert is called each time a value is fetched.
199
199
  ## Requirements
200
200
 
201
201
  - Ruby 1.9.1 or higher
202
- - An installation of the ExifTool command-line application (version 7.65 or
202
+ - An installation of the ExifTool command-line application (version 11.10 or
203
203
  higher). Instructions for installation you can find under
204
204
  https://exiftool.org/install.html .
205
- - If you have problems with special characters (like German umlauts) in
206
- filenames on windows system it is recommended to use exiftool version 9.79
207
- or higher.
208
205
 
209
206
  ## Installation
210
207
 
data/Rakefile CHANGED
@@ -18,14 +18,14 @@ Rim.setup do |p|
18
18
  p.homepage = 'https://github.com/janfri/multi_exiftool'
19
19
  p.install_message = %q{
20
20
  +-----------------------------------------------------------------------+
21
- | Please ensure you have installed exiftool version 7.65 or higher and |
21
+ | Please ensure you have installed exiftool version 11.10 or higher and |
22
22
  | it's found in your PATH (Try "exiftool -ver" on your commandline). |
23
23
  | For more details see |
24
- | https://exiftool.org/install.html |
24
+ | https://exiftool.org/install.html |
25
25
  +-----------------------------------------------------------------------+
26
26
  }
27
27
  p.development_dependencies << %w(contest ~>0.1)
28
28
  p.development_dependencies << 'test-unit'
29
- p.requirements << 'exiftool, version 7.65 or higher'
29
+ p.requirements << 'exiftool, version 11.10 or higher'
30
30
  p.test_warning = false
31
31
  end
@@ -30,13 +30,6 @@ module MultiExiftool
30
30
  @writers.map {|w| w.exiftool_args + ['-execute']}.flatten
31
31
  end
32
32
 
33
- private
34
-
35
- def parse_results
36
- @errors = @stderr.read.split(/\n/)
37
- @errors.empty?
38
- end
39
-
40
33
  end
41
34
 
42
35
  end
@@ -72,6 +72,15 @@ module MultiExiftool
72
72
  stdin.close
73
73
  end
74
74
 
75
+ def parse_results
76
+ parse_errors
77
+ @errors.empty?
78
+ end
79
+
80
+ def parse_errors
81
+ @errors = @stderr.read.lines(chomp: true).select {|l| l =~ /^(Error|Warning):/}
82
+ end
83
+
75
84
  end
76
85
 
77
86
  end
@@ -29,11 +29,7 @@ module MultiExiftool
29
29
  end
30
30
 
31
31
  def self.mandatory_args
32
- if MultiExiftool.exiftool_version >= 9.79
33
- %w(-J -charset FileName=utf8 -charset utf8)
34
- else
35
- %w(-J -charset utf8)
36
- end
32
+ %w(-J -charset FileName=utf8 -charset utf8)
37
33
  end
38
34
 
39
35
  # Options to use with the exiftool command.
@@ -73,9 +69,8 @@ module MultiExiftool
73
69
  end
74
70
 
75
71
  def parse_results
72
+ parse_errors
76
73
  stdout = @stdout.read
77
- error_string = @stderr.read.gsub(/^ .*$/, '')
78
- @errors = error_string.split(/\n/)
79
74
  json = JSON.parse(stdout)
80
75
  json.map {|values| Values.new(values)}
81
76
  rescue JSON::ParserError
@@ -20,11 +20,7 @@ module MultiExiftool
20
20
  end
21
21
 
22
22
  def self.mandatory_args
23
- if MultiExiftool.exiftool_version >= 9.79
24
- %w(-charset FileName=utf8 -charset utf8)
25
- else
26
- %w(-charset utf8)
27
- end
23
+ %w(-charset FileName=utf8 -charset utf8)
28
24
  end
29
25
 
30
26
  # Options to use with the exiftool command.
@@ -71,11 +67,6 @@ module MultiExiftool
71
67
  res.flatten
72
68
  end
73
69
 
74
- def parse_results
75
- @errors = @stderr.read.split(/\n/)
76
- @errors.empty?
77
- end
78
-
79
70
  end
80
71
 
81
72
  end
@@ -8,7 +8,7 @@ require_relative 'multi_exiftool/batch'
8
8
 
9
9
  module MultiExiftool
10
10
 
11
- VERSION = '0.17.1'
11
+ VERSION = '0.18.0'
12
12
 
13
13
  @exiftool_command = 'exiftool'
14
14
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: multi_exiftool 0.17.1 ruby lib
2
+ # stub: multi_exiftool 0.18.0 ruby lib
3
3
  #
4
4
  # This file is automatically generated by rim.
5
5
  # PLEASE DO NOT EDIT IT DIRECTLY!
@@ -7,21 +7,21 @@
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "multi_exiftool"
10
- s.version = "0.17.1"
10
+ s.version = "0.18.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 = "2023-10-06"
15
+ s.date = "2024-04-04"
16
16
  s.description = "This library is a wrapper for the ExifTool command-line application (https://exiftool.org) 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/batch.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/data/example.config", "test/helper.rb", "test/test_batch.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"]
19
19
  s.homepage = "https://github.com/janfri/multi_exiftool"
20
20
  s.licenses = ["MIT"]
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| https://exiftool.org/install.html |\n+-----------------------------------------------------------------------+\n "
21
+ s.post_install_message = "\n+-----------------------------------------------------------------------+\n| Please ensure you have installed exiftool version 11.10 or higher and |\n| it's found in your PATH (Try \"exiftool -ver\" on your commandline). |\n| For more details see |\n| https://exiftool.org/install.html |\n+-----------------------------------------------------------------------+\n "
22
22
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
23
- s.requirements = ["exiftool, version 7.65 or higher"]
24
- s.rubygems_version = "3.5.0.dev"
23
+ s.requirements = ["exiftool, version 11.10 or higher"]
24
+ s.rubygems_version = "3.6.0.dev"
25
25
  s.summary = "This library is a wrapper for the ExifTool command-line application (https://exiftool.org)."
26
26
 
27
27
  s.specification_version = 4
@@ -4,10 +4,10 @@ result:
4
4
  - - !ruby/object:MultiExiftool::Values
5
5
  values:
6
6
  sourcefile: regtest/test.jpg
7
- exiftoolversion: 12.0
7
+ exiftoolversion: 12.26
8
8
  filename: test.jpg
9
9
  directory: regtest
10
- filesize: 43 kB
10
+ filesize: 43 KiB
11
11
  filetype: JPEG
12
12
  filetypeextension: jpg
13
13
  mimetype: image/jpeg
@@ -135,7 +135,7 @@ class TestFunctionalApi < Test::Unit::TestCase
135
135
  run_in_temp_dir do
136
136
  values = {orientation: 2}
137
137
  errors = MultiExiftool.write(@filenames, values)
138
- assert_equal ["Warning: Can't convert IFD0:Orientation (matches more than one PrintConv)", "Nothing to do."], errors
138
+ assert_equal ["Warning: Can't convert IFD0:Orientation (matches more than one PrintConv)"], errors
139
139
  errors = MultiExiftool.write(@filenames, values, numerical: true)
140
140
  assert errors.empty?
141
141
  end
@@ -188,13 +188,11 @@ class TestFunctionalApi < Test::Unit::TestCase
188
188
  test 'error if tags do not exist' do
189
189
  run_in_temp_dir do
190
190
  errors = MultiExiftool.delete_values(@filenames, tags: %w[foo bar])
191
- err1, err2, err3 = errors
192
- expected1 = /^Warning: Tag 'foo' is not (defined|supported)$/
193
- expected2 = /^Warning: Tag 'bar' is not (defined|supported)$/
194
- expected3 = 'Nothing to do.'
191
+ err1, err2 = errors
192
+ expected1 = /^Warning: Tag 'foo' is not defined$/
193
+ expected2 = /^Warning: Tag 'bar' is not defined$/
195
194
  assert_match expected1, err1
196
195
  assert_match expected2, err2
197
- assert_equal expected3, err3
198
196
  end
199
197
  end
200
198
 
data/test/test_reader.rb CHANGED
@@ -101,11 +101,7 @@ class TestReader < Test::Unit::TestCase
101
101
  @reader.filenames = %w(non_existing_file)
102
102
  res = @reader.read
103
103
  assert_equal [], res
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
104
+ assert_equal ['Error: File not found - non_existing_file'], @reader.errors
109
105
  end
110
106
  end
111
107
 
@@ -115,11 +111,7 @@ class TestReader < Test::Unit::TestCase
115
111
  @reader.tags = %w(fnumber foo)
116
112
  res = @reader.read
117
113
  assert_equal [5.6], res.map {|e| e['FNumber']}
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
114
+ assert_equal ['Error: File not found - xxx'], @reader.errors
123
115
  end
124
116
  end
125
117
 
data/test/test_writer.rb CHANGED
@@ -123,11 +123,7 @@ class TestWriter < Test::Unit::TestCase
123
123
  @writer.values = {comment: 'foo', bar: 'x'}
124
124
  rc = @writer.write
125
125
  assert !rc
126
- if MultiExiftool.exiftool_version >= 10.38
127
- assert_equal ["Warning: Tag 'bar' is not defined", "Error: File not found - xxx"], @writer.errors
128
- else
129
- assert_equal ["Warning: Tag 'bar' is not supported", "Error: File not found - xxx"], @writer.errors
130
- end
126
+ assert_equal ["Warning: Tag 'bar' is not defined", "Error: File not found - xxx"], @writer.errors
131
127
  end
132
128
  end
133
129
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_exiftool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Friedrich
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-10-06 00:00:00.000000000 Z
10
+ date: 2024-04-04 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -124,10 +123,10 @@ licenses:
124
123
  - MIT
125
124
  metadata: {}
126
125
  post_install_message: "\n+-----------------------------------------------------------------------+\n|
127
- Please ensure you have installed exiftool version 7.65 or higher and |\n| it's
126
+ Please ensure you have installed exiftool version 11.10 or higher and |\n| it's
128
127
  found in your PATH (Try \"exiftool -ver\" on your commandline). |\n| For more
129
128
  details see |\n| https://exiftool.org/install.html
130
- \ |\n+-----------------------------------------------------------------------+\n
129
+ \ |\n+-----------------------------------------------------------------------+\n
131
130
  \ "
132
131
  rdoc_options: []
133
132
  require_paths:
@@ -143,9 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
142
  - !ruby/object:Gem::Version
144
143
  version: '0'
145
144
  requirements:
146
- - exiftool, version 7.65 or higher
147
- rubygems_version: 3.5.0.dev
148
- signing_key:
145
+ - exiftool, version 11.10 or higher
146
+ rubygems_version: 3.6.0.dev
149
147
  specification_version: 4
150
148
  summary: This library is a wrapper for the ExifTool command-line application (https://exiftool.org).
151
149
  test_files: []