File: external_photo.rb

package info (click to toggle)
ruby-mini-exiftool 2.9.0-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 688 kB
  • sloc: ruby: 2,616; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -- encoding: utf-8 --
require 'open-uri'
require 'rubygems'
require 'mini_exiftool'

unless ARGV.size == 1
  puts "usage: ruby #{__FILE__} URI"
  puts " i.e.: ruby #{__FILE__} http://www.23hq.com/janfri/photo/1535332/large"
  exit -1
end

# Fetch an external photo
filename = open(ARGV.first).path

# Read the metadata
photo = MiniExiftool.new filename

# Print the metadata
photo.tags.sort.each do |tag|
#  puts "#{tag}: #{photo[tag]}"
  puts tag.ljust(28) + photo[tag].to_s
end