Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: libexif/sources/libexif/exif-format.c

Issue 10535156: Add libexif to deps/third_party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « libexif/sources/libexif/exif-format.h ('k') | libexif/sources/libexif/exif-ifd.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
21 #include <config.h>
22
23 #include <libexif/exif-format.h>
24 #include <libexif/i18n.h>
25
26 #include <stdlib.h>
27
28 /*! Table of data format types, descriptions and sizes.
29 * This table should be sorted in decreasing order of popularity in order
30 * to decrease the total average lookup time.
31 */
32 static const struct {
33 ExifFormat format;
34 const char *name;
35 unsigned char size;
36 } ExifFormatTable[] = {
37 {EXIF_FORMAT_SHORT, N_("Short"), 2},
38 {EXIF_FORMAT_RATIONAL, N_("Rational"), 8},
39 {EXIF_FORMAT_SRATIONAL, N_("SRational"), 8},
40 {EXIF_FORMAT_UNDEFINED, N_("Undefined"), 1},
41 {EXIF_FORMAT_ASCII, N_("ASCII"), 1},
42 {EXIF_FORMAT_LONG, N_("Long"), 4},
43 {EXIF_FORMAT_BYTE, N_("Byte"), 1},
44 {EXIF_FORMAT_SBYTE, N_("SByte"), 1},
45 {EXIF_FORMAT_SSHORT, N_("SShort"), 2},
46 {EXIF_FORMAT_SLONG, N_("SLong"), 4},
47 {EXIF_FORMAT_FLOAT, N_("Float"), 4},
48 {EXIF_FORMAT_DOUBLE, N_("Double"), 8},
49 {0, NULL, 0}
50 };
51
52 const char *
53 exif_format_get_name (ExifFormat format)
54 {
55 unsigned int i;
56
57 /* FIXME: This belongs to somewhere else. */
58 /* libexif should use the default system locale.
59 * If an application specifically requires UTF-8, then we
60 * must give the application a way to tell libexif that.
61 *
62 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
63 */
64 #if defined(BIND_TEXTDOMAIN)
65 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
66 #endif
67 for (i = 0; ExifFormatTable[i].name; i++)
68 if (ExifFormatTable[i].format == format)
69 return _(ExifFormatTable[i].name);
70 return NULL;
71 }
72
73 unsigned char
74 exif_format_get_size (ExifFormat format)
75 {
76 unsigned int i;
77
78 for (i = 0; ExifFormatTable[i].size; i++)
79 if (ExifFormatTable[i].format == format)
80 return ExifFormatTable[i].size;
81 return 0;
82 }
OLDNEW
« no previous file with comments | « libexif/sources/libexif/exif-format.h ('k') | libexif/sources/libexif/exif-ifd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698