Blame Scripts/Functions/Render/render_convertPngTo.sh

4c79b5
#!/bin/bash
4c79b5
#
ab1d67
# render_convertPngTo.sh -- This function provides post-rendition
61bb5b
# to convert images images produced by centos-art base-rendition.
4c79b5
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
4c79b5
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
ab1d67
function render_convertPngTo {
4c79b5
4c79b5
    # Get image formats.
ab1d67
    local FORMATS=$(render_getConfigOption "$ACTION" '2-')
4c79b5
4c79b5
    # Check base file existence.
61bb5b
    cli_checkFiles ${FILE}.png 'f'
61bb5b
61bb5b
    # Check image formats and do convertion.
61bb5b
    if [[ "$FORMATS" != "" ]];then
61bb5b
        for FORMAT in $FORMATS;do
61bb5b
            cli_printMessage "${FILE}.${FORMAT}" "AsSavedAsLine"
61bb5b
            convert -quality 85 ${FILE}.png ${FILE}.${FORMAT}
61bb5b
        done
4c79b5
4c79b5
    fi
4c79b5
4c79b5
}