1 /*****************************************************************************
2 * This file is part of gfxprim library. *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
19 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
21 *****************************************************************************/
25 Meta-data storage operations example.
27 Meta-data storage is used to store image meta-data (if present) such as
28 physical size, creation date, etc...
30 Meta-data storage is basically an typed dictionary.
32 This example shows low-level interface to GP_MetaData structure.
42 GP_MetaData
*data
= GP_MetaDataCreate(10);
44 //GP_SetDebugLevel(10);
52 * May fail, if there is allready record with id 'dpi' or
53 * if there is no space left.
55 GP_MetaDataCreateInt(data
, "dpi", 300);
60 * The last parameter says, if the string should be duplicated
61 * in the metadata storage.
63 GP_MetaDataCreateString(data
, "author", "Foo Bar <foo@bar.net>", 0, 1);
64 GP_MetaDataCreateString(data
, "comment", "Created in hurry.", 0, 1);
65 GP_MetaDataCreateDouble(data
, "pi", 3.141592);
69 ret
= GP_MetaDataGetString(data
, "comment");
72 printf("Found string 'comment' = '%s'\n", ret
);
74 printf("ERROR: cannot cound string 'comment'\n");
81 GP_MetaDataPrint(data
);