exif_gps_injector 1.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/.gitignore +12 -0
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +23 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +112 -0
- data/Guardfile +18 -0
- data/LICENSE +20 -0
- data/README.md +51 -0
- data/bin/exif_gps_injector +42 -0
- data/exif_gps_injector.gemspec +26 -0
- data/lib/exif_gps_injector.rb +6 -0
- data/lib/exif_gps_injector/kml.rb +29 -0
- data/lib/exif_gps_injector/media.rb +40 -0
- data/spec/exif_gps_injector/kml_spec.rb +22 -0
- data/spec/exif_gps_injector/media_spec.rb +41 -0
- data/spec/fixtures/_example.jpg +0 -0
- data/spec/fixtures/history.kml +1 -0
- data/spec/spec_helper.rb +10 -0
- metadata +194 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 662a71459f65785c321cb9e30f9b5c076029f987
|
4
|
+
data.tar.gz: c6ba3fbba3b4658699ed5f7195c80e0574a566a2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2218c8431857f0182a42aad791732767194d3edc19b1176169e1b33dc11d7457c40be4470cc32624fe03aab0646d7bf82e894e61173cf6bce859df3edec353a6
|
7
|
+
data.tar.gz: 86022c86ee6c453eaf267bc1bd437b0bcadd545b333a7bce8ec3757b00554a748a3d699ad33378e58663e151dc7697180c1578e96f9b8ed60c9414479df7e1ad
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Changelog
|
2
|
+
=========
|
3
|
+
|
4
|
+
Version 1.0.0 (January 14, 2016)
|
5
|
+
-----------------------------
|
6
|
+
|
7
|
+
* Added --fallback-location
|
8
|
+
* Added --gps-refs
|
9
|
+
* Released 1.0.0 to Rubygems
|
10
|
+
|
11
|
+
Version 0.0.2 (January 10, 2016)
|
12
|
+
-----------------------------
|
13
|
+
|
14
|
+
* Added progress bar on executable call
|
15
|
+
* Added --replace-original-files option
|
16
|
+
* Added mp4 files support
|
17
|
+
|
18
|
+
Version 0.0.1 (January 6, 2016)
|
19
|
+
-----------------------------
|
20
|
+
|
21
|
+
* Added exif_gp_injector executable
|
22
|
+
* Added Media model
|
23
|
+
* Added Kml model
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
exif_gps_injector (1.0.0)
|
5
|
+
activesupport (~> 4.2)
|
6
|
+
mini_exiftool (~> 2.5)
|
7
|
+
nokogiri (~> 1.6)
|
8
|
+
ruby-progressbar (~> 1.7)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
activesupport (4.2.5)
|
14
|
+
i18n (~> 0.7)
|
15
|
+
json (~> 1.7, >= 1.7.7)
|
16
|
+
minitest (~> 5.1)
|
17
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
18
|
+
tzinfo (~> 1.1)
|
19
|
+
ast (2.2.0)
|
20
|
+
astrolabe (1.3.1)
|
21
|
+
parser (~> 2.2)
|
22
|
+
coderay (1.1.0)
|
23
|
+
diff-lcs (1.2.5)
|
24
|
+
ffi (1.9.10)
|
25
|
+
formatador (0.2.5)
|
26
|
+
guard (2.13.0)
|
27
|
+
formatador (>= 0.2.4)
|
28
|
+
listen (>= 2.7, <= 4.0)
|
29
|
+
lumberjack (~> 1.0)
|
30
|
+
nenv (~> 0.1)
|
31
|
+
notiffany (~> 0.0)
|
32
|
+
pry (>= 0.9.12)
|
33
|
+
shellany (~> 0.0)
|
34
|
+
thor (>= 0.18.1)
|
35
|
+
guard-compat (1.2.1)
|
36
|
+
guard-rspec (4.6.4)
|
37
|
+
guard (~> 2.1)
|
38
|
+
guard-compat (~> 1.1)
|
39
|
+
rspec (>= 2.99.0, < 4.0)
|
40
|
+
guard-rubocop (1.2.0)
|
41
|
+
guard (~> 2.0)
|
42
|
+
rubocop (~> 0.20)
|
43
|
+
i18n (0.7.0)
|
44
|
+
json (1.8.3)
|
45
|
+
listen (3.0.5)
|
46
|
+
rb-fsevent (>= 0.9.3)
|
47
|
+
rb-inotify (>= 0.9)
|
48
|
+
lumberjack (1.0.10)
|
49
|
+
method_source (0.8.2)
|
50
|
+
mini_exiftool (2.5.1)
|
51
|
+
mini_portile2 (2.0.0)
|
52
|
+
minitest (5.8.3)
|
53
|
+
nenv (0.2.0)
|
54
|
+
nokogiri (1.6.7.1)
|
55
|
+
mini_portile2 (~> 2.0.0.rc2)
|
56
|
+
notiffany (0.0.8)
|
57
|
+
nenv (~> 0.1)
|
58
|
+
shellany (~> 0.0)
|
59
|
+
parser (2.2.3.0)
|
60
|
+
ast (>= 1.1, < 3.0)
|
61
|
+
powerpack (0.1.1)
|
62
|
+
pry (0.10.3)
|
63
|
+
coderay (~> 1.1.0)
|
64
|
+
method_source (~> 0.8.1)
|
65
|
+
slop (~> 3.4)
|
66
|
+
rainbow (2.0.0)
|
67
|
+
rb-fsevent (0.9.7)
|
68
|
+
rb-inotify (0.9.5)
|
69
|
+
ffi (>= 0.5.0)
|
70
|
+
rspec (3.4.0)
|
71
|
+
rspec-core (~> 3.4.0)
|
72
|
+
rspec-expectations (~> 3.4.0)
|
73
|
+
rspec-mocks (~> 3.4.0)
|
74
|
+
rspec-core (3.4.1)
|
75
|
+
rspec-support (~> 3.4.0)
|
76
|
+
rspec-expectations (3.4.0)
|
77
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
+
rspec-support (~> 3.4.0)
|
79
|
+
rspec-mocks (3.4.1)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.4.0)
|
82
|
+
rspec-support (3.4.1)
|
83
|
+
rubocop (0.35.1)
|
84
|
+
astrolabe (~> 1.3)
|
85
|
+
parser (>= 2.2.3.0, < 3.0)
|
86
|
+
powerpack (~> 0.1)
|
87
|
+
rainbow (>= 1.99.1, < 3.0)
|
88
|
+
ruby-progressbar (~> 1.7)
|
89
|
+
tins (<= 1.6.0)
|
90
|
+
ruby-progressbar (1.7.5)
|
91
|
+
shellany (0.0.1)
|
92
|
+
slop (3.6.0)
|
93
|
+
thor (0.19.1)
|
94
|
+
thread_safe (0.3.5)
|
95
|
+
tins (1.6.0)
|
96
|
+
tzinfo (1.2.2)
|
97
|
+
thread_safe (~> 0.1)
|
98
|
+
vcr (3.0.1)
|
99
|
+
|
100
|
+
PLATFORMS
|
101
|
+
ruby
|
102
|
+
|
103
|
+
DEPENDENCIES
|
104
|
+
exif_gps_injector!
|
105
|
+
guard (~> 2.13)
|
106
|
+
guard-rspec (~> 4.6)
|
107
|
+
guard-rubocop (~> 1.2)
|
108
|
+
rspec (~> 3.4)
|
109
|
+
vcr (~> 3.0)
|
110
|
+
|
111
|
+
BUNDLED WITH
|
112
|
+
1.10.6
|
data/Guardfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
2
|
+
# rspec may be run, below are examples of the most common uses.
|
3
|
+
# * bundler: 'bundle exec rspec'
|
4
|
+
# * bundler binstubs: 'bin/rspec'
|
5
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
6
|
+
# installed the spring binstubs per the docs)
|
7
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
8
|
+
# * 'just' rspec: 'rspec'
|
9
|
+
|
10
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
11
|
+
watch(%r{^lib/(.+)\.rb$}) { 'spec' }
|
12
|
+
watch(%r{^spec/(.+)\.rb$}) { 'spec' }
|
13
|
+
end
|
14
|
+
|
15
|
+
guard :rubocop do
|
16
|
+
watch(/.+\.rb$/)
|
17
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
18
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 Jhimy Fernandes Villar.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Exif GPS Injector
|
2
|
+
|
3
|
+
Add GPS exif tags to images/videos based on a kml file
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem install exif_gps_injector
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
### Command line
|
14
|
+
|
15
|
+
Copy images and kml to the same folder:
|
16
|
+
|
17
|
+
```
|
18
|
+
❯❯❯ exif_gps_injector --help
|
19
|
+
Usage: exif_gps_injector [options]
|
20
|
+
--fallback-location LOCATION Fallback to this location if can't locate on kml files eg: '-42.0000 -10.0000 0'
|
21
|
+
--gps-refs REFS Default South/West
|
22
|
+
--input-dir INPUT_DIR Directory to read media files, default to ./
|
23
|
+
--kml-dir KML_DIR Directory to read the kml files, default to ./
|
24
|
+
--replace-original-files Default to false
|
25
|
+
```
|
26
|
+
|
27
|
+
```
|
28
|
+
❯❯❯ exif_gps_injector --replace-original-files
|
29
|
+
23 files found |
|
30
|
+
2621 location points
|
31
|
+
|
32
|
+
Injecting: |=========================================================================================================================================|
|
33
|
+
|
34
|
+
Finished!
|
35
|
+
```
|
36
|
+
|
37
|
+
### Ruby
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
kml = ExifGpsInjector::Kml.new(dir: options[:kml_dir])
|
41
|
+
kml.locate_at('2015-01-01 12:00') => '-42.000 -10.000 0'
|
42
|
+
|
43
|
+
media = ExifGpsInjector::Media.new('./image.jpg')
|
44
|
+
media.original_date_time => '2015-01-01 12:00'
|
45
|
+
media.location = { gps_latitude: '-10.000', gps_longitude: '-42.000', gps_altitude: 0 }
|
46
|
+
```
|
47
|
+
|
48
|
+
|
49
|
+
## License
|
50
|
+
|
51
|
+
MIT License. Copyright 2016 Jhimy Fernandes Villar.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'exif_gps_injector'
|
4
|
+
require 'ruby-progressbar'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
OptionParser.new do |opt|
|
8
|
+
opt.on('--fallback-location LOCATION', "Fallback to this location if can't locate on kml files eg: '-42.0000 -10.0000 0'") { |o| options[:fallback_location] = o }
|
9
|
+
opt.on('--gps-refs REFS', 'Default South/West') { |o| options[:gps_refs] = o }
|
10
|
+
opt.on('--input-dir INPUT_DIR', 'Directory to read media files, default to ./') { |o| options[:input_dir] = o }
|
11
|
+
opt.on('--kml-dir KML_DIR', 'Directory to read the kml files, default to ./') { |o| options[:kml_dir] = o }
|
12
|
+
opt.on('--replace-original-files', 'Default to false') { options[:replace_original_files] = true }
|
13
|
+
end.parse!
|
14
|
+
|
15
|
+
pwd = ENV['PWD']
|
16
|
+
options[:kml_dir] ||= pwd
|
17
|
+
options[:input_dir] ||= pwd
|
18
|
+
options[:replace_original_files] ||= false
|
19
|
+
kml = ExifGpsInjector::Kml.new(dir: options[:kml_dir])
|
20
|
+
files = (Dir[File.join(options[:input_dir], '/*.jpg')] + Dir[File.join(options[:input_dir], '/*.mp4')])
|
21
|
+
progressbar = ProgressBar.create(title: 'Injecting', starting_at: 0, total: files.count)
|
22
|
+
|
23
|
+
puts "#{files.count} files found"
|
24
|
+
puts "#{kml.list.count} location points\n\n"
|
25
|
+
|
26
|
+
files.each do |file|
|
27
|
+
unless options[:replace_original_files]
|
28
|
+
FileUtils.cp(file, "#{File.dirname(file)}/_#{File.basename(file)}")
|
29
|
+
file = "#{File.dirname(file)}/_#{File.basename(file)}"
|
30
|
+
end
|
31
|
+
media = ExifGpsInjector::Media.new(file)
|
32
|
+
location = kml.locate_at(media.original_date_time.to_s)
|
33
|
+
location ||= options[:fallback_location] unless options[:fallback_location].to_s.empty?
|
34
|
+
if location
|
35
|
+
long, lat, alt = location.split(' ')
|
36
|
+
lat_ref, long_ref = options[:gps_refs].to_s.split('/')
|
37
|
+
media.location = { gps_latitude: lat, gps_longitude: long, gps_altitude: alt, gps_latitude_ref: lat_ref, gps_longitude_ref: long_ref }
|
38
|
+
end
|
39
|
+
progressbar.increment
|
40
|
+
end
|
41
|
+
|
42
|
+
puts "\n Finished!"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'exif_gps_injector'
|
3
|
+
s.authors = ['Jhimy Fernandes Villar']
|
4
|
+
s.email = ['stjhimy@gmail.com']
|
5
|
+
s.homepage = 'http://github.com/stjhimy/exif_gps_injector'
|
6
|
+
s.license = 'MIT'
|
7
|
+
s.summary = 'Add GPS exif tags to media files'
|
8
|
+
s.description = 'Add GPS exif tags to images/videos based on a kml file'
|
9
|
+
s.version = '1.0.0'
|
10
|
+
|
11
|
+
s.executables = ['exif_gps_injector']
|
12
|
+
s.files = `git ls-files`.split("\n")
|
13
|
+
s.require_paths = ['lib']
|
14
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
+
|
16
|
+
s.add_dependency 'activesupport', '~> 4.2'
|
17
|
+
s.add_dependency 'mini_exiftool', '~> 2.5'
|
18
|
+
s.add_dependency 'nokogiri', '~> 1.6'
|
19
|
+
s.add_dependency 'ruby-progressbar', '~> 1.7'
|
20
|
+
|
21
|
+
s.add_development_dependency 'guard', '~> 2.13'
|
22
|
+
s.add_development_dependency 'guard-rspec', '~> 4.6'
|
23
|
+
s.add_development_dependency 'guard-rubocop', '~> 1.2'
|
24
|
+
s.add_development_dependency 'rspec', '~> 3.4'
|
25
|
+
s.add_development_dependency 'vcr', '~> 3.0'
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module ExifGpsInjector
|
2
|
+
# Kml
|
3
|
+
class Kml
|
4
|
+
attr_reader :list
|
5
|
+
attr_accessor :max_distance_time
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
@dir = options.delete(:dir)
|
9
|
+
@max_distance_time = options.delete(:max_distance_time) || 2.minutes
|
10
|
+
@list = {}
|
11
|
+
Dir.glob("#{@dir}/*.kml").each { |kml| @list.merge!(extract_list_from_kml(File.read(kml))) }
|
12
|
+
end
|
13
|
+
|
14
|
+
def locate_at(date)
|
15
|
+
date = DateTime.parse(date).utc
|
16
|
+
@list.select { |key, _value| key <= date && key >= date - @max_distance_time }.to_a.last.try(:last) ||
|
17
|
+
@list.select { |key, _value| key >= date && key <= date + @max_distance_time }.to_a.first.try(:last)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def extract_list_from_kml(kml)
|
23
|
+
Nokogiri::XML(kml).search('when')
|
24
|
+
.map { |e| { (DateTime.parse(e.text).utc) => e.next_element.text } }
|
25
|
+
.reduce({}, :merge)
|
26
|
+
.sort.to_h
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module ExifGpsInjector
|
2
|
+
# Media
|
3
|
+
class Media
|
4
|
+
attr_reader :exif
|
5
|
+
|
6
|
+
def initialize(file)
|
7
|
+
@exif = MiniExiftool.new(file)
|
8
|
+
end
|
9
|
+
|
10
|
+
def tags
|
11
|
+
@exif.tags.map { |e| [e, @exif[e]] }.to_h
|
12
|
+
end
|
13
|
+
|
14
|
+
def original_date_time
|
15
|
+
@original_date_time ||= @exif.date_time_original || @exif.create_date || @exif.modify_date
|
16
|
+
end
|
17
|
+
|
18
|
+
def original_date_time=(value)
|
19
|
+
date = DateTime.parse(value).strftime
|
20
|
+
@exif.date_time_original = date
|
21
|
+
@exif.create_date = date
|
22
|
+
@exif.modify_date = date
|
23
|
+
@exif.save
|
24
|
+
value
|
25
|
+
end
|
26
|
+
|
27
|
+
def location
|
28
|
+
{ latitude: @exif.gps_latitude, longitude: @exif.gps_longitude }
|
29
|
+
end
|
30
|
+
|
31
|
+
def location=(options)
|
32
|
+
@exif.gps_latitude = options[:gps_latitude]
|
33
|
+
@exif.gps_longitude = options[:gps_longitude]
|
34
|
+
@exif.gps_altitude = options[:gps_altitude] || 0
|
35
|
+
@exif.gps_latitude_ref = options[:gps_latitude_ref] || 'South'
|
36
|
+
@exif.gps_longitude_ref = options[:gps_longitude_ref] || 'West'
|
37
|
+
@exif.save
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ExifGpsInjector::Kml do
|
4
|
+
let(:kml) do
|
5
|
+
ExifGpsInjector::Kml.new(dir: File.join(File.dirname(__FILE__), '../fixtures'))
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'parse a list of locations based on kml file' do
|
9
|
+
expect(kml.list).to_not be_nil
|
10
|
+
expect(kml.list).to_not eq({})
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'locate_at' do
|
14
|
+
it 'return gps coordinates' do
|
15
|
+
expect(kml.locate_at('2015-12-27T02:00:35+00:00')).to eq('-48.000 -21.000 0')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'return nil when no match is found' do
|
19
|
+
expect(kml.locate_at('2015-01-01')).to eq(nil)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ExifGpsInjector::Media do
|
4
|
+
before(:all) do
|
5
|
+
system("cp #{File.join(File.dirname(__FILE__), '../fixtures/_example.jpg')} #{File.join(File.dirname(__FILE__), '../fixtures/example.jpg')}")
|
6
|
+
end
|
7
|
+
|
8
|
+
after(:all) do
|
9
|
+
system("rm #{File.join(File.dirname(__FILE__), '../fixtures/example.jpg')}")
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:media) do
|
13
|
+
ExifGpsInjector::Media.new(File.join(File.dirname(__FILE__), '../fixtures/example.jpg'))
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'return tags' do
|
17
|
+
expect(media.tags).to_not eq(nil)
|
18
|
+
expect(media.tags).to_not eq({})
|
19
|
+
expect(media.tags.count).to be > 0
|
20
|
+
expect(media.tags['FileSize']).to include('bytes')
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'return original_date_time' do
|
24
|
+
expect(media.original_date_time).to eq('2015-01-01 00:00:00.000000000 -0200')
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'set original_date_time' do
|
28
|
+
media.original_date_time = '2015-02-01'
|
29
|
+
expect(media.tags['DateTimeOriginal']).to eq('2015-02-01 00:00:00 -0200')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'return location' do
|
33
|
+
expect(media.location).to_not eq(nil)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'set location' do
|
37
|
+
media.location = { gps_latitude: '-1000', gps_longitude: '-1000' }
|
38
|
+
expect(media.tags['GPSLatitude']).to include('1000')
|
39
|
+
expect(media.tags['GPSLongitude']).to include('1000')
|
40
|
+
end
|
41
|
+
end
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"><Document><name> Location history from 2015-12-27 to 2015-12-27 </name><open>1</open><description></description><StyleMap id="multiTrack"><Pair><key>normal</key><styleUrl>#multiTrack_n</styleUrl></Pair><Pair><key>highlight</key><styleUrl>#multiTrack_h</styleUrl></Pair></StyleMap><Style id="multiTrack_n"><IconStyle><Icon><href>https://earth.google.com/images/kml-icons/track-directional/track-0.png</href></Icon></IconStyle><LineStyle><color>99ffac59</color><width>6</width></LineStyle></Style><Style id="multiTrack_h"><IconStyle><scale>1.2</scale><Icon><href>https://earth.google.com/images/kml-icons/track-directional/track-0.png</href></Icon></IconStyle><LineStyle><color>99ffac59</color><width>8</width></LineStyle></Style><Placemark><name>Google User</name><description> Location history for Google User from 2015-12-27 to 2015-12-27 </description><gx:Track><altitudeMode>clampToGround</altitudeMode><when>2015-12-26T18:00:35.491-08:00</when><gx:coord>-48.000 -21.000 0</gx:coord></gx:Track></Placemark></Document></kml>
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: exif_gps_injector
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jhimy Fernandes Villar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mini_exiftool
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.5'
|
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.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ruby-progressbar
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.13'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.13'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '4.6'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '4.6'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.4'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.4'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: vcr
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.0'
|
139
|
+
description: Add GPS exif tags to images/videos based on a kml file
|
140
|
+
email:
|
141
|
+
- stjhimy@gmail.com
|
142
|
+
executables:
|
143
|
+
- exif_gps_injector
|
144
|
+
extensions: []
|
145
|
+
extra_rdoc_files: []
|
146
|
+
files:
|
147
|
+
- ".gitignore"
|
148
|
+
- ".rubocop.yml"
|
149
|
+
- CHANGELOG.md
|
150
|
+
- Gemfile
|
151
|
+
- Gemfile.lock
|
152
|
+
- Guardfile
|
153
|
+
- LICENSE
|
154
|
+
- README.md
|
155
|
+
- bin/exif_gps_injector
|
156
|
+
- exif_gps_injector.gemspec
|
157
|
+
- lib/exif_gps_injector.rb
|
158
|
+
- lib/exif_gps_injector/kml.rb
|
159
|
+
- lib/exif_gps_injector/media.rb
|
160
|
+
- spec/exif_gps_injector/kml_spec.rb
|
161
|
+
- spec/exif_gps_injector/media_spec.rb
|
162
|
+
- spec/fixtures/_example.jpg
|
163
|
+
- spec/fixtures/history.kml
|
164
|
+
- spec/spec_helper.rb
|
165
|
+
homepage: http://github.com/stjhimy/exif_gps_injector
|
166
|
+
licenses:
|
167
|
+
- MIT
|
168
|
+
metadata: {}
|
169
|
+
post_install_message:
|
170
|
+
rdoc_options: []
|
171
|
+
require_paths:
|
172
|
+
- lib
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
requirements: []
|
184
|
+
rubyforge_project:
|
185
|
+
rubygems_version: 2.4.5.1
|
186
|
+
signing_key:
|
187
|
+
specification_version: 4
|
188
|
+
summary: Add GPS exif tags to media files
|
189
|
+
test_files:
|
190
|
+
- spec/exif_gps_injector/kml_spec.rb
|
191
|
+
- spec/exif_gps_injector/media_spec.rb
|
192
|
+
- spec/fixtures/_example.jpg
|
193
|
+
- spec/fixtures/history.kml
|
194
|
+
- spec/spec_helper.rb
|