Created
November 19, 2014 14:54
-
-
Save lehanto/fedd582307b3dc58385a to your computer and use it in GitHub Desktop.
ruby exifr example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'exifr' | |
@exif = EXIFR::JPEG::new('hoge.jpg') | |
# カメラ機種 | |
puts "カメラ:#{@exif.model}" | |
# シャッタースピード | |
puts "S速:#{@exif.exposure_time.to_s}" | |
# F値 | |
puts "F値:#{@exif.f_number.to_f.to_s}" | |
# レンズ焦点距離 | |
puts "焦点距離:#{@exif.focal_length.to_i}" | |
# 35mm換算焦点距離 | |
puts "35mm換算:#{@exif.focal_length_in_35mm_film.to_i}" | |
# ISO感度 | |
puts "ISO感度:#{@exif.iso_speed_ratings}" | |
# ファイル更新日時 | |
puts "更新日時:#{@exif.date_time}" | |
# 撮影日時 | |
puts "撮影日時:#{@exif.date_time_original}" | |
# 縦横 | |
puts "横幅:#{@exif.pixel_x_dimension}" | |
puts "縦幅:#{@exif.pixel_y_dimension}" | |
#GPS緯度、経度 | |
puts "GPS緯度:#{@exif.gps.latitude}" | |
puts "GPS経度:#{@exif.gps.longitude}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment