Updated config
This commit is contained in:
parent
7085c0afa9
commit
7547ef0ff1
11 changed files with 127 additions and 6 deletions
24
.config/fish/scripts/jpgtoavif
Executable file
24
.config/fish/scripts/jpgtoavif
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/fish
|
||||
|
||||
if not set -q argv[1]
|
||||
echo "Usage: $argv[0] /path/to/search"
|
||||
exit 1
|
||||
end
|
||||
|
||||
for jpg in (find $argv[1] -type f -name '*.jpg')
|
||||
set avif (string replace -r '\.jpg$' '.avif' $jpg)
|
||||
|
||||
if test -f $avif
|
||||
echo Skip $avif
|
||||
continue
|
||||
end
|
||||
|
||||
echo Converting $jpg to $avif
|
||||
avifenc $jpg $avif
|
||||
|
||||
set json "$jpg.JSON"
|
||||
if test -f $json
|
||||
echo Renaming JSON $json to "$avif.JSON"
|
||||
mv $json "$avif.JSON"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue