To Webp Function
A simple for loop to make using globs easier with cwebp.
function towebp -d "Convert image files to web with cweb"
for SOURCE_IMAGE in $argv
set OUTPUT (path change-extension webp $SOURCE_IMAGE)
cwebp $SOURCE_IMAGE -o $OUTPUT
end
end
I'm pretty sure I saw a one-liner to do this (using pipes) but it was hard to understand so I thought this would make it clearer to myself what is going on, rather than just copying a command I can't figure out.