Skip to content

Commit

Permalink
Create remove-crunch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wiwikuan authored May 1, 2024
1 parent b9ead32 commit a56646a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions remove-crunch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash

# 這個 bash 腳本的目的是移除 PNG 圖片檔名中的 "-crunch" 後綴
# 通常這個後綴是由 PNG 壓縮軟體 crunch 在壓縮圖片時自動添加的
# 執行此腳本可以批次將當前目錄中所有符合 "*-crunch.png" 模式的圖片檔重新命名
# 移除其檔名中的 "-crunch" 部分,還原為原始的檔名
# 注意,這會覆寫原始的 PNG 檔案

for file in *-crunch.png; do mv "$file" "${file/-crunch/}"; done

0 comments on commit a56646a

Please sign in to comment.