File: copy_icc_profile.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 (20 lines) | stat: -rw-r--r-- 460 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
# -- encoding: utf-8 --
require 'mini_exiftool'

if ARGV.size < 2
  puts "usage: ruby #{__FILE__} SOURCE_FILE TARGET_FILE"
  exit -1
end

source_filename, target_filename = ARGV

begin
  photo = MiniExiftool.new filename
  # The second parameter of MiniExiftool#copy_tags_from
  # could be a String, Symbol or an Array of Strings,
  # Symbols
  photo.copy_tags_from(target, 'icc_profile')
rescue MiniExiftool::Error => e
  $stderr.puts e.message
  exit -1
end