diff options
author | ダカマ <dakama@kakeranoumi.xyz> | 2025-06-02 13:08:46 +0200 |
---|---|---|
committer | ダカマ <dakama@kakeranoumi.xyz> | 2025-06-02 13:08:46 +0200 |
commit | 14a892e627a375334a02381351f139d94ad7ecf3 (patch) | |
tree | e7c1ee5040f3076f57401b3b9e9eb567e2ecfb1a /scriptlets/unwebp.sh |
Diffstat (limited to 'scriptlets/unwebp.sh')
-rwxr-xr-x | scriptlets/unwebp.sh | 8 |
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 |