...
|
...
|
@@ -33,28 +33,26 @@ for ((g=0; g<${#galerie[@]}; g++)); do
|
33
|
33
|
for image in $(mysql -N -u $dbuser -p${dbpasswd} $dbname <<< $sqlcmd); do
|
34
|
34
|
eval "$image"
|
35
|
35
|
format=""
|
36
|
|
- file=${file/$sourceDir}
|
37
|
36
|
fnNoExt="${file%.*}"
|
38
|
37
|
fnExt="${file##*.}"
|
39
|
38
|
fnPath="${file%/*}"
|
40
|
|
- fnPath="${fnPath#$sourceDir}"
|
41
|
|
- fnNoExt="${fnNoExt#$sourceDir}"
|
42
|
|
- mkdir -p $destDir/$sourceDir/$fnPath
|
|
39
|
+ mkdir -p $destDir/$fnPath
|
43
|
40
|
cmd="nice -n20 convert $site/$file -write mpr:image +delete "
|
44
|
41
|
for ((i=0; i<${#imgsize[@]}; i+=3)); do
|
45
|
|
- if ! test -e ${destDir}/${sourceDir}/${fnNoExt}-${imgsize[i]:0:2}.$fnExt; then
|
|
42
|
+ if ! test -e ${destDir}/${fnNoExt}-${imgsize[i]:0:2}.$fnExt; then
|
46
|
43
|
format+="${imgsize[i]} "
|
47
|
44
|
cmd+="mpr:image -filter Lanczos -strip -quality 95 -interlace line -sampling-factor 4:2:2 "
|
48
|
45
|
if test $rotation -ne 0; then
|
49
|
46
|
cmd+="-rotate -$rotation -orient top-left "
|
50
|
47
|
fi
|
51
|
|
- cmd+="-resize ${imgsize[i+1]}x${imgsize[i+2]} -write ${destDir}/${sourceDir}/${fnNoExt}-${imgsize[i]:0:2}.$fnExt +delete "
|
|
48
|
+ cmd+="-resize ${imgsize[i+1]}x${imgsize[i+2]} -write ${destDir}/${fnNoExt}-${imgsize[i]:0:2}.$fnExt +delete "
|
52
|
49
|
fi
|
53
|
50
|
done
|
54
|
51
|
cmd=$(sed 's/\s*+delete\s*$//' <<< $cmd)
|
55
|
52
|
if test -n "$format"; then
|
56
|
53
|
echo "$site/$file : $format"
|
57
|
54
|
eval "$(echo -e $cmd)"
|
|
55
|
+ echo done
|
58
|
56
|
sleep 30
|
59
|
57
|
fi
|
60
|
58
|
done
|