summaryrefslogtreecommitdiff
path: root/scriptlets/unwebp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scriptlets/unwebp.sh')
-rwxr-xr-xscriptlets/unwebp.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scriptlets/unwebp.sh b/scriptlets/unwebp.sh
new file mode 100755
index 0000000..49d8f5a
--- /dev/null
+++ b/scriptlets/unwebp.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+find "$PWD" -type f -name '*webp' -print0 | \
+ while IFS= read -r -d '' file; do
+ newfile=$( echo "$file" | sed -r "s|nhentai_[0-9]+_0||g; s|\.webp$|.png|")
+ printf '%s ---> %s\n' "$file" "$newfile"
+ magick "$file" "$newfile" && rm -f "$file"
+ done