|
|
4c79b5 |
#!/bin/bash
|
|
|
4c79b5 |
#
|
|
|
fe6777 |
# svg_convertPngToBrands.sh -- This function provides post-rendition
|
|
|
fe6777 |
# actions to produce brand images in different sizes and formats from
|
|
|
fe6777 |
|
|
|
4c79b5 |
#
|
|
|
2fe9b7 |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
fa95b1 |
#
|
|
|
fa95b1 |
# This program is free software; you can redistribute it and/or modify
|
|
|
fa95b1 |
|
|
|
dcd347 |
|
|
|
dcd347 |
|
|
|
fa95b1 |
#
|
|
|
74a058 |
|
|
|
74a058 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# General Public License for more details.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# along with this program; if not, write to the Free Software
|
|
|
dcd347 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
7ac5a5 |
#
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
418249 |
# $Id$
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
4c79b5 |
|
|
|
fe6777 |
function svg_convertPngToBrands {
|
|
|
4c79b5 |
|
|
|
f1cb29 |
|
|
|
c3637a |
local SIZE=""
|
|
|
e8be68 |
local SIZES="16 20 22 24 32 36 38 40 48 64 96 111 124 128 148 164 196 200 512"
|
|
|
4c79b5 |
|
|
|
f1cb29 |
|
|
|
c3637a |
local FORMAT=""
|
|
|
aa0c83 |
local FORMATS="xpm pdf jpg tif"
|
|
|
4c79b5 |
|
|
|
f1cb29 |
for SIZE in ${SIZES};do
|
|
|
f1cb29 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE)
|
|
|
aa0c83 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
if [[ ! -d $(dirname $FINALFILE) ]];then
|
|
|
aa0c83 |
mkdir -p $(dirname $FINALFILE)
|
|
|
aa0c83 |
fi
|
|
|
aa0c83 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
cli_printMessage "${FINALFILE}.png" --as-creating-line
|
|
|
aa0c83 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
inkscape $INSTANCE --export-id=$EXPORTID \
|
|
|
aa0c83 |
--export-png=${FINALFILE}.png --export-height=${SIZE} \
|
|
|
aa0c83 |
&> /dev/null
|
|
|
aa0c83 |
|
|
|
f1cb29 |
for FORMAT in ${FORMATS};do
|
|
|
f1cb29 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line
|
|
|
f1cb29 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
convert ${FINALFILE}.png ${FINALFILE}.${FORMAT}
|
|
|
f1cb29 |
|
|
|
f1cb29 |
done
|
|
|
f1cb29 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
cli_printMessage "${FINALFILE}.xbm" --as-creating-line
|
|
|
aa0c83 |
convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm
|
|
|
f1cb29 |
|
|
|
aa0c83 |
|
|
|
aa0c83 |
cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line
|
|
|
aa0c83 |
convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png
|
|
|
f1cb29 |
|
|
|
f1cb29 |
done
|
|
|
f1cb29 |
|
|
|
4c79b5 |
}
|