more comments
This commit is contained in:
parent
227b48bd41
commit
83ee37675a
@ -134,9 +134,10 @@ convert_image() {
|
|||||||
local wight=`${CMD_identify} -format "%w" $src`
|
local wight=`${CMD_identify} -format "%w" $src`
|
||||||
${CMD_identify} -format "%wx%h" $src
|
${CMD_identify} -format "%wx%h" $src
|
||||||
|
|
||||||
|
# first resize the image to the new aspect ratio and add white borders
|
||||||
if [ $wight -lt $hight ] ; then
|
if [ $wight -lt $hight ] ; then
|
||||||
# Its higher so force x160 and let imagemagic decide the right wight
|
# Its higher so force x160 and let imagemagic decide the right wight
|
||||||
# then add transparency to the rest of the image to fit 160x160
|
# then add white to the rest of the image to fit 160x160
|
||||||
log_debug "Icon Wight: $wight < Hight: $hight"
|
log_debug "Icon Wight: $wight < Hight: $hight"
|
||||||
convert $src -colorspace RGB -resize x160 \
|
convert $src -colorspace RGB -resize x160 \
|
||||||
-size 160x160 xc:white +swap -gravity center -composite \
|
-size 160x160 xc:white +swap -gravity center -composite \
|
||||||
@ -144,7 +145,7 @@ convert_image() {
|
|||||||
builder_check_error "converting image"
|
builder_check_error "converting image"
|
||||||
elif [ $wight -gt $hight ] ; then
|
elif [ $wight -gt $hight ] ; then
|
||||||
# Its wider so force 160x and let imagemagic decide the right hight
|
# Its wider so force 160x and let imagemagic decide the right hight
|
||||||
# then add transparency to the rest of the image to fit 160x160
|
# then add white to the rest of the image to fit 160x160
|
||||||
log_debug "Icon Wight: $wight > Hight: $hight"
|
log_debug "Icon Wight: $wight > Hight: $hight"
|
||||||
convert $src -colorspace RGB -resize 160x \
|
convert $src -colorspace RGB -resize 160x \
|
||||||
-size 160x160 xc:white +swap -gravity center -composite \
|
-size 160x160 xc:white +swap -gravity center -composite \
|
||||||
|
Loading…
Reference in New Issue
Block a user