Blame Scripts/Functions/Render/render_convertPngTo.sh

4c79b5
#!/bin/bash
4c79b5
#
ab1d67
# render_convertPngTo.sh -- This function provides post-rendition
f6c88f
# to convert images produced by centos-art base-rendition.
4c79b5
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
dcd347
# This program is distributed in the hope that it will be useful,
dcd347
# but 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
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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
}