2
폴더의 모든 이미지를 자동으로 워터 마크하는 bash 스크립트가 있습니다.자동 워터 마킹 - 폴더 동작
WATERMARK="$HOME/Dropbox/logo_bw.png"
if [ ! -e "watermarked_tmp" ]
then
mkdir watermarked_tmp
fi
#loop inside all the images in folder
for image in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG
do
if [ ! -e "$image" ] # Check if file exists.
then
continue
fi
#Retrieve size of the image and divide the lenght by 2
size=`identify -format %[fx:w/4,279] $image`
#Apply the watermark and create a new image in the "watermarked" subfolder
composite -dissolve 10% -quality 100 -gravity SouthEast -background none \($WATERMARK -geometry ${size} \) ${image} watermarked_tmp/${image}
done
Automator를 사용하여이 코드에서 폴더 작업을 만들고 싶습니다. 누구든지 현재 디렉토리와 파일을 전달하는 방법을 알고 있습니까? 내가하려고 노력하지만 인수로에 줄 for image in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG
이 전체 스크립트 주셔서 감사합니다. 문제없이 실행되지만 watermarked_temp 폴더 만 생성합니다. 안쪽에 워터 마킹 된 이미지가 없습니다. – Adrian
네 말이 맞아. 나는 대본을 편집했다. 'ident'와'compose'에 대한 전체 경로를 사용해야 할 수도 있습니다. – user495470
예, 작동 중입니다. :) 한가지 더 질문 : watermarked_temp 디렉토리를 현재 디렉토리에 만들 수있는 방법이 있습니까? – Adrian