From e660d0cddacd9fb91814307f2a4de17dd1ce5d61 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Oct 27 2010 08:54:17 +0000 Subject: Update render_doIdentityImageBrands.sh: - Before this commit, '*.xbm' and '*-emboss.png' images produced by render_doIdentityImageBrands post-rendering action were stored all together in the same location. - In this commit, '*.xbm' images are stored inside Xbm/ directoy and '*-emboss.png' images under Png/ directory. If these directories doesn't exist they are created by centos-art.sh script. - The moving file functionality is marked to be unified in centos-art.sh path functionality. Run the command `centos-art help --read=trunk/Scripts/Bash/Functions/Path', for more information. --- diff --git a/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh b/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh index 89dac63..1d081f4 100644 --- a/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentityImageBrands.sh @@ -1,7 +1,7 @@ #!/bin/bash # # render_doIdentityImageBrands.sh -- This function provides -# post-rendering actions for producing CentOS brands. +# post-rendering actions to produce CentOS brands. # # Copyright (C) 2009-2010 Alain Reguera Delgado # @@ -26,10 +26,14 @@ function render_doIdentityImageBrands { - # Get absolute path of PNG image file. + local SOURCEFILE='' + local TARGETDIR='' + local TARGETFILE='' + + # Define absolute path to image file. local FILE="$1" - # Get image formats. + # Define image formats. local FORMATS="$2" # Create logo copy in defined formats. @@ -37,7 +41,6 @@ function render_doIdentityImageBrands { # Create logo copy in 2 colors. cli_printMessage "${FILE}.xbm (`gettext "2 colors grayscale"`)" "AsSavedAsLine" - convert -colorspace gray -colors 2 \ ${FILE}.png \ ${FILE}.xbm @@ -48,4 +51,30 @@ function render_doIdentityImageBrands { ${FILE}.png \ ${FILE}-emboss.png + # Move logo copy in 2 colors into its final location. This action + # complements groupByType post-rendering action. + SOURCEFILE=$FILE.xbm + TARGETDIR=$(dirname $FILE)/Xbm + TARGETFILE=$TARGETDIR/$(basename $SOURCEFILE) + # --- centos-art path $SOURCEFILE --move-to=$TARGETDIR + cli_printMessage "$TARGETFILE" 'AsMovedToLine' + cli_checkFiles $TARGETDIR 'd' '' '--quiet' + if [[ $? -ne 0 ]];then + mkdir -p $TARGETDIR + fi + mv ${SOURCEFILE} --target-directory=$TARGETDIR --force + + # Move logo copy with emboss effect into its final location. This + # action complements groupByType post-rendering action. + SOURCEFILE=${FILE}-emboss.png + TARGETDIR=$(dirname $FILE)/Png + TARGETFILE=$TARGETDIR/$(basename $SOURCEFILE) + # --- centos-art path $SOURCEFILE --move-to=$TARGETDIR + cli_printMessage "$TARGETFILE" 'AsMovedToLine' + cli_checkFiles $TARGETDIR 'd' '' '--quiet' + if [[ $? -ne 0 ]];then + mkdir -p $TARGETDIR + fi + mv ${SOURCEFILE} --target-directory=$TARGETDIR --force + }