by michaelbryzek · 11mo ago · 0 comments
#!/usr/bin/env ruby
def run(extension)
files = `find . -type f -name "\*.# {extension}"`.split("\n")
files.each do |f|
jpg = f.sub(/\.#{extension}/i, '.jpg')
if !File.exist?(jpg)
cmd = "sips -s format jpeg '#{f}' --out '#{jpg}'"
`#{cmd}`
puts cmd
end
end
end
run("HEIC")
run("heic") magick mogrify -format JPG *.heic *.HEIC