Skip to content

Instantly share code, notes, and snippets.

View prgrmr-yn's full-sized avatar

yat prgrmr-yn

View GitHub Profile
@rietta
rietta / batch-convert-heic.rb
Created July 6, 2021 22:47
Shell script to batch convert HEIC files to jpeg, leaving the original and its converted side by side. Requires Mac OS or Linux, the find command line tool, and ImageMagick
#!/usr/bin/env ruby
require 'shellwords'
files = `find . -iname '*.heic'`.split("\n")
files.each do |original_file|
output_file = original_file.gsub(/\.heic\z/i, ' Converted.jpg')
if File.exist?(output_file)
STDERR.puts "Skipping output #{output_file} exists."
else