37 printf(
" Entry %u: %s (%s)\n"
38 " Size, Comps: %d, %d\n"
53 static unsigned content_count;
66 printf(
" MakerNote\n");
67 for (i=0; i < num; ++i) {
73 printf(
" Entry %u: %u, %s\n"
75 " Value: %s\n", i,
id,
name, (
unsigned)strlen(buf), buf);
82 static void test_parse(
const char *filename,
void *callback_data,
int swap)
87 const char *fn = strrchr(filename,
'/');
92 printf(
"File %s\n", fn);
96 fprintf (stderr,
"Could not load data from '%s'!\n", filename);
99 printf(
"Byte order: %s\n",
110 printf(
"New byte order: %s\n",
123 typedef void (*
test_parse_func) (
const char *filename,
void *callback_data,
int swap);
129 const char *start =
string;
130 const char *p = start;
132 if (*p ==
' ' || *p ==
'\t' || *p ==
'\n' || *p ==
'\r' || *p ==
'\0' ) {
133 size_t len = p-start;
136 char *str = malloc(1+len);
138 memcpy(str, start, len);
140 func(str, callback_data, 0);
157 int main(
const int argc,
const char *argv[])
160 void *callback_data = NULL;
164 if (argc > 1 && !strcmp(argv[1],
"--swap-byte-order")) {
170 for (i=first; i<argc; i++) {
176 const char *envar = getenv(
"TEST_IMAGES");
const char * exif_byte_order_get_name(ExifByteOrder order)
Return a short, localized, textual name for the given byte order.
ExifByteOrder
Which byte order to use.
@ EXIF_BYTE_ORDER_INTEL
Little-endian byte order.
@ EXIF_BYTE_ORDER_MOTOROLA
Big-endian byte order.
ExifIfd exif_content_get_ifd(ExifContent *c)
Return the IFD number in which the given ExifContent is found.
void exif_content_foreach_entry(ExifContent *content, ExifContentForeachEntryFunc func, void *data)
Executes function on each EXIF tag in this IFD in turn.
void exif_data_set_byte_order(ExifData *data, ExifByteOrder order)
Set the byte order to use for this EXIF data.
void exif_data_unref(ExifData *data)
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
ExifMnoteData * exif_data_get_mnote_data(ExifData *d)
Return the MakerNote data out of the EXIF data.
ExifData * exif_data_new_from_file(const char *path)
Allocate a new ExifData and load EXIF data from a JPEG file.
void exif_data_foreach_content(ExifData *data, ExifDataForeachContentFunc func, void *user_data)
Execute a function on each IFD in turn.
Defines the ExifData type and the associated functions.
const char * exif_entry_get_value(ExifEntry *e, char *val, unsigned int maxlen)
Return a localized textual representation of the value of the EXIF entry.
char * exif_mnote_data_get_value(ExifMnoteData *d, unsigned int n, char *val, unsigned int maxlen)
Return a textual representation of the value of the MakerNote entry.
const char * exif_mnote_data_get_name(ExifMnoteData *d, unsigned int n)
Returns textual name of the given MakerNote tag.
unsigned int exif_mnote_data_get_id(ExifMnoteData *d, unsigned int n)
Return the MakerNote tag number for the tag at the specified index within the MakerNote.
unsigned int exif_mnote_data_count(ExifMnoteData *d)
Return the number of tags in the MakerNote.
System specific definitions, not for installation!
const char * exif_tag_get_name(ExifTag tag)
Represents the entire EXIF data found in an image.
Data found in one EXIF tag.
unsigned long components
Number of elements in the array, if this is an array entry.
ExifFormat format
Type of data in this entry.
ExifTag tag
EXIF tag for this entry.
unsigned int size
Number of bytes in the buffer at data.
void(* test_parse_func)(const char *filename, void *callback_data, int swap)
static unsigned entry_count
static void data_foreach_func(ExifContent *content, void *callback_data)
static void test_parse(const char *filename, void *callback_data, int swap)
static void content_foreach_func(ExifEntry *entry, void *UNUSED(callback_data))
static void dump_makernote(ExifData *d)
static void split_ws_string(const char *string, test_parse_func func, void *callback_data)
int main(const int argc, const char *argv[])