EXIF library (libexif) Internals 0.6.26
exif-format.c
Go to the documentation of this file.
1/* exif-format.c
2 *
3 * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA.
19 *
20 * SPDX-License-Identifier: LGPL-2.0-or-later
21 */
22
23#include <config.h>
24
25#include <libexif/exif-format.h>
26#include <libexif/i18n.h>
27
28#include <stdlib.h>
29
34static const struct {
36 const char *name;
37 unsigned char size;
38} ExifFormatTable[] = {
39 {EXIF_FORMAT_SHORT, N_("Short"), 2},
40 {EXIF_FORMAT_RATIONAL, N_("Rational"), 8},
41 {EXIF_FORMAT_SRATIONAL, N_("SRational"), 8},
42 {EXIF_FORMAT_UNDEFINED, N_("Undefined"), 1},
43 {EXIF_FORMAT_ASCII, N_("ASCII"), 1},
44 {EXIF_FORMAT_LONG, N_("Long"), 4},
45 {EXIF_FORMAT_BYTE, N_("Byte"), 1},
46 {EXIF_FORMAT_SBYTE, N_("SByte"), 1},
47 {EXIF_FORMAT_SSHORT, N_("SShort"), 2},
48 {EXIF_FORMAT_SLONG, N_("SLong"), 4},
49 {EXIF_FORMAT_FLOAT, N_("Float"), 4},
50 {EXIF_FORMAT_DOUBLE, N_("Double"), 8},
51 {0, NULL, 0}
52};
53
54const char *
56{
57 unsigned int i;
58
59 (void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
60
61 for (i = 0; ExifFormatTable[i].name; i++)
63 return _(ExifFormatTable[i].name);
64 return NULL;
65}
66
67unsigned char
69{
70 unsigned int i;
71
72 for (i = 0; ExifFormatTable[i].size; i++)
74 return ExifFormatTable[i].size;
75 return 0;
76}
const char * exif_format_get_name(ExifFormat format)
Return a textual representation of the given EXIF data type.
Definition exif-format.c:55
const char * name
Definition exif-format.c:36
unsigned char exif_format_get_size(ExifFormat format)
Return the raw size of the given EXIF data type.
Definition exif-format.c:68
unsigned char size
Definition exif-format.c:37
ExifFormat format
Definition exif-format.c:35
static const struct @7 ExifFormatTable[]
Table of data format types, descriptions and sizes.
Handling native EXIF data types.
ExifFormat
EXIF tag data formats.
Definition exif-format.h:34
@ EXIF_FORMAT_SLONG
Definition exif-format.h:43
@ EXIF_FORMAT_RATIONAL
Definition exif-format.h:39
@ EXIF_FORMAT_SRATIONAL
Definition exif-format.h:44
@ EXIF_FORMAT_LONG
Definition exif-format.h:38
@ EXIF_FORMAT_UNDEFINED
Definition exif-format.h:41
@ EXIF_FORMAT_SHORT
Definition exif-format.h:37
@ EXIF_FORMAT_SSHORT
Definition exif-format.h:42
@ EXIF_FORMAT_ASCII
Definition exif-format.h:36
@ EXIF_FORMAT_SBYTE
Definition exif-format.h:40
@ EXIF_FORMAT_FLOAT
Definition exif-format.h:45
@ EXIF_FORMAT_DOUBLE
Definition exif-format.h:46
@ EXIF_FORMAT_BYTE
Definition exif-format.h:35
#define _(String)
Definition i18n.h:50
#define N_(String)
Definition i18n.h:51
#define bindtextdomain(Domain, Directory)
Definition i18n.h:48

libexif Generated by doxygen