feat: more f2 and vips

main
sudo pacman -Syu 2024-05-13 12:14:40 +07:00
parent 5f268f8557
commit 74ab76b545
2 changed files with 14 additions and 6 deletions

View File

@ -452,10 +452,10 @@ rsync -avzP src/ dst</pre>
<p>Rename:</p>
<div class="highlight highlight-source-shell">
<pre><span class="pl-c"><span class="pl-c">#</span> If dry run, remove --exec</span>
f2 --replace <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}{ext}<span class="pl-pds">"</span></span> --fix-conflicts --exec
f2 --replace <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}{ext}<span class="pl-pds">"</span></span> --fix-conflicts --fix-conflicts-pattern <span class="pl-s"><span class="pl-pds">"</span>_%02d<span class="pl-pds">"</span></span> --exec
<span class="pl-c"><span class="pl-c">#</span> Include ImageSize (require exiftool)</span>
f2 --replace <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}{ext}<span class="pl-pds">"</span></span> --fix-conflicts --exec
f2 --replace <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}{ext}<span class="pl-pds">"</span></span> --fix-conflicts --fix-conflicts-pattern <span class="pl-s"><span class="pl-pds">"</span>_%02d<span class="pl-pds">"</span></span> --exec
<span class="pl-c"><span class="pl-c">#</span> Remove space in directory</span>
f2 --find <span class="pl-s"><span class="pl-pds">"</span> <span class="pl-pds">"</span></span> --replace <span class="pl-s"><span class="pl-pds">"</span>_<span class="pl-pds">"</span></span> --string-mode --only-dir --exec</pre>
@ -474,11 +474,15 @@ f2 --find <span class="pl-s"><span class="pl-pds">"</span> <span class="pl-pds">
</div>
<p>Convert:</p>
<div class="highlight highlight-source-shell">
<pre>vips jxlsave filename.jpg filename.jxl --keep=none
<pre><span class="pl-c"><span class="pl-c">#</span> Add --vips-progress to show progress</span>
vips jxlsave filename.jpg filename.jxl --keep=none
<span class="pl-c"><span class="pl-c">#</span> Batch convert (require fd)</span>
fd <span class="pl-s"><span class="pl-pds">"</span>jpg|jpeg|png|webp<span class="pl-pds">"</span></span> --exec vips jxlsave {} {.}.jxl --keep=none
fd <span class="pl-s"><span class="pl-pds">"</span>jpg|jpeg|png|webp<span class="pl-pds">"</span></span> --exec-batch rm</pre>
fd <span class="pl-s"><span class="pl-pds">"</span>jpg|jpeg|png|webp<span class="pl-pds">"</span></span> --exec-batch rm
<span class="pl-c"><span class="pl-c">#</span> Rotate</span>
vips rot filename.jxl new_filename.jxl d90</pre>
</div>
<div>

View File

@ -323,10 +323,10 @@ Rename:
```sh
# If dry run, remove --exec
f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}{ext}" --fix-conflicts --exec
f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}{ext}" --fix-conflicts --fix-conflicts-pattern "_%02d" --exec
# Include ImageSize (require exiftool)
f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}{ext}" --fix-conflicts --exec
f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}{ext}" --fix-conflicts --fix-conflicts-pattern "_%02d" --exec
# Remove space in directory
f2 --find " " --replace "_" --string-mode --only-dir --exec
@ -337,9 +337,13 @@ f2 --find " " --replace "_" --string-mode --only-dir --exec
Convert:
```sh
# Add --vips-progress to show progress
vips jxlsave filename.jpg filename.jxl --keep=none
# Batch convert (require fd)
fd "jpg|jpeg|png|webp" --exec vips jxlsave {} {.}.jxl --keep=none
fd "jpg|jpeg|png|webp" --exec-batch rm
# Rotate
vips rot filename.jxl new_filename.jxl d90
```