Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfix [#8073]: Handling '-' in tag names like Self-timer.

  • Loading branch information...
commit 1a10120a78576f6dcf10056296fe38c1cc336512 1 parent 972e77b
Jan Friedrich authored
5 Changelog
View
@@ -1,3 +1,8 @@
+Version 0.1.1
+- Fixing bug [#8073]
+ Handling the '-' in tag Self-timer
+ Thanks to Eric Young
+
Version 0.1.0
- New method "revert"
- More tests
2  Rakefile
View
@@ -45,7 +45,7 @@ REQUIRE_PATHS << EXT_DIR if HAVE_EXT
$LOAD_PATH.concat(REQUIRE_PATHS)
# This library file defines the MyProject::VERSION constant.
require "#{UNIX_NAME}"
-PROJECT_VERSION = eval("#{PROJECT}::Version") # e.g. "1.0.2"
+PROJECT_VERSION = eval("#{PROJECT}::VERSION") # e.g. "1.0.2"
#---
# Clobber object files and Makefiles generated by extconf.rb.
CLOBBER.include("#{EXT_DIR}/**/*.{so,dll,o}", "#{EXT_DIR}/**/Makefile")
6 lib/mini_exiftool.rb
View
@@ -25,7 +25,7 @@ class MiniExiftool
attr_reader :filename
attr_accessor :numerical
- Version = '0.1.0'
+ VERSION = '0.1.1'
# opts at the moment only support :numerical for numerical values
# (the -n parameter in the command line)
@@ -121,7 +121,7 @@ def run cmd
end
def unify name
- name.gsub(/_/, '').downcase
+ name.gsub(/[_\-]/, '').downcase
end
def convert val
@@ -151,7 +151,7 @@ def parse_output
end
def parse_line line
- if line =~ /^(\w+?)\t(.*)$/
+ if line =~ /^([^\t]+?)\t(.*)$/
tag, value = $1, $2
case value
when /^\d{4}:\d\d:\d\d \d\d:\d\d:\d\d$/
BIN  test/data/Canon.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3  test/data/INFORMATION
View
@@ -0,0 +1,3 @@
+Following files are borrowed from the original Exiftool perl package.
+
+Canon.jpg
28 test/test_special.rb
View
@@ -0,0 +1,28 @@
+require 'mini_exiftool'
+require 'test/unit'
+begin
+ require 'turn'
+rescue LoadError
+end
+
+class TestSpecial < Test::Unit::TestCase
+
+ def setup
+ @data_dir = File.dirname(__FILE__) + '/data'
+ @filename_canon = @data_dir + '/Canon.jpg'
+ @canon = MiniExiftool.new @filename_canon
+ end
+
+ # Catching bug [#8073]
+ # Thanks to Eric Young
+ def test_special_chars
+ assert_equal 0, @canon['Self-timer']
+ assert_equal 0, @canon.self_timer
+ # preserving the original tag name
+ assert @canon.tags.include?('Self-timer')
+ assert !@canon.tags.include?('self_timer')
+ end
+
+
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.