mini_exiftool 2.2.0 → 2.2.1

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog +4 -0
  3. data/Rakefile +0 -1
  4. data/lib/mini_exiftool.rb +8 -4
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2970f3d46bd1c8af75467b6914b3bc0f13723615
4
- data.tar.gz: 2ac12585911106fe8b086b24f8d881f4f2b830aa
3
+ metadata.gz: 159cfbc0f0d31089460212c5e262d0f33741fab9
4
+ data.tar.gz: 5371c34ee8764f93c172b45d831d0b5ef25f39d6
5
5
  SHA512:
6
- metadata.gz: 3b5379aefcce1ef0f88154f4026de05a1c227ed209b69eb35d0d4f1559531556ea8dab0ae78f4b518f77a6ad804b3ec756a8359211e266d1d0de4b597dff6a47
7
- data.tar.gz: 8a85d9606d967cac3bde0041a8ce790cb5c4b34292204d4f662943b3ed49e6b81dc12aaee84e1081e33a82480361e05600e6924bfffeafbcf94d3c1280091486
6
+ metadata.gz: b954c6e2d92c8a355a2d1be4b84f321ee5f8ecdd2a1005ab02f9a4898080ab92514df488e306d4124e3fc8f1e714aa5e23e313a9b8440992682ca59354854ea8
7
+ data.tar.gz: 31d4634627c91a491018ae78cc768c692f54c2e080b4cf5da827ce8bfa50adadb52625448932f1fb1361880ba17f2048e1550c3e969394b5920b54a2f311b57e
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 2.2.1
2
+ - Bugfix: Ignore filename specific tags to avoid encoding
3
+ confusions.
4
+
1
5
  2.2.0
2
6
  The Encoding Release
3
7
  - New option :replace_invalid_chars to handle "bad data"
data/Rakefile CHANGED
@@ -15,7 +15,6 @@ Rim.setup do |p|
15
15
  p.summary = 'This library is wrapper for the Exiftool command-line application (http://www.sno.phy.queensu.ca/~phil/exiftool).'
16
16
  p.homepage = 'http://gitorious.org/mini_exiftool'
17
17
  p.gem_files << 'Tutorial.rdoc'
18
- puts p.rdoc_files
19
18
  p.rdoc_files << 'Tutorial.rdoc'
20
19
  p.install_message = %q{
21
20
  +-----------------------------------------------------------------------+
data/lib/mini_exiftool.rb CHANGED
@@ -39,7 +39,7 @@ class MiniExiftool
39
39
  attr_accessor :numerical, :composite, :ignore_minor_errors, :errors,
40
40
  :replace_invalid_chars, :timestamps
41
41
 
42
- VERSION = '2.2.0'
42
+ VERSION = '2.2.1'
43
43
 
44
44
  # +opts+ support at the moment
45
45
  # * <code>:numerical</code> for numerical values, default is +false+
@@ -80,7 +80,7 @@ class MiniExiftool
80
80
 
81
81
  def initialize_from_hash hash # :nodoc:
82
82
  hash.each_pair do |tag,value|
83
- set_value tag, convert_after_load(value)
83
+ set_value tag, convert_after_load(tag, value)
84
84
  end
85
85
  set_attributes_by_heuristic
86
86
  self
@@ -357,13 +357,17 @@ class MiniExiftool
357
357
  @output.encode!('UTF-16le', invalid: :replace, replace: @replace_invalid_chars).encode!('UTF-8')
358
358
  end
359
359
  JSON.parse(@output)[0].each do |tag,value|
360
- value = convert_after_load(value)
360
+ value = convert_after_load(tag, value)
361
361
  set_value tag, value
362
362
  end
363
363
  end
364
364
 
365
- def convert_after_load value
365
+ def convert_after_load tag, value
366
366
  return value unless value.kind_of?(String)
367
+ if %w(sourcefile filename directory).include?(MiniExiftool.unify(tag))
368
+ # ignore filesystem relevant tags to avoid encoding problems
369
+ return nil
370
+ end
367
371
  case value
368
372
  when /^\d{4}:\d\d:\d\d \d\d:\d\d:\d\d/
369
373
  s = value.sub(/^(\d+):(\d+):/, '\1-\2-')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_exiftool
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Friedrich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-27 00:00:00.000000000 Z
11
+ date: 2013-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rim