]> Sergey Matveev's repositories - galgen.git/commitdiff
ExifTool is able to produce HTML
authorSergey Matveev <stargrave@stargrave.org>
Wed, 22 Feb 2023 09:28:47 +0000 (12:28 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 22 Feb 2023 09:28:47 +0000 (12:28 +0300)
galgen.zsh

index 55e24e84300dc39da2d62a4b82ec8a9bf5289421..8124fd8554016b2fa6adb7c8d77eb82b9d3a0077 100755 (executable)
@@ -7,6 +7,15 @@ pagesize=${PAGESIZE:-100}
 ordering=${ORDERING:-Om}
 style=$STYLE
 
+exifTagsOmit=(
+    ExifToolVersion
+    Directory
+    FileAccessDate
+    FileAttributes
+    FileInodeChangeDate
+    FilePermissions
+)
+
 djxl2ppm() {
     djxl $1 $1.ppm
     [[ -r ${1}-ec0.ppm ]] || return 0
@@ -69,9 +78,9 @@ EOF
         echo "</pre>" >> $dst
         [[ -r $img.preview.webp ]] || dwebp $img -ppm -o $img.ppm
     fi
-    echo "<hr/><pre>" >> $dst
-    exiftool -a -u -g1 $img >> $dst
-    echo "</pre>" >> $dst
+    echo "<hr/>" >> $dst
+    exiftool -escapeHTML -htmlFormat -groupHeadings \
+        --${=${(j/ --/)exifTagsOmit}} $img >> $dst
     [[ -r $img.ppm ]] && {
         pnmscale -w 100 < $img.ppm > $img.ppm.ppm
         mv $img.ppm.ppm $img.ppm