204a0d Add render_mogrifyCommentToPng.sh.

Authored and Committed by areguera 13 years ago
Scripts/Functions/Render/render_mogrifyCommentToPng.sh ADDED
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ #
3
+ # render_mogrifyCommentToPng.sh -- This function provides
4
+ # post-rendition to write a commentary in PNG images produced as
5
+ # result of centos-art.sh base-rendition action. The commentary is
6
+ # written in the image datastream and can be seen using the command
7
+ # `identify -verbose file.png'.
8
+ #
9
+ # Copyright (C) 2009-2011 Alain Reguera Delgado
10
+ #
11
+ # This program is free software; you can redistribute it and/or
12
+ # modify it under the terms of the GNU General Public License as
13
+ # published by the Free Software Foundation; either version 2 of the
14
+ # License, or (at your option) any later version.
15
+ #
16
+ # This program is distributed in the hope that it will be useful, but
17
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
+ # General Public License for more details.
20
+ #
21
+ # You should have received a copy of the GNU General Public License
22
+ # along with this program; if not, write to the Free Software
23
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24
+ # USA.
25
+ #
26
+ # ----------------------------------------------------------------------
27
+ # $Id$
28
+ # ----------------------------------------------------------------------
29
+
30
+ function render_mogrifyCommentToPng {
31
+
32
+ # Get commentary.
33
+ local COMMENT=$(render_getConfigOption "$ACTION" '2-')
34
+
35
+ # Check base file existence.
36
+ cli_checkFiles ${FILE}.png 'f'
37
+
38
+ # Check commentary and write commentary.
39
+ if [[ "$COMMENT" != "" ]];then
40
+ mogrify -comment "$COMMENT" ${FILE}.png
41
+ fi
42
+
43
+ }