diff --git a/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh b/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh index 8917904..767e48f 100644 --- a/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh @@ -1,7 +1,10 @@ #!/bin/bash # # render_doIdentityImageBrands.sh -- This function provides -# post-rendition actions to produce CentOS brands. +# last-rendition actions to produce CentOS brands. This function takes +# both The CentOS Symbol and The CentOS Type images and produces +# variation of them in different dimensions and formats using +# ImageMagick tool-set. # # Copyright (C) 2009-2011 Alain Reguera Delgado # @@ -29,22 +32,54 @@ function render_doIdentityImageBrands { local SOURCEFILE='' local TARGETDIR='' local TARGETFILE='' + local NEWFILE='' # Define absolute path to image file. local FILE="$1" - # Define image formats. - local FORMATS="$2" + # Define height dimensions you want to produce brands for. + local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" - # Create logo copy in defined formats. - render_doIdentityImageFormats "$FILE" "$FORMATS" + # Define image formats you want to produce brands for. + local FORMATS="png xpm pdf jpg tif" - # Create logo copy in 2 colors. - cli_printMessage "${FILE}.xbm (`gettext "2 colors grayscale"`)" "AsSavedAsLine" - convert -colorspace gray -colors 2 ${FILE}.png ${FILE}.xbm + # Redefine absolute path to directory where final brand images + # will be stored. Notice how both final image directory and design + # model have the same name, this is intentional in order to keep + # images and design models related and organized inside their own + # directory structures. + local DIRNAME=$(cli_getRepoName "$FILE" 'd')/$(cli_getRepoName "$FILE" 'fd') - # Create logo copy in emboss effect. - cli_printMessage "${FILE}-emboss.png" "AsSavedAsLine" - convert -emboss 1 ${FILE}.png ${FILE}-emboss.png + # Check directory where final brand images will be stored. + if [[ ! -d $DIRNAME ]];then + mkdir -p ${DIRNAME} + fi + for SIZE in ${SIZES};do + + # Redefine name of new file. + NEWFILE=${DIRNAME}/${SIZE} + + for FORMAT in ${FORMATS};do + + # Output action information. + cli_printMessage "${NEWFILE}.${FORMAT}" "AsCreatingLine" + + # Convert and resize to create new file. + convert -resize x${SIZE} ${FILE}.png ${NEWFILE}.${FORMAT} + + done + + # Create logo copy in 2 colors. + cli_printMessage "${NEWFILE}.xbm (`gettext "2 colors grayscale"`)" "AsCreatingLine" + convert -resize x${SIZE} -colorspace gray -colors 2 ${FILE}.png ${NEWFILE}.xbm + + # Create logo copy in emboss effect. + cli_printMessage "${NEWFILE}-emboss.png" "AsCreatingLine" + convert -resize x${SIZE} -emboss 1 ${FILE}.png ${NEWFILE}-emboss.png + + done + + # Output division line. + cli_printMessage '-' 'AsSeparatorLine' }