diff --git a/Scripts/Bash/Functions/Render/render_doIdentityImageKsplash.sh b/Scripts/Bash/Functions/Render/render_doIdentityImageKsplash.sh index 13720eb..3110b53 100755 --- a/Scripts/Bash/Functions/Render/render_doIdentityImageKsplash.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentityImageKsplash.sh @@ -1,7 +1,8 @@ #!/bin/bash # -# render_doIdentityImageKsplash.sh -- This function provides -# post-rendering actions to render KSplash images. +# render_doIdentityImageKsplash.sh -- This function renders +# KSplash Preview.png image. Use this function as last-rendering +# function to KSplash base-rendering. # # Copyright (C) 2009-2010 Alain Reguera Delgado # @@ -26,11 +27,14 @@ function render_doIdentityImageKsplash { - local FILE=$1 + # Define variables as local to avoid conflicts outside. + local RELDIR='' + local KSPLASH_TOP='' + local KSPLASH_PREVIEW='' + local RELDIRS=$(find $OPTIONVAL -regextype posix-egrep -maxdepth 1 \ + -type d -regex "^.*/$RELEASE_FORMAT$" | egrep $REGEX) - # Define names of files with dynamic store location. - local KSPLASH_TOP="$(dirname $FILE)/splash_top.png" - local KSPLASH_PREVIEW="$(dirname $FILE)/Preview.png" + # Define font file used to render Preview.png bottom text. local KSPLASH_PREVIEW_FONT=/home/centos/artwork/trunk/Identity/Fonts/Ttf/DejaVuLGCSans-Bold.ttf # Define relative location to splash_active_bar and splash_bottom @@ -40,37 +44,39 @@ function render_doIdentityImageKsplash { local KSPLASH_ACTIVE_BAR="$OPTIONVAL/splash_active_bar.png" local KSPLASH_BOTTOM="$OPTIONVAL/splash_bottom.png" - # The Preview.png image is produced if the current file being - # rendered is the splash_top image. The splash_top image is the - # only file that is rendered for different versions. The - # splash_top image is taken as reference to create the whole - # ksplash image preview. - if [ ! "$(basename $FILE).png" == "splash_top.png" ];then - continue - fi - - # Check required image files existence. - cli_checkFiles $KSPLASH_PREVIEW + # Check existence of non-release-specific required image files. cli_checkFiles $KSPLASH_ACTIVE_BAR cli_checkFiles $KSPLASH_BOTTOM cli_checkFiles $KSPLASH_PREVIEW_FONT - # Create Preview.png image. - convert -append \ - $KSPLASH_TOP \ - $KSPLASH_ACTIVE_BAR \ - $KSPLASH_BOTTOM \ - $KSPLASH_PREVIEW + # Look for release specific directories. + for RELDIR in $RELDIRS;do + + # Define release-specific files. + KSPLASH_TOP="${RELDIR}/splash_top.png" + KSPLASH_PREVIEW="${RELDIR}/Preview.png" + + # Check existence of release-specific required image files. + cli_checkFiles $KSPLASH_TOP + + # Create Preview.png image. + convert -append \ + $KSPLASH_TOP \ + $KSPLASH_ACTIVE_BAR \ + $KSPLASH_BOTTOM \ + $KSPLASH_PREVIEW + + # Add bottom text to Preview.png image. The text position was + # set inside an image of 400x300 pixels. If you change the + # final preview image dimension, you need to change the text + # position too. + mogrify -draw 'text 6,295 "KDE is up and running."' \ + -fill \#ffffff \ + -font $KSPLASH_PREVIEW_FONT \ + $KSPLASH_PREVIEW - # Add bottom text to Preview.png image. The text position was set - # inside an image of 400x300 pixels. If you change the final - # preview image dimension, you need to change the text position - # too. - mogrify -draw 'text 6,295 "KDE is up and running."' \ - -fill \#ffffff \ - -font $KSPLASH_PREVIEW_FONT \ - $KSPLASH_PREVIEW + cli_printMessage "$KSPLASH_PREVIEW" "AsSavedAsLine" - cli_printMessage "$KSPLASH_PREVIEW" "AsSavedAsLine" + done }