Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-09-16 02:17:13

birch
Member
Registered: 2014-07-12
Posts: 63

[Solved] Thunar Custom Action - Cwebp

I need a Custom Action which will allow me to convert images to the webp format using cwebp.

This is the command I use to convert images to webp using the command line:

for F in /home/$USER/Pictures/grain/*.jpg ; do cwebp $F -o /home/$USER/Pictures/grain/`basename ${F%.jpg}
`aa%04d.webp ; done

Offline

#2 2014-09-16 15:54:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Thunar Custom Action - Cwebp

Try (with test images):

for file in %F; do cwebp "$file" -o "${file%%.*}".webp; done

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2014-09-16 16:42:35

birch
Member
Registered: 2014-07-12
Posts: 63

Re: [Solved] Thunar Custom Action - Cwebp

Thanks, that works great! Could you add a command to the command that would place the converted files in a subfolder of the working directory?

Offline

#4 2014-09-16 23:04:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Thunar Custom Action - Cwebp

This looks like it works:

mkdir %d/webp && cd %d; for file in %N; do cwebp "$file" -o "webp/${file%%.*}".webp; done

...this should create a webp folder as a subfolder and contain the converted files.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2014-09-17 02:23:28

birch
Member
Registered: 2014-07-12
Posts: 63

Re: [Solved] Thunar Custom Action - Cwebp

Tx, that works great!

Offline

Board footer

Powered by FluxBB