add an white border to the source image so if the images goes to the corners it will have

an white border to work on on convertiong the white to transparent
This commit is contained in:
Mario Fetka 2013-03-11 19:31:52 +01:00
parent d7318c9306
commit 8e01c00a60
2 changed files with 7 additions and 10 deletions

View File

@ -148,12 +148,15 @@ convert_image() {
local wight=`${CMD_identify} -format "%w" $src`
${CMD_identify} -format "%wx%h" $src
# Add a white border to the image so that the convert to stansparent can go around an image
convert -bordercolor White -border 3x3 $src $OUTPUT_DIR/bigger.png
# first resize the image to the new aspect ratio and add white borders
if [ $wight -lt $hight ] ; then
# Its higher so force x160 and let imagemagic decide the right wight
# then add white to the rest of the image to fit 160x160
log_debug "Icon Wight: $wight < Hight: $hight"
convert $src -colorspace RGB -resize x160 \
convert $OUTPUT_DIR/bigger.png -colorspace RGB -resize x160 \
-size 160x160 xc:white +swap -gravity center -composite \
-modulate 110 -colors 256 png8:$OUTPUT_DIR/resize.png
builder_check_error "converting image"
@ -161,14 +164,14 @@ convert_image() {
# Its wider so force 160x and let imagemagic decide the right hight
# then add white to the rest of the image to fit 160x160
log_debug "Icon Wight: $wight > Hight: $hight"
convert $src -colorspace RGB -resize 160x \
convert $OUTPUT_DIR/bigger.png -colorspace RGB -resize 160x \
-size 160x160 xc:white +swap -gravity center -composite \
-modulate 110 -colors 256 png8:$OUTPUT_DIR/resize.png
builder_check_error "converting image"
elif [ $wight -eq $hight ] ; then
# Its scare so force 160x160
log_debug "Icon Wight: $wight = Hight: $hight"
convert $src -colorspace RGB -resize 160x160 \
convert $OUTPUT_DIR/bigger.png -colorspace RGB -resize 160x160 \
-size 160x160 xc:white +swap -gravity center -composite \
-modulate 110 -colors 256 png8:$OUTPUT_DIR/resize.png
builder_check_error "converting image"
@ -176,7 +179,7 @@ convert_image() {
# Imagemagic is unable to detect the aspect ratio so just force 160x160
# this could result in streched images
log_debug "Icon Wight: $wight unknown Hight: $hight"
convert $src -colorspace RGB -resize 160x160 \
convert $OUTPUT_DIR/bigger.png -colorspace RGB -resize 160x160 \
-size 160x160 xc:white +swap -gravity center -composite \
-modulate 110 -colors 256 png8:$OUTPUT_DIR/resize.png
builder_check_error "converting image"

View File

@ -120,12 +120,6 @@ delete -sf "$InstallDir32$\"
; === Inno Setup ========================================================================================
; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES /nocancel
[Winbatch_uninstall_msi_old_64]
msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi_64]
msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress
[Files_uninstall_64]
; Example for recursively deleting the installation directory:
;