tdiary-contrib 3.2.2.20130518
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +35 -0
- data/README.en.md +12 -0
- data/README.md +13 -0
- data/Rakefile +41 -0
- data/doc/en/filter/spambayes.txt +3 -0
- data/doc/en/plugin.txt +1 -0
- data/doc/en/style/hatena.txt +10 -0
- data/doc/en/style/markdown.txt +16 -0
- data/doc/en/util.txt +1 -0
- data/doc/ja/filter/antirefspam.history.txt +59 -0
- data/doc/ja/filter/antirefspam.txt +86 -0
- data/doc/ja/filter/comment_key.ja.html +182 -0
- data/doc/ja/filter/spambayes.txt +3 -0
- data/doc/ja/plugin/add_bookmark.txt +50 -0
- data/doc/ja/plugin/category_to_tag.txt +21 -0
- data/doc/ja/plugin/cocoment.txt +31 -0
- data/doc/ja/plugin/google_adsense.txt +25 -0
- data/doc/ja/plugin/google_analytics.txt +7 -0
- data/doc/ja/plugin/image_detail.txt +69 -0
- data/doc/ja/plugin/image_gps.txt +36 -0
- data/doc/ja/plugin/image_gps2.txt +41 -0
- data/doc/ja/plugin/livedoor_weather.txt +105 -0
- data/doc/ja/plugin/opensearch_ad.txt +16 -0
- data/doc/ja/plugin/section_footer.txt +84 -0
- data/doc/ja/plugin/select_theme.txt +1 -0
- data/doc/ja/plugin.txt +13 -0
- data/doc/ja/style/hatena.txt +10 -0
- data/doc/ja/style/markdown.txt +13 -0
- data/doc/ja/util.txt +12 -0
- data/filter/antirefspam.rb +263 -0
- data/filter/commentkey.rb +29 -0
- data/filter/commentsize.rb +18 -0
- data/filter/hidecomment.rb +13 -0
- data/filter/iplookup.rb +55 -0
- data/filter/plugin/antirefspam.rb +59 -0
- data/filter/plugin/commentkey.rb +58 -0
- data/filter/plugin/commentsize.rb +12 -0
- data/filter/plugin/en/iplookup.rb +9 -0
- data/filter/plugin/en/spambayes.rb +123 -0
- data/filter/plugin/iplookup.rb +39 -0
- data/filter/plugin/ja/antirefspam.rb +91 -0
- data/filter/plugin/ja/commentkey.rb +17 -0
- data/filter/plugin/ja/commentsize.rb +6 -0
- data/filter/plugin/ja/iplookup.rb +9 -0
- data/filter/plugin/ja/spambayes.rb +124 -0
- data/filter/plugin/spambayes.rb +501 -0
- data/filter/plugin/zh/iplookup.rb +9 -0
- data/filter/rblcheck.rb +36 -0
- data/filter/spambayes.rb +535 -0
- data/filter/spamlookup.rb +37 -0
- data/io/dbi_io/ChangeLog +19 -0
- data/io/dbi_io/README.ja +39 -0
- data/io/dbi_io/dbi_io.rb +181 -0
- data/io/dbi_io/plugin/refererDbiIO.rb +76 -0
- data/io/dbi_io/tdiary_table.sql +42 -0
- data/js/appstore.js +109 -0
- data/js/datepicker.js +69 -0
- data/js/editor.js +82 -0
- data/js/flickr.js +157 -0
- data/js/image_ex.js +79 -0
- data/js/jquery.socialbutton.js +842 -0
- data/js/nicovideo.js +17 -0
- data/js/picasa.js +322 -0
- data/js/plugin_checker.js +71 -0
- data/js/prettify/lang-apollo.js +2 -0
- data/js/prettify/lang-clj.js +18 -0
- data/js/prettify/lang-css.js +2 -0
- data/js/prettify/lang-go.js +1 -0
- data/js/prettify/lang-hs.js +2 -0
- data/js/prettify/lang-lisp.js +3 -0
- data/js/prettify/lang-lua.js +2 -0
- data/js/prettify/lang-ml.js +2 -0
- data/js/prettify/lang-n.js +4 -0
- data/js/prettify/lang-proto.js +1 -0
- data/js/prettify/lang-scala.js +2 -0
- data/js/prettify/lang-sql.js +2 -0
- data/js/prettify/lang-tex.js +1 -0
- data/js/prettify/lang-vb.js +2 -0
- data/js/prettify/lang-vhdl.js +3 -0
- data/js/prettify/lang-wiki.js +2 -0
- data/js/prettify/lang-xq.js +3 -0
- data/js/prettify/lang-yaml.js +2 -0
- data/js/prettify/prettify.css +1 -0
- data/js/prettify/prettify.js +28 -0
- data/js/referer.js +17 -0
- data/js/show_and_hide.js +39 -0
- data/js/socialbutton.js +126 -0
- data/js/twitter_anywhere.js +28 -0
- data/js/yahoo_kousei.js +21 -0
- data/lib/bayes/convert.rb +34 -0
- data/lib/bayes.rb +232 -0
- data/lib/exifparser/BUGS +1 -0
- data/lib/exifparser/ChangeLog +169 -0
- data/lib/exifparser/README +15 -0
- data/lib/exifparser/install.rb +1015 -0
- data/lib/exifparser/lib/exifparser/makernote/canon.rb +502 -0
- data/lib/exifparser/lib/exifparser/makernote/fujifilm.rb +415 -0
- data/lib/exifparser/lib/exifparser/makernote/minolta.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/mk_nikonflensname.rb +39 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon.rb +267 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon2.rb +581 -0
- data/lib/exifparser/lib/exifparser/makernote/nikonflensname.rb +438 -0
- data/lib/exifparser/lib/exifparser/makernote/olympus.rb +225 -0
- data/lib/exifparser/lib/exifparser/makernote/prove.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/sigma.rb +237 -0
- data/lib/exifparser/lib/exifparser/pre-setup.rb +1 -0
- data/lib/exifparser/lib/exifparser/scan.rb +278 -0
- data/lib/exifparser/lib/exifparser/tag.rb +2298 -0
- data/lib/exifparser/lib/exifparser/thumbnail.rb +76 -0
- data/lib/exifparser/lib/exifparser/utils.rb +88 -0
- data/lib/exifparser/lib/exifparser.rb +265 -0
- data/lib/exifparser/sample/exifview.rb +279 -0
- data/lib/tdiary-contrib.rb +19 -0
- data/lib/wgs2tky.rb +93 -0
- data/misc/section_footer2/buzzurl.yaml +6 -0
- data/misc/section_footer2/fc2.yaml +6 -0
- data/misc/section_footer2/ldc.yaml +6 -0
- data/misc/section_footer2/retweet.yaml +7 -0
- data/misc/section_footer2/twitter.yaml +7 -0
- data/misc/section_footer2/yahoo.yaml +6 -0
- data/misc/tdiarygraph/tdiarygraph120x90e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph125x125e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph240x180e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph468x60e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph728x90e.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r7.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125s.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes234x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes468x30.swf +0 -0
- data/plugin/add_bookmark.rb +89 -0
- data/plugin/apple_webclip.rb +26 -0
- data/plugin/appstore.rb +47 -0
- data/plugin/bigpresen.rb +86 -0
- data/plugin/bitly.rb +39 -0
- data/plugin/bootstrap-navi.rb +54 -0
- data/plugin/canonical.rb +9 -0
- data/plugin/category_similar.rb +73 -0
- data/plugin/category_to_tag.rb +60 -0
- data/plugin/category_to_tagcloud.rb +172 -0
- data/plugin/cocomment.rb +37 -0
- data/plugin/code-prettify.rb +23 -0
- data/plugin/coderwall.rb +34 -0
- data/plugin/datepicker.rb +28 -0
- data/plugin/day2section.rb +20 -0
- data/plugin/del_footer.rb +111 -0
- data/plugin/description_from_body.rb +23 -0
- data/plugin/development.rb +16 -0
- data/plugin/editor.rb +11 -0
- data/plugin/en/add_bookmark.rb +20 -0
- data/plugin/en/del_footer.rb +10 -0
- data/plugin/en/git-register.rb +3 -0
- data/plugin/en/livedoor_weather.rb +25 -0
- data/plugin/en/microsummary.rb +18 -0
- data/plugin/en/nicovideo.rb +38 -0
- data/plugin/en/openid.rb +8 -0
- data/plugin/en/section_footer.rb +6 -0
- data/plugin/en/section_footer2.rb +3 -0
- data/plugin/en/socialbutton.rb +5 -0
- data/plugin/everytrail.rb +39 -0
- data/plugin/facebook_comments.rb +59 -0
- data/plugin/flickr.rb +209 -0
- data/plugin/gist.rb +16 -0
- data/plugin/git-register.rb +240 -0
- data/plugin/github_badge.rb +27 -0
- data/plugin/github_link.rb +9 -0
- data/plugin/goo_gl.rb +42 -0
- data/plugin/google_adsense.rb +132 -0
- data/plugin/google_analytics.rb +39 -0
- data/plugin/google_map.rb +168 -0
- data/plugin/google_sitemaps.rb +60 -0
- data/plugin/google_webmaster.rb +22 -0
- data/plugin/hatena_bookmark_nocomment.rb +9 -0
- data/plugin/hatena_star.rb +66 -0
- data/plugin/hb_footer.rb +255 -0
- data/plugin/hb_footer4sec.rb +244 -0
- data/plugin/hb_footer4sec_js.rb +30 -0
- data/plugin/hide_comment_form.rb +4 -0
- data/plugin/hide_sidebar_iphone.rb +21 -0
- data/plugin/iddy.rb +81 -0
- data/plugin/image_detail.rb +143 -0
- data/plugin/image_ex.rb +462 -0
- data/plugin/image_gps.rb +128 -0
- data/plugin/inline_wiki.rb +6 -0
- data/plugin/instagr.rb +64 -0
- data/plugin/ja/add_bookmark.rb +20 -0
- data/plugin/ja/del_footer.rb +10 -0
- data/plugin/ja/flickr.rb +62 -0
- data/plugin/ja/git-register.rb +3 -0
- data/plugin/ja/google_sitemaps.rb +35 -0
- data/plugin/ja/livedoor_weather.rb +25 -0
- data/plugin/ja/microsummary.rb +18 -0
- data/plugin/ja/nicovideo.rb +41 -0
- data/plugin/ja/openid.rb +7 -0
- data/plugin/ja/section_footer.rb +6 -0
- data/plugin/ja/section_footer2.rb +4 -0
- data/plugin/ja/socialbutton.rb +6 -0
- data/plugin/jdate.rb +20 -0
- data/plugin/jholiday.rb +16 -0
- data/plugin/jmonth.rb +20 -0
- data/plugin/jquery_ui_theme.rb +55 -0
- data/plugin/jroku.rb +28 -0
- data/plugin/jyear.rb +37 -0
- data/plugin/latlonglab_route.rb +25 -0
- data/plugin/lazy_referer.rb +38 -0
- data/plugin/livedoor_weather.rb +180 -0
- data/plugin/make_link.rb +44 -0
- data/plugin/makerss_category.rb +43 -0
- data/plugin/makerss_comment.rb +35 -0
- data/plugin/microsummary.rb +62 -0
- data/plugin/mm_footer.rb +215 -0
- data/plugin/monthly_autopagerize.rb +67 -0
- data/plugin/my_hotentry.rb +132 -0
- data/plugin/navi_day.rb +118 -0
- data/plugin/navi_this_month.rb +15 -0
- data/plugin/nicovideo.rb +115 -0
- data/plugin/notify_miniblog.rb +134 -0
- data/plugin/ogp.rb +55 -0
- data/plugin/ohmsha_estore.rb +71 -0
- data/plugin/openid.rb +90 -0
- data/plugin/opensearch_ad.rb +33 -0
- data/plugin/picasa.rb +56 -0
- data/plugin/plugin_checker.rb +41 -0
- data/plugin/popit.rb +22 -0
- data/plugin/prettify.rb +19 -0
- data/plugin/prezi.rb +10 -0
- data/plugin/profile.rb +222 -0
- data/plugin/puboo.rb +93 -0
- data/plugin/pygments_css.rb +76 -0
- data/plugin/rating.rb +419 -0
- data/plugin/recent_estraier.rb +50 -0
- data/plugin/recent_tweet.rb +71 -0
- data/plugin/retweet.rb +86 -0
- data/plugin/rubykaigi.rb +99 -0
- data/plugin/search-bing.rb +87 -0
- data/plugin/search-default.rb +264 -0
- data/plugin/search-google-custom.rb +60 -0
- data/plugin/search-yahoo-websearch.rb +121 -0
- data/plugin/search-yahoo.rb +109 -0
- data/plugin/section_footer.rb +195 -0
- data/plugin/section_footer2.rb +278 -0
- data/plugin/section_permalink.rb +73 -0
- data/plugin/section_permalink_anchor.rb +39 -0
- data/plugin/select_style.rb +42 -0
- data/plugin/select_theme.rb +90 -0
- data/plugin/show_and_hide.rb +77 -0
- data/plugin/slideshare.rb +10 -0
- data/plugin/socialbutton.rb +60 -0
- data/plugin/tatsu_zine.rb +93 -0
- data/plugin/tdiarygraph_flashstyle.rb +296 -0
- data/plugin/tdiarytimes.rb +166 -0
- data/plugin/tdiarytimes2.rb +406 -0
- data/plugin/tdiarytimes_flashstyle.rb +263 -0
- data/plugin/tdiarytimes_textstyle.rb +290 -0
- data/plugin/title_anchor.rb +16 -0
- data/plugin/tweet_quote.rb +106 -0
- data/plugin/twitpic.rb +10 -0
- data/plugin/twitter.rb +46 -0
- data/plugin/twitter_anywhere.rb +209 -0
- data/plugin/twitter_badge.rb +42 -0
- data/plugin/twitter_js.rb +59 -0
- data/plugin/ustream.rb +19 -0
- data/plugin/vimeo.rb +14 -0
- data/plugin/volatile.rb +89 -0
- data/plugin/vote.rb +100 -0
- data/plugin/wikiloc.rb +27 -0
- data/plugin/windex.rb +512 -0
- data/plugin/yahoo_kousei.rb +79 -0
- data/plugin/yahoo_map.rb +97 -0
- data/plugin/youtube.rb +33 -0
- data/plugin/yshop.rb +189 -0
- data/plugin/zenback.rb +46 -0
- data/spec/apple_webclip_spec.rb +46 -0
- data/spec/fixtures/friendfeed.xml +2 -0
- data/spec/fixtures/github.json +1 -0
- data/spec/fixtures/twitter.xml +73 -0
- data/spec/gist_spec.rb +16 -0
- data/spec/github_link_spec.rb +39 -0
- data/spec/google_analytics_spec.rb +60 -0
- data/spec/jdate_spec.rb +23 -0
- data/spec/jmonth_spec.rb +28 -0
- data/spec/jyear_spec.rb +21 -0
- data/spec/my_hotentry_spec.rb +78 -0
- data/spec/openid_spec.rb +246 -0
- data/spec/opensearch_ad_spec.rb +50 -0
- data/spec/profile_spec.rb +88 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec_helper.rb +223 -0
- data/spec/title_anchor_spec.rb +39 -0
- data/spec/twitter_js_spec.rb +116 -0
- data/spec/youtube_spec.rb +20 -0
- data/style/hatena_style.rb +1011 -0
- data/style/markdown_style.rb +239 -0
- data/style/wikiext_style.rb +21 -0
- data/tdiary-contrib.gemspec +25 -0
- data/util/clean-spam/README.ja +1 -0
- data/util/clean-spam/tdiary-comment-clean +46 -0
- data/util/clean-spam/tdiary-comment-clean2 +81 -0
- data/util/clean-spam/tdiary-referer-clean +46 -0
- data/util/convert_pstore.rb +82 -0
- data/util/estraier-search/ChangeLog +36 -0
- data/util/estraier-search/README.ja +114 -0
- data/util/estraier-search/en/estraier-register.rb +3 -0
- data/util/estraier-search/estraier-register.rb +298 -0
- data/util/estraier-search/estraier-search.rb +273 -0
- data/util/estraier-search/estraier.rhtml +73 -0
- data/util/estraier-search/estraier.rxml +23 -0
- data/util/estraier-search/i.estraier.rhtml +31 -0
- data/util/estraier-search/ja/estraier-register.rb +3 -0
- data/util/image-gallery/README.ja +27 -0
- data/util/image-gallery/image-gallery.rb +523 -0
- data/util/image-gallery/image-gallery.rb.euc-jp +523 -0
- data/util/image-gallery/js/SmoothGallery/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/css/ReMooz.css +186 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/spinner.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/jd.gallery.css +371 -0
- data/util/image-gallery/js/SmoothGallery/css/layout.css +91 -0
- data/util/image-gallery/js/SmoothGallery/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/resizer.php +113 -0
- data/util/image-gallery/js/SmoothGallery/scripts/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.Routing.js +126 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.js +109 -0
- data/util/image-gallery/js/SmoothGallery/scripts/ReMooz.js +364 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.js +843 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.set.js +183 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.transitions.js +90 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jdgalleryresize.js +828 -0
- data/util/image-gallery/js/SmoothGallery/scripts/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2-more.js +103 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2.1-core-yc.js +349 -0
- data/util/image-gallery/js/SmoothGallery/scripts/resizer.php +113 -0
- data/util/image-gallery/misc/plugin/recent_image.rb +406 -0
- data/util/image-gallery/skel/gallery.rhtml +154 -0
- data/util/image-gallery/skel/gallery.rhtml.euc-jp +154 -0
- data/util/image-gallery/tdiary.conf.igsample +8 -0
- data/util/image-gallery/theme/image-gallery.css +85 -0
- data/util/image2flickr.rb +282 -0
- data/util/posttdiary/README.ja +12 -0
- data/util/posttdiary/posttdiary-ex.rb +1155 -0
- data/util/posttdiary/posttdiary.rb +245 -0
- data/util/rast-search/ChangeLog +55 -0
- data/util/rast-search/README.ja +99 -0
- data/util/rast-search/en/rast-register.rb +3 -0
- data/util/rast-search/i.rast.rhtml +33 -0
- data/util/rast-search/ja/rast-register.rb +3 -0
- data/util/rast-search/rast-register.rb +326 -0
- data/util/rast-search/rast-search.rb +249 -0
- data/util/rast-search/rast.rhtml +66 -0
- data/util/rast-search/rast.rxml +21 -0
- data/util/section_link/README +11 -0
- data/util/section_link/misc/plugin/section_link.rb +68 -0
- data/util/section_link/misc/plugin/section_link_anchor.rb +38 -0
- data/util/section_link/tdiary/tdiary_day_ext.rb +21 -0
- data/util/section_link/tdiary/tdiaryext_style.rb +36 -0
- data/util/section_link/tdiary/wikiext_style.rb +36 -0
- data/util/tdiary-for-ruby1.9/compatible.rb +97 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.2.0.patch +98 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.3.1.patch +212 -0
- data/util/tdiary-grep/README +4 -0
- data/util/tdiary-grep/grep.rb +445 -0
- data/util/tdiary-mode/http.el +130 -0
- data/util/tdiary-mode/tdiary-mode.el +613 -0
- data/util/tdiary-vim/ChangeLog +25 -0
- data/util/tdiary-vim/README +60 -0
- data/util/tdiary-vim/tdiary.vim +350 -0
- data/util/tdiarysearch/README.en +53 -0
- data/util/tdiarysearch/README.ja +99 -0
- data/util/tdiarysearch/search.rb +504 -0
- metadata +497 -0
@@ -0,0 +1,581 @@
|
|
1
|
+
#
|
2
|
+
# exif/makernote/nikon2.rb
|
3
|
+
#
|
4
|
+
# $Revision: 1.3 $
|
5
|
+
# $Date: 2003/04/27 13:54:52 $
|
6
|
+
#
|
7
|
+
#== Reference
|
8
|
+
#
|
9
|
+
#http://www.ba.wakwak.com/%7Etsuruzoh/Computer/Digicams/exif-e.html
|
10
|
+
#
|
11
|
+
require 'exifparser/tag'
|
12
|
+
require 'exifparser/utils'
|
13
|
+
require 'exifparser/makernote/nikonflensname'
|
14
|
+
|
15
|
+
module Exif
|
16
|
+
#
|
17
|
+
# Tags used in Nikon Makernote
|
18
|
+
#
|
19
|
+
module Tag
|
20
|
+
|
21
|
+
module MakerNote
|
22
|
+
#
|
23
|
+
# Shared Datas between Tags
|
24
|
+
#
|
25
|
+
module SharedData
|
26
|
+
@@nikon_serial_no = nil # written by NikonCameaSerialNumber Tag
|
27
|
+
@@release_count = nil # written by ReleaseCount Tag
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Subclass for Tags need shared datas
|
32
|
+
#
|
33
|
+
class NikonBase < Base
|
34
|
+
include SharedData
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# 0x0001 - Data Version
|
39
|
+
#
|
40
|
+
class DataVersion < Base
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
#
|
45
|
+
# 0x0002 - ISOUsed
|
46
|
+
#
|
47
|
+
# class ISOUsed < Base
|
48
|
+
# end
|
49
|
+
|
50
|
+
#
|
51
|
+
# 0x0003 - ColorMode
|
52
|
+
#
|
53
|
+
class ColorMode < Base
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# 0x0004 - ImageQuality
|
58
|
+
#
|
59
|
+
class ImageQuality < Base
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# 0x0005 - Whitebalance
|
64
|
+
#
|
65
|
+
class Whitebalance < Base
|
66
|
+
end
|
67
|
+
|
68
|
+
#
|
69
|
+
# 0x0006 - ImageSharpening
|
70
|
+
#
|
71
|
+
class ImageSharpening < Base
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# 0x0007 - FocusingMode
|
76
|
+
#
|
77
|
+
class FocusingMode < Base
|
78
|
+
end
|
79
|
+
|
80
|
+
#
|
81
|
+
# 0x0008 - FlashSetting
|
82
|
+
#
|
83
|
+
class FlashSetting < Base
|
84
|
+
end
|
85
|
+
|
86
|
+
#
|
87
|
+
# 0x0009 - SpeedlightMode
|
88
|
+
#
|
89
|
+
class SpeedlightMode < Base
|
90
|
+
end
|
91
|
+
|
92
|
+
#
|
93
|
+
# 0x000d - ProgramShift
|
94
|
+
#
|
95
|
+
class ProgramShift < Base
|
96
|
+
|
97
|
+
def to_s
|
98
|
+
case @formatted
|
99
|
+
when [0xfc, 0x01, 0x06, 0x00]
|
100
|
+
"-2/3EV"
|
101
|
+
when [0xfd, 0x01, 0x06, 0x00]
|
102
|
+
"-1/2EV"
|
103
|
+
when [0xfe, 0x01, 0x06, 0x00]
|
104
|
+
"-1/3EV"
|
105
|
+
when [0x00, 0x01, 0x06, 0x00]
|
106
|
+
"+0EV"
|
107
|
+
when [0x02, 0x01, 0x06, 0x00]
|
108
|
+
"+1/3EV"
|
109
|
+
when [0x03, 0x01, 0x06, 0x00]
|
110
|
+
"+1/2EV"
|
111
|
+
when [0x04, 0x01, 0x06, 0x00]
|
112
|
+
"+2/3EV"
|
113
|
+
else
|
114
|
+
""
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
#
|
121
|
+
# 0x000e - ExposureDifference
|
122
|
+
#
|
123
|
+
class ExposureDifference < Base
|
124
|
+
|
125
|
+
def to_s
|
126
|
+
case @formatted
|
127
|
+
when [0xf7, 0x01, 0x0c, 0x00]
|
128
|
+
"-2/3EV"
|
129
|
+
when [0xf9, 0x01, 0x0c, 0x00]
|
130
|
+
"-1/2EV"
|
131
|
+
when [0xfc, 0x01, 0x0c, 0x00]
|
132
|
+
"-1/3EV"
|
133
|
+
when [0x00, 0x01, 0x0c, 0x00]
|
134
|
+
"+0EV"
|
135
|
+
when [0x04, 0x01, 0x0c, 0x00]
|
136
|
+
"+1/3EV"
|
137
|
+
when [0x06, 0x01, 0x0c, 0x00]
|
138
|
+
"+1/2EV"
|
139
|
+
when [0x08, 0x01, 0x0c, 0x00]
|
140
|
+
"+2/3EV"
|
141
|
+
else
|
142
|
+
""
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
end
|
147
|
+
|
148
|
+
#
|
149
|
+
# 0x000f - ISOSelection
|
150
|
+
#
|
151
|
+
class ISOSelection < Base
|
152
|
+
end
|
153
|
+
|
154
|
+
#
|
155
|
+
# 0x0010 - DataDump
|
156
|
+
#
|
157
|
+
class DataDump < Base
|
158
|
+
end
|
159
|
+
|
160
|
+
#
|
161
|
+
# 0x0012 - Speedlight Bias
|
162
|
+
#
|
163
|
+
class SpeedlightBias < Base
|
164
|
+
|
165
|
+
def to_s
|
166
|
+
case @formatted
|
167
|
+
when [0xfc, 0x01, 0x06, 0x00]
|
168
|
+
"-2/3EV"
|
169
|
+
when [0xfd, 0x01, 0x06, 0x00]
|
170
|
+
"-1/2EV"
|
171
|
+
when [0xfe, 0x01, 0x06, 0x00]
|
172
|
+
"-1/3EV"
|
173
|
+
when [0x00, 0x01, 0x06, 0x00]
|
174
|
+
"+0EV"
|
175
|
+
when [0x02, 0x01, 0x06, 0x00]
|
176
|
+
"+1/3EV"
|
177
|
+
when [0x03, 0x01, 0x06, 0x00]
|
178
|
+
"+1/2EV"
|
179
|
+
when [0x04, 0x01, 0x06, 0x00]
|
180
|
+
"+2/3EV"
|
181
|
+
else
|
182
|
+
""
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
#
|
189
|
+
# 0x001d - NikonCameraSerialNumber
|
190
|
+
#
|
191
|
+
class NikonCameraSerialNumber < NikonBase
|
192
|
+
|
193
|
+
def processData
|
194
|
+
super
|
195
|
+
@@nikon_serial_no = @formatted # This value is used for LensParamaters tag.
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
#
|
201
|
+
# 0x0022 ActiveD_Lighting
|
202
|
+
#
|
203
|
+
class ActiveD_Lighting < Base
|
204
|
+
|
205
|
+
def to_s
|
206
|
+
case @formatted
|
207
|
+
when 0
|
208
|
+
"Off"
|
209
|
+
when 1
|
210
|
+
"Low"
|
211
|
+
when 3
|
212
|
+
"Normal"
|
213
|
+
when 5
|
214
|
+
"Hight"
|
215
|
+
when 7
|
216
|
+
"Extra High"
|
217
|
+
when 65535
|
218
|
+
"Auto"
|
219
|
+
else
|
220
|
+
""
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
|
226
|
+
#
|
227
|
+
# 0x0023 - PictureControl
|
228
|
+
#
|
229
|
+
class PictureControl < Base
|
230
|
+
def to_s
|
231
|
+
@formatted[4,20].pack('C*')
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
#
|
236
|
+
# 0x0080 - ImageAdjustment
|
237
|
+
#
|
238
|
+
class ImageAdjustment < Base
|
239
|
+
end
|
240
|
+
|
241
|
+
#
|
242
|
+
# 0x0081 - Tone Compensation
|
243
|
+
#
|
244
|
+
class ToneCompensation < Base
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# 0x0082 - Adapter
|
249
|
+
#
|
250
|
+
class Adapter < Base
|
251
|
+
end
|
252
|
+
|
253
|
+
#
|
254
|
+
# 0x0083 - LensType
|
255
|
+
#
|
256
|
+
class LensType < Base
|
257
|
+
def to_s
|
258
|
+
data = @formatted[0]
|
259
|
+
isVR = (data[3] == 1 ? "Yes":"No")
|
260
|
+
isG = (data[2] == 1 ? "Yes":"No")
|
261
|
+
isD = (data[1] == 1 ? "Yes":"No")
|
262
|
+
isMF = (data[0] == 1 ? "Yes":"No")
|
263
|
+
"VR:#{isVR}, G:#{isG}, D:#{isD}, MF:#{isMF}"
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
#
|
268
|
+
# 0x0084 - LensSpecification
|
269
|
+
#
|
270
|
+
class LensSpecification < Base
|
271
|
+
def processData
|
272
|
+
@formatted = []
|
273
|
+
partition_data(@count) do |data|
|
274
|
+
@formatted.push _formatData(data)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
def to_s
|
279
|
+
if @formatted[0] != @formatted[1]
|
280
|
+
"#{@formatted[0]}-#{@formatted[1]}mm, F#{@formatted[2].to_f}-#{@formatted[3].to_f}"
|
281
|
+
else
|
282
|
+
"#{@formatted[0]}mm, F#{@formatted[2].to_f} (Prime Lens)"
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
#
|
288
|
+
# 0x0085 - ManualForcusDistance
|
289
|
+
#
|
290
|
+
class ManualForcusDistance < Base
|
291
|
+
end
|
292
|
+
|
293
|
+
#
|
294
|
+
# 0x0086 - DigitalZoom
|
295
|
+
#
|
296
|
+
class DigitalZoom < Base
|
297
|
+
end
|
298
|
+
|
299
|
+
#
|
300
|
+
# 0x0088 - AFFocusPosition
|
301
|
+
#
|
302
|
+
class AFFocusPosition < Base
|
303
|
+
end
|
304
|
+
|
305
|
+
#
|
306
|
+
# 0x008D - CameraColorMode
|
307
|
+
#
|
308
|
+
class CameraColorMode < Base
|
309
|
+
end
|
310
|
+
|
311
|
+
#
|
312
|
+
# 0x008F - SceneMode
|
313
|
+
#
|
314
|
+
class SceneMode < Base
|
315
|
+
end
|
316
|
+
|
317
|
+
#
|
318
|
+
# 0x0090 - LightSource
|
319
|
+
#
|
320
|
+
class LightSource < Base
|
321
|
+
end
|
322
|
+
|
323
|
+
#
|
324
|
+
# 0x0095 - LongtimeExposureNR
|
325
|
+
#
|
326
|
+
class LongtimeExposureNR < Base
|
327
|
+
end
|
328
|
+
|
329
|
+
#
|
330
|
+
# 0x0098 - LensParamaters
|
331
|
+
#
|
332
|
+
class LensParameters < NikonBase
|
333
|
+
def _format0(data)
|
334
|
+
data.unpack("C*").collect{|e| e.to_i}
|
335
|
+
end
|
336
|
+
|
337
|
+
def to_hex
|
338
|
+
str = ""
|
339
|
+
@formatted.each do |dat|
|
340
|
+
str += sprintf("%02x ", dat)
|
341
|
+
end
|
342
|
+
return str
|
343
|
+
end
|
344
|
+
|
345
|
+
XLAT0 = [0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d,
|
346
|
+
0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d,
|
347
|
+
0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f,
|
348
|
+
0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f,
|
349
|
+
0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1,
|
350
|
+
0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17,
|
351
|
+
0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89,
|
352
|
+
0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f,
|
353
|
+
0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b,
|
354
|
+
0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb,
|
355
|
+
0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3,
|
356
|
+
0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f,
|
357
|
+
0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35,
|
358
|
+
0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43,
|
359
|
+
0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5,
|
360
|
+
0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7]
|
361
|
+
|
362
|
+
XLAT1 = [0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c,
|
363
|
+
0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34,
|
364
|
+
0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad,
|
365
|
+
0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05,
|
366
|
+
0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee,
|
367
|
+
0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d,
|
368
|
+
0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b,
|
369
|
+
0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b,
|
370
|
+
0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc,
|
371
|
+
0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33,
|
372
|
+
0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8,
|
373
|
+
0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6,
|
374
|
+
0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c,
|
375
|
+
0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49,
|
376
|
+
0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb,
|
377
|
+
0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f]
|
378
|
+
|
379
|
+
def to_s
|
380
|
+
data = @formatted
|
381
|
+
lens_data = ""
|
382
|
+
version = data[0, 4].pack('C*')
|
383
|
+
case version
|
384
|
+
when "0100"
|
385
|
+
lens_data = data[6, 7]
|
386
|
+
|
387
|
+
when "0101"
|
388
|
+
lens_data = data[11, 7]
|
389
|
+
|
390
|
+
when "0201", "0202", "0203"
|
391
|
+
decryptted = decrypt_data(data[4..(data.length - 1)], @@nikon_serial_no, @@release_count)
|
392
|
+
lens_data = decryptted[7, 7]
|
393
|
+
|
394
|
+
when "0204"
|
395
|
+
decryptted = decrypt_data(data[4..(data.length - 1)], @@nikon_serial_no, @@release_count)
|
396
|
+
lens_data = decryptted[8, 7]
|
397
|
+
end
|
398
|
+
|
399
|
+
return "" if lens_data.length == 0
|
400
|
+
|
401
|
+
self.extend NikonFmount
|
402
|
+
ret = Tag::NikonFmount::LensName[lens_data]
|
403
|
+
return ret != nil ? ret : ""
|
404
|
+
|
405
|
+
end
|
406
|
+
|
407
|
+
def decrypt_data(data, serial, count)
|
408
|
+
serialno = serial.to_i
|
409
|
+
if serialno == 0
|
410
|
+
if serial[0,3] == "D50"
|
411
|
+
serialno = 0x22
|
412
|
+
else
|
413
|
+
serialno = 0x60
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
key = 0
|
418
|
+
4.times do |i|
|
419
|
+
key ^= ((count >> (i*8)) & 0xff)
|
420
|
+
end
|
421
|
+
|
422
|
+
ci = XLAT0[serialno & 0xff]
|
423
|
+
cj = XLAT1[key]
|
424
|
+
ck = 0x60;
|
425
|
+
pdata = []
|
426
|
+
|
427
|
+
data.each do |dat|
|
428
|
+
cj += ((ci * ck) & 0xff)
|
429
|
+
cj &= 0xff
|
430
|
+
ck += 1
|
431
|
+
pdata.push(dat ^= cj)
|
432
|
+
end
|
433
|
+
|
434
|
+
return pdata
|
435
|
+
end
|
436
|
+
end
|
437
|
+
|
438
|
+
#
|
439
|
+
# 0x00a7 - ReleaseCount
|
440
|
+
#
|
441
|
+
class ReleaseCount < NikonBase
|
442
|
+
def processData
|
443
|
+
super
|
444
|
+
@@release_count = @formatted # This value is used for LensParamaters tag.
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
448
|
+
#
|
449
|
+
# 0x00a9 - ImageOptimization
|
450
|
+
#
|
451
|
+
class ImageOptimization < Base
|
452
|
+
end
|
453
|
+
|
454
|
+
#
|
455
|
+
# 0x00aa - Saturation
|
456
|
+
#
|
457
|
+
class Saturation < Base
|
458
|
+
end
|
459
|
+
|
460
|
+
end
|
461
|
+
|
462
|
+
|
463
|
+
Nikon2IFDTable = {
|
464
|
+
0x0001 => MakerNote::DataVersion,
|
465
|
+
# 0x0002 => MakerNote::ISOUsed,
|
466
|
+
0x0003 => MakerNote::ColorMode,
|
467
|
+
0x0004 => MakerNote::ImageQuality,
|
468
|
+
0x0005 => MakerNote::Whitebalance,
|
469
|
+
0x0006 => MakerNote::ImageSharpening,
|
470
|
+
0x0007 => MakerNote::FocusingMode,
|
471
|
+
0x0008 => MakerNote::FlashSetting,
|
472
|
+
0x0009 => MakerNote::SpeedlightMode,
|
473
|
+
0x000d => MakerNote::ProgramShift,
|
474
|
+
0x000e => MakerNote::ExposureDifference,
|
475
|
+
0x000f => MakerNote::ISOSelection,
|
476
|
+
0x0010 => MakerNote::DataDump,
|
477
|
+
0x0012 => MakerNote::SpeedlightBias,
|
478
|
+
0x001d => MakerNote::NikonCameraSerialNumber,
|
479
|
+
0x0022 => MakerNote::ActiveD_Lighting,
|
480
|
+
0x0023 => MakerNote::PictureControl,
|
481
|
+
0x0080 => MakerNote::ImageAdjustment,
|
482
|
+
0x0081 => MakerNote::ToneCompensation,
|
483
|
+
0x0082 => MakerNote::Adapter,
|
484
|
+
0x0083 => MakerNote::LensType,
|
485
|
+
0x0084 => MakerNote::LensSpecification,
|
486
|
+
0x0085 => MakerNote::ManualForcusDistance,
|
487
|
+
0x0086 => MakerNote::DigitalZoom,
|
488
|
+
0x0088 => MakerNote::AFFocusPosition,
|
489
|
+
0x008D => MakerNote::CameraColorMode,
|
490
|
+
0x008F => MakerNote::SceneMode,
|
491
|
+
0x0090 => MakerNote::LightSource,
|
492
|
+
0x0095 => MakerNote::LongtimeExposureNR,
|
493
|
+
0x0098 => MakerNote::LensParameters,
|
494
|
+
0x00a7 => MakerNote::ReleaseCount,
|
495
|
+
0x00a9 => MakerNote::ImageOptimization,
|
496
|
+
0x00aa => MakerNote::Saturation
|
497
|
+
|
498
|
+
}
|
499
|
+
|
500
|
+
end
|
501
|
+
|
502
|
+
class Nikon2
|
503
|
+
|
504
|
+
def initialize(fin, tiff_origin, dataPos, byteOrder_module)
|
505
|
+
@fin = fin
|
506
|
+
@tiffHeader0 = tiff_origin
|
507
|
+
@dataPos = dataPos
|
508
|
+
@nikonOffset = 0
|
509
|
+
|
510
|
+
@fin.pos = dataPos
|
511
|
+
magic = fin_read_n(6)
|
512
|
+
|
513
|
+
if magic == "Nikon\000"
|
514
|
+
@nikonOffset = 18 # D100, E5700, etc..
|
515
|
+
fin_read_n(4)
|
516
|
+
@tiffHeader0 = @fin.pos
|
517
|
+
bo = @fin.read(2)
|
518
|
+
case bo
|
519
|
+
when "MM"
|
520
|
+
byteOrder_module = Utils::Decode::Motorola
|
521
|
+
when "II"
|
522
|
+
byteOrder_module = Utils::Decode::Intel
|
523
|
+
else
|
524
|
+
raise RuntimeError, "Unknown byte order"
|
525
|
+
end
|
526
|
+
end
|
527
|
+
@byteOrder_module = byteOrder_module
|
528
|
+
self.extend @byteOrder_module
|
529
|
+
end
|
530
|
+
|
531
|
+
def scan_IFD
|
532
|
+
#
|
533
|
+
# Nikon D1 series MakerNote starts from 0 byte from the origin.
|
534
|
+
#
|
535
|
+
@fin.pos = @dataPos + @nikonOffset
|
536
|
+
|
537
|
+
#
|
538
|
+
# get the number of tags
|
539
|
+
#
|
540
|
+
num_dirs = decode_ushort(fin_read_n(2))
|
541
|
+
|
542
|
+
#
|
543
|
+
# now scan them
|
544
|
+
#
|
545
|
+
1.upto(num_dirs) {
|
546
|
+
curpos_tag = @fin.pos
|
547
|
+
tag = parseTagID(fin_read_n(2))
|
548
|
+
tagclass = Tag.find(tag.hex, Tag::Nikon2IFDTable)
|
549
|
+
unit, formatter = Tag::Format::Unit[decode_ushort(fin_read_n(2))]
|
550
|
+
count = decode_ulong(fin_read_n(4))
|
551
|
+
tagdata = fin_read_n(4)
|
552
|
+
obj = tagclass.new(tag, "MakerNote", count)
|
553
|
+
obj.extend formatter, @byteOrder_module
|
554
|
+
obj.pos = curpos_tag
|
555
|
+
if unit * count > 4
|
556
|
+
curpos = @fin.pos
|
557
|
+
begin
|
558
|
+
@fin.pos = @tiffHeader0 + decode_ulong(tagdata)
|
559
|
+
obj.dataPos = @fin.pos
|
560
|
+
obj.data = fin_read_n(unit*count)
|
561
|
+
ensure
|
562
|
+
@fin.pos = curpos
|
563
|
+
end
|
564
|
+
else
|
565
|
+
obj.dataPos = @fin.pos - 4
|
566
|
+
obj.data = tagdata
|
567
|
+
end
|
568
|
+
obj.processData
|
569
|
+
yield obj
|
570
|
+
}
|
571
|
+
end
|
572
|
+
|
573
|
+
private
|
574
|
+
|
575
|
+
def fin_read_n(n)
|
576
|
+
@fin.read(n)
|
577
|
+
end
|
578
|
+
|
579
|
+
end
|
580
|
+
|
581
|
+
end
|