|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <config.h> |
|
|
|
|
|
#include <libexif/exif-format.h> |
|
|
#include <libexif/i18n.h> |
|
|
|
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const struct { |
|
|
ExifFormat format; |
|
|
const char *name; |
|
|
unsigned char size; |
|
|
} ExifFormatTable[] = { |
|
|
{EXIF_FORMAT_SHORT, N_("Short"), 2}, |
|
|
{EXIF_FORMAT_RATIONAL, N_("Rational"), 8}, |
|
|
{EXIF_FORMAT_SRATIONAL, N_("SRational"), 8}, |
|
|
{EXIF_FORMAT_UNDEFINED, N_("Undefined"), 1}, |
|
|
{EXIF_FORMAT_ASCII, N_("ASCII"), 1}, |
|
|
{EXIF_FORMAT_LONG, N_("Long"), 4}, |
|
|
{EXIF_FORMAT_BYTE, N_("Byte"), 1}, |
|
|
{EXIF_FORMAT_SBYTE, N_("SByte"), 1}, |
|
|
{EXIF_FORMAT_SSHORT, N_("SShort"), 2}, |
|
|
{EXIF_FORMAT_SLONG, N_("SLong"), 4}, |
|
|
{EXIF_FORMAT_FLOAT, N_("Float"), 4}, |
|
|
{EXIF_FORMAT_DOUBLE, N_("Double"), 8}, |
|
|
{0, NULL, 0} |
|
|
}; |
|
|
|
|
|
const char * |
|
|
exif_format_get_name (ExifFormat format) |
|
|
{ |
|
|
unsigned int i; |
|
|
|
|
|
(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); |
|
|
|
|
|
for (i = 0; ExifFormatTable[i].name; i++) |
|
|
if (ExifFormatTable[i].format == format) |
|
|
return _(ExifFormatTable[i].name); |
|
|
return NULL; |
|
|
} |
|
|
|
|
|
unsigned char |
|
|
exif_format_get_size (ExifFormat format) |
|
|
{ |
|
|
unsigned int i; |
|
|
|
|
|
for (i = 0; ExifFormatTable[i].size; i++) |
|
|
if (ExifFormatTable[i].format == format) |
|
|
return ExifFormatTable[i].size; |
|
|
return 0; |
|
|
} |
|
|
|