-
-
Save scarwu/f0a6ba04de523d6e814f4a27839f51ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
case "${1}" in | |
zm35) | |
export LENS_NAME="Carl Zeiss Distagon T* 35mm F1.4 ZM" | |
export FOCAL_LENGTH="35" | |
export APERTURE_VALUE="1.4" | |
;; | |
km35) | |
export LENS_NAME="Konica M-Hexanon 35mm F2" | |
export FOCAL_LENGTH="35" | |
export APERTURE_VALUE="2" | |
;; | |
vm35) | |
export LENS_NAME="Voigtlander Nokton Classic 35mm F1.4" | |
export FOCAL_LENGTH="35" | |
export APERTURE_VALUE="1.4" | |
;; | |
vm15) | |
export LENS_NAME="Voigtlander Super Wide-Heliar Aspherical III 15mm F4.5" | |
export FOCAL_LENGTH="15" | |
export APERTURE_VALUE="4.5" | |
;; | |
pk50) | |
export LENS_NAME="SMC Pentax-M 50mm F1.4" | |
export FOCAL_LENGTH="50" | |
export APERTURE_VALUE="1.4" | |
;; | |
lomo32) | |
export LENS_NAME="Lomogon 32mm F2.5 Art Lens" | |
export FOCAL_LENGTH="32" | |
export APERTURE_VALUE="2.5" | |
;; | |
*) | |
echo $"Usage: $0 <zm35|km35|vm35|vm15|pk50|lomo32> <?path>" | |
exit 1 | |
esac | |
if [ "" != "${2}" ]; then | |
export TARGET_PATH="${2}" | |
else | |
export TARGET_PATH=`pwd` | |
fi | |
if [ ! -d "${TARGET_PATH}" ]; then | |
echo "Path is't folder or not exists" | |
exit 1 | |
fi | |
echo "Target Path: ${TARGET_PATH}" | |
echo "Lens Name: ${LENS_NAME}" | |
echo "Focal Length: ${FOCAL_LENGTH}" | |
echo "Aperture Value: ${APERTURE_VALUE}" | |
echo -e "\nIs above information correct? [Y/n] \c" | |
read ANWSER | |
if [ "n" == "${ANWSER}" ]; then | |
exit 1 | |
fi | |
echo "" | |
for FILENAME in "${TARGET_PATH}"/*.jpg; do | |
if [ ! -f "${FILENAME}" ]; then | |
continue | |
fi | |
echo "${FILENAME}" | |
exiftool -overwrite_original \ | |
-Lens="${LENS_NAME}" \ | |
-LensModel="${LENS_NAME}" \ | |
-XMP-microsoft:LensModel="${LENS_NAME}" \ | |
-LensInfo="${FOCAL_LENGTH}mm f/${APERTURE_VALUE}" \ | |
-FocalLength="${FOCAL_LENGTH}.0" \ | |
-FocalLengthIn35mmFormat="${FOCAL_LENGTH}" \ | |
-MaxApertureValue="${APERTURE_VALUE}" \ | |
-ApertureValue="" \ | |
-FNumber="" \ | |
-LensID="" \ | |
"${FILENAME}" 1> /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment