shithub: img

Download patch

ref: 2fa650c0e4cbbf0777eb10d91c0f4018cada9bb1
parent: b24df14003cf4b8e6c6a5725531b859ba93c2303
author: Alex Musolino <[email protected]>
date: Mon Nov 14 10:12:58 EST 2022

add support for ingestion of HEIC files

--- a/sdrip/archive.rc
+++ b/sdrip/archive.rc
@@ -1,6 +1,6 @@
 #!/bin/rc
 
-ls *.JPG | awk -F_ '{
+ls *.JPG *.HEIC | awk -F_ '{
 	year=substr($1, 1, 4)
 	month=substr($1, 5, 2)
 	dirs[sprintf("%s/%s", year, month)] = 1
--- a/sdrip/rename.rc
+++ b/sdrip/rename.rc
@@ -1,9 +1,9 @@
 #!/bin/rc -e
 
 rename jpg JPG *.jpg >[2]/dev/null || {}
-exiv2 --verbose --Force -t rename *.JPG
+exiv2 --verbose --Force -t rename *.JPG *.HEIC
 
-sha1sum *.JPG *.jpg >[2]/dev/null | awk '
+sha1sum *.JPG *.HEIC >[2]/dev/null | awk '
 function quote(s){
 	gsub("''", "''''", s)
 	return sprintf("%s", s)
@@ -11,5 +11,7 @@
 {
 	hash=substr($1, 1, 8)
 	date=substr($2, 1, 15)
-	printf "mv %s %s.%s.full.JPG\n", quote($2), date, hash
+	match($2, ".[A-Z]+$")
+	fext=substr($2, RSTART+1, RLENGTH-1)
+	printf "mv %s %s.%s.full.%s\n", quote($2), date, hash, fext
 }' | rc