mini_exiftool 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +3 -0
- data/README +1 -1
- data/Rakefile +1 -1
- data/lib/mini_exiftool.rb +8 -8
- data/test/data/test_special_dates.jpg +0 -0
- data/test/test_special_dates.rb +7 -1
- metadata +6 -18
data/Changelog
CHANGED
data/README
CHANGED
@@ -33,7 +33,7 @@ feel free to contribute!
|
|
33
33
|
Jan Friedrich <janfri DOT rubyforge AT gmail DOT com>
|
34
34
|
|
35
35
|
== Copyright / License
|
36
|
-
Copyright (c) 2007-
|
36
|
+
Copyright (c) 2007-2011 by Jan Friedrich
|
37
37
|
|
38
38
|
Licensed under terms of the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1,
|
39
39
|
February 1999 (see file COPYING for more details)
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ PROJECT = "MiniExiftool"
|
|
11
11
|
MY_NAME = "Jan Friedrich"
|
12
12
|
|
13
13
|
# Your email address, used in packaging.
|
14
|
-
MY_EMAIL = "
|
14
|
+
MY_EMAIL = "janfri26@gmail.com"
|
15
15
|
|
16
16
|
# Short summary of your project, used in packaging.
|
17
17
|
PROJECT_SUMMARY = 'A library for nice OO access to the Exiftool command-line application written by Phil Harvey.'
|
data/lib/mini_exiftool.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
# Read and write access is done in a clean OO manner.
|
8
8
|
#
|
9
9
|
# Author: Jan Friedrich
|
10
|
-
# Copyright (c) 2007
|
10
|
+
# Copyright (c) 2007-2011 by Jan Friedrich
|
11
11
|
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE,
|
12
12
|
# Version 2.1, February 1999
|
13
13
|
#
|
@@ -17,6 +17,7 @@ require 'tempfile'
|
|
17
17
|
require 'pstore'
|
18
18
|
require 'set'
|
19
19
|
require 'shellwords'
|
20
|
+
require 'time'
|
20
21
|
|
21
22
|
# Simple OO access to the Exiftool command-line application.
|
22
23
|
class MiniExiftool
|
@@ -30,7 +31,7 @@ class MiniExiftool
|
|
30
31
|
attr_reader :filename
|
31
32
|
attr_accessor :numerical, :composite, :convert_encoding, :errors, :timestamps
|
32
33
|
|
33
|
-
VERSION = '1.
|
34
|
+
VERSION = '1.2.0'
|
34
35
|
|
35
36
|
# +opts+ support at the moment
|
36
37
|
# * <code>:numerical</code> for numerical values, default is +false+
|
@@ -314,14 +315,13 @@ class MiniExiftool
|
|
314
315
|
if line =~ /^([^\t]+)\t(.*)$/
|
315
316
|
tag, value = $1, $2
|
316
317
|
case value
|
317
|
-
when /^\d{4}:\d\d:\d\d \d\d:\d\d:\d\d
|
318
|
-
|
319
|
-
arr.map! {|elem| elem.to_i}
|
318
|
+
when /^\d{4}:\d\d:\d\d \d\d:\d\d:\d\d/
|
319
|
+
s = value.sub(/^(\d+):(\d+):/, '\1-\2-')
|
320
320
|
begin
|
321
321
|
if @timestamps == Time
|
322
|
-
value = Time.
|
323
|
-
|
324
|
-
value = DateTime.
|
322
|
+
value = Time.parse(s)
|
323
|
+
elsif @timestamps == DateTime
|
324
|
+
value = DateTime.parse(s)
|
325
325
|
else
|
326
326
|
raise MiniExiftool::Error.new("Value #@timestamps not allowed for option timestamps.")
|
327
327
|
end
|
Binary file
|
data/test/test_special_dates.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'date'
|
2
1
|
require 'fileutils'
|
3
2
|
require 'tempfile'
|
4
3
|
require 'helpers_for_test'
|
@@ -43,5 +42,12 @@ class TestSpecialDates < TestCase
|
|
43
42
|
assert_equal false, @mini_exiftool.modify_date
|
44
43
|
end
|
45
44
|
|
45
|
+
def test_time_zone
|
46
|
+
s = '1961-08-13 12:08:25+01:00'
|
47
|
+
assert_equal Time.parse(s), @mini_exiftool.preview_date_time
|
48
|
+
assert_equal DateTime.parse(s),
|
49
|
+
@mini_exiftool_datetime.preview_date_time
|
50
|
+
end
|
51
|
+
|
46
52
|
end
|
47
53
|
|
metadata
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_exiftool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 1.1.0
|
4
|
+
version: 1.2.0
|
11
5
|
platform: ruby
|
12
6
|
authors:
|
13
7
|
- Jan Friedrich
|
@@ -15,12 +9,12 @@ autorequire:
|
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
11
|
|
18
|
-
date: 2011-
|
12
|
+
date: 2011-03-14 00:00:00 +01:00
|
19
13
|
default_executable:
|
20
14
|
dependencies: []
|
21
15
|
|
22
16
|
description:
|
23
|
-
email:
|
17
|
+
email: janfri26@gmail.com
|
24
18
|
executables: []
|
25
19
|
|
26
20
|
extensions: []
|
@@ -68,27 +62,21 @@ rdoc_options:
|
|
68
62
|
require_paths:
|
69
63
|
- lib
|
70
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
65
|
requirements:
|
73
66
|
- - ">="
|
74
67
|
- !ruby/object:Gem::Version
|
75
|
-
hash: 3
|
76
|
-
segments:
|
77
|
-
- 0
|
78
68
|
version: "0"
|
69
|
+
version:
|
79
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
71
|
requirements:
|
82
72
|
- - ">="
|
83
73
|
- !ruby/object:Gem::Version
|
84
|
-
hash: 3
|
85
|
-
segments:
|
86
|
-
- 0
|
87
74
|
version: "0"
|
75
|
+
version:
|
88
76
|
requirements: []
|
89
77
|
|
90
78
|
rubyforge_project: miniexiftool
|
91
|
-
rubygems_version: 1.3.
|
79
|
+
rubygems_version: 1.3.5
|
92
80
|
signing_key:
|
93
81
|
specification_version: 3
|
94
82
|
summary: A library for nice OO access to the Exiftool command-line application written by Phil Harvey.
|