diff --git a/piwigo_thumbgen.sh b/piwigo_thumbgen.sh index 57575f3..716308f 100755 --- a/piwigo_thumbgen.sh +++ b/piwigo_thumbgen.sh @@ -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,11 +52,15 @@ do mkdir -p "${destDir}${fnPath}" - #Error checking - result=$(jpeginfo -c "$file") - if [[ $result != *"[OK]"* ]] - then - echo $result + # 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 @@ -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}"