filmrolls 0.0.0
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 +7 -0
- data/LICENSE.md +17 -0
- data/README.md +22 -0
- data/bin/filmrolls +45 -0
- data/lib/filmrolls.rb +3 -0
- data/test/test_exiftool.rb +18 -0
- data/test/test_filmrolls.rb +85 -0
- data/test/test_helper.rb +7 -0
- metadata +208 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: cfda4ddc50406fe47135099abc8df5ff236cb6b6
|
|
4
|
+
data.tar.gz: ea118d58dbed88d834655d415e0a06006597fc92
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fbc09d0798e834f807cd62ed396352d2470ebc7bc2b337ec5bee4c147a71c4a278437ca05cb757b6c1b8db11f5000989493571543a540a30ef6f0e1bc8432a1e
|
|
7
|
+
data.tar.gz: 0aea4f82a5bf2f9a4827af9dd5338633b5cc633e314fe785ab8d3b3df18b9d57002e79f7902ff7d90c60b239c47dfa4ab451f299250f362f78ad2f67c9a5a908
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ISC License
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Copyright (c) 2016, Simon Sigurdhsson
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
8
|
+
copyright notice and this permission notice appear in all copies.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
11
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
12
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
13
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
14
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
15
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
16
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
+
```
|
data/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Film Rolls EXIF tagger
|
|
2
|
+
|
|
3
|
+
[][build-status]
|
|
4
|
+
[][codacy]
|
|
5
|
+
[][codacy]
|
|
6
|
+
[][release]
|
|
7
|
+
[][license]
|
|
8
|
+
[][semver]
|
|
9
|
+
|
|
10
|
+
This is a utility designed to read the XML files used by the [Film Rolls iOS app][film-rolls], and enable batch EXIF tagging of scanned negatives in TIFF format based on the information in these XML files.
|
|
11
|
+
|
|
12
|
+
The gem is released under the [ISC license][license].
|
|
13
|
+
Eventually there will be some sort of [changelog][changelog] as well.
|
|
14
|
+
|
|
15
|
+
[film-rolls]: https://itunes.apple.com/se/app/film-rolls-app-for-film-photographers/id675626559
|
|
16
|
+
[semver]: http://semver.org/spec/v2.0.0.html
|
|
17
|
+
|
|
18
|
+
[build-status]: https://travis-ci.org/urdh/roll2exif
|
|
19
|
+
[codacy]: https://www.codacy.com/app/Sigurdhsson/roll2exif
|
|
20
|
+
[release]: https://rubygems.org/gems/filmrolls
|
|
21
|
+
[license]: https://github.com/urdh/roll2exif/blob/master/LICENSE.md
|
|
22
|
+
[changelog]: https://github.com/urdh/roll2exif/blob/master/CHANGELOG.md
|
data/bin/filmrolls
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
require 'commander/import'
|
|
4
|
+
require 'filmrolls'
|
|
5
|
+
|
|
6
|
+
begin
|
|
7
|
+
GEMSPEC = Gem::Specification.find_by_name('filmrolls')
|
|
8
|
+
SPECFILE = GEMSPEC.loaded_from
|
|
9
|
+
rescue Gem::LoadError
|
|
10
|
+
SPECFILE = File.expand_path(File.dirname(__FILE__) + '/../filmrolls.gemspec')
|
|
11
|
+
GEMSPEC = Gem::Specification.load(SPECFILE)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
program :version, GEMSPEC.version.to_s
|
|
15
|
+
program :description, GEMSPEC.summary
|
|
16
|
+
|
|
17
|
+
command :list do |c|
|
|
18
|
+
c.syntax = 'filmrolls list [options] xml-file'
|
|
19
|
+
c.summary = 'List film rolls'
|
|
20
|
+
c.description = 'List ID and additional data for all film rolls in xml-file.'
|
|
21
|
+
|
|
22
|
+
c.action do |args, _options|
|
|
23
|
+
filename = args.shift
|
|
24
|
+
abort 'Missing xml-file argument.' if filename.nil?
|
|
25
|
+
|
|
26
|
+
begin
|
|
27
|
+
xml = File.read(filename)
|
|
28
|
+
rescue SystemCallError
|
|
29
|
+
abort "Could not read XML input from `#{filename}`."
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
rolls =
|
|
33
|
+
Filmrolls::FilmRolls.load(xml)[:rolls].map do |roll|
|
|
34
|
+
roll = roll.to_h
|
|
35
|
+
roll[:frames] = roll[:frames].length
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
unless rolls.empty?
|
|
39
|
+
require 'terminal-table'
|
|
40
|
+
head = rolls.first.keys.map(&:capitalize)
|
|
41
|
+
rows = rolls.map(&:values)
|
|
42
|
+
say Terminal::Table.new(headings: head, rows: rows)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
data/lib/filmrolls.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'minitest/autorun'
|
|
3
|
+
require 'filmrolls/exiftool'
|
|
4
|
+
|
|
5
|
+
describe Filmrolls::Exiftool do
|
|
6
|
+
it 'has the correct (vendored) exiftool version' do
|
|
7
|
+
require 'exiftool_vendored/version'
|
|
8
|
+
vendored_version = ExiftoolVendored::VERSION
|
|
9
|
+
executable_version = Gem::Version.new(Filmrolls::Exiftool.exiftool_version)
|
|
10
|
+
|
|
11
|
+
executable_version.must_equal vendored_version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it 'should be able to load EXIF tags from TIFF files' do
|
|
15
|
+
Filmrolls::Exiftool.new('test/data/with-exif.tiff')
|
|
16
|
+
Filmrolls::Exiftool.new('test/data/without-exif.tiff')
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'minitest/autorun'
|
|
3
|
+
require 'filmrolls/filmrolls'
|
|
4
|
+
|
|
5
|
+
describe 'Filmrolls::FilmRolls.load' do
|
|
6
|
+
let(:data) do
|
|
7
|
+
@output ||= Filmrolls::FilmRolls.load(File.read('test/data/filmrolls.xml'))
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
describe 'the parser output' do
|
|
11
|
+
it 'should contain two cameras' do
|
|
12
|
+
data[:cameras].must_include 'Yashica Electro 35 GT'
|
|
13
|
+
data[:cameras].must_include 'Voigtländer Bessa R2M'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'should contain two lenses' do
|
|
17
|
+
data[:lenses].must_include 'Yashinon 45mm f/1.7'
|
|
18
|
+
data[:lenses].must_include 'Color Skopar 35/2.5 Pancake II'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'should contain zero accessories' do
|
|
22
|
+
data[:accessories].must_be_empty
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'should contain one film roll' do
|
|
26
|
+
data[:rolls].length.must_equal 1
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'the film roll' do
|
|
30
|
+
let(:roll) { data[:rolls].first }
|
|
31
|
+
|
|
32
|
+
it 'should have the expected roll id' do
|
|
33
|
+
roll[:id].must_equal 'A0012'
|
|
34
|
+
end
|
|
35
|
+
it 'should have the expected film type' do
|
|
36
|
+
roll[:film].must_equal 'Ilford Delta 100'
|
|
37
|
+
end
|
|
38
|
+
it 'should have the expected film speed' do
|
|
39
|
+
roll[:speed].must_equal 100
|
|
40
|
+
end
|
|
41
|
+
it 'should have the expected camera type' do
|
|
42
|
+
roll[:camera].must_equal 'Voigtländer Bessa R2M'
|
|
43
|
+
end
|
|
44
|
+
it 'should have the expected load date' do
|
|
45
|
+
roll[:load].must_equal DateTime.new(2016, 3, 28, 15, 16, 36, '+00:00')
|
|
46
|
+
end
|
|
47
|
+
it 'should have the expected unload date' do
|
|
48
|
+
roll[:unload].must_equal DateTime.new(2016, 5, 21, 14, 13, 15, '+00:00')
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it 'should have one frame' do
|
|
52
|
+
roll[:frames].length.must_equal 1
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe 'the frame' do
|
|
56
|
+
let(:frame) { roll[:frames].first }
|
|
57
|
+
|
|
58
|
+
it 'should have the expected lens type' do
|
|
59
|
+
frame[:lens].must_equal 'Color Skopar 35/2.5 Pancake II'
|
|
60
|
+
end
|
|
61
|
+
it 'should have the expected aperture' do
|
|
62
|
+
frame[:aperture].must_equal 5.6
|
|
63
|
+
end
|
|
64
|
+
it 'should have the expected shutter speed' do
|
|
65
|
+
frame[:shutter_speed].must_equal Rational(1, 500)
|
|
66
|
+
end
|
|
67
|
+
it 'should have the expected compensation' do
|
|
68
|
+
frame[:compensation].must_equal 0.0
|
|
69
|
+
end
|
|
70
|
+
it 'should have the expected accessory type' do
|
|
71
|
+
frame[:accessory].must_equal ''
|
|
72
|
+
end
|
|
73
|
+
it 'should have the expected date' do
|
|
74
|
+
frame[:date].must_equal DateTime.new(2016, 5, 13, 14, 12, 40, '+00:00')
|
|
75
|
+
end
|
|
76
|
+
it 'should have the expected note' do
|
|
77
|
+
frame[:note].must_equal ''
|
|
78
|
+
end
|
|
79
|
+
it 'should have the expected position' do
|
|
80
|
+
frame[:position].must_equal Geokit::LatLng.new(57.700767, 11.953715)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: filmrolls
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Simon Sigurdhsson
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: mini_exiftool
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '2.8'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '2.8'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: exiftool_vendored
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.49'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.49'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: nokogiri
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.7'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.7'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: geokit
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.11'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '1.11'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: commander
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '4.4'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '4.4'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: terminal-table
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '1.8'
|
|
90
|
+
type: :runtime
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '1.8'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rake
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '12'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '12'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: bundler
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '1.14'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '1.14'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: codacy-coverage
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '1.1'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '1.1'
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: minitest
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - "~>"
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '5.8'
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - "~>"
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '5.8'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: minitest-reporters
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - "~>"
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '1.1'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - "~>"
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '1.1'
|
|
167
|
+
description: |2
|
|
168
|
+
This is a utility designed to read the XML files used by the Film Rolls
|
|
169
|
+
iOS app, and enable batch EXIF tagging of scanned negatives in TIFF format
|
|
170
|
+
based on the information in these XML files.
|
|
171
|
+
email: Sigurdhsson@gmail.com
|
|
172
|
+
executables:
|
|
173
|
+
- filmrolls
|
|
174
|
+
extensions: []
|
|
175
|
+
extra_rdoc_files: []
|
|
176
|
+
files:
|
|
177
|
+
- LICENSE.md
|
|
178
|
+
- README.md
|
|
179
|
+
- bin/filmrolls
|
|
180
|
+
- lib/filmrolls.rb
|
|
181
|
+
- test/test_exiftool.rb
|
|
182
|
+
- test/test_filmrolls.rb
|
|
183
|
+
- test/test_helper.rb
|
|
184
|
+
homepage: https://github.com/urdh/roll2exif
|
|
185
|
+
licenses:
|
|
186
|
+
- ISC
|
|
187
|
+
metadata: {}
|
|
188
|
+
post_install_message:
|
|
189
|
+
rdoc_options: []
|
|
190
|
+
require_paths:
|
|
191
|
+
- lib
|
|
192
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
193
|
+
requirements:
|
|
194
|
+
- - ">="
|
|
195
|
+
- !ruby/object:Gem::Version
|
|
196
|
+
version: '0'
|
|
197
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
|
+
requirements:
|
|
199
|
+
- - ">="
|
|
200
|
+
- !ruby/object:Gem::Version
|
|
201
|
+
version: '0'
|
|
202
|
+
requirements: []
|
|
203
|
+
rubyforge_project:
|
|
204
|
+
rubygems_version: 2.6.11
|
|
205
|
+
signing_key:
|
|
206
|
+
specification_version: 4
|
|
207
|
+
summary: Tag TIFF files with EXIF data extracted from XML data
|
|
208
|
+
test_files: []
|