Last active
June 9, 2019 09:15
-
-
Save skoji/240dd38fa0c30a74ecd76a8c0b2c3e19 to your computer and use it in GitHub Desktop.
Pentax RAW file to jpeg, preserving creation date
This file contains hidden or 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
filename = ARGV[0] | |
raise "specify PEF file." unless filename =~ /.PEF$/ # should change according to what you want to convert | |
raise "file #{filename} does not exists." unless File.exist?(filename) | |
stat = File::Stat.new(filename) | |
converted = filename.sub(/.PEF$/, ".jpg") | |
raise "convesion failed" unless system "convert #{filename} #{converted}" | |
File.utime(stat.mtime, stat.mtime, converted) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment