# exiftool拷貝資訊 ###### tags: `影像` Ubuntu 22.04安裝套件 `sudo apt install libimage-exiftool-perl` ## 顯示exif資訊 用法 `exiftool 圖檔路徑` - `-htmlDump` 輸出成html,這會有hexdump和互動 - `-b` 輸出成二進位資料 - `-sort` 欄位依照文字排序 實用參數 `exiftool 圖檔路徑 -sort > info.txt` `exiftool 圖檔路徑 -htmlDump > info.html` ### -htmlDump的樣式  ### -sort的樣式  ## 拷貝exif資訊 拷貝有三種模式 - 預設 `-G0:1` (實測是預設選項) - ALL `'-all:all>all:all'` 這裡因為有>符號,所以要用引號刮起來使用 - EXIF `-exif` 實測影像  因為不清楚三者差異,所以這裡只用容量來看 模式|檔案大小|備註 ---|---|--- 原始|722,096| 預設(-G0:1)|729,072|大 ALL|723,185|小 EXIF|723,213|中 **實驗script** 這裡用-o輸出成不同檔案 ```bash #!/usr/bin/bash src=$1 dst=$2 exiftool -TagsFromFile "$src" "$dst" -o "none-$dst" exiftool -TagsFromFile "$src" -G0:1 "$dst" -o "g01-$dst" exiftool -TagsFromFile "$src" -exif "$dst" -o "exif-$dst" exiftool -TagsFromFile "$src" '-all:all>all:all' "$dst" -o "all-$dst" ``` ## 拷貝script 加上-overwrite_original直接更新到原本的目標檔案上 ```bash #!/usr/bin/bash src=$1 dst=$2 exiftool -TagsFromFile "$src" -overwrite_original "$dst" ``` 用法: `copyExif.sh <來源圖檔> <目標圖檔>`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up