From fe67775fb737f95529f165a52b39efa279f328a8 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jul 03 2011 14:02:49 +0000 Subject: Add `svg_convertPngToIcons' function and fix function name inside `svg_convertPngToBrands.sh' file. --- diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh b/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh index 8268e68..d887b92 100644 --- a/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh +++ b/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh @@ -1,9 +1,8 @@ #!/bin/bash # -# svg_convertPngToIcons.sh -- This function provides post-rendition -# actions to produce images in different sizes and formats from the -# same SVG design model. This function might be useful to produce -# icons and brands images. +# svg_convertPngToBrands.sh -- This function provides post-rendition +# actions to produce brand images in different sizes and formats from +# the same SVG design model. # # Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG # @@ -25,7 +24,7 @@ # $Id$ # ---------------------------------------------------------------------- -function svg_convertPngToIcons { +function svg_convertPngToBrands { # Define height dimensions you want to produce brands for. local SIZE="" diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToIcons.sh b/Scripts/Functions/Render/Svg/svg_convertPngToIcons.sh new file mode 100644 index 0000000..0430b10 --- /dev/null +++ b/Scripts/Functions/Render/Svg/svg_convertPngToIcons.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +# svg_convertPngToIcons.sh -- This function provides post-rendition +# actions to produce icon images in different sizes and formats from +# the same SVG design model. +# +# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToIcons { + + # Define height dimensions you want to produce brands for. + local SIZE="" + local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" + + # Define image formats you want to produce brands for. + local FORMAT="" + local FORMATS="" + + for SIZE in ${SIZES};do + + # Redefine absolute path to file location where size-specific + # images will be stored in. + local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) + + # Prepare directory where size-specific images will be stored + # in. If it doesn't exist create it. + if [[ ! -d $(dirname $FINALFILE) ]];then + mkdir -p $(dirname $FINALFILE) + fi + + # Print action message. + cli_printMessage "${FINALFILE}.png" --as-creating-line + + # Create size-specific PNG image ommiting all output. + inkscape $INSTANCE --export-id=$EXPORTID \ + --export-png=${FINALFILE}.png --export-height=${SIZE} \ + &> /dev/null + + #for FORMAT in ${FORMATS};do + # + # # Print action message. + # cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line + # + # # Convert size-specific PNG image into different formats. + # convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} + # + #done + + # Create copy of size-specific image in 2 colors. + #cli_printMessage "${FINALFILE}.xbm" --as-creating-line + #convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm + + # Create copy of size-specific image with emboss effect. + #cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line + #convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png + + done + +}