mini_exiftool 2.8.2 → 2.10.2
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.
- checksums.yaml +5 -5
- data/.aspell.pws +121 -0
- data/Changelog +21 -0
- data/Gemfile +3 -0
- data/README.md +13 -8
- data/Rakefile +5 -5
- data/Tutorial.md +1 -1
- data/lib/mini_exiftool.rb +16 -11
- data/mini_exiftool.gemspec +40 -0
- data/regtest/read_all.rb +12 -0
- data/regtest/read_all.yml +575 -0
- data/test/helpers_for_test.rb +1 -9
- data/test/test_dumping.rb +0 -1
- data/test/test_instance_methods.rb +24 -0
- data/test/test_invalid_byte_sequence_in_utf8.rb +1 -0
- data/test/test_pstore.rb +24 -11
- data/test/test_read_numerical.rb +7 -0
- metadata +30 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 51cea5ba80431798479c6bef0c1554fd9af1f228ebcfc7944215b4bff2206087
|
|
4
|
+
data.tar.gz: ca0f34cc3e579a6a3fb06f60f10275e57f700c0ef48e8c6ea687bc6ce3256705
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54713433ddd51360894ed0ca8e0cda2cd91c45c7f9c14db0cffab40296b2bf7d359abf1d41fa8b646a932eb9169795133367da38d0be226c10720d7e91e068eb
|
|
7
|
+
data.tar.gz: 4e1906897d09383272d8cbb69abe50e4e477e6d340cf1a13a4fc29f7d5cd53c454360af44ab45f7998383437fbe1ed3fbd7543debeab8fef8172773f1267ee95
|
data/.aspell.pws
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
personal_ws-1.1 en 120
|
|
2
|
+
Barushev
|
|
3
|
+
Bugfix
|
|
4
|
+
CaptionAbstract
|
|
5
|
+
CodedCharacterSet
|
|
6
|
+
Cypriano
|
|
7
|
+
DYNAX
|
|
8
|
+
DateTime
|
|
9
|
+
DateTimeOriginal
|
|
10
|
+
Dungan
|
|
11
|
+
ExifTool
|
|
12
|
+
FNumber
|
|
13
|
+
Fixnum
|
|
14
|
+
Forwardable
|
|
15
|
+
Friedrich
|
|
16
|
+
GPS
|
|
17
|
+
Gaelan
|
|
18
|
+
Gemfile
|
|
19
|
+
Gieseler
|
|
20
|
+
Gitorious
|
|
21
|
+
Henning
|
|
22
|
+
Hinrich
|
|
23
|
+
Horrocks
|
|
24
|
+
Hoy
|
|
25
|
+
JPEG
|
|
26
|
+
JPEGs
|
|
27
|
+
Joshfindit
|
|
28
|
+
J�rome
|
|
29
|
+
Krogmann
|
|
30
|
+
Kulander
|
|
31
|
+
MacRoman
|
|
32
|
+
MiniExiftool
|
|
33
|
+
MultiExiftool
|
|
34
|
+
OO
|
|
35
|
+
POSIX
|
|
36
|
+
PStore
|
|
37
|
+
Picturelife
|
|
38
|
+
README
|
|
39
|
+
Rau
|
|
40
|
+
Refactoring
|
|
41
|
+
Regexes
|
|
42
|
+
Romahn
|
|
43
|
+
Salzberg
|
|
44
|
+
SemVer
|
|
45
|
+
SemVerTag
|
|
46
|
+
Soika
|
|
47
|
+
Soutar
|
|
48
|
+
StandardError
|
|
49
|
+
Stjernstrom
|
|
50
|
+
SubjectLocation
|
|
51
|
+
SupplementalCategories
|
|
52
|
+
Tempfile
|
|
53
|
+
TestEscapeFilename
|
|
54
|
+
UTF
|
|
55
|
+
Wil
|
|
56
|
+
acki
|
|
57
|
+
aiff
|
|
58
|
+
atomar
|
|
59
|
+
backticks
|
|
60
|
+
bundler
|
|
61
|
+
ccoenen
|
|
62
|
+
cgat
|
|
63
|
+
charset
|
|
64
|
+
commandline
|
|
65
|
+
coord
|
|
66
|
+
customizable
|
|
67
|
+
darwin
|
|
68
|
+
datetimeoriginal
|
|
69
|
+
dir
|
|
70
|
+
echoe
|
|
71
|
+
encod
|
|
72
|
+
encodings
|
|
73
|
+
exif
|
|
74
|
+
exiftool
|
|
75
|
+
filename
|
|
76
|
+
filenames
|
|
77
|
+
gemspec
|
|
78
|
+
github
|
|
79
|
+
gras
|
|
80
|
+
icc
|
|
81
|
+
io
|
|
82
|
+
iptc
|
|
83
|
+
jpg
|
|
84
|
+
json
|
|
85
|
+
jvradelis
|
|
86
|
+
md
|
|
87
|
+
metadata
|
|
88
|
+
mfo
|
|
89
|
+
mie
|
|
90
|
+
multi
|
|
91
|
+
neccessary
|
|
92
|
+
params
|
|
93
|
+
pdf
|
|
94
|
+
photoshop
|
|
95
|
+
png
|
|
96
|
+
popen
|
|
97
|
+
prerelease
|
|
98
|
+
pstore
|
|
99
|
+
ptore
|
|
100
|
+
quicktime
|
|
101
|
+
rb
|
|
102
|
+
rdoc
|
|
103
|
+
refactorings
|
|
104
|
+
regtest
|
|
105
|
+
releating
|
|
106
|
+
robotmay
|
|
107
|
+
rubyforge
|
|
108
|
+
shellwords
|
|
109
|
+
shioyama
|
|
110
|
+
stderr
|
|
111
|
+
stdout
|
|
112
|
+
str
|
|
113
|
+
timestamps
|
|
114
|
+
uwe
|
|
115
|
+
vorbis
|
|
116
|
+
warings
|
|
117
|
+
ws
|
|
118
|
+
xmp
|
|
119
|
+
yaml
|
|
120
|
+
yardopts
|
|
121
|
+
�ml�uts
|
data/Changelog
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
2.10.2
|
|
2
|
+
- Escape backticks and use escaped values in option coord_format.
|
|
3
|
+
|
|
4
|
+
2.10.1
|
|
5
|
+
- Make access via PStore thread-safe.
|
|
6
|
+
- Fix conversion of values with leading zeros.
|
|
7
|
+
Thanks to jvradelis for reporting this bug (github issue #40) and the hint
|
|
8
|
+
to the incorrect regular expression.
|
|
9
|
+
|
|
10
|
+
2.10.0
|
|
11
|
+
- Implement the method MiniExiftool#respond_to_missing? for completeness and
|
|
12
|
+
the possibility to use MiniExiftool with Forwardable.
|
|
13
|
+
|
|
14
|
+
2.9.1
|
|
15
|
+
- Fix a problem with frozen string in newer Ruby versions.
|
|
16
|
+
- Improve internal stuff and documentation.
|
|
17
|
+
|
|
18
|
+
2.9.0
|
|
19
|
+
- Use rim/regtest instead of regtest/task to include regtest files into gem.
|
|
20
|
+
- Update to rim 2.15 to include Gemfile and other stuff into gem file.
|
|
21
|
+
|
|
1
22
|
2.8.2
|
|
2
23
|
- Upgrade to rim 2.10.0 to unfreeze gemspec.
|
|
3
24
|
|
data/Gemfile
ADDED
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# MiniExiftool
|
|
1
|
+
# MiniExiftool [](https://travis-ci.org/janfri/mini_exiftool)
|
|
2
2
|
|
|
3
3
|
This library is a wrapper for the ExifTool command-line application
|
|
4
|
-
(
|
|
4
|
+
(https://exiftool.org) written by Phil Harvey.
|
|
5
5
|
It provides the full power of ExifTool to Ruby: reading and writing of
|
|
6
6
|
EXIF-data, IPTC-data and XMP-data.
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ command-line application at least version 7.65.
|
|
|
12
12
|
If you run on Ruby 1.8 or with a prior exiftool version
|
|
13
13
|
install mini_exiftool version 1.x.x.
|
|
14
14
|
Instructions for installation you can find under
|
|
15
|
-
|
|
15
|
+
https://exiftool.org/install.html .
|
|
16
16
|
|
|
17
17
|
Alternatively Wil Gieseler has bundled a meta-gem that eliminates the
|
|
18
18
|
need for a separate ExifTool installation. Have a look at
|
|
@@ -28,7 +28,7 @@ gem install mini_exiftool
|
|
|
28
28
|
```
|
|
29
29
|
or simply add to the following to your Gemfile:
|
|
30
30
|
```ruby
|
|
31
|
-
gem '
|
|
31
|
+
gem 'mini_exiftool'
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
If you need to support older versions of Ruby or Exiftool (see Requirements above)
|
|
@@ -40,7 +40,7 @@ gem install --version "< 2.0.0" mini_exiftool
|
|
|
40
40
|
or if you use a Gemfile add:
|
|
41
41
|
|
|
42
42
|
```ruby
|
|
43
|
-
gem '
|
|
43
|
+
gem 'mini_exiftool', '<2.0.0'
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## Configuration
|
|
@@ -100,7 +100,7 @@ examples.
|
|
|
100
100
|
|
|
101
101
|
The philosophy of MiniExiftool is safety over performance.
|
|
102
102
|
It can not handle more than one file at once. Writing operations are
|
|
103
|
-
executed on a copy of the original file to have
|
|
103
|
+
executed on a copy of the original file to have atomic writing: Either
|
|
104
104
|
all changed values are written or none.
|
|
105
105
|
To be able to assign errors to a specific tag writing operations also call
|
|
106
106
|
the Exiftool command-line application once for each changed tag!
|
|
@@ -131,7 +131,7 @@ tag.
|
|
|
131
131
|
|
|
132
132
|
Please read the section about the character sets of the ExifTool command
|
|
133
133
|
line application carefully to understand what's going on
|
|
134
|
-
(
|
|
134
|
+
(https://exiftool.org/faq.html#Q10)!
|
|
135
135
|
|
|
136
136
|
```ruby
|
|
137
137
|
# Using UTF-8 as internal encoding for IPTC tags and MacRoman
|
|
@@ -171,11 +171,16 @@ The code is hosted in a git repository on github at
|
|
|
171
171
|
https://github.com/janfri/mini_exiftool
|
|
172
172
|
feel free to contribute!
|
|
173
173
|
|
|
174
|
+
## Versioning
|
|
175
|
+
|
|
176
|
+
MiniExiftool follows [Semantic Versioning](https://semver.org/), both SemVer and
|
|
177
|
+
SemVerTag.
|
|
178
|
+
|
|
174
179
|
## Author
|
|
175
180
|
Jan Friedrich <janfri26@gmail.com>
|
|
176
181
|
|
|
177
182
|
## Copyright / License
|
|
178
|
-
Copyright (c) 2007-
|
|
183
|
+
Copyright (c) 2007-2019 by Jan Friedrich
|
|
179
184
|
|
|
180
185
|
Licensed under terms of the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1,
|
|
181
186
|
February 1999 (see file COPYING for more details)
|
data/Rakefile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'rim/tire'
|
|
2
2
|
require 'rim/version'
|
|
3
|
-
require 'regtest
|
|
3
|
+
require 'rim/regtest'
|
|
4
4
|
|
|
5
5
|
$:.unshift 'lib'
|
|
6
6
|
require 'mini_exiftool'
|
|
@@ -10,10 +10,10 @@ Rim.setup do |p|
|
|
|
10
10
|
p.version = MiniExiftool::VERSION
|
|
11
11
|
p.authors = 'Jan Friedrich'
|
|
12
12
|
p.email = 'janfri26@gmail.com'
|
|
13
|
-
p.summary = 'This library is a wrapper for the ExifTool command-line application (
|
|
13
|
+
p.summary = 'This library is a wrapper for the ExifTool command-line application (https://exiftool.org).'
|
|
14
14
|
p.description <<-END
|
|
15
15
|
This library is a wrapper for the ExifTool command-line application
|
|
16
|
-
(
|
|
16
|
+
(https://exiftool.org) written by Phil Harvey.
|
|
17
17
|
It provides the full power of ExifTool to Ruby: reading and writing of
|
|
18
18
|
EXIF-data, IPTC-data and XMP-data.
|
|
19
19
|
END
|
|
@@ -26,14 +26,14 @@ EXIF-data, IPTC-data and XMP-data.
|
|
|
26
26
|
| Please ensure you have installed exiftool at least version 7.65 |
|
|
27
27
|
| and it's found in your PATH (Try "exiftool -ver" on your commandline).|
|
|
28
28
|
| For more details see |
|
|
29
|
-
|
|
|
29
|
+
| https://exiftool.org/install.html |
|
|
30
30
|
| You need also Ruby 1.9 or higher. |
|
|
31
31
|
| If you need support for Ruby 1.8 or exiftool prior 7.65 install |
|
|
32
32
|
| mini_exiftool version < 2.0.0. |
|
|
33
33
|
+-----------------------------------------------------------------------+
|
|
34
34
|
END
|
|
35
35
|
p.test_warning = false
|
|
36
|
-
p.development_dependencies << '
|
|
36
|
+
p.development_dependencies << 'test-unit'
|
|
37
37
|
if p.feature_loaded? 'rim/aspell'
|
|
38
38
|
p.aspell_files << 'Tutorial.md'
|
|
39
39
|
end
|
data/Tutorial.md
CHANGED
data/lib/mini_exiftool.rb
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
# MiniExiftool
|
|
4
4
|
#
|
|
5
5
|
# This library is wrapper for the ExifTool command-line
|
|
6
|
-
# application (
|
|
6
|
+
# application (https://exiftool.org/)
|
|
7
7
|
# written by Phil Harvey.
|
|
8
8
|
# Read and write access is done in a clean OO manner.
|
|
9
9
|
#
|
|
10
10
|
# Author: Jan Friedrich
|
|
11
|
-
# Copyright (c) 2007-
|
|
11
|
+
# Copyright (c) 2007-2019 by Jan Friedrich
|
|
12
12
|
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE,
|
|
13
13
|
# Version 2.1, February 1999
|
|
14
14
|
#
|
|
@@ -26,7 +26,7 @@ require 'time'
|
|
|
26
26
|
# Simple OO access to the ExifTool command-line application.
|
|
27
27
|
class MiniExiftool
|
|
28
28
|
|
|
29
|
-
VERSION = '2.
|
|
29
|
+
VERSION = '2.10.2'
|
|
30
30
|
|
|
31
31
|
# Name of the ExifTool command-line application
|
|
32
32
|
@@cmd = 'exiftool'
|
|
@@ -149,7 +149,7 @@ class MiniExiftool
|
|
|
149
149
|
params = '-j '
|
|
150
150
|
params << (@opts[:numerical] ? '-n ' : '')
|
|
151
151
|
params << (@opts[:composite] ? '' : '-e ')
|
|
152
|
-
params << (@opts[:coord_format] ? "-c
|
|
152
|
+
params << (@opts[:coord_format] ? "-c #{escape(@opts[:coord_format])}" : '')
|
|
153
153
|
params << (@opts[:fast] ? '-fast ' : '')
|
|
154
154
|
params << (@opts[:fast2] ? '-fast2 ' : '')
|
|
155
155
|
params << generate_encoding_params
|
|
@@ -418,13 +418,18 @@ class MiniExiftool
|
|
|
418
418
|
|
|
419
419
|
def method_missing symbol, *args
|
|
420
420
|
tag_name = symbol.id2name
|
|
421
|
-
if tag_name
|
|
422
|
-
self[
|
|
421
|
+
if tag_name =~ /^(.+)=$/
|
|
422
|
+
self[$1] = args.first
|
|
423
423
|
else
|
|
424
424
|
self[tag_name]
|
|
425
425
|
end
|
|
426
426
|
end
|
|
427
427
|
|
|
428
|
+
def respond_to_missing? symbol, *args
|
|
429
|
+
tag_name = MiniExiftool.unify(symbol.id2name)
|
|
430
|
+
!!(tag_name =~ /=$/) || @values.key?(tag_name) || super
|
|
431
|
+
end
|
|
432
|
+
|
|
428
433
|
def parse_output
|
|
429
434
|
adapt_encoding
|
|
430
435
|
set_values JSON.parse(@output).first
|
|
@@ -456,8 +461,8 @@ class MiniExiftool
|
|
|
456
461
|
end
|
|
457
462
|
when /^\+\d+\.\d+$/
|
|
458
463
|
value = value.to_f
|
|
459
|
-
when /^0
|
|
460
|
-
#
|
|
464
|
+
when /^0\d+$/
|
|
465
|
+
# no conversion => String
|
|
461
466
|
when /^-?\d+$/
|
|
462
467
|
value = value.to_i
|
|
463
468
|
when %r(^(\d+)/(\d+)$)
|
|
@@ -503,7 +508,7 @@ class MiniExiftool
|
|
|
503
508
|
def self.load_or_create_pstore
|
|
504
509
|
FileUtils.mkdir_p(pstore_dir)
|
|
505
510
|
pstore_filename = File.join(pstore_dir, 'exiftool_tags_' << exiftool_version.gsub('.', '_') << '.pstore')
|
|
506
|
-
@@pstore = PStore.new
|
|
511
|
+
@@pstore = PStore.new(pstore_filename, _threadsafe = true)
|
|
507
512
|
if !File.exist?(pstore_filename) || File.size(pstore_filename) == 0
|
|
508
513
|
$stderr.puts 'Generating cache file for ExifTool tag names. This takes a few seconds but is only needed once...'
|
|
509
514
|
@@pstore.transaction do |ps|
|
|
@@ -530,11 +535,11 @@ class MiniExiftool
|
|
|
530
535
|
|
|
531
536
|
if @@running_on_windows
|
|
532
537
|
def escape val
|
|
533
|
-
'"' << val.to_s.gsub(/([\\"])/, "\\\\\\1") << '"'
|
|
538
|
+
'"' << val.to_s.gsub(/([\\"`])/, "\\\\\\1") << '"'
|
|
534
539
|
end
|
|
535
540
|
else
|
|
536
541
|
def escape val
|
|
537
|
-
'"' << val.to_s.gsub(/([\\"
|
|
542
|
+
'"' << val.to_s.gsub(/([\\"$`])/, "\\\\\\1") << '"'
|
|
538
543
|
end
|
|
539
544
|
end
|
|
540
545
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
# stub: mini_exiftool 2.10.2 ruby lib
|
|
3
|
+
#
|
|
4
|
+
# This file is automatically generated by rim.
|
|
5
|
+
# PLEASE DO NOT EDIT IT DIRECTLY!
|
|
6
|
+
# Change the values in Rim.setup in Rakefile instead.
|
|
7
|
+
|
|
8
|
+
Gem::Specification.new do |s|
|
|
9
|
+
s.name = "mini_exiftool"
|
|
10
|
+
s.version = "2.10.2"
|
|
11
|
+
|
|
12
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
13
|
+
s.require_paths = ["lib"]
|
|
14
|
+
s.authors = ["Jan Friedrich"]
|
|
15
|
+
s.date = "2021-06-29"
|
|
16
|
+
s.description = "This library is a wrapper for the ExifTool command-line application\n(https://exiftool.org) written by Phil Harvey.\nIt provides the full power of ExifTool to Ruby: reading and writing of\nEXIF-data, IPTC-data and XMP-data.\n"
|
|
17
|
+
s.email = "janfri26@gmail.com"
|
|
18
|
+
s.files = ["./.aspell.pws", "COPYING", "Changelog", "Gemfile", "README.md", "Rakefile", "Tutorial.md", "examples/copy_icc_profile.rb", "examples/external_photo.rb", "examples/print_portraits.rb", "examples/shift_time.rb", "examples/show_speedup_with_fast_option.rb", "lib/mini_exiftool.rb", "mini_exiftool.gemspec", "regtest/read_all.rb", "regtest/read_all.yml", "test/data", "test/data/Bad_PreviewIFD.jpg", "test/data/Canon.jpg", "test/data/INFORMATION", "test/data/invalid_byte_sequence_in_utf8.json", "test/data/invalid_rational.json", "test/data/test.jpg", "test/data/test.jpg.json", "test/data/test_coordinates.jpg", "test/data/test_encodings.jpg", "test/data/test_special_dates.jpg", "test/helpers_for_test.rb", "test/test_bad_preview_ifd.rb", "test/test_class_methods.rb", "test/test_composite.rb", "test/test_copy_tags_from.rb", "test/test_dumping.rb", "test/test_encodings.rb", "test/test_filename_access.rb", "test/test_from_hash.rb", "test/test_instance_methods.rb", "test/test_invalid_byte_sequence_in_utf8.rb", "test/test_invalid_rational.rb", "test/test_io.rb", "test/test_pstore.rb", "test/test_read.rb", "test/test_read_coordinates.rb", "test/test_read_numerical.rb", "test/test_save.rb", "test/test_special.rb", "test/test_special_dates.rb", "test/test_write.rb"]
|
|
19
|
+
s.homepage = "https://github.com/janfri/mini_exiftool"
|
|
20
|
+
s.licenses = ["LGPL-2.1"]
|
|
21
|
+
s.post_install_message = "+-----------------------------------------------------------------------+\n| Please ensure you have installed exiftool at least version 7.65 |\n| and it's found in your PATH (Try \"exiftool -ver\" on your commandline).|\n| For more details see |\n| https://exiftool.org/install.html |\n| You need also Ruby 1.9 or higher. |\n| If you need support for Ruby 1.8 or exiftool prior 7.65 install |\n| mini_exiftool version < 2.0.0. |\n+-----------------------------------------------------------------------+\n"
|
|
22
|
+
s.rubygems_version = "3.2.15"
|
|
23
|
+
s.summary = "This library is a wrapper for the ExifTool command-line application (https://exiftool.org)."
|
|
24
|
+
|
|
25
|
+
if s.respond_to? :specification_version then
|
|
26
|
+
s.specification_version = 4
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
if s.respond_to? :add_runtime_dependency then
|
|
30
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
31
|
+
s.add_development_dependency(%q<rim>, ["~> 2.17"])
|
|
32
|
+
s.add_development_dependency(%q<test-unit>, [">= 0"])
|
|
33
|
+
s.add_development_dependency(%q<regtest>, ["~> 2"])
|
|
34
|
+
else
|
|
35
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
36
|
+
s.add_dependency(%q<rim>, ["~> 2.17"])
|
|
37
|
+
s.add_dependency(%q<test-unit>, [">= 0"])
|
|
38
|
+
s.add_dependency(%q<regtest>, ["~> 2"])
|
|
39
|
+
end
|
|
40
|
+
end
|
data/regtest/read_all.rb
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'mini_exiftool'
|
|
2
|
+
require 'regtest'
|
|
3
|
+
|
|
4
|
+
Dir['test/data/*.jpg'].sort.each do |fn|
|
|
5
|
+
Regtest.sample 'read ' << File.basename(fn) do
|
|
6
|
+
h = MiniExiftool.new(fn).to_hash
|
|
7
|
+
%w(FileModifyDate FileAccessDate FileInodeChangeDate FilePermissions).each do |tag|
|
|
8
|
+
h.delete(tag)
|
|
9
|
+
end
|
|
10
|
+
h
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
---
|
|
2
|
+
sample: read Bad_PreviewIFD.jpg
|
|
3
|
+
result:
|
|
4
|
+
ExifToolVersion: 11.7
|
|
5
|
+
FileSize: 8.4 kB
|
|
6
|
+
FileType: JPEG
|
|
7
|
+
FileTypeExtension: jpg
|
|
8
|
+
MIMEType: image/jpeg
|
|
9
|
+
JFIFVersion: 1.01
|
|
10
|
+
ExifByteOrder: Big-endian (Motorola, MM)
|
|
11
|
+
Make: NIKON CORPORATION
|
|
12
|
+
Model: NIKON D60
|
|
13
|
+
XResolution: 300
|
|
14
|
+
YResolution: 300
|
|
15
|
+
ResolutionUnit: inches
|
|
16
|
+
Software: GIMP 2.6.11
|
|
17
|
+
ModifyDate: 2012-05-31 21:33:12.000000000 +02:00
|
|
18
|
+
YCbCrPositioning: Centered
|
|
19
|
+
ExposureTime: !ruby/object:Rational
|
|
20
|
+
denominator: 125
|
|
21
|
+
numerator: 1
|
|
22
|
+
FNumber: 5.6
|
|
23
|
+
ExposureProgram: Not Defined
|
|
24
|
+
ISO: 110
|
|
25
|
+
ExifVersion: '0221'
|
|
26
|
+
DateTimeOriginal: 2008-12-12 11:12:30.000000000 +01:00
|
|
27
|
+
CreateDate: 2008-12-12 11:12:30.000000000 +01:00
|
|
28
|
+
ComponentsConfiguration: Y, Cb, Cr, -
|
|
29
|
+
ExposureCompensation: 0
|
|
30
|
+
MaxApertureValue: 4.0
|
|
31
|
+
MeteringMode: Multi-segment
|
|
32
|
+
Flash: No Flash
|
|
33
|
+
FocalLength: 55.0 mm
|
|
34
|
+
MakerNoteVersion: 2.1
|
|
35
|
+
ColorMode: Color
|
|
36
|
+
Quality: Fine
|
|
37
|
+
WhiteBalance: Auto
|
|
38
|
+
Sharpness: Auto
|
|
39
|
+
FocusMode: AF-A
|
|
40
|
+
WhiteBalanceFineTune: 0 0
|
|
41
|
+
WB_RBLevels: 56833 21761 1 1
|
|
42
|
+
ProgramShift: 0
|
|
43
|
+
ExposureDifference: 0
|
|
44
|
+
Warning: "[minor] Bad PreviewIFD directory"
|
|
45
|
+
ISOSetting: 110
|
|
46
|
+
ImageBoundary: 0 0 3872 2592
|
|
47
|
+
CropHiSpeed: Off (3904x2616 cropped to 3904x2616 at pixel 0,0)
|
|
48
|
+
SerialNumber: 3365614
|
|
49
|
+
VRInfoVersion: 100
|
|
50
|
+
VibrationReduction: 'On'
|
|
51
|
+
VRMode: Normal
|
|
52
|
+
ActiveD-Lighting: 'Off'
|
|
53
|
+
TimeZone: "-05:00"
|
|
54
|
+
DaylightSavings: 'No'
|
|
55
|
+
DateDisplayFormat: Y/M/D
|
|
56
|
+
ISOExpansion: 'Off'
|
|
57
|
+
ISO2: 112
|
|
58
|
+
ISOExpansion2: 'Off'
|
|
59
|
+
ToneComp: Auto
|
|
60
|
+
LensType: G VR
|
|
61
|
+
Lens: 55-200mm f/4-5.6
|
|
62
|
+
FlashMode: Did Not Fire
|
|
63
|
+
AFAreaMode: Dynamic Area (closest subject)
|
|
64
|
+
AFPoint: Center
|
|
65
|
+
AFPointsInFocus: Center
|
|
66
|
+
ShootingMode: Single-Frame
|
|
67
|
+
ColorHue: Mode3a
|
|
68
|
+
LightSource: Natural
|
|
69
|
+
ShotInfoVersion: '0211'
|
|
70
|
+
HueAdjustment: 0
|
|
71
|
+
NoiseReduction: 'Off'
|
|
72
|
+
WB_RGGBLevels: 56833 1 1 7
|
|
73
|
+
LensDataVersion: 202
|
|
74
|
+
ExitPupilPosition: 70.6 mm
|
|
75
|
+
AFAperture: 4.1
|
|
76
|
+
FocusPosition: '0x22'
|
|
77
|
+
FocusDistance: 6.31 m
|
|
78
|
+
LensIDNumber: 144
|
|
79
|
+
LensFStops: 4.92
|
|
80
|
+
MinFocalLength: 55.0 mm
|
|
81
|
+
MaxFocalLength: 201.6 mm
|
|
82
|
+
MaxApertureAtMinFocal: 4.0
|
|
83
|
+
MaxApertureAtMaxFocal: 5.7
|
|
84
|
+
MCUVersion: 146
|
|
85
|
+
EffectiveMaxAperture: 4.0
|
|
86
|
+
SensorPixelSize: 6.05 x 6.05 um
|
|
87
|
+
DateStampMode: 'Off'
|
|
88
|
+
RetouchHistory: None
|
|
89
|
+
ImageDataSize: 4725881
|
|
90
|
+
ShutterCount: 290
|
|
91
|
+
ImageOptimization: ''
|
|
92
|
+
Saturation: Auto
|
|
93
|
+
VariProgram: Auto
|
|
94
|
+
MultiExposureVersion: 100
|
|
95
|
+
MultiExposureMode: 'Off'
|
|
96
|
+
MultiExposureShots: 0
|
|
97
|
+
MultiExposureAutoGain: 'Off'
|
|
98
|
+
HighISONoiseReduction: 'Off'
|
|
99
|
+
PowerUpTime: 2008-12-12 11:11:24.000000000 +01:00
|
|
100
|
+
FileInfoVersion: 100
|
|
101
|
+
MemoryCardNumber: 0
|
|
102
|
+
DirectoryNumber: 100
|
|
103
|
+
FileNumber: '0081'
|
|
104
|
+
RetouchInfoVersion: 100
|
|
105
|
+
NEFBitDepth: Unknown (0 0 16723 17225)
|
|
106
|
+
UserComment: ''
|
|
107
|
+
SubSecTime: 0
|
|
108
|
+
SubSecTimeOriginal: 0
|
|
109
|
+
SubSecTimeDigitized: 0
|
|
110
|
+
FlashpixVersion: 100
|
|
111
|
+
ColorSpace: sRGB
|
|
112
|
+
ExifImageWidth: 1
|
|
113
|
+
ExifImageHeight: 1
|
|
114
|
+
SensingMethod: One-chip color area
|
|
115
|
+
FileSource: Digital Camera
|
|
116
|
+
SceneType: Directly photographed
|
|
117
|
+
CFAPattern: "[Green,Blue][Red,Green]"
|
|
118
|
+
XPTitle: ''
|
|
119
|
+
XPKeywords: ''
|
|
120
|
+
Compression: JPEG (old-style)
|
|
121
|
+
ThumbnailOffset: 3690
|
|
122
|
+
ThumbnailLength: 631
|
|
123
|
+
RatingPercent: 0
|
|
124
|
+
Rating: 0
|
|
125
|
+
Title: ''
|
|
126
|
+
ProfileCMMType: Linotronic
|
|
127
|
+
ProfileVersion: 2.1.0
|
|
128
|
+
ProfileClass: Display Device Profile
|
|
129
|
+
ColorSpaceData: 'RGB '
|
|
130
|
+
ProfileConnectionSpace: 'XYZ '
|
|
131
|
+
ProfileDateTime: 1998-02-09 06:49:00.000000000 +01:00
|
|
132
|
+
ProfileFileSignature: acsp
|
|
133
|
+
PrimaryPlatform: Microsoft Corporation
|
|
134
|
+
CMMFlags: Not Embedded, Independent
|
|
135
|
+
DeviceManufacturer: Hewlett-Packard
|
|
136
|
+
DeviceModel: sRGB
|
|
137
|
+
DeviceAttributes: Reflective, Glossy, Positive, Color
|
|
138
|
+
RenderingIntent: Perceptual
|
|
139
|
+
ConnectionSpaceIlluminant: 0.9642 1 0.82491
|
|
140
|
+
ProfileCreator: Hewlett-Packard
|
|
141
|
+
ProfileID: 0
|
|
142
|
+
ProfileCopyright: Copyright (c) 1998 Hewlett-Packard Company
|
|
143
|
+
ProfileDescription: sRGB IEC61966-2.1
|
|
144
|
+
MediaWhitePoint: 0.95045 1 1.08905
|
|
145
|
+
MediaBlackPoint: 0 0 0
|
|
146
|
+
RedMatrixColumn: 0.43607 0.22249 0.01392
|
|
147
|
+
GreenMatrixColumn: 0.38515 0.71687 0.09708
|
|
148
|
+
BlueMatrixColumn: 0.14307 0.06061 0.7141
|
|
149
|
+
DeviceMfgDesc: IEC http://www.iec.ch
|
|
150
|
+
DeviceModelDesc: IEC 61966-2.1 Default RGB colour space - sRGB
|
|
151
|
+
ViewingCondDesc: Reference Viewing Condition in IEC61966-2.1
|
|
152
|
+
ViewingCondIlluminant: 19.6445 20.3718 16.8089
|
|
153
|
+
ViewingCondSurround: 3.92889 4.07439 3.36179
|
|
154
|
+
ViewingCondIlluminantType: D50
|
|
155
|
+
Luminance: 76.03647 80 87.12462
|
|
156
|
+
MeasurementObserver: CIE 1931
|
|
157
|
+
MeasurementBacking: 0 0 0
|
|
158
|
+
MeasurementGeometry: Unknown
|
|
159
|
+
MeasurementFlare: 0.999%
|
|
160
|
+
MeasurementIlluminant: D65
|
|
161
|
+
Technology: Cathode Ray Tube Display
|
|
162
|
+
RedTRC: "(Binary data 2060 bytes, use -b option to extract)"
|
|
163
|
+
GreenTRC: "(Binary data 2060 bytes, use -b option to extract)"
|
|
164
|
+
BlueTRC: "(Binary data 2060 bytes, use -b option to extract)"
|
|
165
|
+
ImageWidth: 1
|
|
166
|
+
ImageHeight: 1
|
|
167
|
+
EncodingProcess: Baseline DCT, Huffman coding
|
|
168
|
+
BitsPerSample: 8
|
|
169
|
+
ColorComponents: 3
|
|
170
|
+
YCbCrSubSampling: YCbCr4:4:0 (1 2)
|
|
171
|
+
Aperture: 5.6
|
|
172
|
+
BlueBalance: 7
|
|
173
|
+
ImageSize: 1x1
|
|
174
|
+
Megapixels: 1.0e-06
|
|
175
|
+
RedBalance: 56833
|
|
176
|
+
ShutterSpeed: !ruby/object:Rational
|
|
177
|
+
denominator: 125
|
|
178
|
+
numerator: 1
|
|
179
|
+
SubSecCreateDate: 2008-12-12 11:12:30.000000000 +01:00
|
|
180
|
+
SubSecDateTimeOriginal: 2008-12-12 11:12:30.000000000 +01:00
|
|
181
|
+
SubSecModifyDate: 2012-05-31 21:33:12.000000000 +02:00
|
|
182
|
+
ThumbnailImage: "(Binary data 631 bytes, use -b option to extract)"
|
|
183
|
+
LensID: AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED
|
|
184
|
+
LensSpec: 55-200mm f/4-5.6 G VR
|
|
185
|
+
FocalLength35efl: 55.0 mm
|
|
186
|
+
LightValue: 11.8
|
|
187
|
+
---
|
|
188
|
+
sample: read Canon.jpg
|
|
189
|
+
result:
|
|
190
|
+
ExifToolVersion: 11.7
|
|
191
|
+
FileSize: 2.6 kB
|
|
192
|
+
FileType: JPEG
|
|
193
|
+
FileTypeExtension: jpg
|
|
194
|
+
MIMEType: image/jpeg
|
|
195
|
+
ExifByteOrder: Little-endian (Intel, II)
|
|
196
|
+
Make: Canon
|
|
197
|
+
Model: Canon EOS DIGITAL REBEL
|
|
198
|
+
Orientation: Horizontal (normal)
|
|
199
|
+
XResolution: 180
|
|
200
|
+
YResolution: 180
|
|
201
|
+
ResolutionUnit: inches
|
|
202
|
+
ModifyDate: 2003-12-04 06:46:52.000000000 +01:00
|
|
203
|
+
YCbCrPositioning: Centered
|
|
204
|
+
ExposureTime: 4
|
|
205
|
+
FNumber: 14.0
|
|
206
|
+
ISO: 100
|
|
207
|
+
ExifVersion: '0221'
|
|
208
|
+
DateTimeOriginal: 2003-12-04 06:46:52.000000000 +01:00
|
|
209
|
+
CreateDate: 2003-12-04 06:46:52.000000000 +01:00
|
|
210
|
+
ComponentsConfiguration: Y, Cb, Cr, -
|
|
211
|
+
CompressedBitsPerPixel: 9
|
|
212
|
+
ShutterSpeedValue: 0
|
|
213
|
+
ApertureValue: 14.0
|
|
214
|
+
MaxApertureValue: 4.5
|
|
215
|
+
Flash: No Flash
|
|
216
|
+
FocalLength: 34.0 mm
|
|
217
|
+
MacroMode: Unknown (0)
|
|
218
|
+
SelfTimer: 'Off'
|
|
219
|
+
Quality: RAW
|
|
220
|
+
CanonFlashMode: 'Off'
|
|
221
|
+
ContinuousDrive: Continuous
|
|
222
|
+
FocusMode: Manual Focus (3)
|
|
223
|
+
RecordMode: CRW+THM
|
|
224
|
+
CanonImageSize: Large
|
|
225
|
+
EasyMode: Manual
|
|
226
|
+
DigitalZoom: Unknown (-1)
|
|
227
|
+
Contrast: "+1"
|
|
228
|
+
Saturation: "+1"
|
|
229
|
+
Sharpness: "+1"
|
|
230
|
+
CameraISO: n/a
|
|
231
|
+
MeteringMode: Center-weighted average
|
|
232
|
+
FocusRange: Not Known
|
|
233
|
+
CanonExposureMode: Manual
|
|
234
|
+
LensType: n/a
|
|
235
|
+
MaxFocalLength: 55 mm
|
|
236
|
+
MinFocalLength: 18 mm
|
|
237
|
+
FocalUnits: 1/mm
|
|
238
|
+
MaxAperture: 4
|
|
239
|
+
MinAperture: 27
|
|
240
|
+
FlashActivity: 0
|
|
241
|
+
FlashBits: "(none)"
|
|
242
|
+
ZoomSourceWidth: 3072
|
|
243
|
+
ZoomTargetWidth: 3072
|
|
244
|
+
ManualFlashOutput: n/a
|
|
245
|
+
ColorTone: Normal
|
|
246
|
+
FocalPlaneXSize: 23.22 mm
|
|
247
|
+
FocalPlaneYSize: 15.49 mm
|
|
248
|
+
AutoISO: 100
|
|
249
|
+
BaseISO: 100
|
|
250
|
+
MeasuredEV: -1.25
|
|
251
|
+
TargetAperture: 14
|
|
252
|
+
ExposureCompensation: 0
|
|
253
|
+
WhiteBalance: Auto
|
|
254
|
+
SlowShutter: None
|
|
255
|
+
SequenceNumber: 0
|
|
256
|
+
OpticalZoomCode: n/a
|
|
257
|
+
FlashGuideNumber: 0
|
|
258
|
+
FlashExposureComp: 0
|
|
259
|
+
AutoExposureBracketing: 'Off'
|
|
260
|
+
AEBBracketValue: 0
|
|
261
|
+
ControlMode: Camera Local Control
|
|
262
|
+
FocusDistanceUpper: inf
|
|
263
|
+
FocusDistanceLower: 5.46 m
|
|
264
|
+
MeasuredEV2: -1.25
|
|
265
|
+
BulbDuration: 4
|
|
266
|
+
CameraType: EOS Mid-range
|
|
267
|
+
AutoRotate: None
|
|
268
|
+
NDFilter: n/a
|
|
269
|
+
SelfTimer2: 0
|
|
270
|
+
BracketMode: 'Off'
|
|
271
|
+
BracketValue: 0
|
|
272
|
+
BracketShotNumber: 0
|
|
273
|
+
CanonImageType: CRW:EOS DIGITAL REBEL CMOS RAW
|
|
274
|
+
CanonFirmwareVersion: Firmware Version 1.1.1
|
|
275
|
+
SerialNumber: 560018150
|
|
276
|
+
SerialNumberFormat: Format 1
|
|
277
|
+
FileNumber: 118-1861
|
|
278
|
+
OwnerName: Phil Harvey
|
|
279
|
+
CanonModelID: EOS Digital Rebel / 300D / Kiss Digital
|
|
280
|
+
CanonFileLength: 4480822
|
|
281
|
+
MeasuredRGGB: 998 1022 1026 808
|
|
282
|
+
WB_RGGBLevelsAuto: 1719 832 831 990
|
|
283
|
+
WB_RGGBLevelsDaylight: 1722 832 831 989
|
|
284
|
+
WB_RGGBLevelsShade: 2035 832 831 839
|
|
285
|
+
WB_RGGBLevelsCloudy: 1878 832 831 903
|
|
286
|
+
WB_RGGBLevelsTungsten: 1228 913 912 1668
|
|
287
|
+
WB_RGGBLevelsFluorescent: 1506 842 841 1381
|
|
288
|
+
WB_RGGBLevelsFlash: 1933 832 831 895
|
|
289
|
+
WB_RGGBLevelsCustom: 1722 832 831 989
|
|
290
|
+
WB_RGGBLevelsKelvin: 1722 832 831 988
|
|
291
|
+
WB_RGGBBlackLevels: 124 123 124 123
|
|
292
|
+
ColorTemperature: 5200
|
|
293
|
+
NumAFPoints: 7
|
|
294
|
+
ValidAFPoints: 7
|
|
295
|
+
CanonImageWidth: 3072
|
|
296
|
+
CanonImageHeight: 2048
|
|
297
|
+
AFImageWidth: 3072
|
|
298
|
+
AFImageHeight: 2048
|
|
299
|
+
AFAreaWidth: 151
|
|
300
|
+
AFAreaHeight: 151
|
|
301
|
+
AFAreaXPositions: 1014 608 0 0 0 -608 -1014
|
|
302
|
+
AFAreaYPositions: 0 0 -506 0 506 0 0
|
|
303
|
+
AFPointsInFocus: "(none)"
|
|
304
|
+
ThumbnailImageValidArea: 0 159 7 112
|
|
305
|
+
UserComment: ''
|
|
306
|
+
FlashpixVersion: 100
|
|
307
|
+
ColorSpace: sRGB
|
|
308
|
+
ExifImageWidth: 160
|
|
309
|
+
ExifImageHeight: 120
|
|
310
|
+
InteropIndex: THM - DCF thumbnail file
|
|
311
|
+
InteropVersion: 100
|
|
312
|
+
RelatedImageWidth: 3072
|
|
313
|
+
RelatedImageHeight: 2048
|
|
314
|
+
FocalPlaneXResolution: 3443.946188
|
|
315
|
+
FocalPlaneYResolution: 3442.016807
|
|
316
|
+
FocalPlaneResolutionUnit: inches
|
|
317
|
+
SensingMethod: One-chip color area
|
|
318
|
+
FileSource: Digital Camera
|
|
319
|
+
CustomRendered: Normal
|
|
320
|
+
ExposureMode: Manual
|
|
321
|
+
SceneCaptureType: Standard
|
|
322
|
+
ImageWidth: 8
|
|
323
|
+
ImageHeight: 8
|
|
324
|
+
EncodingProcess: Baseline DCT, Huffman coding
|
|
325
|
+
BitsPerSample: 8
|
|
326
|
+
ColorComponents: 3
|
|
327
|
+
YCbCrSubSampling: YCbCr4:2:0 (2 2)
|
|
328
|
+
DriveMode: Continuous Shooting
|
|
329
|
+
Lens: 18.0 - 55.0 mm
|
|
330
|
+
ShootingMode: Bulb
|
|
331
|
+
WB_RGGBLevels: 1719 832 831 990
|
|
332
|
+
Aperture: 14.0
|
|
333
|
+
BlueBalance: 1.190619
|
|
334
|
+
ImageSize: 8x8
|
|
335
|
+
LensID: Unknown 18-55mm
|
|
336
|
+
Megapixels: 6.4e-05
|
|
337
|
+
RedBalance: 2.067348
|
|
338
|
+
ScaleFactor35efl: 1.6
|
|
339
|
+
ShutterSpeed: 4
|
|
340
|
+
Lens35efl: '18.0 - 55.0 mm (35 mm equivalent: 28.6 - 87.4 mm)'
|
|
341
|
+
CircleOfConfusion: 0.019 mm
|
|
342
|
+
DOF: inf (4.31 m - inf)
|
|
343
|
+
FOV: 36.9 deg
|
|
344
|
+
FocalLength35efl: '34.0 mm (35 mm equivalent: 54.0 mm)'
|
|
345
|
+
HyperfocalDistance: 4.37 m
|
|
346
|
+
LightValue: 5.6
|
|
347
|
+
---
|
|
348
|
+
sample: read test.jpg
|
|
349
|
+
result:
|
|
350
|
+
ExifToolVersion: 11.7
|
|
351
|
+
FileSize: 46 kB
|
|
352
|
+
FileType: JPEG
|
|
353
|
+
FileTypeExtension: jpg
|
|
354
|
+
MIMEType: image/jpeg
|
|
355
|
+
JFIFVersion: 1.01
|
|
356
|
+
ExifByteOrder: Big-endian (Motorola, MM)
|
|
357
|
+
ImageDescription: KONICA MINOLTA DIGITAL CAMERA
|
|
358
|
+
Make: KONICA MINOLTA
|
|
359
|
+
Model: DYNAX 7D
|
|
360
|
+
Orientation: Horizontal (normal)
|
|
361
|
+
XResolution: 72
|
|
362
|
+
YResolution: 72
|
|
363
|
+
ResolutionUnit: inches
|
|
364
|
+
Software: DYNAX 7D v1.10
|
|
365
|
+
ModifyDate: 2005-09-13 20:08:50.000000000 +02:00
|
|
366
|
+
YCbCrPositioning: Centered
|
|
367
|
+
ExposureTime: !ruby/object:Rational
|
|
368
|
+
denominator: 60
|
|
369
|
+
numerator: 1
|
|
370
|
+
FNumber: 9.5
|
|
371
|
+
ExposureProgram: Program AE
|
|
372
|
+
ISO: 400
|
|
373
|
+
ExifVersion: '0221'
|
|
374
|
+
DateTimeOriginal: 2005-09-13 20:08:50.000000000 +02:00
|
|
375
|
+
CreateDate: 2005-09-13 20:08:50.000000000 +02:00
|
|
376
|
+
ComponentsConfiguration: Y, Cb, Cr, -
|
|
377
|
+
BrightnessValue: 4.5
|
|
378
|
+
ExposureCompensation: -1
|
|
379
|
+
MaxApertureValue: 4.5
|
|
380
|
+
MeteringMode: Multi-segment
|
|
381
|
+
LightSource: Unknown
|
|
382
|
+
Flash: Off, Did not fire
|
|
383
|
+
FocalLength: 75.0 mm
|
|
384
|
+
SubjectArea: 1504 1000 256 304
|
|
385
|
+
MakerNoteVersion: MLT0
|
|
386
|
+
MinoltaImageSize: Large
|
|
387
|
+
WhiteBalance: Auto
|
|
388
|
+
FocusMode: AF-A
|
|
389
|
+
AFPoints: Center
|
|
390
|
+
FlashMode: Normal
|
|
391
|
+
ISOSetting: 400
|
|
392
|
+
FreeMemoryCardImages: 202
|
|
393
|
+
HueAdjustment: 0
|
|
394
|
+
Rotation: Horizontal (normal)
|
|
395
|
+
ImageNumber: 6
|
|
396
|
+
NoiseReduction: Unknown (2)
|
|
397
|
+
ImageNumber2: 50
|
|
398
|
+
ZoneMatchingOn: 'Off'
|
|
399
|
+
CompressedImageSize: 1598477
|
|
400
|
+
PreviewImageStart: 39152
|
|
401
|
+
PreviewImageLength: 0
|
|
402
|
+
SceneMode: Standard
|
|
403
|
+
ColorMode: Natural sRGB
|
|
404
|
+
MinoltaQuality: Fine
|
|
405
|
+
FlashExposureComp: 0
|
|
406
|
+
Teleconverter: None
|
|
407
|
+
ImageStabilization: 'On'
|
|
408
|
+
ZoneMatching: ISO Setting Used
|
|
409
|
+
ColorTemperature: 0
|
|
410
|
+
LensType: Minolta AF 28-135mm F4-4.5 or Other Lens
|
|
411
|
+
UserComment: ''
|
|
412
|
+
FlashpixVersion: 100
|
|
413
|
+
ColorSpace: sRGB
|
|
414
|
+
ExifImageWidth: 3008
|
|
415
|
+
ExifImageHeight: 2000
|
|
416
|
+
CustomRendered: Normal
|
|
417
|
+
ExposureMode: Auto
|
|
418
|
+
DigitalZoomRatio: 0
|
|
419
|
+
FocalLengthIn35mmFormat: 112 mm
|
|
420
|
+
SceneCaptureType: Standard
|
|
421
|
+
GainControl: Low gain up
|
|
422
|
+
Contrast: Normal
|
|
423
|
+
Saturation: Normal
|
|
424
|
+
Sharpness: Normal
|
|
425
|
+
PrintIMVersion: 300
|
|
426
|
+
Compression: JPEG (old-style)
|
|
427
|
+
ThumbnailOffset: 39274
|
|
428
|
+
ThumbnailLength: 1820
|
|
429
|
+
CurrentIPTCDigest: dd8d51d28ddf04f08f870e5ff2f64d01
|
|
430
|
+
Keywords:
|
|
431
|
+
- Orange
|
|
432
|
+
- Rot
|
|
433
|
+
ApplicationRecordVersion: 4
|
|
434
|
+
SupplementalCategories: Natur
|
|
435
|
+
XMPToolkit: Image::ExifTool 7.03
|
|
436
|
+
Title: Abenddämmerung
|
|
437
|
+
ImageWidth: 300
|
|
438
|
+
ImageHeight: 199
|
|
439
|
+
EncodingProcess: Baseline DCT, Huffman coding
|
|
440
|
+
BitsPerSample: 8
|
|
441
|
+
ColorComponents: 3
|
|
442
|
+
YCbCrSubSampling: YCbCr4:2:0 (2 2)
|
|
443
|
+
Aperture: 9.5
|
|
444
|
+
ImageSize: 300x199
|
|
445
|
+
LensID: Tokina AT-X 242 AF 24-200mm F3.5-5.6
|
|
446
|
+
Megapixels: 0.06
|
|
447
|
+
ScaleFactor35efl: 1.5
|
|
448
|
+
ShutterSpeed: !ruby/object:Rational
|
|
449
|
+
denominator: 60
|
|
450
|
+
numerator: 1
|
|
451
|
+
ThumbnailImage: "(Binary data 1820 bytes, use -b option to extract)"
|
|
452
|
+
CircleOfConfusion: 0.020 mm
|
|
453
|
+
FOV: 18.3 deg
|
|
454
|
+
FocalLength35efl: '75.0 mm (35 mm equivalent: 112.0 mm)'
|
|
455
|
+
HyperfocalDistance: 29.43 m
|
|
456
|
+
LightValue: 10.4
|
|
457
|
+
---
|
|
458
|
+
sample: read test_coordinates.jpg
|
|
459
|
+
result:
|
|
460
|
+
ExifToolVersion: 11.7
|
|
461
|
+
FileSize: 251 kB
|
|
462
|
+
FileType: JPEG
|
|
463
|
+
FileTypeExtension: jpg
|
|
464
|
+
MIMEType: image/jpeg
|
|
465
|
+
ExifByteOrder: Big-endian (Motorola, MM)
|
|
466
|
+
ImageDescription: clip
|
|
467
|
+
Orientation: Horizontal (normal)
|
|
468
|
+
XResolution: 72
|
|
469
|
+
YResolution: 72
|
|
470
|
+
ResolutionUnit: inches
|
|
471
|
+
YCbCrPositioning: Centered
|
|
472
|
+
ExposureTime: !ruby/object:Rational
|
|
473
|
+
denominator: 30
|
|
474
|
+
numerator: 1
|
|
475
|
+
FNumber: 2.4
|
|
476
|
+
ExposureProgram: Program AE
|
|
477
|
+
ISO: 400
|
|
478
|
+
ExifVersion: '0221'
|
|
479
|
+
ComponentsConfiguration: Y, Cb, Cr, -
|
|
480
|
+
ShutterSpeedValue: !ruby/object:Rational
|
|
481
|
+
denominator: 30
|
|
482
|
+
numerator: 1
|
|
483
|
+
ApertureValue: 2.4
|
|
484
|
+
BrightnessValue: 1.954376479
|
|
485
|
+
MeteringMode: Multi-segment
|
|
486
|
+
Flash: Off, Did not fire
|
|
487
|
+
FocalLength: 4.1 mm
|
|
488
|
+
SubjectArea: 519 403 239 180
|
|
489
|
+
UserComment: clip
|
|
490
|
+
FlashpixVersion: 100
|
|
491
|
+
ColorSpace: sRGB
|
|
492
|
+
ExifImageWidth: 1280
|
|
493
|
+
ExifImageHeight: 720
|
|
494
|
+
SensingMethod: One-chip color area
|
|
495
|
+
ExposureMode: Auto
|
|
496
|
+
WhiteBalance: Auto
|
|
497
|
+
FocalLengthIn35mmFormat: 35 mm
|
|
498
|
+
SceneCaptureType: Standard
|
|
499
|
+
GPSLatitudeRef: North
|
|
500
|
+
GPSLongitudeRef: West
|
|
501
|
+
GPSAltitude: 0 m
|
|
502
|
+
GPSTimeStamp: '00:00:00'
|
|
503
|
+
GPSDOP: 0
|
|
504
|
+
Compression: JPEG (old-style)
|
|
505
|
+
ThumbnailOffset: 766
|
|
506
|
+
ThumbnailLength: 3831
|
|
507
|
+
ImageWidth: 1280
|
|
508
|
+
ImageHeight: 720
|
|
509
|
+
EncodingProcess: Baseline DCT, Huffman coding
|
|
510
|
+
BitsPerSample: 8
|
|
511
|
+
ColorComponents: 3
|
|
512
|
+
YCbCrSubSampling: YCbCr4:2:0 (2 2)
|
|
513
|
+
Aperture: 2.4
|
|
514
|
+
ImageSize: 1280x720
|
|
515
|
+
Megapixels: 0.922
|
|
516
|
+
ScaleFactor35efl: 8.5
|
|
517
|
+
ShutterSpeed: !ruby/object:Rational
|
|
518
|
+
denominator: 30
|
|
519
|
+
numerator: 1
|
|
520
|
+
ThumbnailImage: "(Binary data 3831 bytes, use -b option to extract)"
|
|
521
|
+
GPSLatitude: 43 deg 39' 11.40" N
|
|
522
|
+
GPSLongitude: 79 deg 22' 23.40" W
|
|
523
|
+
CircleOfConfusion: 0.004 mm
|
|
524
|
+
FOV: 54.4 deg
|
|
525
|
+
FocalLength35efl: '4.1 mm (35 mm equivalent: 35.0 mm)'
|
|
526
|
+
GPSPosition: 43 deg 39' 11.40" N, 79 deg 22' 23.40" W
|
|
527
|
+
HyperfocalDistance: 2.00 m
|
|
528
|
+
LightValue: 5.4
|
|
529
|
+
---
|
|
530
|
+
sample: read test_encodings.jpg
|
|
531
|
+
result:
|
|
532
|
+
ExifToolVersion: 11.7
|
|
533
|
+
FileSize: 660 bytes
|
|
534
|
+
FileType: JPEG
|
|
535
|
+
FileTypeExtension: jpg
|
|
536
|
+
MIMEType: image/jpeg
|
|
537
|
+
CurrentIPTCDigest: '09b79ab4703f3570ba3140ffc2dba2f6'
|
|
538
|
+
ObjectName: Mšhre
|
|
539
|
+
ApplicationRecordVersion: 4
|
|
540
|
+
ImageWidth: 1
|
|
541
|
+
ImageHeight: 1
|
|
542
|
+
EncodingProcess: Baseline DCT, Huffman coding
|
|
543
|
+
BitsPerSample: 8
|
|
544
|
+
ColorComponents: 3
|
|
545
|
+
YCbCrSubSampling: YCbCr4:2:0 (2 2)
|
|
546
|
+
ImageSize: 1x1
|
|
547
|
+
Megapixels: 1.0e-06
|
|
548
|
+
---
|
|
549
|
+
sample: read test_special_dates.jpg
|
|
550
|
+
result:
|
|
551
|
+
ExifToolVersion: 11.7
|
|
552
|
+
FileSize: 3.7 kB
|
|
553
|
+
FileType: JPEG
|
|
554
|
+
FileTypeExtension: jpg
|
|
555
|
+
MIMEType: image/jpeg
|
|
556
|
+
ExifByteOrder: Big-endian (Motorola, MM)
|
|
557
|
+
XResolution: 72
|
|
558
|
+
YResolution: 72
|
|
559
|
+
ResolutionUnit: inches
|
|
560
|
+
ModifyDate: false
|
|
561
|
+
YCbCrPositioning: Centered
|
|
562
|
+
ExifVersion: 220
|
|
563
|
+
DateTimeOriginal: 1961-08-13 12:08:25.000000000 +01:00
|
|
564
|
+
ComponentsConfiguration: Y, Cb, Cr, -
|
|
565
|
+
FlashpixVersion: 100
|
|
566
|
+
ColorSpace: Uncalibrated
|
|
567
|
+
PreviewDateTime: 1961-08-13 12:08:25.000000000 +01:00
|
|
568
|
+
ImageWidth: 300
|
|
569
|
+
ImageHeight: 199
|
|
570
|
+
EncodingProcess: Baseline DCT, Huffman coding
|
|
571
|
+
BitsPerSample: 8
|
|
572
|
+
ColorComponents: 3
|
|
573
|
+
YCbCrSubSampling: YCbCr4:2:0 (2 2)
|
|
574
|
+
ImageSize: 300x199
|
|
575
|
+
Megapixels: 0.06
|
data/test/helpers_for_test.rb
CHANGED
|
@@ -3,15 +3,7 @@ require 'mini_exiftool'
|
|
|
3
3
|
require 'test/unit'
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'tempfile'
|
|
6
|
-
|
|
7
|
-
require 'turn'
|
|
8
|
-
rescue LoadError
|
|
9
|
-
begin
|
|
10
|
-
require 'rubygems'
|
|
11
|
-
require 'turn'
|
|
12
|
-
rescue LoadError
|
|
13
|
-
end
|
|
14
|
-
end
|
|
6
|
+
require 'yaml'
|
|
15
7
|
|
|
16
8
|
include Test::Unit
|
|
17
9
|
|
data/test/test_dumping.rb
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -- encoding: utf-8 --
|
|
2
|
+
require 'helpers_for_test'
|
|
3
|
+
|
|
4
|
+
class TestRead < TestCase
|
|
5
|
+
|
|
6
|
+
def setup
|
|
7
|
+
@data_dir = File.dirname(__FILE__) + '/data'
|
|
8
|
+
@filename_test = @data_dir + '/test.jpg'
|
|
9
|
+
@mini_exiftool = MiniExiftool.new @filename_test
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def test_respond_to_missing
|
|
13
|
+
assert_true @mini_exiftool.respond_to?(:iso), 'instance should respond to iso because it has a value for ISO'
|
|
14
|
+
assert_true @mini_exiftool.respond_to?('iso'), 'instance should respond to iso because it has a value for ISO'
|
|
15
|
+
assert_true @mini_exiftool.respond_to?('ISO'), 'instance should respond to ISO because it has a value for ISO'
|
|
16
|
+
assert_true @mini_exiftool.respond_to?(:iso=), 'instance should respond to iso= because all setters are allowed'
|
|
17
|
+
assert_true @mini_exiftool.respond_to?('iso='), 'instance should respond to iso= because all setters are allowed'
|
|
18
|
+
assert_true @mini_exiftool.respond_to?('ISO='), 'instance should respond to ISO= because all setters are allowed'
|
|
19
|
+
assert_false @mini_exiftool.respond_to?(:comment), 'instance should not respond to comment because it has no value for Comment'
|
|
20
|
+
assert_false @mini_exiftool.respond_to?('comment'), 'instance should not respond to comment because it has no value for Comment'
|
|
21
|
+
assert_false @mini_exiftool.respond_to?('Comment'), 'instance should not respond to Comment because it has no value for Comment'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
@@ -12,6 +12,7 @@ class TestInvalidByteSequenceInUtf8 < TestCase
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def test_invalid_byte_sequence_gets_unconverted_value_with_invalid_encoding
|
|
15
|
+
omit 'Java version of json gem can not handle invalid encoded data' if RUBY_PLATFORM == 'java'
|
|
15
16
|
assert_nothing_raised do
|
|
16
17
|
mini_exiftool = MiniExiftool.from_json(@json)
|
|
17
18
|
assert_equal 1561, mini_exiftool.color_balance_unknown.size
|
data/test/test_pstore.rb
CHANGED
|
@@ -5,20 +5,33 @@ class TestPstore < TestCase
|
|
|
5
5
|
|
|
6
6
|
def test_pstore
|
|
7
7
|
pstore_dir = Dir.mktmpdir
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
b = Time.now
|
|
13
|
-
assert_equal s, result.chomp
|
|
8
|
+
writable_tags = MiniExiftool.writable_tags
|
|
9
|
+
res = execute(pstore_dir)
|
|
10
|
+
t1 = res['time']
|
|
11
|
+
assert_equal writable_tags, res['writable_tags']
|
|
14
12
|
assert_equal 1, Dir[File.join(pstore_dir, '*')].size
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
assert 10 * (
|
|
13
|
+
res = execute(pstore_dir)
|
|
14
|
+
t2 = res['time']
|
|
15
|
+
assert_equal writable_tags, res['writable_tags']
|
|
16
|
+
assert t2 < 1.0, format('loading cached tag information should be done in under 1 second but needed %.2fs', t2)
|
|
17
|
+
assert 10 * t2 < t1, format('loading cached tag information (%.2fs) should be 10 times faster than loading uncached information (%.2fs)', t2, t1)
|
|
20
18
|
ensure
|
|
21
19
|
FileUtils.rm_rf pstore_dir
|
|
22
20
|
end
|
|
23
21
|
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def execute pstore_dir
|
|
25
|
+
script = <<-END
|
|
26
|
+
MiniExiftool.pstore_dir = '#{pstore_dir}'
|
|
27
|
+
res = {}
|
|
28
|
+
start = Time.now
|
|
29
|
+
res['writable_tags'] = MiniExiftool.writable_tags
|
|
30
|
+
res['time'] = Time.now - start
|
|
31
|
+
puts YAML.dump res
|
|
32
|
+
END
|
|
33
|
+
cmd = %Q(#{RUBY_ENGINE} -EUTF-8 -I lib -r mini_exiftool -r yaml -e "#{script}")
|
|
34
|
+
YAML.load(`#{cmd}`)
|
|
35
|
+
end
|
|
36
|
+
|
|
24
37
|
end
|
data/test/test_read_numerical.rb
CHANGED
|
@@ -30,4 +30,11 @@ class TestReadNumerical < TestCase
|
|
|
30
30
|
assert_kind_of String, @mini_exiftool_num['SupplementalCategories']
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Catching github issue [#40]
|
|
34
|
+
# Values with leading zeros can have further zeros in it
|
|
35
|
+
# Thanks to jvradelis
|
|
36
|
+
def test_digits_starting_with_zero_and_has_further_zeros
|
|
37
|
+
assert_equal '0300', @mini_exiftool_num['PrintIMVersion']
|
|
38
|
+
end
|
|
39
|
+
|
|
33
40
|
end
|
metadata
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mini_exiftool
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Friedrich
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-06-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: rake
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: rim
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '2.17'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '2.17'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: test-unit
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
@@ -53,22 +53,22 @@ dependencies:
|
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: regtest
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
59
|
+
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
61
|
+
version: '2'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- - "
|
|
66
|
+
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
68
|
+
version: '2'
|
|
69
69
|
description: |
|
|
70
70
|
This library is a wrapper for the ExifTool command-line application
|
|
71
|
-
(
|
|
71
|
+
(https://exiftool.org) written by Phil Harvey.
|
|
72
72
|
It provides the full power of ExifTool to Ruby: reading and writing of
|
|
73
73
|
EXIF-data, IPTC-data and XMP-data.
|
|
74
74
|
email: janfri26@gmail.com
|
|
@@ -76,8 +76,10 @@ executables: []
|
|
|
76
76
|
extensions: []
|
|
77
77
|
extra_rdoc_files: []
|
|
78
78
|
files:
|
|
79
|
+
- "./.aspell.pws"
|
|
79
80
|
- COPYING
|
|
80
81
|
- Changelog
|
|
82
|
+
- Gemfile
|
|
81
83
|
- README.md
|
|
82
84
|
- Rakefile
|
|
83
85
|
- Tutorial.md
|
|
@@ -87,6 +89,9 @@ files:
|
|
|
87
89
|
- examples/shift_time.rb
|
|
88
90
|
- examples/show_speedup_with_fast_option.rb
|
|
89
91
|
- lib/mini_exiftool.rb
|
|
92
|
+
- mini_exiftool.gemspec
|
|
93
|
+
- regtest/read_all.rb
|
|
94
|
+
- regtest/read_all.yml
|
|
90
95
|
- test/data/Bad_PreviewIFD.jpg
|
|
91
96
|
- test/data/Canon.jpg
|
|
92
97
|
- test/data/INFORMATION
|
|
@@ -106,6 +111,7 @@ files:
|
|
|
106
111
|
- test/test_encodings.rb
|
|
107
112
|
- test/test_filename_access.rb
|
|
108
113
|
- test/test_from_hash.rb
|
|
114
|
+
- test/test_instance_methods.rb
|
|
109
115
|
- test/test_invalid_byte_sequence_in_utf8.rb
|
|
110
116
|
- test/test_invalid_rational.rb
|
|
111
117
|
- test/test_io.rb
|
|
@@ -126,7 +132,7 @@ post_install_message: |
|
|
|
126
132
|
| Please ensure you have installed exiftool at least version 7.65 |
|
|
127
133
|
| and it's found in your PATH (Try "exiftool -ver" on your commandline).|
|
|
128
134
|
| For more details see |
|
|
129
|
-
|
|
|
135
|
+
| https://exiftool.org/install.html |
|
|
130
136
|
| You need also Ruby 1.9 or higher. |
|
|
131
137
|
| If you need support for Ruby 1.8 or exiftool prior 7.65 install |
|
|
132
138
|
| mini_exiftool version < 2.0.0. |
|
|
@@ -145,9 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
145
151
|
- !ruby/object:Gem::Version
|
|
146
152
|
version: '0'
|
|
147
153
|
requirements: []
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
signing_key:
|
|
154
|
+
rubygems_version: 3.2.15
|
|
155
|
+
signing_key:
|
|
151
156
|
specification_version: 4
|
|
152
|
-
summary: This library is a wrapper for the ExifTool command-line application (
|
|
157
|
+
summary: This library is a wrapper for the ExifTool command-line application (https://exiftool.org).
|
|
153
158
|
test_files: []
|