Adding support for png images
This commit is contained in:
@@ -22,7 +22,7 @@ STARTTIME=$(date +%s)
|
||||
# drop CIFS cache in case target files existed before
|
||||
#sync; echo 3 > /proc/sys/vm/drop_caches;
|
||||
|
||||
for file in "$sourceDir"/**/*.{jpg,JPG,jpeg,JPEG}
|
||||
for file in "$sourceDir"/**/*.{jpg,JPG,jpeg,JPEG,png,PNG}
|
||||
do
|
||||
if [[ ! -f "$file" ]]
|
||||
then
|
||||
@@ -52,12 +52,16 @@ do
|
||||
|
||||
mkdir -p "${destDir}${fnPath}"
|
||||
|
||||
# image format specific checks to display warnings
|
||||
exp='\.(png|PNG)$'
|
||||
if [[ ! "$file" =~ $exp ]] ; then
|
||||
#Error checking
|
||||
result=$(jpeginfo -c "$file")
|
||||
if [[ $result != *"[OK]"* ]]
|
||||
then
|
||||
echo $result
|
||||
fi
|
||||
fi
|
||||
|
||||
#auto rotate source image according to exif orientation information
|
||||
orient=$(exiftool -Orientation "${file}")
|
||||
@@ -66,6 +70,7 @@ do
|
||||
if [ "$quali" -le "0" ]; then
|
||||
quali=94
|
||||
fi
|
||||
|
||||
echo "rotate with quality $quali preserving timestamp: $file"
|
||||
TIMESTAMP="$( ls -l --time-style='+%Y%m%d%H%M.%S' "${file}" | cut --delimiter=' ' --fields=6 )"
|
||||
mogrify -auto-orient -quality ${quali} "${file}"
|
||||
|
Reference in New Issue
Block a user