Please write an linux shell script: First, enter d...
創建於:2025年6月23日
創建於:2025年6月23日
Please write an linux shell script:
First, enter directory /storage/emulated/0/Pictures/Raw, Then, run commands:
exiftool -overwrite_original -m -ForwardMatrix1="0.6953125 0.140625 0.125 0.2265625 0.8984375 -0.125 -0.0078125 -0.3515625 1.1796875" example.dng
exiftool -overwrite_original -m -ForwardMatrix2="0.6953125 0.140625 0.125 0.2265625 0.8984375 -0.125 -0.0078125 -0.3515625 1.1796875" example.dng
exiftool -overwrite_original -m -ProfileHueSatMapData1= example.dng
exiftool -overwrite_original -m -ProfileHueSatMapData2= example.dng
Replace example.dng to a wildcard that matches all dng files in the directory.
Here’s a compact Bash script that changes to the Raw folder and updates every .dng
file in one go:
bash#!/usr/bin/env bash # tweak_dng_forward_matrices.sh # Applies updated Forward Matrix and clears Hue/Sat maps for every .dng in the Raw folder. set -euo pipefail RAW_DIR="/storage/emulated/0/Pictures/Raw" # Ensure the target directory exists cd "$RAW_DIR" || { echo "❌ Folder not found: $RAW_DIR"; exit 1; } # Run a single exiftool command on all DNGs exiftool -overwrite_original -m \ -ForwardMatrix1="0.6953125 0.140625 0.125 0.2265625 0.8984375 -0.125 -0.0078125 -0.3515625 1.1796875" \ -ForwardMatrix2="0.6953125 0.140625 0.125 0.2265625 0.8984375 -0.125 -0.0078125 -0.3515625 1.1796875" \ -ProfileHueSatMapData1= \ -ProfileHueSatMapData2= \ *.dng echo "✅ Forward matrices updated and hue/sat maps cleared for all .dng files in $RAW_DIR"
How to use
tweak_dng_forward_matrices.sh
.bashchmod +x tweak_dng_forward_matrices.sh
bash./tweak_dng_forward_matrices.sh
The single exiftool
invocation is faster than looping, and the wildcard *.dng
targets every DNG in the directory as you requested.