tdiary-contrib 3.2.2.20130518 → 3.2.2.20130614
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 +4 -4
- data/.travis.yml +1 -3
- data/doc/ja/plugin/image_gps.txt +56 -17
- data/doc/ja/plugin/playstore.txt +31 -0
- data/js/socialbutton.js +8 -2
- data/lib/exifparser/README +6 -12
- data/lib/tdiary-contrib.rb +7 -6
- data/plugin/brow_si.rb +32 -0
- data/plugin/image_gps.rb +110 -56
- data/plugin/instagr.rb +1 -0
- data/plugin/playstore.rb +161 -0
- data/plugin/tweet_quote.rb +102 -48
- data/plugin/twitter_badge.rb +1 -1
- data/util/estraier-search/estraier-register.rb +2 -1
- data/util/estraier-search/estraier-search.rb +2 -1
- data/util/image-gallery/misc/plugin/recent_image.rb +1 -1
- metadata +7 -27
- data/doc/ja/plugin/image_detail.txt +0 -69
- data/doc/ja/plugin/image_gps2.txt +0 -41
- data/lib/exifparser/BUGS +0 -1
- data/lib/exifparser/ChangeLog +0 -169
- data/lib/exifparser/install.rb +0 -1015
- data/lib/exifparser/lib/exifparser/makernote/canon.rb +0 -502
- data/lib/exifparser/lib/exifparser/makernote/fujifilm.rb +0 -415
- data/lib/exifparser/lib/exifparser/makernote/minolta.rb +0 -84
- data/lib/exifparser/lib/exifparser/makernote/mk_nikonflensname.rb +0 -39
- data/lib/exifparser/lib/exifparser/makernote/nikon.rb +0 -267
- data/lib/exifparser/lib/exifparser/makernote/nikon2.rb +0 -581
- data/lib/exifparser/lib/exifparser/makernote/nikonflensname.rb +0 -438
- data/lib/exifparser/lib/exifparser/makernote/olympus.rb +0 -225
- data/lib/exifparser/lib/exifparser/makernote/prove.rb +0 -84
- data/lib/exifparser/lib/exifparser/makernote/sigma.rb +0 -237
- data/lib/exifparser/lib/exifparser/pre-setup.rb +0 -1
- data/lib/exifparser/lib/exifparser/scan.rb +0 -278
- data/lib/exifparser/lib/exifparser/tag.rb +0 -2298
- data/lib/exifparser/lib/exifparser/thumbnail.rb +0 -76
- data/lib/exifparser/lib/exifparser/utils.rb +0 -88
- data/lib/exifparser/lib/exifparser.rb +0 -265
- data/lib/exifparser/sample/exifview.rb +0 -279
- data/plugin/image_detail.rb +0 -143
data/plugin/image_detail.rb
DELETED
@@ -1,143 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# image_gps.rb $Revision: 1.1 $
|
3
|
-
#
|
4
|
-
# 概要:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# 使い方:
|
8
|
-
# 絵日記Plugin(image.rb)とおなじ
|
9
|
-
#
|
10
|
-
# Copyright (c) 2009,2010 kp <kp@mmho.no-ip.org>
|
11
|
-
# Distributed under the GPL
|
12
|
-
#
|
13
|
-
|
14
|
-
=begin ChangeLog
|
15
|
-
2010-04-21 kp
|
16
|
-
* スマートフォン対応
|
17
|
-
* Google Maps API Keyが設定されていない場合はStaticMAPを生成しない
|
18
|
-
* リンク先をGoogle Mapsに統一
|
19
|
-
2009-06-03 kp
|
20
|
-
* first version
|
21
|
-
* fork from image_gps2.rb
|
22
|
-
=end
|
23
|
-
|
24
|
-
require 'exifparser'
|
25
|
-
|
26
|
-
def tky2wgs lat,lon
|
27
|
-
lat_w = lat - lat*0.00010695 + lon*0.000017464 + 0.0046017
|
28
|
-
lon_w = lon - lat*0.000046038 - lon*0.000083043 + 0.010040
|
29
|
-
lat = lat_w
|
30
|
-
lon = lon_w
|
31
|
-
return lat,lon
|
32
|
-
end
|
33
|
-
|
34
|
-
def image( id, alt = 'image', thumbnail = nil, size = nil, place = 'photo' )
|
35
|
-
if @conf.secure then
|
36
|
-
image = "#{@image_date}_#{id}.jpg"
|
37
|
-
image_t = "#{@image_date}_#{thumbnail}.jpg" if thumbnail
|
38
|
-
else
|
39
|
-
image = image_list( @image_date )[id.to_i]
|
40
|
-
image_t = image_list( @image_date )[thumbnail.to_i] if thumbnail
|
41
|
-
end
|
42
|
-
if size then
|
43
|
-
if size.kind_of?(Array)
|
44
|
-
size = %Q[ width="#{size[0]}" height="#{size[1]}"]
|
45
|
-
else
|
46
|
-
size = %Q[ width="#{size.to_i}"]
|
47
|
-
end
|
48
|
-
else
|
49
|
-
size = ""
|
50
|
-
end
|
51
|
-
|
52
|
-
exif = ExifParser.new("#{@image_dir}/#{image}".untaint) rescue nil
|
53
|
-
|
54
|
-
google = "http://maps.google.co.jp"
|
55
|
-
|
56
|
-
if exif
|
57
|
-
#GPS Info
|
58
|
-
begin
|
59
|
-
lat = exif['GPSLatitude'].value
|
60
|
-
lat = lat[0].to_f + lat[1].to_f/60 + lat[2].to_f/3600
|
61
|
-
lat = -lat if exif['GPSLatitudeRef'].value == 'S'
|
62
|
-
lon = exif['GPSLongitude'].value
|
63
|
-
lon = lon[0].to_f + lon[1].to_f/60 + lon[2].to_f/3600
|
64
|
-
lon = -lon if exif['GPSLongitudeRef'].value == 'W'
|
65
|
-
datum = exif['GPSMapDatum'].value if exif.tag?('GPSMapDatum')
|
66
|
-
lat,lon = tky2wgs(lat,lon) if datum == 'TOKYO'
|
67
|
-
rescue
|
68
|
-
lat = nil
|
69
|
-
end
|
70
|
-
detail = "<ul>"
|
71
|
-
detail += "<li>#{exif['Model'].to_s}" if exif.tag?('Model')
|
72
|
-
detail += "<li>焦点距離:#{exif['FocalLength'].to_s}" if exif.tag?('FocalLength')
|
73
|
-
detail += "<li>F値:#{exif['FNumber'].to_s}" if exif.tag?('FNumber')
|
74
|
-
detail += "<li>露出時間:#{exif['ExposureTime'].to_s}" if exif.tag?('ExposureTime')
|
75
|
-
detail += "<li>露出補正:#{exif['ExposureBiasValue'].to_s}" if exif.tag?('ExposureBiasValue')
|
76
|
-
unless lat.nil?
|
77
|
-
unless (@conf['image_gps.google_maps_api_key'] == '' || @conf.smartphone?)
|
78
|
-
img_map = %Q["http://maps.google.com/staticmap?format=gif&]
|
79
|
-
img_map += %Q[center=#{lat},#{lon}&zoom=14&size=200x200&markers=#{lat},#{lon}&]
|
80
|
-
img_map += %Q[key=#{@conf['image_gps.google_maps_api_key']}&sensor=false"]
|
81
|
-
end
|
82
|
-
map_link = %Q[<a href="#{google}/maps?q=#{lat},#{lon}">]
|
83
|
-
map_link += "#{exif['GPSLatitude'].to_s},#{exif['GPSLatitudeRef'].value}"
|
84
|
-
map_link += " #{exif['GPSLongitude'].to_s},#{exif['GPSLongitudeRef'].value}"
|
85
|
-
map_link += %Q[<img class="map" src=#{img_map}>] if img_map
|
86
|
-
map_link += "</a>"
|
87
|
-
detail += "<li>"+map_link
|
88
|
-
end
|
89
|
-
detail += "</ul>"
|
90
|
-
end
|
91
|
-
|
92
|
-
img = %Q[<img class="#{place}" src="#{@image_url}/#{image}" alt="#{alt}" title="#{alt}" #{size}>]
|
93
|
-
img_t = %Q[<img class="#{place}" src="#{@image_url}/#{image_t}" alt="#{alt}" title="#{alt}" #{size}>]
|
94
|
-
|
95
|
-
url = ''
|
96
|
-
if @conf.mobile_agent?
|
97
|
-
url += %Q[<a href=#{google}/maps/m?q=#{lat},#{lon}>] unless lat.nil?
|
98
|
-
url += thumbnail ? img_t : img
|
99
|
-
url += %Q[</a>] unless lat.nil?
|
100
|
-
else
|
101
|
-
url += %Q[<div class="photo_detail"><p>#{alt}</p>] if detail
|
102
|
-
url += %Q[<a href="#{@image_url}/#{image}">]
|
103
|
-
url += thumbnail ? img_t : img
|
104
|
-
url +=%Q[</a>]
|
105
|
-
url += %Q[#{detail}</div>] if detail
|
106
|
-
end
|
107
|
-
url
|
108
|
-
end
|
109
|
-
add_header_proc do
|
110
|
-
if @mode !~ /conf$/ and not bot? then
|
111
|
-
<<-HTML
|
112
|
-
<style type="text/css"><!--
|
113
|
-
img.map{
|
114
|
-
display:none;
|
115
|
-
position:absolute;
|
116
|
-
border:none;
|
117
|
-
}
|
118
|
-
a:hover img.map{
|
119
|
-
display:inline;
|
120
|
-
}
|
121
|
-
--></style>
|
122
|
-
HTML
|
123
|
-
else
|
124
|
-
''
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
add_conf_proc('image_gps','image_gpsの設定','etc') do
|
129
|
-
if @mode == 'saveconf' then
|
130
|
-
@conf['image_gps.add_info'] = @cgi.params['image_gps.add_info'][0]
|
131
|
-
@conf['image_gps.google_maps_api_key'] = @cgi.params['image_gps.google_maps_api_key'][0]
|
132
|
-
end
|
133
|
-
|
134
|
-
<<-HTML
|
135
|
-
<p>
|
136
|
-
<h3>撮影条件の表示</h3>
|
137
|
-
<input type="checkbox" name="image_gps.add_info" value="true" #{if @conf['image_gps.add_info'] then " checked" end}>タイトルに撮影条件を追加する
|
138
|
-
<h3>Google Maps API Key</h3>
|
139
|
-
<input type="text" name="image_gps.google_maps_api_key" value="#{@conf['image_gps.google_maps_api_key']}">
|
140
|
-
</p>
|
141
|
-
HTML
|
142
|
-
|
143
|
-
end
|