Created
August 2, 2023 21:06
-
-
Save sylph01/ed619007b7877ca45740ed44795fc03b to your computer and use it in GitHub Desktop.
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 'exif' | |
require 'json' | |
h = {} | |
Dir.glob('*.JPG') do |fname| | |
data = Exif::Data.new(File.open(fname)) | |
h[fname] = { | |
focal_length: data.focal_length.to_i, | |
iso_speed_ratings: data.iso_speed_ratings, | |
f_number: data.fnumber.to_f | |
} | |
end | |
File.write('exif_stats.json', h.to_json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment