_Z12content_funcP10_ExifEntryPv:
   20|  71.2k|void content_func(ExifEntry *entry, void *user_data) {
   21|  71.2k|  char buf[10000];
   22|  71.2k|  exif_entry_get_value(entry, buf, sizeof(buf));
   23|  71.2k|}
_Z9data_funcP12_ExifContentPv:
   25|  53.7k|void data_func(ExifContent *content, void *user_data) {
   26|       |  exif_content_foreach_entry(content, content_func, NULL);
   27|  53.7k|}
LLVMFuzzerTestOneInput:
   56|  11.1k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   57|  11.1k|  ExifLoader *loader = exif_loader_new();
   58|  11.1k|  ExifData *exif_data;
   59|  11.1k|  if (!loader) {
  ------------------
  |  Branch (59:7): [True: 0, False: 11.1k]
  ------------------
   60|      0|    return 0;
   61|      0|  }
   62|  11.1k|  exif_loader_write(loader, const_cast<unsigned char*>(data), size);
   63|  11.1k|  exif_data = exif_loader_get_data(loader);
   64|  11.1k|  if(!exif_data) {
  ------------------
  |  Branch (64:6): [True: 369, False: 10.7k]
  ------------------
   65|    369|    exif_loader_unref(loader);
   66|    369|    return 0;
   67|    369|  }
   68|  10.7k|  exif_data_foreach_content(exif_data, data_func, NULL);
   69|  10.7k|  test_exif_data (exif_data);
   70|  10.7k|  exif_loader_unref(loader);
   71|  10.7k|  exif_data_unref(exif_data);
   72|  10.7k|  return 0;
   73|  11.1k|}
exif_loader_fuzzer.cc:_ZL14test_exif_dataP9_ExifData:
   30|  10.7k|test_exif_data (ExifData *d) {
   31|  10.7k|  unsigned int i, c;
   32|  10.7k|  char v[1024], *p;
   33|  10.7k|  ExifMnoteData *md;
   34|       |
   35|  10.7k|  md = exif_data_get_mnote_data (d);
   36|  10.7k|  if (!md) {
  ------------------
  |  Branch (36:7): [True: 3.74k, False: 7.01k]
  ------------------
   37|  3.74k|    return;
   38|  3.74k|  }
   39|       |
   40|  7.01k|  exif_mnote_data_ref (md);
   41|  7.01k|  exif_mnote_data_unref (md);
   42|       |
   43|  7.01k|  c = exif_mnote_data_count (md);
   44|  1.79M|  for (i = 0; i < c; i++) {
  ------------------
  |  Branch (44:15): [True: 1.79M, False: 4.58k]
  ------------------
   45|  1.79M|    const char *name = exif_mnote_data_get_name (md, i);
   46|  1.79M|    if (!name) {
  ------------------
  |  Branch (46:9): [True: 2.42k, False: 1.78M]
  ------------------
   47|  2.42k|      break;
   48|  2.42k|    }
   49|  1.78M|    exif_mnote_data_get_title (md, i);
   50|  1.78M|    exif_mnote_data_get_description (md, i);
   51|  1.78M|    exif_mnote_data_get_value (md, i, v, sizeof (v));
   52|  1.78M|  }
   53|  7.01k|}

exif_mnote_data_canon_identify:
  400|  3.24k|{
  401|  3.24k|	char value[8];
  402|       |
  403|  3.24k|	ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|  3.24k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 876, False: 2.36k]
  |  |  ------------------
  |  |  254|  3.24k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  3.24k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 164, False: 2.20k]
  |  |  ------------------
  |  |  256|  2.36k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  2.36k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 2.20k]
  |  |  ------------------
  |  |  258|  2.20k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  2.20k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 2.20k]
  |  |  ------------------
  |  |  260|  2.20k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  2.20k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 2.20k]
  |  |  ------------------
  |  |  262|  2.20k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  404|  3.24k|	if (!em) 
  ------------------
  |  Branch (404:6): [True: 2.20k, False: 1.04k]
  ------------------
  405|  2.20k|		return 0;
  406|       |
  407|  1.04k|	(void) e;  /* unused */
  408|  1.04k|	return !strcmp (exif_entry_get_value (em, value, sizeof (value)), "Canon");
  409|  3.24k|}
exif_mnote_data_canon_new:
  413|    906|{
  414|    906|	ExifMnoteData *d;
  415|    906|	ExifMnoteDataCanon *dc;
  416|       |
  417|    906|	if (!mem) return NULL;
  ------------------
  |  Branch (417:6): [True: 0, False: 906]
  ------------------
  418|       |
  419|    906|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataCanon));
  420|    906|	if (!d)
  ------------------
  |  Branch (420:6): [True: 0, False: 906]
  ------------------
  421|      0|		return NULL;
  422|       |
  423|    906|	exif_mnote_data_construct (d, mem);
  424|       |
  425|       |	/* Set up function pointers */
  426|    906|	d->methods.free            = exif_mnote_data_canon_free;
  427|    906|	d->methods.set_byte_order  = exif_mnote_data_canon_set_byte_order;
  428|    906|	d->methods.set_offset      = exif_mnote_data_canon_set_offset;
  429|    906|	d->methods.load            = exif_mnote_data_canon_load;
  430|    906|	d->methods.save            = exif_mnote_data_canon_save;
  431|    906|	d->methods.count           = exif_mnote_data_canon_count;
  432|    906|	d->methods.get_id          = exif_mnote_data_canon_get_id;
  433|    906|	d->methods.get_name        = exif_mnote_data_canon_get_name;
  434|    906|	d->methods.get_title       = exif_mnote_data_canon_get_title;
  435|    906|	d->methods.get_description = exif_mnote_data_canon_get_description;
  436|    906|	d->methods.get_value       = exif_mnote_data_canon_get_value;
  437|       |
  438|    906|	dc = (ExifMnoteDataCanon*)d;
  439|    906|	dc->options = o;
  440|    906|	return d;
  441|    906|}
exif-mnote-data-canon.c:exif_mnote_data_canon_free:
   62|    906|{
   63|    906|	if (!n) return;
  ------------------
  |  Branch (63:6): [True: 0, False: 906]
  ------------------
   64|       |
   65|    906|	exif_mnote_data_canon_clear ((ExifMnoteDataCanon *) n);
   66|    906|}
exif-mnote-data-canon.c:exif_mnote_data_canon_clear:
   42|  1.79k|{
   43|  1.79k|	ExifMnoteData *d = (ExifMnoteData *) n;
   44|  1.79k|	unsigned int i;
   45|       |
   46|  1.79k|	if (!n) return;
  ------------------
  |  Branch (46:6): [True: 0, False: 1.79k]
  ------------------
   47|       |
   48|  1.79k|	if (n->entries) {
  ------------------
  |  Branch (48:6): [True: 889, False: 906]
  ------------------
   49|  12.0k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (49:15): [True: 11.1k, False: 889]
  ------------------
   50|  11.1k|			if (n->entries[i].data) {
  ------------------
  |  Branch (50:8): [True: 11.1k, False: 0]
  ------------------
   51|  11.1k|				exif_mem_free (d->mem, n->entries[i].data);
   52|  11.1k|				n->entries[i].data = NULL;
   53|  11.1k|			}
   54|    889|		exif_mem_free (d->mem, n->entries);
   55|       |		n->entries = NULL;
   56|    889|		n->count = 0;
   57|    889|	}
   58|  1.79k|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_byte_order:
  101|    906|{
  102|    906|	ExifByteOrder o_orig;
  103|    906|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) d;
  104|    906|	unsigned int i;
  105|       |
  106|    906|	if (!n) return;
  ------------------
  |  Branch (106:6): [True: 0, False: 906]
  ------------------
  107|       |
  108|    906|	o_orig = n->order;
  109|    906|	n->order = o;
  110|    906|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (110:14): [True: 0, False: 906]
  ------------------
  111|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (111:7): [True: 0, False: 0]
  |  Branch (111:35): [True: 0, False: 0]
  ------------------
  112|      0|			continue;
  113|      0|		n->entries[i].order = o;
  114|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  115|      0|				n->entries[i].components, o_orig, o);
  116|      0|	}
  117|    906|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_offset:
  121|    906|{
  122|    906|	if (n) ((ExifMnoteDataCanon *) n)->offset = o;
  ------------------
  |  Branch (122:6): [True: 906, False: 0]
  ------------------
  123|    906|}
exif-mnote-data-canon.c:exif_mnote_data_canon_load:
  210|    906|{
  211|    906|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
  212|    906|	ExifShort c;
  213|    906|	size_t i, tcount, o, datao;
  214|    906|	long failsafe_size = 0;
  215|       |
  216|    906|	if (!n) return;
  ------------------
  |  Branch (216:6): [True: 0, False: 906]
  ------------------
  217|       |
  218|    906|	if (!buf || !buf_size) {
  ------------------
  |  Branch (218:6): [True: 0, False: 906]
  |  Branch (218:14): [True: 0, False: 906]
  ------------------
  219|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  220|      0|			  "ExifMnoteCanon", "Short MakerNote");
  221|      0|		return;
  222|      0|	}
  223|    906|	if (CHECKOVERFLOW(n->offset, buf_size, 8)) {
  ------------------
  |  |   35|    906|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 0, False: 906]
  |  |  |  Branch (35:81): [True: 0, False: 906]
  |  |  |  Branch (35:112): [True: 0, False: 906]
  |  |  ------------------
  ------------------
  224|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  225|      0|			  "ExifMnoteCanon", "Short MakerNote");
  226|      0|		return;
  227|      0|	}
  228|    906|	datao = 6 + n->offset;
  229|       |
  230|       |	/* Read the number of tags */
  231|    906|	c = exif_get_short (buf + datao, n->order);
  232|    906|	datao += 2;
  233|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 24 named tags currently.
  234|       |	 * current 2020 camera EOS M6 Mark 2 had 156 entries.
  235|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  236|    906|	if (c > 250) {
  ------------------
  |  Branch (236:6): [True: 17, False: 889]
  ------------------
  237|     17|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Too much tags (%d) in Canon MakerNote", c);
  238|     17|		return;
  239|     17|	}
  240|       |
  241|       |	/* Remove any old entries */
  242|    889|	exif_mnote_data_canon_clear (n);
  243|       |
  244|       |	/* Reserve enough space for all the possible MakerNote tags */
  245|    889|	n->entries = exif_mem_alloc (ne->mem, sizeof (MnoteCanonEntry) * c);
  246|    889|	if (!n->entries) {
  ------------------
  |  Branch (246:6): [True: 0, False: 889]
  ------------------
  247|      0|		EXIF_LOG_NO_MEMORY(ne->log, "ExifMnoteCanon", sizeof (MnoteCanonEntry) * c);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  248|      0|		return;
  249|      0|	}
  250|       |
  251|       |	/* Parse the entries */
  252|    889|	tcount = 0;
  253|  52.0k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (253:25): [True: 51.9k, False: 140]
  ------------------
  254|  51.9k|		size_t s;
  255|       |
  256|  51.9k|		memset(&n->entries[tcount], 0, sizeof(MnoteCanonEntry));
  257|  51.9k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   35|  51.9k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 298, False: 51.6k]
  |  |  |  Branch (35:81): [True: 0, False: 51.6k]
  |  |  |  Branch (35:112): [True: 441, False: 51.1k]
  |  |  ------------------
  ------------------
  258|    739|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  259|    739|				"ExifMnoteCanon", "Short MakerNote");
  260|    739|			break;
  261|    739|		}
  262|       |
  263|  51.1k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  264|  51.1k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  265|  51.1k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  266|  51.1k|		n->entries[tcount].order      = n->order;
  267|       |
  268|  51.1k|		exif_log (ne->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteCanon",
  269|  51.1k|			"Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  270|  51.1k|			 mnote_canon_tag_get_name (n->entries[tcount].tag));
  271|       |
  272|       |		/* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  273|       |		 * we will check the buffer sizes closer later. */
  274|  51.1k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (274:8): [True: 16.8k, False: 34.3k]
  ------------------
  275|  16.8k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (275:4): [True: 4.08k, False: 12.7k]
  ------------------
  276|  51.1k|		) {
  277|  4.08k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  278|  4.08k|				  "ExifMnoteCanon", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  279|  4.08k|			continue;
  280|  4.08k|		}
  281|       |
  282|       |		/*
  283|       |		 * Size? If bigger than 4 bytes, the actual data is not
  284|       |		 * in the entry but somewhere else (offset).
  285|       |		 */
  286|  47.0k|		s = exif_format_get_size (n->entries[tcount].format) * 
  287|  47.0k|								  n->entries[tcount].components;
  288|  47.0k|		n->entries[tcount].size = s;
  289|  47.0k|		if (!s) {
  ------------------
  |  Branch (289:7): [True: 34.7k, False: 12.3k]
  ------------------
  290|  34.7k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  291|  34.7k|				  "ExifMnoteCanon",
  292|  34.7k|				  "Invalid zero-length tag size");
  293|  34.7k|			continue;
  294|       |
  295|  34.7k|		} else {
  296|  12.3k|			size_t dataofs = o + 8;
  297|  12.3k|			if (s > 4) dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  ------------------
  |  Branch (297:8): [True: 8.92k, False: 3.41k]
  ------------------
  298|       |
  299|  12.3k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   35|  12.3k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 836, False: 11.5k]
  |  |  |  Branch (35:81): [True: 0, False: 11.5k]
  |  |  |  Branch (35:112): [True: 373, False: 11.1k]
  |  |  ------------------
  ------------------
  300|  1.20k|				exif_log (ne->log, EXIF_LOG_CODE_DEBUG,
  301|  1.20k|					"ExifMnoteCanon",
  302|  1.20k|					"Tag data past end of buffer (%u > %u)",
  303|  1.20k|					(unsigned)(dataofs + s), buf_size);
  304|  1.20k|				continue;
  305|  1.20k|			}
  306|       |
  307|  11.1k|			n->entries[tcount].data = exif_mem_alloc (ne->mem, s);
  308|  11.1k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (308:8): [True: 0, False: 11.1k]
  ------------------
  309|      0|				EXIF_LOG_NO_MEMORY(ne->log, "ExifMnoteCanon", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  310|      0|				continue;
  311|      0|			}
  312|  11.1k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  313|  11.1k|		}
  314|       |
  315|       |		/* Track the size of decoded tag data. A malicious file could
  316|       |		 * be crafted to cause extremely large values here without
  317|       |		 * tripping any buffer range checks.  This is especially bad
  318|       |		 * with the libexif representation of Canon MakerNotes because
  319|       |		 * some arrays are turned into individual tags that the
  320|       |		 * application must loop around. */
  321|  11.1k|		failsafe_size += mnote_canon_entry_count_values(&n->entries[tcount]);
  322|       |
  323|  11.1k|		if (failsafe_size > FAILSAFE_SIZE_MAX) {
  ------------------
  |  |   38|  11.1k|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  |  Branch (323:7): [True: 10, False: 11.1k]
  ------------------
  324|       |			/* Abort if the total size of the data in the tags extraordinarily large, */
  325|     10|			exif_mem_free (ne->mem, n->entries[tcount].data);
  326|     10|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  327|     10|					  "ExifMnoteCanon", "Failsafe tag size overflow (%lu > %ld)",
  328|     10|					  failsafe_size, FAILSAFE_SIZE_MAX);
  ------------------
  |  |   38|     10|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  329|     10|			break;
  330|     10|		}
  331|       |
  332|       |		/* Tag was successfully parsed */
  333|  11.1k|		++tcount;
  334|  11.1k|	}
  335|       |	/* Store the count of successfully parsed tags */
  336|    889|	n->count = tcount;
  337|    889|}
exif-mnote-data-canon.c:exif_mnote_data_canon_count:
  341|    906|{
  342|    906|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) n;
  343|    906|	unsigned int i, c;
  344|       |
  345|  12.0k|	for (i = c = 0; dc && (i < dc->count); i++)
  ------------------
  |  Branch (345:18): [True: 12.0k, False: 0]
  |  Branch (345:24): [True: 11.1k, False: 906]
  ------------------
  346|  11.1k|		c += mnote_canon_entry_count_values (&dc->entries[i]);
  347|    906|	return c;
  348|    906|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_tags:
   71|  6.85M|{
   72|  6.85M|	unsigned int from = 0, to;
   73|       |
   74|  6.85M|	if (s) *s = 0;
  ------------------
  |  Branch (74:6): [True: 5.14M, False: 1.71M]
  ------------------
   75|       |
   76|  6.85M|	if (!dc || !m) return;
  ------------------
  |  Branch (76:6): [True: 0, False: 6.85M]
  |  Branch (76:13): [True: 0, False: 6.85M]
  ------------------
   77|   135M|	for (*m = 0; *m < dc->count; (*m)++) {
  ------------------
  |  Branch (77:15): [True: 135M, False: 0]
  ------------------
   78|   135M|		to = from + mnote_canon_entry_count_values (&dc->entries[*m]);
   79|   135M|		if (to > n) {
  ------------------
  |  Branch (79:7): [True: 6.85M, False: 128M]
  ------------------
   80|  6.85M|			if (s) *s = n - from;
  ------------------
  |  Branch (80:8): [True: 5.14M, False: 1.71M]
  ------------------
   81|  6.85M|			break;
   82|  6.85M|		}
   83|   128M|		from = to;
   84|   128M|	}
   85|  6.85M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_name:
  364|  1.71M|{
  365|  1.71M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  366|  1.71M|	unsigned int m, s;
  367|       |
  368|  1.71M|	if (!dc) return NULL;
  ------------------
  |  Branch (368:6): [True: 0, False: 1.71M]
  ------------------
  369|  1.71M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  370|  1.71M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (370:6): [True: 0, False: 1.71M]
  ------------------
  371|  1.71M|	return mnote_canon_tag_get_name_sub (dc->entries[m].tag, s, dc->options);
  372|  1.71M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_title:
  376|  1.71M|{
  377|  1.71M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  378|  1.71M|	unsigned int m, s;
  379|       |
  380|  1.71M|	if (!dc) return NULL;
  ------------------
  |  Branch (380:6): [True: 0, False: 1.71M]
  ------------------
  381|  1.71M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  382|  1.71M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (382:6): [True: 0, False: 1.71M]
  ------------------
  383|  1.71M|	return mnote_canon_tag_get_title_sub (dc->entries[m].tag, s, dc->options);
  384|  1.71M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_description:
  388|  1.71M|{
  389|  1.71M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  390|  1.71M|	unsigned int m;
  391|       |
  392|  1.71M|	if (!dc) return NULL;
  ------------------
  |  Branch (392:6): [True: 0, False: 1.71M]
  ------------------
  393|  1.71M|	exif_mnote_data_canon_get_tags (dc, i, &m, NULL);
  394|  1.71M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (394:6): [True: 0, False: 1.71M]
  ------------------
  395|  1.71M|	return mnote_canon_tag_get_description (dc->entries[m].tag);
  396|  1.71M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_value:
   89|  1.71M|{
   90|  1.71M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
   91|  1.71M|	unsigned int m, s;
   92|       |
   93|  1.71M|	if (!dc) return NULL;
  ------------------
  |  Branch (93:6): [True: 0, False: 1.71M]
  ------------------
   94|  1.71M|	exif_mnote_data_canon_get_tags (dc, n, &m, &s);
   95|  1.71M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (95:6): [True: 0, False: 1.71M]
  ------------------
   96|  1.71M|	return mnote_canon_entry_get_value (&dc->entries[m], s, val, maxlen);
   97|  1.71M|}

mnote_canon_entry_count_values:
  505|   135M|{
  506|   135M|	unsigned int  val;
  507|       |
  508|   135M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 135M]
  ------------------
  509|       |
  510|   135M|	switch (entry->tag) {
  511|   307k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 307k, False: 134M]
  ------------------
  512|   308k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 621, False: 135M]
  ------------------
  513|   308k|		return entry->components;
  514|  3.20M|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 3.20M, False: 131M]
  ------------------
  515|  4.30M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.09M, False: 133M]
  ------------------
  516|   130M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 126M, False: 8.69M]
  ------------------
  517|   130M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 85.7k, False: 134M]
  ------------------
  518|   130M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 50.1k, False: 130M]
  ------------------
  519|       |
  520|   130M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|   130M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|   130M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 130M, False: 610k]
  |  |  ------------------
  ------------------
  523|  3.99M|	default:
  ------------------
  |  Branch (523:2): [True: 3.99M, False: 131M]
  ------------------
  524|  3.99M|		return 1;
  525|   135M|	}
  526|   135M|}
mnote_canon_entry_get_value:
  552|  1.71M|{
  553|  1.71M|	char buf[128];
  554|  1.71M|	ExifLong vl;
  555|  1.71M|	ExifSLong vsl;
  556|  1.71M|	ExifShort vs, n;
  557|  1.71M|	ExifSShort vss;
  558|  1.71M|	unsigned char *data;
  559|  1.71M|	size_t	size;
  560|  1.71M|	double d;
  561|       |
  562|  1.71M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.71M]
  ------------------
  563|      0|		return NULL;
  564|  1.71M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.71M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.71M|	data = entry->data;
  568|  1.71M|	size = entry->size;
  569|       |
  570|  1.71M|	memset (val, 0, maxlen);
  571|  1.71M|	maxlen--;
  572|       |
  573|  1.71M|	switch (entry->tag) {
  574|  2.89k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 2.89k, False: 1.71M]
  ------------------
  575|  2.89k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.89k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.89k|{                                                               \
  |  |   38|  2.89k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.89k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  2.89k|}
  ------------------
  576|       |
  577|  2.89k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 2.89k]
  ------------------
  578|  2.89k|		n = exif_get_short (data, entry->order) / 2;
  579|  2.89k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 2.89k]
  ------------------
  580|       |
  581|  2.89k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.89k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.89k|{                                                                       \
  |  |   50|  2.89k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 331, False: 2.56k]
  |  |  ------------------
  |  |   51|    331|                snprintf (v, maxlen,                                    \
  |  |   52|    331|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    331|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    331|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    331|                break;                                                  \
  |  |   55|    331|        }                                                               \
  |  |   56|  2.89k|}
  ------------------
  582|       |
  583|  2.56k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.56k]
  ------------------
  584|  2.56k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.56k|		switch (t) {
  586|    518|		case 1:
  ------------------
  |  Branch (586:3): [True: 518, False: 2.04k]
  ------------------
  587|    518|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 199, False: 319]
  ------------------
  588|    199|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    199|				break;
  590|    199|			}
  591|    319|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    319|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    319|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.56k]
  ------------------
  594|      0|			if (((vs & 0xC000) == 0x4000) && (vs != 0x7FFF)) {
  ------------------
  |  Branch (594:8): [True: 0, False: 0]
  |  Branch (594:37): [True: 0, False: 0]
  ------------------
  595|       |				/* Canon S3 IS - directly specified value */
  596|      0|				snprintf (val, maxlen, "%i", vs & ~0x4000);
  597|      0|			} else {
  598|       |				/* Standard Canon - index into lookup table */
  599|      0|				canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  600|      0|			}
  601|      0|			break;
  602|      0|		case 22:
  ------------------
  |  Branch (602:3): [True: 0, False: 2.56k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.56k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.56k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.56k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.56k]
  ------------------
  609|      0|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vs / 32.0));
  610|      0|			break;
  611|      0|		case 28:
  ------------------
  |  Branch (611:3): [True: 0, False: 2.56k]
  ------------------
  612|      0|			canon_search_table_bitfield(entries_settings_1, t, vs, val, maxlen);
  613|      0|			break;
  614|      0|		case 34:
  ------------------
  |  Branch (614:3): [True: 0, False: 2.56k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.56k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.56k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  2.04k|		default:
  ------------------
  |  Branch (621:3): [True: 2.04k, False: 518]
  ------------------
  622|  2.04k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.56k|		}
  624|  2.56k|		break;
  625|       |
  626|  2.56k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.49k, False: 1.71M]
  ------------------
  627|  1.49k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.49k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.49k|{                                                               \
  |  |   38|  1.49k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 409, False: 1.08k]
  |  |  ------------------
  |  |   39|    409|                snprintf (v, maxlen,                            \
  |  |   40|    409|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    409|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    409|                        "expected '%s'."),                      \
  |  |   42|    409|                        exif_format_get_name (format),          \
  |  |   43|    409|                        exif_format_get_name (target));         \
  |  |   44|    409|                break;                                          \
  |  |   45|    409|        }                                                       \
  |  |   46|  1.49k|}
  ------------------
  628|  1.08k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.08k]
  ------------------
  629|  1.08k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.08k|		switch (t) {
  631|    287|		case 1:
  ------------------
  |  Branch (631:3): [True: 287, False: 801]
  ------------------
  632|    287|			snprintf (val, maxlen, "%u", vs);
  633|    287|			break;
  634|    251|		case 2:
  ------------------
  |  Branch (634:3): [True: 251, False: 837]
  ------------------
  635|    500|		case 3:
  ------------------
  |  Branch (635:3): [True: 249, False: 839]
  ------------------
  636|    500|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    500|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    500|			break;
  638|    301|		default:
  ------------------
  |  Branch (638:3): [True: 301, False: 787]
  ------------------
  639|    301|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.08k|		}
  641|  1.08k|		break;
  642|       |
  643|  6.92k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 6.92k, False: 1.70M]
  ------------------
  644|  6.92k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  6.92k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  6.92k|{                                                               \
  |  |   38|  6.92k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 6.92k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  6.92k|}
  ------------------
  645|  6.92k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 6.92k]
  ------------------
  646|  6.92k|		n = exif_get_short (data, entry->order) / 2;
  647|  6.92k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 6.92k]
  ------------------
  648|  6.92k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  6.92k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  6.92k|{                                                                       \
  |  |   50|  6.92k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.18k, False: 5.74k]
  |  |  ------------------
  |  |   51|  1.18k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.18k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.18k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.18k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.18k|                break;                                                  \
  |  |   55|  1.18k|        }                                                               \
  |  |   56|  6.92k|}
  ------------------
  649|  5.74k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 5.74k]
  ------------------
  650|  5.74k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  5.74k|		switch (t) {
  652|    660|		case 0:
  ------------------
  |  Branch (652:3): [True: 660, False: 5.08k]
  ------------------
  653|    660|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    660|			break;
  655|    660|		case 1:
  ------------------
  |  Branch (655:3): [True: 660, False: 5.08k]
  ------------------
  656|    660|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    660|			break;
  658|    660|		case 2:
  ------------------
  |  Branch (658:3): [True: 660, False: 5.08k]
  ------------------
  659|  1.27k|		case 5:
  ------------------
  |  Branch (659:3): [True: 612, False: 5.13k]
  ------------------
  660|  1.27k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 5.74k]
  ------------------
  661|  1.27k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 5.74k]
  ------------------
  662|  1.27k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.27k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.27k|			break;
  664|    660|		case 3:
  ------------------
  |  Branch (664:3): [True: 660, False: 5.08k]
  ------------------
  665|    660|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 5.74k]
  ------------------
  666|    660|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    660|			break;
  668|    660|		case 4:
  ------------------
  |  Branch (668:3): [True: 660, False: 5.08k]
  ------------------
  669|    660|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 5.74k]
  ------------------
  670|    660|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    660|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 344, False: 316]
  ------------------
  672|    344|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    316|			else
  674|    316|				snprintf (val, maxlen, "%.0f", d);
  675|    660|			break;
  676|    611|		case 8:
  ------------------
  |  Branch (676:3): [True: 611, False: 5.13k]
  ------------------
  677|    611|			snprintf (val, maxlen, "%u", vss);
  678|    611|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 5.74k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 5.74k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 5.74k]
  ------------------
  684|      0|			snprintf (val, maxlen, _("%u mm"), vss);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  685|      0|			break;
  686|      0|		case 28:
  ------------------
  |  Branch (686:3): [True: 0, False: 5.74k]
  ------------------
  687|      0|			if (vss <= 0) {
  ------------------
  |  Branch (687:8): [True: 0, False: 0]
  ------------------
  688|      0|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  689|      0|				break;
  690|      0|			}
  691|      0|			snprintf (val, maxlen, _("%i (ms)"), vss * 100);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  692|      0|			break;
  693|  1.22k|		default:
  ------------------
  |  Branch (693:3): [True: 1.22k, False: 4.52k]
  ------------------
  694|  1.22k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  5.74k|		}
  696|  5.74k|		break;
  697|       |
  698|  5.74k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.71M]
  ------------------
  699|      0|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|      0|#define CF(format,target,v,maxlen)                              \
  |  |   37|      0|{                                                               \
  |  |   38|      0|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|      0|}
  ------------------
  700|      0|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (700:7): [True: 0, False: 0]
  ------------------
  701|      0|		vs = exif_get_short (data + t * 2, entry->order);
  702|      0|		canon_search_table_value (entries_panorama, t, vs, val, maxlen);
  703|      0|		break;
  704|       |
  705|    337|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 337, False: 1.71M]
  ------------------
  706|    337|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    337|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    337|{                                                                       \
  |  |   50|    337|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 92, False: 245]
  |  |  ------------------
  |  |   51|     92|                snprintf (v, maxlen,                                    \
  |  |   52|     92|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     92|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|     92|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|     92|                break;                                                  \
  |  |   55|     92|        }                                                               \
  |  |   56|    337|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    861|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 616, False: 1.71M]
  ------------------
  710|    861|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    861|#define CF(format,target,v,maxlen)                              \
  |  |   37|    861|{                                                               \
  |  |   38|    861|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 423, False: 438]
  |  |  ------------------
  |  |   39|    423|                snprintf (v, maxlen,                            \
  |  |   40|    423|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    423|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    423|                        "expected '%s'."),                      \
  |  |   42|    423|                        exif_format_get_name (format),          \
  |  |   43|    423|                        exif_format_get_name (target));         \
  |  |   44|    423|                break;                                          \
  |  |   45|    423|        }                                                       \
  |  |   46|    861|}
  ------------------
  711|    438|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    438|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 123, False: 315]
  |  |  ------------------
  ------------------
  712|    438|		break;
  713|       |
  714|    545|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 545, False: 1.71M]
  ------------------
  715|    545|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    545|#define CF(format,target,v,maxlen)                              \
  |  |   37|    545|{                                                               \
  |  |   38|    545|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 244, False: 301]
  |  |  ------------------
  |  |   39|    244|                snprintf (v, maxlen,                            \
  |  |   40|    244|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    244|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    244|                        "expected '%s'."),                      \
  |  |   42|    244|                        exif_format_get_name (format),          \
  |  |   43|    244|                        exif_format_get_name (target));         \
  |  |   44|    244|                break;                                          \
  |  |   45|    244|        }                                                       \
  |  |   46|    545|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    301|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    301|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 72, False: 229]
  |  |  ------------------
  ------------------
  718|    301|		break;
  719|       |
  720|    794|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 794, False: 1.71M]
  ------------------
  721|    794|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    794|#define CF(format,target,v,maxlen)                              \
  |  |   37|    794|{                                                               \
  |  |   38|    794|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 196, False: 598]
  |  |  ------------------
  |  |   39|    196|                snprintf (v, maxlen,                            \
  |  |   40|    196|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    196|                        "expected '%s'."),                      \
  |  |   42|    196|                        exif_format_get_name (format),          \
  |  |   43|    196|                        exif_format_get_name (target));         \
  |  |   44|    196|                break;                                          \
  |  |   45|    196|        }                                                       \
  |  |   46|    794|}
  ------------------
  722|    598|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    598|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    598|{                                                                       \
  |  |   50|    598|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 385, False: 213]
  |  |  ------------------
  |  |   51|    385|                snprintf (v, maxlen,                                    \
  |  |   52|    385|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    385|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    385|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    385|                break;                                                  \
  |  |   55|    385|        }                                                               \
  |  |   56|    598|}
  ------------------
  723|    213|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 213]
  ------------------
  724|    213|		vl = exif_get_long (data, entry->order);
  725|    213|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    213|				(unsigned long) vl/10000,
  727|    213|				(unsigned long) vl%10000);
  728|    213|		break;
  729|       |
  730|    640|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 640, False: 1.71M]
  ------------------
  731|    640|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    640|#define CF(format,target,v,maxlen)                              \
  |  |   37|    640|{                                                               \
  |  |   38|    640|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 213, False: 427]
  |  |  ------------------
  |  |   39|    213|                snprintf (v, maxlen,                            \
  |  |   40|    213|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    213|                        "expected '%s'."),                      \
  |  |   42|    213|                        exif_format_get_name (format),          \
  |  |   43|    213|                        exif_format_get_name (target));         \
  |  |   44|    213|                break;                                          \
  |  |   45|    213|        }                                                       \
  |  |   46|    640|}
  ------------------
  732|    427|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    427|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    427|{                                                                       \
  |  |   50|    427|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 216, False: 211]
  |  |  ------------------
  |  |   51|    216|                snprintf (v, maxlen,                                    \
  |  |   52|    216|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    216|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    216|                break;                                                  \
  |  |   55|    216|        }                                                               \
  |  |   56|    427|}
  ------------------
  733|    211|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 211]
  ------------------
  734|    211|		vl = exif_get_long (data, entry->order);
  735|    211|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|    211|		break;
  737|       |
  738|  1.69M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.69M, False: 19.7k]
  ------------------
  739|  1.69M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.69M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.69M|{                                                               \
  |  |   38|  1.69M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.69M]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  1.69M|}
  ------------------
  740|  1.69M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.69M]
  ------------------
  741|  1.69M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.69M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.69M]
  ------------------
  743|  1.69M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.69M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.69M|{                                                                       \
  |  |   50|  1.69M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.67M, False: 21.5k]
  |  |  ------------------
  |  |   51|  1.67M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.67M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.67M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.67M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.67M|                break;                                                  \
  |  |   55|  1.67M|        }                                                               \
  |  |   56|  1.69M|}
  ------------------
  744|  21.5k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 21.5k]
  ------------------
  745|  21.5k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  21.5k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  21.5k|		strncat (val, buf, maxlen - strlen (val));
  748|  21.5k|		break;
  749|       |
  750|  2.93k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.93k, False: 1.71M]
  ------------------
  751|  2.93k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.93k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.93k|{                                                               \
  |  |   38|  2.93k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.93k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  2.93k|}
  ------------------
  752|  2.93k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.93k]
  ------------------
  753|  2.93k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.93k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.93k]
  ------------------
  755|  2.93k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.93k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.93k|{                                                                       \
  |  |   50|  2.93k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 720, False: 2.21k]
  |  |  ------------------
  |  |   51|    720|                snprintf (v, maxlen,                                    \
  |  |   52|    720|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    720|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    720|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    720|                break;                                                  \
  |  |   55|    720|        }                                                               \
  |  |   56|  2.93k|}
  ------------------
  756|  2.21k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 2.21k]
  ------------------
  757|  2.21k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  2.21k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  2.21k|		break;
  760|       |
  761|  2.58k|	default:
  ------------------
  |  Branch (761:2): [True: 2.58k, False: 1.71M]
  ------------------
  762|  2.58k|		switch (entry->format) {
  763|    368|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 368, False: 2.21k]
  ------------------
  764|    368|		  {
  765|    368|			size_t i, len = strlen(val);
  766|  84.8k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 84.5k, False: 368]
  ------------------
  767|  84.5k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 84.5k]
  ------------------
  768|      0|					break;
  769|  84.5k|				vs = exif_get_short (data, entry->order);
  770|  84.5k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  84.5k|				len = strlen(val);
  772|  84.5k|				data += 2;
  773|  84.5k|				size -= 2;
  774|  84.5k|			}
  775|    368|		  }
  776|    368|		  break;
  777|    291|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 291, False: 2.29k]
  ------------------
  778|    291|		  {
  779|    291|			size_t i, len = strlen(val);
  780|  24.1k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 23.8k, False: 291]
  ------------------
  781|  23.8k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 23.8k]
  ------------------
  782|      0|					break;
  783|  23.8k|				vss = exif_get_sshort (data, entry->order);
  784|  23.8k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  23.8k|				data += 2;
  786|  23.8k|				size -= 2;
  787|  23.8k|			}
  788|    291|		  }
  789|    291|		  break;
  790|    346|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 346, False: 2.23k]
  ------------------
  791|    346|		  {
  792|    346|			size_t i, len = strlen(val);
  793|  22.7k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 22.3k, False: 346]
  ------------------
  794|  22.3k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 22.3k]
  ------------------
  795|      0|					break;
  796|  22.3k|				vl = exif_get_long (data, entry->order);
  797|  22.3k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  22.3k|				data += 4;
  799|  22.3k|				size -= 4;
  800|  22.3k|			}
  801|    346|		  }
  802|    346|		  break;
  803|    497|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 497, False: 2.08k]
  ------------------
  804|    497|		  {
  805|    497|			size_t i, len = strlen(val);
  806|  66.8k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 66.3k, False: 497]
  ------------------
  807|  66.3k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 66.3k]
  ------------------
  808|      0|					break;
  809|  66.3k|				vsl = exif_get_slong (data, entry->order);
  810|  66.3k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  66.3k|				data += 4;
  812|  66.3k|				size -= 4;
  813|  66.3k|			}
  814|    497|		  }
  815|    497|		  break;
  816|    823|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 823, False: 1.75k]
  ------------------
  817|    823|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    823|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 77, False: 746]
  |  |  ------------------
  ------------------
  818|    823|			break;
  819|    256|		default:
  ------------------
  |  Branch (819:3): [True: 256, False: 2.32k]
  ------------------
  820|    256|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    256|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    256|			  entry->size);
  822|    256|		  break;
  823|  2.58k|		}
  824|  2.58k|		break;
  825|  1.71M|	}
  826|  1.71M|	return val;
  827|  1.71M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  5.79k|{
  445|  5.79k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  85.0k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 84.1k, False: 909]
  |  Branch (448:32): [True: 61.8k, False: 22.3k]
  ------------------
  449|  80.5k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 19.4k, False: 2.96k]
  |  Branch (449:31): [True: 18.7k, False: 654]
  ------------------
  450|  80.5k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 18.7k, False: 61.8k]
  |  Branch (450:33): [True: 1.26k, False: 17.4k]
  ------------------
  451|  1.26k|			break;
  452|  1.26k|		}
  453|  80.5k|	}
  454|  5.79k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.21k, False: 3.57k]
  |  Branch (454:32): [True: 1.26k, False: 948]
  |  Branch (454:58): [True: 1.26k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.26k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.26k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.52k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.52k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.52k|	}
  461|  5.79k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    660|{
  535|    660|	return pow (2, x / 2.);
  536|    660|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    660|{
  547|    660|	return 3.125 * pow (2, x);
  548|    660|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    660|{
  541|    660|	return 1.0 / pow (2, x);
  542|    660|}

mnote_canon_tag_get_name:
  212|  1.75M|{
  213|  1.75M|	unsigned int i;
  214|       |
  215|  24.8M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (215:14): [True: 24.8M, False: 24.2k]
  ------------------
  216|  24.8M|		if (table[i].tag == t) return table[i].name; /* do not translate */
  ------------------
  |  Branch (216:7): [True: 1.72M, False: 23.1M]
  ------------------
  217|  24.2k|	return NULL;
  218|  1.75M|}
mnote_canon_tag_get_name_sub:
  222|  1.71M|{
  223|  1.71M|	unsigned int i;
  224|  1.71M|	int tag_found = 0;
  225|       |
  226|   146M|	for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
  ------------------
  |  Branch (226:14): [True: 145M, False: 1.69M]
  ------------------
  227|   145M|		if (table_sub[i].tag == t) {
  ------------------
  |  Branch (227:7): [True: 67.1k, False: 145M]
  ------------------
  228|  67.1k|			if (table_sub[i].subtag == s)
  ------------------
  |  Branch (228:8): [True: 14.2k, False: 52.8k]
  ------------------
  229|  14.2k|				return table_sub[i].name;
  230|  52.8k|			tag_found = 1;
  231|  52.8k|		}
  232|   145M|	}
  233|  1.69M|	if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
  ------------------
  |  Branch (233:6): [True: 1.69M, False: 76]
  |  Branch (233:20): [True: 0, False: 76]
  ------------------
  234|  1.69M|		return mnote_canon_tag_get_name (t);
  235|     76|	else
  236|     76|		return NULL;
  237|  1.69M|}
mnote_canon_tag_get_title:
  241|  1.69M|{
  242|  1.69M|	unsigned int i;
  243|       |
  244|  1.69M|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  245|  22.0M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (245:14): [True: 22.0M, False: 0]
  ------------------
  246|  22.0M|		if (table[i].tag == t) {
  ------------------
  |  Branch (246:7): [True: 1.69M, False: 20.3M]
  ------------------
  247|  1.69M|			if (!table[i].title)
  ------------------
  |  Branch (247:8): [True: 0, False: 1.69M]
  ------------------
  248|      0|				return NULL;
  249|  1.69M|			return _(table[i].title);
  ------------------
  |  |   31|  1.69M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.69M|		}
  251|      0|	return NULL;
  252|  1.69M|}
mnote_canon_tag_get_title_sub:
  256|  1.71M|{
  257|  1.71M|	unsigned int i;
  258|  1.71M|	int tag_found = 0;
  259|       |
  260|   146M|	for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
  ------------------
  |  Branch (260:14): [True: 145M, False: 1.69M]
  ------------------
  261|   145M|		if (table_sub[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 66.2k, False: 144M]
  ------------------
  262|  66.2k|			if (table_sub[i].subtag == s) {
  ------------------
  |  Branch (262:8): [True: 14.2k, False: 51.9k]
  ------------------
  263|  14.2k|				if (!table_sub[i].name)
  ------------------
  |  Branch (263:9): [True: 0, False: 14.2k]
  ------------------
  264|      0|					return NULL;
  265|  14.2k|				return _(table_sub[i].name);
  ------------------
  |  |   31|  14.2k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  14.2k|			}
  267|  51.9k|			tag_found = 1;
  268|  51.9k|		}
  269|   145M|	}
  270|  1.69M|	if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
  ------------------
  |  Branch (270:6): [True: 1.69M, False: 0]
  |  Branch (270:20): [True: 0, False: 0]
  ------------------
  271|  1.69M|		return mnote_canon_tag_get_title (t);
  272|      0|	else
  273|      0|		return NULL;
  274|  1.69M|}
mnote_canon_tag_get_description:
  278|  1.71M|{
  279|  1.71M|	unsigned int i;
  280|       |
  281|  22.1M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (281:14): [True: 22.1M, False: 0]
  ------------------
  282|  22.1M|		if (table[i].tag == t) {
  ------------------
  |  Branch (282:7): [True: 1.71M, False: 20.4M]
  ------------------
  283|  1.71M|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (283:8): [True: 0, False: 1.71M]
  |  Branch (283:33): [True: 1.71M, False: 0]
  ------------------
  284|  1.71M|				return "";
  285|      0|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  286|      0|			return _(table[i].description);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  287|  1.71M|		}
  288|      0|	return NULL;
  289|  1.71M|}

exif_content_new_mem:
   57|  53.7k|{
   58|  53.7k|	ExifContent *content;
   59|       |
   60|  53.7k|	if (!mem) return NULL;
  ------------------
  |  Branch (60:6): [True: 0, False: 53.7k]
  ------------------
   61|       |
   62|  53.7k|	content = exif_mem_alloc (mem, (ExifLong) sizeof (ExifContent));
   63|  53.7k|	if (!content)
  ------------------
  |  Branch (63:6): [True: 0, False: 53.7k]
  ------------------
   64|      0|		return NULL;
   65|  53.7k|	content->priv = exif_mem_alloc (mem,
   66|  53.7k|				(ExifLong) sizeof (ExifContentPrivate));
   67|  53.7k|	if (!content->priv) {
  ------------------
  |  Branch (67:6): [True: 0, False: 53.7k]
  ------------------
   68|      0|		exif_mem_free (mem, content);
   69|      0|		return NULL;
   70|      0|	}
   71|       |
   72|  53.7k|	content->priv->ref_count = 1;
   73|       |
   74|  53.7k|	content->priv->mem = mem;
   75|  53.7k|	exif_mem_ref (mem);
   76|       |
   77|  53.7k|	return content;
   78|  53.7k|}
exif_content_unref:
   91|  53.7k|{
   92|  53.7k|	if (!content)
  ------------------
  |  Branch (92:6): [True: 0, False: 53.7k]
  ------------------
   93|      0|		return;
   94|       |
   95|  53.7k|	content->priv->ref_count--;
   96|  53.7k|	if (!content->priv->ref_count)
  ------------------
  |  Branch (96:6): [True: 53.7k, False: 0]
  ------------------
   97|  53.7k|		exif_content_free (content);
   98|  53.7k|}
exif_content_free:
  102|  53.7k|{
  103|  53.7k|	ExifMem *mem = (content && content->priv) ? content->priv->mem : NULL;
  ------------------
  |  Branch (103:18): [True: 53.7k, False: 0]
  |  Branch (103:29): [True: 53.7k, False: 0]
  ------------------
  104|  53.7k|	unsigned int i;
  105|       |
  106|  53.7k|	if (!content) return;
  ------------------
  |  Branch (106:6): [True: 0, False: 53.7k]
  ------------------
  107|       |
  108|   124k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (108:14): [True: 71.2k, False: 53.7k]
  ------------------
  109|  71.2k|		exif_entry_unref (content->entries[i]);
  110|  53.7k|	exif_mem_free (mem, content->entries);
  111|       |
  112|  53.7k|	if (content->priv) {
  ------------------
  |  Branch (112:6): [True: 53.7k, False: 0]
  ------------------
  113|  53.7k|		exif_log_unref (content->priv->log);
  114|  53.7k|	}
  115|       |
  116|  53.7k|	exif_mem_free (mem, content->priv);
  117|  53.7k|	exif_mem_free (mem, content);
  118|  53.7k|	exif_mem_unref (mem);
  119|  53.7k|}
exif_content_add_entry:
  142|  81.1k|{
  143|  81.1k|	ExifEntry **entries;
  144|  81.1k|	unsigned int s;
  145|  81.1k|	if (!c || !c->priv || !entry || entry->parent) return;
  ------------------
  |  Branch (145:6): [True: 0, False: 81.1k]
  |  Branch (145:12): [True: 0, False: 81.1k]
  |  Branch (145:24): [True: 0, False: 81.1k]
  |  Branch (145:34): [True: 0, False: 81.1k]
  ------------------
  146|       |
  147|       |	/* One tag can only be added once to an IFD. */
  148|  81.1k|	if (exif_content_get_entry (c, entry->tag)) {
  ------------------
  |  Branch (148:6): [True: 8.55k, False: 72.6k]
  ------------------
  149|  8.55k|		exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "ExifContent",
  150|  8.55k|			"An attempt has been made to add "
  151|  8.55k|			"the tag '%s' twice to an IFD. This is against "
  152|  8.55k|			"specification.", exif_tag_get_name (entry->tag));
  153|  8.55k|		return;
  154|  8.55k|	}
  155|       |
  156|  72.6k|	s = sizeof (ExifEntry*) * (c->count + 1);
  157|  72.6k|	entries = exif_mem_realloc (c->priv->mem, c->entries, s);
  158|  72.6k|	if (!entries) {
  ------------------
  |  Branch (158:6): [True: 0, False: 72.6k]
  ------------------
  159|      0|		EXIF_LOG_NO_MEMORY (c->priv->log, "ExifContent", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  160|      0|		return;
  161|      0|	}
  162|  72.6k|	entry->parent = c;
  163|  72.6k|	entries[c->count++] = entry;
  164|  72.6k|	c->entries = entries;
  165|  72.6k|	exif_entry_ref (entry);
  166|  72.6k|}
exif_content_remove_entry:
  170|  1.41k|{
  171|  1.41k|	unsigned int i;
  172|  1.41k|	ExifEntry **t, *temp;
  173|       |
  174|  1.41k|	if (!c || !c->priv || !e || (e->parent != c)) return;
  ------------------
  |  Branch (174:6): [True: 0, False: 1.41k]
  |  Branch (174:12): [True: 0, False: 1.41k]
  |  Branch (174:24): [True: 0, False: 1.41k]
  |  Branch (174:30): [True: 0, False: 1.41k]
  ------------------
  175|       |
  176|       |	/* Search the entry */
  177|  7.56k|	for (i = 0; i < c->count; i++)
  ------------------
  |  Branch (177:14): [True: 7.56k, False: 0]
  ------------------
  178|  7.56k|			if (c->entries[i] == e)
  ------------------
  |  Branch (178:8): [True: 1.41k, False: 6.15k]
  ------------------
  179|  1.41k|					break;
  180|       |
  181|  1.41k|	if (i == c->count)
  ------------------
  |  Branch (181:6): [True: 0, False: 1.41k]
  ------------------
  182|      0|			return;
  183|       |
  184|       |	/* Remove the entry */
  185|  1.41k|	temp = c->entries[c->count-1];
  186|  1.41k|	if (c->count > 1) {
  ------------------
  |  Branch (186:6): [True: 905, False: 505]
  ------------------
  187|    905|		const unsigned int s = sizeof(ExifEntry*) * (c->count - 1);
  188|    905|		t = exif_mem_realloc (c->priv->mem, c->entries, s);
  189|    905|		if (!t) {
  ------------------
  |  Branch (189:7): [True: 0, False: 905]
  ------------------
  190|      0|			EXIF_LOG_NO_MEMORY (c->priv->log, "ExifContent", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  191|      0|			return;
  192|      0|		}
  193|    905|		c->entries = t;
  194|    905|		c->count--;
  195|    905|		if (i != c->count) { /* we deallocated the last slot already */ 
  ------------------
  |  Branch (195:7): [True: 0, False: 905]
  ------------------
  196|      0|			memmove (&t[i], &t[i + 1], sizeof (ExifEntry*) * (c->count - i - 1));
  197|      0|			t[c->count-1] = temp;
  198|      0|		} 
  199|    905|	} else {
  200|    505|		exif_mem_free (c->priv->mem, c->entries);
  201|    505|		c->entries = NULL;
  202|    505|		c->count = 0;
  203|    505|	}
  204|  1.41k|	e->parent = NULL;
  205|  1.41k|	exif_entry_unref (e);
  206|  1.41k|}
exif_content_get_entry:
  210|   182k|{
  211|   182k|	unsigned int i;
  212|       |
  213|   182k|	if (!content)
  ------------------
  |  Branch (213:6): [True: 0, False: 182k]
  ------------------
  214|      0|		return (NULL);
  215|       |
  216|   457k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (216:14): [True: 300k, False: 156k]
  ------------------
  217|   300k|		if (content->entries[i]->tag == tag)
  ------------------
  |  Branch (217:7): [True: 25.6k, False: 274k]
  ------------------
  218|  25.6k|			return (content->entries[i]);
  219|   156k|	return (NULL);
  220|   182k|}
exif_content_foreach_entry:
  225|   120k|{
  226|   120k|	unsigned int i;
  227|       |
  228|   120k|	if (!content || !func)
  ------------------
  |  Branch (228:6): [True: 0, False: 120k]
  |  Branch (228:18): [True: 0, False: 120k]
  ------------------
  229|      0|		return;
  230|       |
  231|   227k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (231:14): [True: 106k, False: 120k]
  ------------------
  232|   106k|		func (content->entries[i], data);
  233|   120k|}
exif_content_log:
  237|  53.7k|{
  238|  53.7k|	if (!content || !content->priv || !log || content->priv->log == log)
  ------------------
  |  Branch (238:6): [True: 0, False: 53.7k]
  |  Branch (238:18): [True: 0, False: 53.7k]
  |  Branch (238:36): [True: 53.7k, False: 0]
  |  Branch (238:44): [True: 0, False: 0]
  ------------------
  239|  53.7k|		return;
  240|       |
  241|      0|	if (content->priv->log) exif_log_unref (content->priv->log);
  ------------------
  |  Branch (241:6): [True: 0, False: 0]
  ------------------
  242|      0|	content->priv->log = log;
  243|      0|	exif_log_ref (log);
  244|      0|}
exif_content_get_ifd:
  248|   144k|{
  249|   144k|	if (!c || !c->parent) return EXIF_IFD_COUNT;
  ------------------
  |  Branch (249:6): [True: 0, False: 144k]
  |  Branch (249:12): [True: 0, False: 144k]
  ------------------
  250|       |
  251|   144k|	return 
  252|   144k|		((c)->parent->ifd[EXIF_IFD_EXIF] == (c)) ? EXIF_IFD_EXIF :
  ------------------
  |  Branch (252:3): [True: 53.1k, False: 91.0k]
  ------------------
  253|   144k|		((c)->parent->ifd[EXIF_IFD_0] == (c)) ? EXIF_IFD_0 :
  ------------------
  |  Branch (253:3): [True: 44.0k, False: 46.9k]
  ------------------
  254|  91.0k|		((c)->parent->ifd[EXIF_IFD_1] == (c)) ? EXIF_IFD_1 :
  ------------------
  |  Branch (254:3): [True: 10.1k, False: 36.8k]
  ------------------
  255|  46.9k|		((c)->parent->ifd[EXIF_IFD_GPS] == (c)) ? EXIF_IFD_GPS :
  ------------------
  |  Branch (255:3): [True: 18.9k, False: 17.8k]
  ------------------
  256|  36.8k|		((c)->parent->ifd[EXIF_IFD_INTEROPERABILITY] == (c)) ? EXIF_IFD_INTEROPERABILITY :
  ------------------
  |  Branch (256:3): [True: 17.8k, False: 0]
  ------------------
  257|  17.8k|		EXIF_IFD_COUNT;
  258|   144k|}
exif_content_fix:
  292|  33.5k|{
  293|  33.5k|	ExifIfd ifd = exif_content_get_ifd (c);
  294|  33.5k|	ExifDataType dt;
  295|  33.5k|	ExifEntry *e;
  296|  33.5k|	unsigned int i, num;
  297|       |
  298|  33.5k|	if (!c)
  ------------------
  |  Branch (298:6): [True: 0, False: 33.5k]
  ------------------
  299|      0|		return;
  300|       |
  301|  33.5k|	dt = exif_data_get_data_type (c->parent);
  302|       |
  303|       |	/*
  304|       |	 * First of all, fix all existing entries.
  305|       |	 */
  306|  33.5k|	exif_content_foreach_entry (c, fix_func, NULL);
  307|       |
  308|       |	/*
  309|       |	 * Go through each tag and if it's not recorded, remove it. If one
  310|       |	 * is removed, exif_content_foreach_entry() will skip the next entry,
  311|       |	 * so if this happens do the loop again from the beginning to ensure
  312|       |	 * they're all checked. This could be avoided if we stop relying on
  313|       |	 * exif_content_foreach_entry but loop intelligently here.
  314|       |	 */
  315|  33.5k|	do {
  316|  33.5k|		num = c->count;
  317|  33.5k|		exif_content_foreach_entry (c, remove_not_recorded, NULL);
  318|  33.5k|	} while (num != c->count);
  ------------------
  |  Branch (318:11): [True: 0, False: 33.5k]
  ------------------
  319|       |
  320|       |	/*
  321|       |	 * Then check for non-existing mandatory tags and create them if needed
  322|       |	 */
  323|  33.5k|	num = exif_tag_table_count();
  324|  5.70M|	for (i = 0; i < num; ++i) {
  ------------------
  |  Branch (324:14): [True: 5.67M, False: 33.5k]
  ------------------
  325|  5.67M|		const ExifTag t = exif_tag_table_get_tag (i);
  326|  5.67M|		if (exif_tag_get_support_level_in_ifd (t, ifd, dt) ==
  ------------------
  |  Branch (326:7): [True: 50.7k, False: 5.62M]
  ------------------
  327|  5.67M|			EXIF_SUPPORT_LEVEL_MANDATORY) {
  328|  50.7k|			if (exif_content_get_entry (c, t))
  ------------------
  |  Branch (328:8): [True: 277, False: 50.5k]
  ------------------
  329|       |				/* This tag already exists */
  330|    277|				continue;
  331|  50.5k|			exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "exif-content",
  332|  50.5k|					"Tag '%s' is mandatory in IFD '%s' and has therefore been added.",
  333|  50.5k|					exif_tag_get_name_in_ifd (t, ifd), exif_ifd_get_name (ifd));
  334|  50.5k|			e = exif_entry_new ();
  335|  50.5k|			exif_content_add_entry (c, e);
  336|  50.5k|			exif_entry_initialize (e, t);
  337|  50.5k|			exif_entry_unref (e);
  338|  50.5k|		}
  339|  5.67M|	}
  340|  33.5k|}
exif-content.c:fix_func:
  262|  17.4k|{
  263|  17.4k|	exif_entry_fix (e);
  264|  17.4k|}
exif-content.c:remove_not_recorded:
  274|  17.4k|{
  275|  17.4k|	ExifIfd ifd = exif_entry_get_ifd(e) ;
  ------------------
  |  |  182|  17.4k|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 17.4k, False: 0]
  |  |  ------------------
  ------------------
  276|  17.4k|	ExifContent *c = e->parent;
  277|  17.4k|	ExifDataType dt = exif_data_get_data_type (c->parent);
  278|  17.4k|	ExifTag t = e->tag;
  279|       |
  280|  17.4k|	if (exif_tag_get_support_level_in_ifd (t, ifd, dt) ==
  ------------------
  |  Branch (280:6): [True: 0, False: 17.4k]
  ------------------
  281|  17.4k|			 EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  282|      0|		exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "exif-content",
  283|      0|				"Tag 0x%04x is not recorded in IFD '%s' and has therefore been "
  284|      0|				"removed.", t, exif_ifd_get_name (ifd));
  285|      0|		exif_content_remove_entry (c, e);
  286|      0|	}
  287|       |
  288|  17.4k|}

exif_data_get_mnote_data:
   93|  10.7k|{
   94|  10.7k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 10.7k, False: 0]
  |  Branch (94:15): [True: 10.7k, False: 0]
  ------------------
   95|  10.7k|}
exif_data_new_mem:
  110|  10.7k|{
  111|  10.7k|	ExifData *data;
  112|  10.7k|	unsigned int i;
  113|       |
  114|  10.7k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 10.7k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  10.7k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  10.7k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 10.7k]
  ------------------
  119|      0|		return (NULL);
  120|  10.7k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  10.7k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 10.7k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  10.7k|	data->priv->ref_count = 1;
  126|       |
  127|  10.7k|	data->priv->mem = mem;
  128|  10.7k|	exif_mem_ref (mem);
  129|       |
  130|  64.5k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 53.7k, False: 10.7k]
  ------------------
  131|  53.7k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  53.7k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 53.7k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  53.7k|		data->ifd[i]->parent = data;
  137|  53.7k|	}
  138|       |
  139|       |	/* Default options */
  140|  10.7k|#ifndef NO_VERBOSE_TAG_STRINGS
  141|       |	/*
  142|       |	 * When the tag list is compiled away, setting this option prevents
  143|       |	 * any tags from being loaded
  144|       |	 */
  145|  10.7k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  10.7k|#endif
  147|  10.7k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  10.7k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  10.7k|	return (data);
  153|  10.7k|}
exif_data_load_data:
  858|  10.7k|{
  859|  10.7k|	unsigned int l;
  860|  10.7k|	ExifLong offset;
  861|  10.7k|	ExifShort n;
  862|  10.7k|	const unsigned char *d = d_orig;
  863|  10.7k|	unsigned int len, fullds;
  864|       |
  865|  10.7k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 10.7k]
  |  Branch (865:15): [True: 0, False: 10.7k]
  |  Branch (865:30): [True: 0, False: 10.7k]
  |  Branch (865:36): [True: 0, False: 10.7k]
  ------------------
  866|      0|		return;
  867|       |
  868|  10.7k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  10.7k|		  "Parsing %i byte(s) EXIF data...\n", ds);
  870|       |
  871|       |	/*
  872|       |	 * It can be that the data starts with the EXIF header. If it does
  873|       |	 * not, search the EXIF marker.
  874|       |	 */
  875|  10.7k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 27, False: 10.7k]
  ------------------
  876|     27|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     27|#define LOG_TOO_SMALL \
  |  |  852|     27|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     27|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     27|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     27|		return;
  878|     27|	}
  879|  10.7k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 10.5k, False: 167]
  ------------------
  880|  10.5k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  10.5k|			  "Found EXIF header at start.");
  882|  10.5k|	} else {
  883|    916|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 901, False: 15]
  ------------------
  884|  1.21k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.20k, False: 5]
  |  Branch (884:17): [True: 312, False: 896]
  ------------------
  885|    312|				d++;
  886|    312|				ds--;
  887|    312|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|    901|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|    896|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 896, False: 5]
  |  Branch (890:14): [True: 277, False: 619]
  ------------------
  891|    277|				d++;
  892|    277|				ds--;
  893|    277|				continue;
  894|    277|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    624|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    619|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 619, False: 5]
  |  Branch (897:14): [True: 332, False: 287]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    332|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 297, False: 35]
  |  Branch (904:22): [True: 55, False: 242]
  ------------------
  905|     55|					break;
  906|       |				/* fallthrough */
  907|    332|			}
  908|       |			/* Skip irrelevant APP markers. The branch for APP1 must come before this,
  909|       |			   otherwise this code block will cause APP1 to be skipped. This code path
  910|       |			   is only relevant for files that are nonconformant to the EXIF
  911|       |			   specification. For conformant files, the APP1 code path above will be
  912|       |			   taken. */
  913|    569|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 558, False: 11]
  |  Branch (913:19): [True: 509, False: 49]
  |  Branch (913:35): [True: 503, False: 6]
  ------------------
  914|    503|				d++;
  915|    503|				ds--;
  916|    503|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    503|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 31, False: 472]
  ------------------
  918|     31|					return;
  919|    472|				d += l;
  920|    472|				ds -= l;
  921|    472|				continue;
  922|    503|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     66|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     66|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     66|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     66|			return;
  928|    569|		}
  929|     70|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 15, False: 55]
  ------------------
  930|     15|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     15|#define LOG_TOO_SMALL \
  |  |  852|     15|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     15|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     15|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     15|			return;
  932|     15|		}
  933|     55|		d++;
  934|     55|		ds--;
  935|     55|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     55|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 34, False: 21]
  ------------------
  937|     34|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     34|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     34|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     34|			return;
  940|     34|		}
  941|     21|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 2, False: 19]
  ------------------
  942|      2|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  943|      2|				  "ExifData", _("APP Tag too short."));
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  944|      2|			return;
  945|      2|		}
  946|     19|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     19|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     19|			  len);
  949|     19|		d += 2;
  950|     19|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     19|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  10.5k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 3, False: 10.5k]
  ------------------
  958|      3|		LOG_TOO_SMALL;
  ------------------
  |  |  851|      3|#define LOG_TOO_SMALL \
  |  |  852|      3|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|      3|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  959|      3|		return;
  960|      3|	}
  961|  10.5k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 10.5k]
  ------------------
  962|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  963|      0|			  "ExifData", _("EXIF header not found."));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  964|      0|		return;
  965|      0|	}
  966|       |
  967|  10.5k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  10.5k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  10.5k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 40, False: 10.5k]
  ------------------
  972|     40|		return;
  973|       |
  974|       |	/* The JPEG APP1 section can be no longer than 64 KiB (including a
  975|       |	   16-bit length), so cap the data length to protect against overflow
  976|       |	   in future offset calculations */
  977|  10.5k|	fullds = ds;
  978|  10.5k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 9, False: 10.5k]
  ------------------
  979|      9|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  10.5k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 7.97k, False: 2.56k]
  ------------------
  983|  7.97k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.56k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 2.49k, False: 63]
  ------------------
  985|  2.49k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
  986|     63|	else {
  987|     63|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  988|     63|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     63|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  989|     63|		return;
  990|     63|	}
  991|       |
  992|       |	/* Fixed value */
  993|  10.4k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 22, False: 10.4k]
  ------------------
  994|     22|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  10.4k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  10.4k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  10.4k|		  "IFD 0 at %i.", (int) offset);
 1000|       |
 1001|       |	/* ds is restricted to 16 bit above, so offset is restricted too, and offset+8 should not overflow. */
 1002|  10.4k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 53, False: 10.3k]
  |  Branch (1002:21): [True: 8, False: 10.3k]
  ------------------
 1003|     61|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  10.3k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  10.3k|	n = exif_get_short (d + 6 + offset, data->priv->order);
 1010|       |	/* offset < 2<<16, n is 16 bit at most, so this op will not overflow */
 1011|  10.3k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 2.03k, False: 8.35k]
  ------------------
 1012|  2.03k|		return;
 1013|       |
 1014|  8.35k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  8.35k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 8.15k, False: 197]
  ------------------
 1016|  8.15k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  8.15k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  8.15k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.68k, False: 6.47k]
  ------------------
 1021|  1.68k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.68k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  6.47k|		} else {
 1024|  6.47k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  6.47k|		}
 1026|  8.15k|	}
 1027|       |
 1028|       |	/*
 1029|       |	 * If we got an EXIF_TAG_MAKER_NOTE, try to interpret it. Some
 1030|       |	 * cameras use pointers in the maker note tag that point to the
 1031|       |	 * space between IFDs. Here is the only place where we have access
 1032|       |	 * to that data.
 1033|       |	 */
 1034|  8.35k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  8.35k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 8.35k, False: 0]
  ------------------
 1038|  8.35k|		exif_data_fix (data);
 1039|  8.35k|}
exif_data_unref:
 1111|  10.7k|{
 1112|  10.7k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 10.7k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  10.7k|	data->priv->ref_count--;
 1116|  10.7k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 10.7k, False: 0]
  ------------------
 1117|  10.7k|		exif_data_free (data);
 1118|  10.7k|}
exif_data_free:
 1122|  10.7k|{
 1123|  10.7k|	unsigned int i;
 1124|  10.7k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 10.7k, False: 0]
  |  Branch (1124:26): [True: 10.7k, False: 0]
  ------------------
 1125|       |
 1126|  10.7k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 10.7k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  64.5k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 53.7k, False: 10.7k]
  ------------------
 1130|  53.7k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 53.7k, False: 0]
  ------------------
 1131|  53.7k|			exif_content_unref (data->ifd[i]);
 1132|  53.7k|			data->ifd[i] = NULL;
 1133|  53.7k|		}
 1134|  53.7k|	}
 1135|       |
 1136|  10.7k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 194, False: 10.5k]
  ------------------
 1137|    194|		exif_mem_free (mem, data->data);
 1138|    194|		data->data = NULL;
 1139|    194|	}
 1140|       |
 1141|  10.7k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 10.7k, False: 0]
  ------------------
 1142|  10.7k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 10.7k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  10.7k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 7.01k, False: 3.74k]
  ------------------
 1147|  7.01k|			exif_mnote_data_unref (data->priv->md);
 1148|  7.01k|			data->priv->md = NULL;
 1149|  7.01k|		}
 1150|  10.7k|		exif_mem_free (mem, data->priv);
 1151|  10.7k|		exif_mem_free (mem, data);
 1152|  10.7k|	}
 1153|       |
 1154|  10.7k|	exif_mem_unref (mem);
 1155|  10.7k|}
exif_data_get_byte_order:
 1186|   158k|{
 1187|   158k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 158k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   158k|	return (data->priv->order);
 1191|   158k|}
exif_data_foreach_content:
 1196|  19.1k|{
 1197|  19.1k|	unsigned int i;
 1198|       |
 1199|  19.1k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 19.1k]
  |  Branch (1199:15): [True: 0, False: 19.1k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   114k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 95.5k, False: 19.1k]
  ------------------
 1203|  95.5k|		func (data->ifd[i], user_data);
 1204|  19.1k|}
exif_data_log:
 1246|  10.7k|{
 1247|  10.7k|	unsigned int i;
 1248|       |
 1249|  10.7k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 10.7k]
  |  Branch (1249:15): [True: 0, False: 10.7k]
  ------------------
 1250|      0|		return;
 1251|  10.7k|	exif_log_unref (data->priv->log);
 1252|  10.7k|	data->priv->log = log;
 1253|  10.7k|	exif_log_ref (log);
 1254|       |
 1255|  64.5k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 53.7k, False: 10.7k]
  ------------------
 1256|  53.7k|		exif_content_log (data->ifd[i], log);
 1257|  10.7k|}
exif_data_get_log:
 1263|  94.4k|{
 1264|  94.4k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 94.4k]
  |  Branch (1264:15): [True: 0, False: 94.4k]
  ------------------
 1265|      0|		return NULL;
 1266|  94.4k|	return data->priv->log;
 1267|  94.4k|}
exif_data_set_option:
 1309|  21.5k|{
 1310|  21.5k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 21.5k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  21.5k|	d->priv->options |= o;
 1314|  21.5k|}
exif_data_fix:
 1355|  8.35k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  8.35k|}
exif_data_set_data_type:
 1361|  10.7k|{
 1362|  10.7k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 10.7k]
  |  Branch (1362:12): [True: 0, False: 10.7k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  10.7k|	d->priv->data_type = dt;
 1366|  10.7k|}
exif_data_get_data_type:
 1370|  51.0k|{
 1371|  51.0k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1371:10): [True: 51.0k, False: 0]
  |  Branch (1371:15): [True: 51.0k, False: 0]
  ------------------
 1372|  51.0k|}
exif-data.c:exif_data_load_data_content:
  401|  36.0M|{
  402|  36.0M|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  403|  36.0M|	ExifShort n;
  404|  36.0M|	ExifEntry *entry;
  405|  36.0M|	unsigned int i;
  406|  36.0M|	ExifTag tag;
  407|       |
  408|  36.0M|	if (!data || !data->priv) 
  ------------------
  |  Branch (408:6): [True: 0, False: 36.0M]
  |  Branch (408:15): [True: 0, False: 36.0M]
  ------------------
  409|      0|		return;
  410|       |
  411|       |	/* check for valid ExifIfd enum range */
  412|  36.0M|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (412:6): [True: 0, False: 36.0M]
  |  Branch (412:26): [True: 0, False: 36.0M]
  ------------------
  413|      0|	  return;
  414|       |
  415|  36.0M|	if (recursion_cost > 170) {
  ------------------
  |  Branch (415:6): [True: 34.3M, False: 1.74M]
  ------------------
  416|       |		/*
  417|       |		 * recursion_cost is a logarithmic-scale indicator of how expensive this
  418|       |		 * recursive call might end up being. It is an indicator of the depth of
  419|       |		 * recursion as well as the potential for worst-case future recursive
  420|       |		 * calls. Since it's difficult to tell ahead of time how often recursion
  421|       |		 * will occur, this assumes the worst by assuming every tag could end up
  422|       |		 * causing recursion.
  423|       |		 * The value of 170 was chosen to limit typical EXIF structures to a
  424|       |		 * recursive depth of about 6, but pathological ones (those with very
  425|       |		 * many tags) to only 2.
  426|       |		 */
  427|  34.3M|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  428|  34.3M|			  "Deep/expensive recursion detected!");
  429|  34.3M|		return;
  430|  34.3M|	}
  431|       |
  432|       |	/* Read the number of entries */
  433|  1.74M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  1.74M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 2, False: 1.74M]
  |  |  |  Branch (53:81): [True: 0, False: 1.74M]
  |  |  |  Branch (53:112): [True: 672, False: 1.74M]
  |  |  ------------------
  ------------------
  434|    674|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|    674|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|    674|		return;
  437|    674|	}
  438|  1.74M|	n = exif_get_short (d + offset, data->priv->order);
  439|  1.74M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  1.74M|	          "Loading %hu entries...", n);
  441|  1.74M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  1.74M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  1.74M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 323, False: 1.74M]
  |  |  |  Branch (53:81): [True: 1.72M, False: 22.2k]
  |  |  |  Branch (53:112): [True: 4.57k, False: 17.6k]
  |  |  ------------------
  ------------------
  445|  1.73M|		n = (ds - offset) / 12;
  446|  1.73M|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  447|  1.73M|				  "Short data; only loading %hu entries...", n);
  448|  1.73M|	}
  449|       |
  450|   110M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (450:14): [True: 109M, False: 1.74M]
  ------------------
  451|       |
  452|   109M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   109M|		switch (tag) {
  454|   696k|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 696k, False: 108M]
  ------------------
  455|  35.3M|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (455:3): [True: 34.6M, False: 74.3M]
  ------------------
  456|  70.4M|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (456:3): [True: 35.1M, False: 73.8M]
  ------------------
  457|  70.4M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (457:3): [True: 6.02k, False: 109M]
  ------------------
  458|  70.4M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 7.37k, False: 109M]
  ------------------
  459|  70.4M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  70.4M|					   data->priv->order);
  461|  70.4M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 3.83k, False: 70.4M]
  ------------------
  462|  3.83k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  3.83k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  3.83k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 2.32k, False: 1.50k]
  ------------------
  465|  2.32k|					return;
  466|  1.50k|				break;
  467|  3.83k|			}
  468|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  469|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  470|       |			 */
  471|  70.4M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  70.4M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  70.4M|				  exif_tag_get_name(tag), o);
  474|  70.4M|			switch (tag) {
  475|   695k|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 695k, False: 69.7M]
  ------------------
  476|   695k|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|   695k|#define CHECK_REC(i) 					\
  |  |  357|   695k|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 4.49k, False: 690k]
  |  |  ------------------
  |  |  358|  4.49k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  4.49k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  4.49k|		"'%s' detected. Skipping...",		\
  |  |  361|  4.49k|		exif_ifd_get_name (i));			\
  |  |  362|  4.49k|	break;						\
  |  |  363|   690k|}							\
  |  |  364|   690k|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 3.48k, False: 687k]
  |  |  ------------------
  |  |  365|  3.48k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  3.48k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  3.48k|		"'%s' multiple times detected. "	\
  |  |  368|  3.48k|		"Skipping...",				\
  |  |  369|  3.48k|		exif_ifd_get_name (i));			\
  |  |  370|  3.48k|	break;						\
  |  |  371|  3.48k|}
  ------------------
  477|   687k|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|   687k|					recursion_cost + level_cost(n));
  479|   687k|				break;
  480|  34.6M|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (480:4): [True: 34.6M, False: 35.8M]
  ------------------
  481|  34.6M|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  356|  34.6M|#define CHECK_REC(i) 					\
  |  |  357|  34.6M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.0M, False: 17.5M]
  |  |  ------------------
  |  |  358|  17.0M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.0M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.0M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.0M|		exif_ifd_get_name (i));			\
  |  |  362|  17.0M|	break;						\
  |  |  363|  17.5M|}							\
  |  |  364|  17.5M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 958, False: 17.5M]
  |  |  ------------------
  |  |  365|    958|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    958|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    958|		"'%s' multiple times detected. "	\
  |  |  368|    958|		"Skipping...",				\
  |  |  369|    958|		exif_ifd_get_name (i));			\
  |  |  370|    958|	break;						\
  |  |  371|    958|}
  ------------------
  482|  17.5M|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  483|  17.5M|					recursion_cost + level_cost(n));
  484|  17.5M|				break;
  485|  35.1M|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (485:4): [True: 35.1M, False: 35.3M]
  ------------------
  486|  35.1M|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  356|  35.1M|#define CHECK_REC(i) 					\
  |  |  357|  35.1M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.3M, False: 17.7M]
  |  |  ------------------
  |  |  358|  17.3M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.3M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.3M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.3M|		exif_ifd_get_name (i));			\
  |  |  362|  17.3M|	break;						\
  |  |  363|  17.7M|}							\
  |  |  364|  17.7M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 868, False: 17.7M]
  |  |  ------------------
  |  |  365|    868|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    868|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    868|		"'%s' multiple times detected. "	\
  |  |  368|    868|		"Skipping...",				\
  |  |  369|    868|		exif_ifd_get_name (i));			\
  |  |  370|    868|	break;						\
  |  |  371|    868|}
  ------------------
  487|  17.7M|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  488|  17.7M|					recursion_cost + level_cost(n));
  489|  17.7M|				break;
  490|  6.70k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 6.70k, False: 70.4M]
  ------------------
  491|  6.70k|				thumbnail_offset = o;
  492|  6.70k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 5.90k, False: 801]
  |  Branch (492:29): [True: 1.71k, False: 4.18k]
  ------------------
  493|  1.71k|					exif_data_load_data_thumbnail (data, d,
  494|  1.71k|								       ds, thumbnail_offset,
  495|  1.71k|								       thumbnail_length);
  496|  6.70k|				break;
  497|  5.10k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 5.10k, False: 70.4M]
  ------------------
  498|  5.10k|				thumbnail_length = o;
  499|  5.10k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 2.97k, False: 2.13k]
  |  Branch (499:29): [True: 2.12k, False: 849]
  ------------------
  500|  2.12k|					exif_data_load_data_thumbnail (data, d,
  501|  2.12k|								       ds, thumbnail_offset,
  502|  2.12k|								       thumbnail_length);
  503|  5.10k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 70.4M]
  ------------------
  505|      0|				return;
  506|  70.4M|			}
  507|  70.4M|			break;
  508|  70.4M|		default:
  ------------------
  |  Branch (508:3): [True: 38.5M, False: 70.4M]
  ------------------
  509|       |
  510|       |			/*
  511|       |			 * If we don't know the tag, don't fail. It could be that new 
  512|       |			 * versions of the standard have defined additional tags. Note that
  513|       |			 * 0 is a valid tag in the GPS IFD.
  514|       |			 */
  515|  38.5M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.2M, False: 266k]
  ------------------
  516|       |
  517|       |				/*
  518|       |				 * Special case: Tag and format 0. That's against specification
  519|       |				 * (at least up to 2.2). But Photoshop writes it anyways.
  520|       |				 */
  521|  38.2M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (521:9): [True: 231k, False: 38.0M]
  ------------------
  522|   231k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   231k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   231k|						  exif_ifd_get_name (ifd));
  525|   231k|					break;
  526|   231k|				}
  527|  38.0M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  528|  38.0M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  529|  38.0M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  530|  38.0M|					  exif_ifd_get_name (ifd));
  531|  38.0M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (531:9): [True: 38.0M, False: 0]
  ------------------
  532|  38.0M|					break;
  533|  38.0M|			}
  534|   266k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   266k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 266k]
  ------------------
  536|      0|				  exif_log (data->priv->log, EXIF_LOG_CODE_NO_MEMORY, "ExifData",
  537|      0|                                          "Could not allocate memory");
  538|      0|				  return;
  539|      0|			}
  540|   266k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 30.6k, False: 236k]
  ------------------
  541|   266k|						   offset + 12 * i))
  542|  30.6k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   266k|			exif_entry_unref (entry);
  544|   266k|			break;
  545|   109M|		}
  546|   109M|	}
  547|  1.74M|}
exif-data.c:level_cost:
  380|  36.0M|{
  381|  36.0M|    static const double log_1_1 = 0.09531017980432493;
  382|       |
  383|       |	/* Adding 0.1 protects against the case where n==1 */
  384|  36.0M|	return ceil(log(n + 0.1)/log_1_1);
  385|  36.0M|}
exif-data.c:exif_data_load_data_thumbnail:
  334|  3.83k|{
  335|       |	/* Sanity checks */
  336|  3.83k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 3.83k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  3.83k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  3.83k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 3.83k]
  |  |  |  Branch (53:81): [True: 0, False: 3.83k]
  |  |  |  Branch (53:112): [True: 1.80k, False: 2.03k]
  |  |  ------------------
  ------------------
  341|  1.80k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  1.80k|		return;
  343|  1.80k|	}
  344|  2.03k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 1.83k, False: 194]
  ------------------
  345|  1.83k|		exif_mem_free (data->priv->mem, data->data);
  346|  2.03k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 2.03k]
  ------------------
  347|      0|		EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  348|      0|		data->size = 0;
  349|      0|		return;
  350|      0|	}
  351|  2.03k|	data->size = s;
  352|  2.03k|	memcpy (data->data, d + o, s);
  353|  2.03k|}
exif-data.c:exif_data_load_data_entry:
  169|   266k|{
  170|   266k|	unsigned int s, doff;
  171|       |
  172|   266k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   266k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   266k|	entry->components = exif_get_long  (d + offset + 4, data->priv->order);
  175|       |
  176|       |	/* FIXME: should use exif_tag_get_name_in_ifd here but entry->parent 
  177|       |	 * has not been set yet
  178|       |	 */
  179|   266k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   266k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   266k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   266k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   266k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 171k, False: 95.1k]
  |  Branch (186:33): [True: 39.7k, False: 55.3k]
  ------------------
  187|   211k|		return 0;
  188|   211k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  55.3k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 43.9k, False: 11.4k]
  ------------------
  195|  43.9k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  11.4k|	else
  197|  11.4k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  55.3k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 21.1k, False: 34.2k]
  ------------------
  201|  21.1k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  21.1k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  21.1k|		return 0;
  204|  21.1k|	}
  205|       |
  206|  34.2k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 3.58k, False: 30.6k]
  ------------------
  207|  3.58k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  3.58k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  3.58k|		return 0;
  210|  3.58k|	}
  211|       |
  212|  30.6k|	entry->data = exif_data_alloc (data, s);
  213|  30.6k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 30.6k, False: 0]
  ------------------
  214|  30.6k|		entry->size = s;
  215|  30.6k|		memcpy (entry->data, d + doff, s);
  216|  30.6k|	} else {
  217|      0|		EXIF_LOG_NO_MEMORY(data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  218|      0|		return 0;
  219|      0|	}
  220|       |
  221|       |	/* If this is the MakerNote, remember the offset */
  222|  30.6k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.87k, False: 21.8k]
  ------------------
  223|  8.87k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.87k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.87k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 7.80k, False: 1.06k]
  ------------------
  227|  7.80k|			exif_log (data->priv->log,
  228|  7.80k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  7.80k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  7.80k|					       "%02x %02x %02x...).",
  231|  7.80k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  7.80k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  7.80k|					       entry->data[6]);
  234|  7.80k|		}
  235|  8.87k|		data->priv->offset_mnote = doff;
  236|  8.87k|	}
  237|  30.6k|	return 1;
  238|  30.6k|}
exif-data.c:interpret_maker_note:
  802|  8.35k|{
  803|  8.35k|	int mnoteid;
  804|  8.35k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  8.35k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 8.35k]
  |  |  ------------------
  |  |  254|  8.35k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  8.35k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 8.35k]
  |  |  ------------------
  |  |  256|  8.35k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  8.35k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 7.21k, False: 1.13k]
  |  |  ------------------
  |  |  258|  8.35k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  8.35k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 1.13k]
  |  |  ------------------
  |  |  260|  1.13k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  1.13k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 1.13k]
  |  |  ------------------
  |  |  262|  1.13k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  805|  8.35k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 1.13k, False: 7.21k]
  ------------------
  806|  1.13k|		return;
  807|       |	
  808|  7.21k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 3.97k, False: 3.24k]
  ------------------
  809|  3.97k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  3.97k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  3.97k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  3.97k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 906, False: 2.33k]
  ------------------
  814|    906|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    906|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    906|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  817|       |
  818|  2.33k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (818:13): [True: 1.04k, False: 1.28k]
  ------------------
  819|  1.04k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|  1.04k|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|  1.04k|		data->priv->md = exif_mnote_data_fuji_new (data->priv->mem);
  822|       |
  823|       |	/* NOTE: Must do Pentax detection last because some of the
  824|       |	 * heuristics are pretty general. */
  825|  1.28k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (825:13): [True: 1.08k, False: 200]
  ------------------
  826|  1.08k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|  1.08k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|  1.08k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|  1.08k|	}
  830|       |/* Marcus: disabled until apple makernote can also be saved
  831|       |	else if ((mnoteid = exif_mnote_data_apple_identify (data, e)) != 0) {
  832|       |		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  833|       |			"ExifData", "Apple MakerNote variant type %d", mnoteid);
  834|       |		data->priv->md = exif_mnote_data_apple_new (data->priv->mem);
  835|       |	}
  836|       |*/
  837|       |
  838|       |	/* 
  839|       |	 * If we are able to interpret the maker note, do so.
  840|       |	 */
  841|  7.21k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 7.01k, False: 200]
  ------------------
  842|  7.01k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  7.01k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  7.01k|						data->priv->order);
  845|  7.01k|		exif_mnote_data_set_offset (data->priv->md,
  846|  7.01k|					    data->priv->offset_mnote);
  847|  7.01k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  7.01k|	}
  849|  7.21k|}
exif-data.c:exif_data_alloc:
   77|  32.7k|{
   78|  32.7k|	void *d;
   79|       |
   80|  32.7k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 32.7k]
  |  Branch (80:15): [True: 0, False: 32.7k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  32.7k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  32.7k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 32.7k, False: 0]
  ------------------
   85|  32.7k|		return d;
   86|       |
   87|      0|	EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
   88|       |	return NULL;
   89|  32.7k|}
exif-data.c:fix_func:
 1327|  41.7k|{
 1328|  41.7k|	switch (exif_content_get_ifd (c)) {
 1329|  8.35k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 8.35k, False: 33.4k]
  ------------------
 1330|  8.35k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 171, False: 8.17k]
  ------------------
 1331|    171|			exif_content_fix (c);
 1332|  8.17k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 505, False: 7.67k]
  ------------------
 1333|    505|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    505|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    505|				  "removed.");
 1336|  1.91k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.41k, False: 505]
  ------------------
 1337|  1.41k|				unsigned int cnt = c->count;
 1338|  1.41k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.41k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.41k]
  ------------------
 1340|       |					/* safety net */
 1341|      0|					exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1342|      0|						  "failed to remove entry from entries.");
 1343|      0|					break;
 1344|      0|				}
 1345|  1.41k|			}
 1346|    505|		}
 1347|  8.35k|		break;
 1348|  33.4k|	default:
  ------------------
  |  Branch (1348:2): [True: 33.4k, False: 8.35k]
  ------------------
 1349|  33.4k|		exif_content_fix (c);
 1350|  41.7k|	}
 1351|  41.7k|}

exif_entry_new:
  114|  50.5k|{
  115|  50.5k|	ExifMem *mem = exif_mem_new_default ();
  116|  50.5k|	ExifEntry *e = exif_entry_new_mem (mem);
  117|       |
  118|  50.5k|	exif_mem_unref (mem);
  119|       |
  120|  50.5k|	return e;
  121|  50.5k|}
exif_entry_new_mem:
  125|   317k|{
  126|   317k|	ExifEntry *e = NULL;
  127|       |
  128|   317k|	e = exif_mem_alloc (mem, sizeof (ExifEntry));
  129|   317k|	if (!e) return NULL;
  ------------------
  |  Branch (129:6): [True: 0, False: 317k]
  ------------------
  130|   317k|	e->priv = exif_mem_alloc (mem, sizeof (ExifEntryPrivate));
  131|   317k|	if (!e->priv) { exif_mem_free (mem, e); return NULL; }
  ------------------
  |  Branch (131:6): [True: 0, False: 317k]
  ------------------
  132|   317k|	e->priv->ref_count = 1;
  133|       |
  134|   317k|	e->priv->mem = mem;
  135|   317k|	exif_mem_ref (mem);
  136|       |
  137|   317k|	return e;
  138|   317k|}
exif_entry_ref:
  142|  72.6k|{
  143|  72.6k|	if (!e) return;
  ------------------
  |  Branch (143:6): [True: 0, False: 72.6k]
  ------------------
  144|       |
  145|  72.6k|	e->priv->ref_count++;
  146|  72.6k|}
exif_entry_unref:
  150|   389k|{
  151|   389k|	if (!e) return;
  ------------------
  |  Branch (151:6): [True: 0, False: 389k]
  ------------------
  152|       |
  153|   389k|	e->priv->ref_count--;
  154|   389k|	if (!e->priv->ref_count)
  ------------------
  |  Branch (154:6): [True: 317k, False: 72.6k]
  ------------------
  155|   317k|		exif_entry_free (e);
  156|   389k|}
exif_entry_free:
  160|   317k|{
  161|   317k|	if (!e) return;
  ------------------
  |  Branch (161:6): [True: 0, False: 317k]
  ------------------
  162|       |
  163|   317k|	if (e->priv) {
  ------------------
  |  Branch (163:6): [True: 317k, False: 0]
  ------------------
  164|   317k|		ExifMem *mem = e->priv->mem;
  165|   317k|		if (e->data)
  ------------------
  |  Branch (165:7): [True: 81.1k, False: 236k]
  ------------------
  166|  81.1k|			exif_mem_free (mem, e->data);
  167|   317k|		exif_mem_free (mem, e->priv);
  168|   317k|		exif_mem_free (mem, e);
  169|   317k|		exif_mem_unref (mem);
  170|   317k|	}
  171|   317k|}
exif_entry_fix:
  208|  17.4k|{
  209|  17.4k|	unsigned int i, newsize;
  210|  17.4k|	unsigned char *newdata;
  211|  17.4k|	ExifByteOrder o;
  212|  17.4k|	ExifRational r;
  213|  17.4k|	ExifSRational sr;
  214|       |
  215|  17.4k|	if (!e || !e->priv) return;
  ------------------
  |  Branch (215:6): [True: 0, False: 17.4k]
  |  Branch (215:12): [True: 0, False: 17.4k]
  ------------------
  216|       |
  217|  17.4k|	switch (e->tag) {
  218|       |	
  219|       |	/* These tags all need to be of format SHORT. */
  220|     57|	case EXIF_TAG_YCBCR_SUB_SAMPLING:
  ------------------
  |  Branch (220:2): [True: 57, False: 17.4k]
  ------------------
  221|     70|	case EXIF_TAG_SUBJECT_AREA:
  ------------------
  |  Branch (221:2): [True: 13, False: 17.4k]
  ------------------
  222|    120|	case EXIF_TAG_COLOR_SPACE:
  ------------------
  |  Branch (222:2): [True: 50, False: 17.4k]
  ------------------
  223|    155|	case EXIF_TAG_PLANAR_CONFIGURATION:
  ------------------
  |  Branch (223:2): [True: 35, False: 17.4k]
  ------------------
  224|    170|	case EXIF_TAG_SENSING_METHOD:
  ------------------
  |  Branch (224:2): [True: 15, False: 17.4k]
  ------------------
  225|    245|	case EXIF_TAG_ORIENTATION:
  ------------------
  |  Branch (225:2): [True: 75, False: 17.3k]
  ------------------
  226|    326|	case EXIF_TAG_YCBCR_POSITIONING:
  ------------------
  |  Branch (226:2): [True: 81, False: 17.3k]
  ------------------
  227|    385|	case EXIF_TAG_PHOTOMETRIC_INTERPRETATION:
  ------------------
  |  Branch (227:2): [True: 59, False: 17.4k]
  ------------------
  228|    453|	case EXIF_TAG_CUSTOM_RENDERED:
  ------------------
  |  Branch (228:2): [True: 68, False: 17.4k]
  ------------------
  229|    500|	case EXIF_TAG_EXPOSURE_MODE:
  ------------------
  |  Branch (229:2): [True: 47, False: 17.4k]
  ------------------
  230|    553|	case EXIF_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (230:2): [True: 53, False: 17.4k]
  ------------------
  231|    594|	case EXIF_TAG_SCENE_CAPTURE_TYPE:
  ------------------
  |  Branch (231:2): [True: 41, False: 17.4k]
  ------------------
  232|    624|	case EXIF_TAG_GAIN_CONTROL:
  ------------------
  |  Branch (232:2): [True: 30, False: 17.4k]
  ------------------
  233|    676|	case EXIF_TAG_SATURATION:
  ------------------
  |  Branch (233:2): [True: 52, False: 17.4k]
  ------------------
  234|    703|	case EXIF_TAG_CONTRAST:
  ------------------
  |  Branch (234:2): [True: 27, False: 17.4k]
  ------------------
  235|    716|	case EXIF_TAG_SHARPNESS:
  ------------------
  |  Branch (235:2): [True: 13, False: 17.4k]
  ------------------
  236|    734|	case EXIF_TAG_ISO_SPEED_RATINGS:
  ------------------
  |  Branch (236:2): [True: 18, False: 17.4k]
  ------------------
  237|    734|		switch (e->format) {
  238|     73|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (238:3): [True: 73, False: 661]
  ------------------
  239|    107|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (239:3): [True: 34, False: 700]
  ------------------
  240|    192|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (240:3): [True: 85, False: 649]
  ------------------
  241|    288|		case EXIF_FORMAT_SBYTE:
  ------------------
  |  Branch (241:3): [True: 96, False: 638]
  ------------------
  242|    344|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (242:3): [True: 56, False: 678]
  ------------------
  243|    344|			if (!e->parent || !e->parent->parent) break;
  ------------------
  |  Branch (243:8): [True: 0, False: 344]
  |  Branch (243:22): [True: 0, False: 344]
  ------------------
  244|    344|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  245|    344|				_("Tag '%s' was of format '%s' (which is "
  ------------------
  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  246|    344|				"against specification) and has been "
  247|    344|				"changed to format '%s'."),
  248|    344|				exif_tag_get_name_in_ifd(e->tag,
  249|    344|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|    344|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 344, False: 0]
  |  |  ------------------
  ------------------
  250|    344|				exif_format_get_name (e->format),
  251|    344|				exif_format_get_name (EXIF_FORMAT_SHORT));
  252|       |
  253|    344|			o = exif_data_get_byte_order (e->parent->parent);
  254|    344|			newsize = e->components * exif_format_get_size (EXIF_FORMAT_SHORT);
  255|    344|			newdata = exif_entry_alloc (e, newsize);
  256|    344|			if (!newdata) {
  ------------------
  |  Branch (256:8): [True: 0, False: 344]
  ------------------
  257|      0|				exif_entry_log (e, EXIF_LOG_CODE_NO_MEMORY,
  258|      0|					"Could not allocate %lu byte(s).", (unsigned long)newsize);
  259|      0|				break;
  260|      0|			}
  261|       |
  262|  64.8k|			for (i = 0; i < e->components; i++)
  ------------------
  |  Branch (262:16): [True: 64.4k, False: 344]
  ------------------
  263|  64.4k|				exif_set_short (
  264|  64.4k|					newdata + i *
  265|  64.4k|					exif_format_get_size (
  266|  64.4k|					 EXIF_FORMAT_SHORT), o,
  267|  64.4k|					 exif_get_short_convert (
  268|  64.4k|					  e->data + i *
  269|  64.4k|					  exif_format_get_size (e->format),
  270|  64.4k|					  e->format, o));
  271|       |
  272|    344|			exif_mem_free (e->priv->mem, e->data);
  273|    344|			e->data = newdata;
  274|    344|			e->size = newsize;
  275|    344|			e->format = EXIF_FORMAT_SHORT;
  276|    344|			break;
  277|    294|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (277:3): [True: 294, False: 440]
  ------------------
  278|       |			/* No conversion necessary */
  279|    294|			break;
  280|     96|		default:
  ------------------
  |  Branch (280:3): [True: 96, False: 638]
  ------------------
  281|     96|			exif_entry_log (e, EXIF_LOG_CODE_CORRUPT_DATA,
  282|     96|				_("Tag '%s' is of format '%s' (which is "
  ------------------
  |  |   31|     96|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  283|     96|				"against specification) but cannot be changed "
  284|     96|				"to format '%s'."),
  285|     96|				exif_tag_get_name_in_ifd(e->tag,
  286|     96|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|     96|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 96, False: 0]
  |  |  ------------------
  ------------------
  287|     96|				exif_format_get_name (e->format),
  288|     96|				exif_format_get_name (EXIF_FORMAT_SHORT));
  289|     96|			break;
  290|    734|		}
  291|    734|		break;
  292|       |
  293|       |	/* All these tags need to be of format 'Rational'. */
  294|    734|	case EXIF_TAG_FNUMBER:
  ------------------
  |  Branch (294:2): [True: 100, False: 17.3k]
  ------------------
  295|    192|	case EXIF_TAG_APERTURE_VALUE:
  ------------------
  |  Branch (295:2): [True: 92, False: 17.3k]
  ------------------
  296|    303|	case EXIF_TAG_EXPOSURE_TIME:
  ------------------
  |  Branch (296:2): [True: 111, False: 17.3k]
  ------------------
  297|    413|	case EXIF_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (297:2): [True: 110, False: 17.3k]
  ------------------
  298|    413|		switch (e->format) {
  299|     97|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (299:3): [True: 97, False: 316]
  ------------------
  300|     97|			if (!e->parent || !e->parent->parent) break;
  ------------------
  |  Branch (300:8): [True: 0, False: 97]
  |  Branch (300:22): [True: 0, False: 97]
  ------------------
  301|     97|			o = exif_data_get_byte_order (e->parent->parent);
  302|  19.2k|			for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (302:16): [True: 19.1k, False: 97]
  ------------------
  303|  19.1k|				sr = exif_get_srational (e->data + i * 
  304|  19.1k|					exif_format_get_size (
  305|  19.1k|						EXIF_FORMAT_SRATIONAL), o);
  306|  19.1k|				r.numerator = (ExifLong) sr.numerator;
  307|  19.1k|				r.denominator = (ExifLong) sr.denominator;
  308|  19.1k|				exif_set_rational (e->data + i *
  309|  19.1k|					exif_format_get_size (
  310|  19.1k|						EXIF_FORMAT_RATIONAL), o, r);
  311|  19.1k|			}
  312|     97|			e->format = EXIF_FORMAT_RATIONAL;
  313|     97|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  314|     97|				_("Tag '%s' was of format '%s' (which is "
  ------------------
  |  |   31|     97|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  315|     97|				"against specification) and has been "
  316|     97|				"changed to format '%s'."),
  317|     97|				exif_tag_get_name_in_ifd(e->tag,
  318|     97|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|     97|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 97, False: 0]
  |  |  ------------------
  ------------------
  319|     97|				exif_format_get_name (EXIF_FORMAT_SRATIONAL),
  320|     97|				exif_format_get_name (EXIF_FORMAT_RATIONAL));
  321|     97|			break;
  322|    316|		default:
  ------------------
  |  Branch (322:3): [True: 316, False: 97]
  ------------------
  323|    316|			break;
  324|    413|		}
  325|    413|		break;
  326|       |
  327|       |	/* All these tags need to be of format 'SRational'. */
  328|    413|	case EXIF_TAG_EXPOSURE_BIAS_VALUE:
  ------------------
  |  Branch (328:2): [True: 177, False: 17.2k]
  ------------------
  329|    317|	case EXIF_TAG_BRIGHTNESS_VALUE:
  ------------------
  |  Branch (329:2): [True: 140, False: 17.3k]
  ------------------
  330|    432|	case EXIF_TAG_SHUTTER_SPEED_VALUE:
  ------------------
  |  Branch (330:2): [True: 115, False: 17.3k]
  ------------------
  331|    432|		switch (e->format) {
  332|    297|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (332:3): [True: 297, False: 135]
  ------------------
  333|    297|			if (!e->parent || !e->parent->parent) break;
  ------------------
  |  Branch (333:8): [True: 0, False: 297]
  |  Branch (333:22): [True: 0, False: 297]
  ------------------
  334|    297|			o = exif_data_get_byte_order (e->parent->parent);
  335|  20.7k|			for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (335:16): [True: 20.4k, False: 297]
  ------------------
  336|  20.4k|				r = exif_get_rational (e->data + i * 
  337|  20.4k|					exif_format_get_size (
  338|  20.4k|						EXIF_FORMAT_RATIONAL), o);
  339|  20.4k|				sr.numerator = (ExifLong) r.numerator;
  340|  20.4k|				sr.denominator = (ExifLong) r.denominator;
  341|  20.4k|				exif_set_srational (e->data + i *
  342|  20.4k|					exif_format_get_size (
  343|  20.4k|						EXIF_FORMAT_SRATIONAL), o, sr);
  344|  20.4k|			}
  345|    297|			e->format = EXIF_FORMAT_SRATIONAL;
  346|    297|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  347|    297|				_("Tag '%s' was of format '%s' (which is "
  ------------------
  |  |   31|    297|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  348|    297|				"against specification) and has been "
  349|    297|				"changed to format '%s'."),
  350|    297|				exif_tag_get_name_in_ifd(e->tag,
  351|    297|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|    297|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 297, False: 0]
  |  |  ------------------
  ------------------
  352|    297|				exif_format_get_name (EXIF_FORMAT_RATIONAL),
  353|    297|				exif_format_get_name (EXIF_FORMAT_SRATIONAL));
  354|    297|			break;
  355|    135|		default:
  ------------------
  |  Branch (355:3): [True: 135, False: 297]
  ------------------
  356|    135|			break;
  357|    432|		}
  358|    432|		break;
  359|       |
  360|    432|	case EXIF_TAG_USER_COMMENT:
  ------------------
  |  Branch (360:2): [True: 169, False: 17.2k]
  ------------------
  361|       |
  362|       |		/* Format needs to be UNDEFINED. */
  363|    169|		if (e->format != EXIF_FORMAT_UNDEFINED) {
  ------------------
  |  Branch (363:7): [True: 94, False: 75]
  ------------------
  364|     94|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  365|     94|				_("Tag 'UserComment' had invalid format '%s'. "
  ------------------
  |  |   31|     94|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  366|     94|				"Format has been set to 'undefined'."),
  367|     94|				exif_format_get_name (e->format));
  368|     94|			e->format = EXIF_FORMAT_UNDEFINED;
  369|     94|		}
  370|       |
  371|       |		/* Some packages like Canon ZoomBrowser EX 4.5 store
  372|       |		   only one zero byte followed by 7 bytes of rubbish */
  373|    169|		if ((e->size >= 8) && (e->data[0] == 0)) {
  ------------------
  |  Branch (373:7): [True: 163, False: 6]
  |  Branch (373:25): [True: 51, False: 112]
  ------------------
  374|     51|			memcpy(e->data, "\0\0\0\0\0\0\0\0", 8);
  375|     51|		}
  376|       |
  377|       |		/* There need to be at least 8 bytes. */
  378|    169|		if (e->size < 8) {
  ------------------
  |  Branch (378:7): [True: 6, False: 163]
  ------------------
  379|      6|			e->data = exif_entry_realloc (e, e->data, 8 + e->size);
  380|      6|			if (!e->data) {
  ------------------
  |  Branch (380:8): [True: 0, False: 6]
  ------------------
  381|      0|				clear_entry(e);
  382|      0|				return;
  383|      0|			}
  384|       |
  385|       |			/* Assume ASCII */
  386|      6|			memmove (e->data + 8, e->data, e->size);
  387|      6|			memcpy (e->data, "ASCII\0\0\0", 8);
  388|      6|			e->size += 8;
  389|      6|			e->components += 8;
  390|      6|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  391|      6|				_("Tag 'UserComment' has been expanded to at "
  ------------------
  |  |   31|      6|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|      6|				"least 8 bytes in order to follow the "
  393|      6|				"specification."));
  394|      6|			break;
  395|      6|		}
  396|       |
  397|       |		/*
  398|       |		 * If the first 8 bytes are empty and real data starts
  399|       |		 * afterwards, let's assume ASCII and claim the 8 first
  400|       |		 * bytes for the format specifier.
  401|       |		 */
  402|  12.9k|		for (i = 0; (i < e->size) && !e->data[i]; i++);
  ------------------
  |  Branch (402:15): [True: 12.9k, False: 6]
  |  Branch (402:32): [True: 12.8k, False: 157]
  ------------------
  403|    555|		if (!i) for ( ; (i < e->size) && (e->data[i] == ' '); i++);
  ------------------
  |  Branch (403:7): [True: 112, False: 51]
  |  Branch (403:19): [True: 553, False: 2]
  |  Branch (403:36): [True: 443, False: 110]
  ------------------
  404|    163|		if ((i >= 8) && (i < e->size)) {
  ------------------
  |  Branch (404:7): [True: 59, False: 104]
  |  Branch (404:19): [True: 51, False: 8]
  ------------------
  405|     51|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  406|     51|				_("Tag 'UserComment' is not empty but does not "
  ------------------
  |  |   31|     51|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  407|     51|				"start with a format identifier. "
  408|     51|				"This has been fixed."));
  409|     51|			memcpy (e->data, "ASCII\0\0\0", 8);
  410|     51|			break;
  411|     51|		}
  412|       |
  413|       |		/* 
  414|       |		 * First 8 bytes need to follow the specification. If they don't, 
  415|       |		 * assume ASCII.
  416|       |		 */
  417|    112|		if (memcmp (e->data, "ASCII\0\0\0"     , 8) &&
  ------------------
  |  Branch (417:7): [True: 111, False: 1]
  ------------------
  418|    111|		    memcmp (e->data, "UNICODE\0"       , 8) &&
  ------------------
  |  Branch (418:7): [True: 110, False: 1]
  ------------------
  419|    110|		    memcmp (e->data, "JIS\0\0\0\0\0"   , 8) &&
  ------------------
  |  Branch (419:7): [True: 109, False: 1]
  ------------------
  420|    109|		    memcmp (e->data, "\0\0\0\0\0\0\0\0", 8)) {
  ------------------
  |  Branch (420:7): [True: 103, False: 6]
  ------------------
  421|    103|			e->data = exif_entry_realloc (e, e->data, 8 + e->size);
  422|    103|			if (!e->data) {
  ------------------
  |  Branch (422:8): [True: 0, False: 103]
  ------------------
  423|      0|				clear_entry(e);
  424|      0|				break;
  425|      0|			}
  426|       |
  427|       |			/* Assume ASCII */
  428|    103|			memmove (e->data + 8, e->data, e->size);
  429|    103|			memcpy (e->data, "ASCII\0\0\0", 8);
  430|    103|			e->size += 8;
  431|    103|			e->components += 8;
  432|    103|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  433|    103|				_("Tag 'UserComment' did not start with a "
  ------------------
  |  |   31|    103|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  434|    103|				"format identifier. This has been fixed."));
  435|    103|			break;
  436|    103|		}
  437|       |
  438|      9|		break;
  439|  15.7k|	default:
  ------------------
  |  Branch (439:2): [True: 15.7k, False: 1.74k]
  ------------------
  440|  15.7k|		break;
  441|  17.4k|	}
  442|  17.4k|}
exif_entry_get_value:
  855|  72.3k|{
  856|  72.3k|	unsigned int i, j, k;
  857|  72.3k|	ExifShort v_short, v_short2, v_short3, v_short4;
  858|  72.3k|	ExifByte v_byte;
  859|  72.3k|	ExifRational v_rat;
  860|  72.3k|	ExifSRational v_srat;
  861|  72.3k|	char b[64];
  862|  72.3k|	const char *c;
  863|  72.3k|	ExifByteOrder o;
  864|  72.3k|	double d;
  865|  72.3k|	ExifEntry *entry;
  866|  72.3k|	static const struct {
  867|  72.3k|		char label[5];
  868|  72.3k|		char major, minor;
  869|  72.3k|	} versions[] = {
  870|  72.3k|		{"0110", 1,  1},
  871|  72.3k|		{"0120", 1,  2},
  872|  72.3k|		{"0200", 2,  0},
  873|  72.3k|		{"0210", 2,  1},
  874|  72.3k|		{"0220", 2,  2},
  875|  72.3k|		{"0221", 2, 21},
  876|  72.3k|		{"0230", 2,  3},
  877|  72.3k|		{"0231", 2, 31},
  878|  72.3k|		{"0232", 2, 32},
  879|  72.3k|		{""    , 0,  0}
  880|  72.3k|	};
  881|       |
  882|  72.3k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  883|       |
  884|  72.3k|	if (!e || !e->parent || !e->parent->parent || !maxlen || !val)
  ------------------
  |  Branch (884:6): [True: 0, False: 72.3k]
  |  Branch (884:12): [True: 0, False: 72.3k]
  |  Branch (884:26): [True: 0, False: 72.3k]
  |  Branch (884:48): [True: 0, False: 72.3k]
  |  Branch (884:59): [True: 0, False: 72.3k]
  ------------------
  885|      0|		return val;
  886|       |
  887|       |	/* make sure the returned string is zero terminated */
  888|       |	/* FIXME: this is inefficient in the case of long buffers and should
  889|       |	 * instead be taken care of on each write instead. */
  890|  72.3k|	memset (val, 0, maxlen);
  891|       |
  892|       |	/* We need the byte order */
  893|  72.3k|	o = exif_data_get_byte_order (e->parent->parent);
  894|       |
  895|       |	/* Sanity check */
  896|  72.3k|	if (e->size != e->components * exif_format_get_size (e->format)) {
  ------------------
  |  Branch (896:6): [True: 25, False: 72.2k]
  ------------------
  897|     25|		snprintf (val, maxlen, _("Invalid size of entry (%i, "
  ------------------
  |  |   31|     25|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  898|     25|			"expected %li x %i)."), e->size, e->components,
  899|     25|				exif_format_get_size (e->format));
  900|     25|		return val;
  901|     25|	}
  902|       |
  903|  72.2k|	switch (e->tag) {
  904|    264|	case EXIF_TAG_USER_COMMENT:
  ------------------
  |  Branch (904:2): [True: 264, False: 72.0k]
  ------------------
  905|       |
  906|       |		/*
  907|       |		 * The specification says UNDEFINED, but some
  908|       |		 * manufacturers don't care and use ASCII. If this is the
  909|       |		 * case here, only refuse to read it if there is no chance
  910|       |		 * of finding readable data.
  911|       |		 */
  912|    264|		if ((e->format != EXIF_FORMAT_ASCII) || 
  ------------------
  |  Branch (912:7): [True: 225, False: 39]
  ------------------
  913|     39|		    (e->size <= 8) ||
  ------------------
  |  Branch (913:7): [True: 1, False: 38]
  ------------------
  914|     38|		    ( memcmp (e->data, "ASCII\0\0\0"  , 8) &&
  ------------------
  |  Branch (914:9): [True: 37, False: 1]
  ------------------
  915|     37|		      memcmp (e->data, "UNICODE\0"    , 8) &&
  ------------------
  |  Branch (915:9): [True: 36, False: 1]
  ------------------
  916|     36|		      memcmp (e->data, "JIS\0\0\0\0\0", 8) &&
  ------------------
  |  Branch (916:9): [True: 35, False: 1]
  ------------------
  917|     35|		      memcmp (e->data, "\0\0\0\0\0\0\0\0", 8)))
  ------------------
  |  Branch (917:9): [True: 31, False: 4]
  ------------------
  918|    257|			CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|    257|#define CF(entry,target,v,maxlen)					\
  |  |  647|    257|{									\
  |  |  648|    257|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 38, False: 219]
  |  |  ------------------
  |  |  649|     38|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     38|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     38|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     38|			"format ('%s', expected '%s')."),		\
  |  |  652|     38|			exif_tag_get_name (entry->tag),			\
  |  |  653|     38|			exif_format_get_name (entry->format),		\
  |  |  654|     38|			exif_format_get_name (target));			\
  |  |  655|     38|		break;							\
  |  |  656|     38|	}								\
  |  |  657|    257|}
  ------------------
  919|       |
  920|       |		/*
  921|       |		 * Note that, according to the specification (V2.1, p 40),
  922|       |		 * the user comment field does not have to be 
  923|       |		 * NULL terminated.
  924|       |		 */
  925|    226|		if ((e->size >= 8) && !memcmp (e->data, "ASCII\0\0\0", 8)) {
  ------------------
  |  Branch (925:7): [True: 218, False: 8]
  |  Branch (925:25): [True: 137, False: 81]
  ------------------
  926|    137|			strncpy (val, (char *) e->data + 8, MIN (e->size - 8, maxlen-1));
  ------------------
  |  |  182|    137|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 109, False: 28]
  |  |  ------------------
  ------------------
  927|    137|			break;
  928|    137|		}
  929|     89|		if ((e->size >= 8) && !memcmp (e->data, "UNICODE\0", 8)) {
  ------------------
  |  Branch (929:7): [True: 81, False: 8]
  |  Branch (929:25): [True: 2, False: 79]
  ------------------
  930|      2|			strncpy (val, _("Unsupported UNICODE string"), maxlen-1);
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  931|       |		/* FIXME: use iconv to convert into the locale encoding.
  932|       |		 * EXIF 2.2 implies (but does not say) that this encoding is
  933|       |		 * UCS-2.
  934|       |		 */
  935|      2|			break;
  936|      2|		}
  937|     87|		if ((e->size >= 8) && !memcmp (e->data, "JIS\0\0\0\0\0", 8)) {
  ------------------
  |  Branch (937:7): [True: 79, False: 8]
  |  Branch (937:25): [True: 2, False: 77]
  ------------------
  938|      2|			strncpy (val, _("Unsupported JIS string"), maxlen-1);
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|       |		/* FIXME: use iconv to convert into the locale encoding */
  940|      2|			break;
  941|      2|		}
  942|       |
  943|       |		/* Check if there is really some information in the tag. */
  944|  1.74k|		for (i = 0; (i < e->size) &&
  ------------------
  |  Branch (944:15): [True: 1.73k, False: 11]
  ------------------
  945|  1.73k|			    (!e->data[i] || (e->data[i] == ' ')); i++);
  ------------------
  |  Branch (945:9): [True: 1.23k, False: 501]
  |  Branch (945:24): [True: 427, False: 74]
  ------------------
  946|     85|		if (i == e->size) break;
  ------------------
  |  Branch (946:7): [True: 11, False: 74]
  ------------------
  947|       |
  948|       |		/*
  949|       |		 * If we reach this point, the tag does not
  950|       | 		 * comply with the standard but seems to contain data.
  951|       |		 * Print as much as possible.
  952|       |		 * Note: make sure we do not overwrite the final \0 at maxlen-1
  953|       |		 */
  954|     74|		exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  955|     74|			_("Tag UserComment contains data but is "
  ------------------
  |  |   31|     74|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  956|     74|			  "against specification."));
  957|  92.2k| 		for (j = 0; (i < e->size) && (j < maxlen-1); i++, j++) {
  ------------------
  |  Branch (957:16): [True: 92.2k, False: 69]
  |  Branch (957:33): [True: 92.2k, False: 5]
  ------------------
  958|  92.2k|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  959|  92.2k|				_("Byte at position %i: 0x%02x"), i, e->data[i]);
  ------------------
  |  |   31|  92.2k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  960|  92.2k| 			val[j] = isprint (e->data[i]) ? e->data[i] : '.';
  ------------------
  |  Branch (960:14): [True: 14.7k, False: 77.4k]
  ------------------
  961|  92.2k|		}
  962|     74|		break;
  963|       |
  964|  8.36k|	case EXIF_TAG_EXIF_VERSION:
  ------------------
  |  Branch (964:2): [True: 8.36k, False: 63.9k]
  ------------------
  965|  8.36k|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|  8.36k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  8.36k|{									\
  |  |  648|  8.36k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 6, False: 8.35k]
  |  |  ------------------
  |  |  649|      6|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      6|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      6|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      6|			"format ('%s', expected '%s')."),		\
  |  |  652|      6|			exif_tag_get_name (entry->tag),			\
  |  |  653|      6|			exif_format_get_name (entry->format),		\
  |  |  654|      6|			exif_format_get_name (target));			\
  |  |  655|      6|		break;							\
  |  |  656|      6|	}								\
  |  |  657|  8.36k|}
  ------------------
  966|  8.35k|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|  8.35k|#define CC(entry,target,v,maxlen)					\
  |  |  660|  8.35k|{									\
  |  |  661|  8.35k|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 9, False: 8.34k]
  |  |  ------------------
  |  |  662|      9|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      9|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      9|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      9|			  "components (%i, expected %i)."),		\
  |  |  665|      9|			exif_tag_get_name (entry->tag),		\
  |  |  666|      9|			(int) entry->components, (int) target);		\
  |  |  667|      9|		break;							\
  |  |  668|      9|	}								\
  |  |  669|  8.35k|}
  ------------------
  967|  8.34k|		strncpy (val, _("Unknown Exif Version"), maxlen-1);
  ------------------
  |  |   31|  8.34k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  968|  33.5k|		for (i = 0; *versions[i].label; i++) {
  ------------------
  |  Branch (968:15): [True: 33.5k, False: 19]
  ------------------
  969|  33.5k|			if (!memcmp (e->data, versions[i].label, 4)) {
  ------------------
  |  Branch (969:8): [True: 8.32k, False: 25.1k]
  ------------------
  970|  8.32k|    				snprintf (val, maxlen,
  971|  8.32k|					_("Exif Version %d.%d"),
  ------------------
  |  |   31|  8.32k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  972|  8.32k|					versions[i].major,
  973|  8.32k|					versions[i].minor);
  974|  8.32k|    				break;
  975|  8.32k|			}
  976|  33.5k|		}
  977|  8.34k|		break;
  978|  8.36k|	case EXIF_TAG_FLASH_PIX_VERSION:
  ------------------
  |  Branch (978:2): [True: 8.36k, False: 63.9k]
  ------------------
  979|  8.36k|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|  8.36k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  8.36k|{									\
  |  |  648|  8.36k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 7, False: 8.35k]
  |  |  ------------------
  |  |  649|      7|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      7|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      7|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      7|			"format ('%s', expected '%s')."),		\
  |  |  652|      7|			exif_tag_get_name (entry->tag),			\
  |  |  653|      7|			exif_format_get_name (entry->format),		\
  |  |  654|      7|			exif_format_get_name (target));			\
  |  |  655|      7|		break;							\
  |  |  656|      7|	}								\
  |  |  657|  8.36k|}
  ------------------
  980|  8.35k|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|  8.35k|#define CC(entry,target,v,maxlen)					\
  |  |  660|  8.35k|{									\
  |  |  661|  8.35k|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 3, False: 8.35k]
  |  |  ------------------
  |  |  662|      3|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      3|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      3|			  "components (%i, expected %i)."),		\
  |  |  665|      3|			exif_tag_get_name (entry->tag),		\
  |  |  666|      3|			(int) entry->components, (int) target);		\
  |  |  667|      3|		break;							\
  |  |  668|      3|	}								\
  |  |  669|  8.35k|}
  ------------------
  981|  8.35k|		if (!memcmp (e->data, "0100", 4))
  ------------------
  |  Branch (981:7): [True: 8.31k, False: 34]
  ------------------
  982|  8.31k|			strncpy (val, _("FlashPix Version 1.0"), maxlen-1);
  ------------------
  |  |   31|  8.31k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  983|     34|		else if (!memcmp (e->data, "0101", 4))
  ------------------
  |  Branch (983:12): [True: 1, False: 33]
  ------------------
  984|      1|			strncpy (val, _("FlashPix Version 1.01"), maxlen-1);
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  985|     33|		else
  986|     33|			strncpy (val, _("Unknown FlashPix Version"), maxlen-1);
  ------------------
  |  |   31|     33|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  987|  8.35k|		break;
  988|    104|	case EXIF_TAG_COPYRIGHT:
  ------------------
  |  Branch (988:2): [True: 104, False: 72.1k]
  ------------------
  989|    104|		CF (e, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |  646|    104|#define CF(entry,target,v,maxlen)					\
  |  |  647|    104|{									\
  |  |  648|    104|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 19, False: 85]
  |  |  ------------------
  |  |  649|     19|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     19|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     19|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     19|			"format ('%s', expected '%s')."),		\
  |  |  652|     19|			exif_tag_get_name (entry->tag),			\
  |  |  653|     19|			exif_format_get_name (entry->format),		\
  |  |  654|     19|			exif_format_get_name (target));			\
  |  |  655|     19|		break;							\
  |  |  656|     19|	}								\
  |  |  657|    104|}
  ------------------
  990|       |
  991|       |		/*
  992|       |		 * First part: Photographer.
  993|       |		 * Some cameras store a string like "   " here. Ignore it.
  994|       |		 * Remember that a corrupted tag might not be NUL-terminated
  995|       |		 */
  996|     85|		if (e->size && e->data && match_repeated_char(e->data, ' ', e->size))
  ------------------
  |  Branch (996:7): [True: 85, False: 0]
  |  Branch (996:18): [True: 85, False: 0]
  |  Branch (996:29): [True: 59, False: 26]
  ------------------
  997|     59|			strncpy (val, (char *) e->data, MIN (maxlen-1, e->size));
  ------------------
  |  |  182|     59|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 6, False: 53]
  |  |  ------------------
  ------------------
  998|     26|		else
  999|     26|			strncpy (val, _("[None]"), maxlen-1);
  ------------------
  |  |   31|     26|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1000|     85|		strncat (val, " ", maxlen-1 - strlen (val));
 1001|     85|		strncat (val, _("(Photographer)"), maxlen-1 - strlen (val));
  ------------------
  |  |   31|     85|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1002|       |
 1003|       |		/* Second part: Editor. */
 1004|     85|		strncat (val, " - ", maxlen-1 - strlen (val));
 1005|     85|		k = 0;
 1006|     85|		if (e->size && e->data) {
  ------------------
  |  Branch (1006:7): [True: 85, False: 0]
  |  Branch (1006:18): [True: 85, False: 0]
  ------------------
 1007|     85|			const unsigned char *tagdata = memchr(e->data, 0, e->size);
 1008|     85|			if (tagdata++) {
  ------------------
  |  Branch (1008:8): [True: 68, False: 17]
  ------------------
 1009|     68|				unsigned int editor_ofs = tagdata - e->data;
 1010|     68|				unsigned int remaining = e->size - editor_ofs;
 1011|     68|				if (match_repeated_char(tagdata, ' ', remaining)) {
  ------------------
  |  Branch (1011:9): [True: 44, False: 24]
  ------------------
 1012|     44|					strncat (val, (const char*)tagdata, MIN (maxlen-1 - strlen (val), remaining));
  ------------------
  |  |  182|     44|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 6, False: 38]
  |  |  ------------------
  ------------------
 1013|     44|					++k;
 1014|     44|				}
 1015|     68|			}
 1016|     85|		}
 1017|     85|		if (!k)
  ------------------
  |  Branch (1017:7): [True: 41, False: 44]
  ------------------
 1018|     41|			strncat (val, _("[None]"), maxlen-1 - strlen (val));
  ------------------
  |  |   31|     41|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1019|     85|		strncat (val, " ", maxlen-1 - strlen (val));
 1020|     85|		strncat (val, _("(Editor)"), maxlen-1 - strlen (val));
  ------------------
  |  |   31|     85|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1021|       |
 1022|     85|		break;
 1023|    175|	case EXIF_TAG_FNUMBER:
  ------------------
  |  Branch (1023:2): [True: 175, False: 72.1k]
  ------------------
 1024|    175|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    175|#define CF(entry,target,v,maxlen)					\
  |  |  647|    175|{									\
  |  |  648|    175|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 8, False: 167]
  |  |  ------------------
  |  |  649|      8|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      8|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      8|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      8|			"format ('%s', expected '%s')."),		\
  |  |  652|      8|			exif_tag_get_name (entry->tag),			\
  |  |  653|      8|			exif_format_get_name (entry->format),		\
  |  |  654|      8|			exif_format_get_name (target));			\
  |  |  655|      8|		break;							\
  |  |  656|      8|	}								\
  |  |  657|    175|}
  ------------------
 1025|    167|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    167|#define CC(entry,target,v,maxlen)					\
  |  |  660|    167|{									\
  |  |  661|    167|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 8, False: 159]
  |  |  ------------------
  |  |  662|      8|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      8|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      8|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      8|			  "components (%i, expected %i)."),		\
  |  |  665|      8|			exif_tag_get_name (entry->tag),		\
  |  |  666|      8|			(int) entry->components, (int) target);		\
  |  |  667|      8|		break;							\
  |  |  668|      8|	}								\
  |  |  669|    167|}
  ------------------
 1026|    159|		v_rat = exif_get_rational (e->data, o);
 1027|    159|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1027:7): [True: 34, False: 125]
  ------------------
 1028|     34|			exif_entry_format_value(e, val, maxlen);
 1029|     34|			break;
 1030|     34|		}
 1031|    125|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1032|    125|		snprintf (val, maxlen, "f/%.01f", d);
 1033|    125|		break;
 1034|    122|	case EXIF_TAG_APERTURE_VALUE:
  ------------------
  |  Branch (1034:2): [True: 122, False: 72.1k]
  ------------------
 1035|    278|	case EXIF_TAG_MAX_APERTURE_VALUE:
  ------------------
  |  Branch (1035:2): [True: 156, False: 72.1k]
  ------------------
 1036|    278|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    278|#define CF(entry,target,v,maxlen)					\
  |  |  647|    278|{									\
  |  |  648|    278|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 12, False: 266]
  |  |  ------------------
  |  |  649|     12|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     12|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     12|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     12|			"format ('%s', expected '%s')."),		\
  |  |  652|     12|			exif_tag_get_name (entry->tag),			\
  |  |  653|     12|			exif_format_get_name (entry->format),		\
  |  |  654|     12|			exif_format_get_name (target));			\
  |  |  655|     12|		break;							\
  |  |  656|     12|	}								\
  |  |  657|    278|}
  ------------------
 1037|    266|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    266|#define CC(entry,target,v,maxlen)					\
  |  |  660|    266|{									\
  |  |  661|    266|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 17, False: 249]
  |  |  ------------------
  |  |  662|     17|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     17|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     17|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     17|			  "components (%i, expected %i)."),		\
  |  |  665|     17|			exif_tag_get_name (entry->tag),		\
  |  |  666|     17|			(int) entry->components, (int) target);		\
  |  |  667|     17|		break;							\
  |  |  668|     17|	}								\
  |  |  669|    266|}
  ------------------
 1038|    249|		v_rat = exif_get_rational (e->data, o);
 1039|    249|		if (!v_rat.denominator || (0x80000000 == v_rat.numerator)) {
  ------------------
  |  Branch (1039:7): [True: 53, False: 196]
  |  Branch (1039:29): [True: 3, False: 193]
  ------------------
 1040|     56|			exif_entry_format_value(e, val, maxlen);
 1041|     56|			break;
 1042|     56|		}
 1043|    193|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1044|    193|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|    193|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1045|    193|		snprintf (b, sizeof (b), _(" (f/%.01f)"), pow (2, d / 2.));
  ------------------
  |  |   31|    193|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1046|    193|		strncat (val, b, maxlen-1 - strlen (val));
 1047|    193|		break;
 1048|    290|	case EXIF_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (1048:2): [True: 290, False: 72.0k]
  ------------------
 1049|    290|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    290|#define CF(entry,target,v,maxlen)					\
  |  |  647|    290|{									\
  |  |  648|    290|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 3, False: 287]
  |  |  ------------------
  |  |  649|      3|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      3|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      3|			"format ('%s', expected '%s')."),		\
  |  |  652|      3|			exif_tag_get_name (entry->tag),			\
  |  |  653|      3|			exif_format_get_name (entry->format),		\
  |  |  654|      3|			exif_format_get_name (target));			\
  |  |  655|      3|		break;							\
  |  |  656|      3|	}								\
  |  |  657|    290|}
  ------------------
 1050|    287|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    287|#define CC(entry,target,v,maxlen)					\
  |  |  660|    287|{									\
  |  |  661|    287|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 23, False: 264]
  |  |  ------------------
  |  |  662|     23|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     23|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     23|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     23|			  "components (%i, expected %i)."),		\
  |  |  665|     23|			exif_tag_get_name (entry->tag),		\
  |  |  666|     23|			(int) entry->components, (int) target);		\
  |  |  667|     23|		break;							\
  |  |  668|     23|	}								\
  |  |  669|    287|}
  ------------------
 1051|    264|		v_rat = exif_get_rational (e->data, o);
 1052|    264|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1052:7): [True: 27, False: 237]
  ------------------
 1053|     27|			exif_entry_format_value(e, val, maxlen);
 1054|     27|			break;
 1055|     27|		}
 1056|       |
 1057|       |		/*
 1058|       |		 * For calculation of the 35mm equivalent,
 1059|       |		 * Minolta cameras need a multiplier that depends on the
 1060|       |		 * camera model.
 1061|       |		 */
 1062|    237|		d = 0.;
 1063|    237|		entry = exif_content_get_entry (
 1064|    237|			e->parent->parent->ifd[EXIF_IFD_0], EXIF_TAG_MAKE);
 1065|    237|		if (entry && entry->data && entry->size >= 7 &&
  ------------------
  |  Branch (1065:7): [True: 155, False: 82]
  |  Branch (1065:16): [True: 155, False: 0]
  |  Branch (1065:31): [True: 146, False: 9]
  ------------------
 1066|    146|		    !strncmp ((char *)entry->data, "Minolta", 7)) {
  ------------------
  |  Branch (1066:7): [True: 72, False: 74]
  ------------------
 1067|     72|			entry = exif_content_get_entry (
 1068|     72|					e->parent->parent->ifd[EXIF_IFD_0],
 1069|     72|					EXIF_TAG_MODEL);
 1070|     72|			if (entry && entry->data && entry->size >= 8) {
  ------------------
  |  Branch (1070:8): [True: 70, False: 2]
  |  Branch (1070:17): [True: 70, False: 0]
  |  Branch (1070:32): [True: 66, False: 4]
  ------------------
 1071|     66|				if (!strncmp ((char *)entry->data, "DiMAGE 7", 8))
  ------------------
  |  Branch (1071:9): [True: 1, False: 65]
  ------------------
 1072|      1|					d = 3.9;
 1073|     65|				else if (!strncmp ((char *)entry->data, "DiMAGE 5", 8))
  ------------------
  |  Branch (1073:14): [True: 1, False: 64]
  ------------------
 1074|      1|					d = 4.9;
 1075|     66|			}
 1076|     72|		}
 1077|    237|		if (d)
  ------------------
  |  Branch (1077:7): [True: 2, False: 235]
  ------------------
 1078|      2|			snprintf (b, sizeof (b), _(" (35 equivalent: %.0f mm)"),
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1079|      2|				  (d * (double) v_rat.numerator /
 1080|      2|				       (double) v_rat.denominator));
 1081|    235|		else
 1082|    235|			b[0] = 0;
 1083|       |
 1084|    237|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1085|    237|		snprintf (val, maxlen, "%.1f mm", d);
 1086|    237|		strncat (val, b, maxlen-1 - strlen (val));
 1087|    237|		break;
 1088|    168|	case EXIF_TAG_SUBJECT_DISTANCE:
  ------------------
  |  Branch (1088:2): [True: 168, False: 72.1k]
  ------------------
 1089|    168|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    168|#define CF(entry,target,v,maxlen)					\
  |  |  647|    168|{									\
  |  |  648|    168|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 9, False: 159]
  |  |  ------------------
  |  |  649|      9|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      9|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      9|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      9|			"format ('%s', expected '%s')."),		\
  |  |  652|      9|			exif_tag_get_name (entry->tag),			\
  |  |  653|      9|			exif_format_get_name (entry->format),		\
  |  |  654|      9|			exif_format_get_name (target));			\
  |  |  655|      9|		break;							\
  |  |  656|      9|	}								\
  |  |  657|    168|}
  ------------------
 1090|    159|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    159|#define CC(entry,target,v,maxlen)					\
  |  |  660|    159|{									\
  |  |  661|    159|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 1, False: 158]
  |  |  ------------------
  |  |  662|      1|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      1|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      1|			  "components (%i, expected %i)."),		\
  |  |  665|      1|			exif_tag_get_name (entry->tag),		\
  |  |  666|      1|			(int) entry->components, (int) target);		\
  |  |  667|      1|		break;							\
  |  |  668|      1|	}								\
  |  |  669|    159|}
  ------------------
 1091|    158|		v_rat = exif_get_rational (e->data, o);
 1092|    158|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1092:7): [True: 44, False: 114]
  ------------------
 1093|     44|			exif_entry_format_value(e, val, maxlen);
 1094|     44|			break;
 1095|     44|		}
 1096|    114|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1097|    114|		snprintf (val, maxlen, "%.1f m", d);
 1098|    114|		break;
 1099|    180|	case EXIF_TAG_EXPOSURE_TIME:
  ------------------
  |  Branch (1099:2): [True: 180, False: 72.1k]
  ------------------
 1100|    180|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    180|#define CF(entry,target,v,maxlen)					\
  |  |  647|    180|{									\
  |  |  648|    180|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 3, False: 177]
  |  |  ------------------
  |  |  649|      3|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      3|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      3|			"format ('%s', expected '%s')."),		\
  |  |  652|      3|			exif_tag_get_name (entry->tag),			\
  |  |  653|      3|			exif_format_get_name (entry->format),		\
  |  |  654|      3|			exif_format_get_name (target));			\
  |  |  655|      3|		break;							\
  |  |  656|      3|	}								\
  |  |  657|    180|}
  ------------------
 1101|    177|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    177|#define CC(entry,target,v,maxlen)					\
  |  |  660|    177|{									\
  |  |  661|    177|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 18, False: 159]
  |  |  ------------------
  |  |  662|     18|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     18|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     18|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     18|			  "components (%i, expected %i)."),		\
  |  |  665|     18|			exif_tag_get_name (entry->tag),		\
  |  |  666|     18|			(int) entry->components, (int) target);		\
  |  |  667|     18|		break;							\
  |  |  668|     18|	}								\
  |  |  669|    177|}
  ------------------
 1102|    159|		v_rat = exif_get_rational (e->data, o);
 1103|    159|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1103:7): [True: 29, False: 130]
  ------------------
 1104|     29|			exif_entry_format_value(e, val, maxlen);
 1105|     29|			break;
 1106|     29|		}
 1107|    130|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1108|    130|		if (d < 1 && d)
  ------------------
  |  Branch (1108:7): [True: 73, False: 57]
  |  Branch (1108:16): [True: 67, False: 6]
  ------------------
 1109|     67|			snprintf (val, maxlen, _("1/%.0f"), 1. / d);
  ------------------
  |  |   31|     67|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1110|     63|		else
 1111|     63|			snprintf (val, maxlen, "%.0f", d);
 1112|    130|		strncat (val, _(" sec."), maxlen-1 - strlen (val));
  ------------------
  |  |   31|    130|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1113|    130|		break;
 1114|    149|	case EXIF_TAG_SHUTTER_SPEED_VALUE:
  ------------------
  |  Branch (1114:2): [True: 149, False: 72.1k]
  ------------------
 1115|    149|		CF (e, EXIF_FORMAT_SRATIONAL, val, maxlen)
  ------------------
  |  |  646|    149|#define CF(entry,target,v,maxlen)					\
  |  |  647|    149|{									\
  |  |  648|    149|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 8, False: 141]
  |  |  ------------------
  |  |  649|      8|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      8|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      8|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      8|			"format ('%s', expected '%s')."),		\
  |  |  652|      8|			exif_tag_get_name (entry->tag),			\
  |  |  653|      8|			exif_format_get_name (entry->format),		\
  |  |  654|      8|			exif_format_get_name (target));			\
  |  |  655|      8|		break;							\
  |  |  656|      8|	}								\
  |  |  657|    149|}
  ------------------
 1116|    141|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    141|#define CC(entry,target,v,maxlen)					\
  |  |  660|    141|{									\
  |  |  661|    141|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 11, False: 130]
  |  |  ------------------
  |  |  662|     11|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     11|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     11|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     11|			  "components (%i, expected %i)."),		\
  |  |  665|     11|			exif_tag_get_name (entry->tag),		\
  |  |  666|     11|			(int) entry->components, (int) target);		\
  |  |  667|     11|		break;							\
  |  |  668|     11|	}								\
  |  |  669|    141|}
  ------------------
 1117|    130|		v_srat = exif_get_srational (e->data, o);
 1118|    130|		if (!v_srat.denominator) {
  ------------------
  |  Branch (1118:7): [True: 36, False: 94]
  ------------------
 1119|     36|			exif_entry_format_value(e, val, maxlen);
 1120|     36|			break;
 1121|     36|		}
 1122|     94|		d = (double) v_srat.numerator / (double) v_srat.denominator;
 1123|     94|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|     94|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1124|     94|		if (pow (2, d))
  ------------------
  |  Branch (1124:7): [True: 81, False: 13]
  ------------------
 1125|     81|			d = 1. / pow (2, d);
 1126|     94|		if (d < 1 && d)
  ------------------
  |  Branch (1126:7): [True: 67, False: 27]
  |  Branch (1126:16): [True: 61, False: 6]
  ------------------
 1127|     61|		  snprintf (b, sizeof (b), _(" (1/%.0f sec.)"), 1. / d);
  ------------------
  |  |   31|     61|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1128|     33|		else
 1129|     33|		  snprintf (b, sizeof (b), _(" (%.0f sec.)"), d);
  ------------------
  |  |   31|     33|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1130|     94|		strncat (val, b, maxlen-1 - strlen (val));
 1131|     94|		break;
 1132|    173|	case EXIF_TAG_BRIGHTNESS_VALUE:
  ------------------
  |  Branch (1132:2): [True: 173, False: 72.1k]
  ------------------
 1133|    173|		CF (e, EXIF_FORMAT_SRATIONAL, val, maxlen)
  ------------------
  |  |  646|    173|#define CF(entry,target,v,maxlen)					\
  |  |  647|    173|{									\
  |  |  648|    173|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 18, False: 155]
  |  |  ------------------
  |  |  649|     18|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     18|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     18|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     18|			"format ('%s', expected '%s')."),		\
  |  |  652|     18|			exif_tag_get_name (entry->tag),			\
  |  |  653|     18|			exif_format_get_name (entry->format),		\
  |  |  654|     18|			exif_format_get_name (target));			\
  |  |  655|     18|		break;							\
  |  |  656|     18|	}								\
  |  |  657|    173|}
  ------------------
 1134|    155|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    155|#define CC(entry,target,v,maxlen)					\
  |  |  660|    155|{									\
  |  |  661|    155|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 31, False: 124]
  |  |  ------------------
  |  |  662|     31|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     31|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     31|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     31|			  "components (%i, expected %i)."),		\
  |  |  665|     31|			exif_tag_get_name (entry->tag),		\
  |  |  666|     31|			(int) entry->components, (int) target);		\
  |  |  667|     31|		break;							\
  |  |  668|     31|	}								\
  |  |  669|    155|}
  ------------------
 1135|    124|		v_srat = exif_get_srational (e->data, o);
 1136|    124|		if (!v_srat.denominator) {
  ------------------
  |  Branch (1136:7): [True: 37, False: 87]
  ------------------
 1137|     37|			exif_entry_format_value(e, val, maxlen);
 1138|     37|			break;
 1139|     37|		}
 1140|     87|		d = (double) v_srat.numerator / (double) v_srat.denominator;
 1141|     87|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|     87|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1142|     87|		snprintf (b, sizeof (b), _(" (%.02f cd/m^2)"),
  ------------------
  |  |   31|     87|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1143|     87|			1. / (M_PI * 0.3048 * 0.3048) * pow (2, d));
 1144|     87|		strncat (val, b, maxlen-1 - strlen (val));
 1145|     87|		break;
 1146|     52|	case EXIF_TAG_FILE_SOURCE:
  ------------------
  |  Branch (1146:2): [True: 52, False: 72.2k]
  ------------------
 1147|     52|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|     52|#define CF(entry,target,v,maxlen)					\
  |  |  647|     52|{									\
  |  |  648|     52|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 4, False: 48]
  |  |  ------------------
  |  |  649|      4|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      4|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      4|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      4|			"format ('%s', expected '%s')."),		\
  |  |  652|      4|			exif_tag_get_name (entry->tag),			\
  |  |  653|      4|			exif_format_get_name (entry->format),		\
  |  |  654|      4|			exif_format_get_name (target));			\
  |  |  655|      4|		break;							\
  |  |  656|      4|	}								\
  |  |  657|     52|}
  ------------------
 1148|     48|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|     48|#define CC(entry,target,v,maxlen)					\
  |  |  660|     48|{									\
  |  |  661|     48|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 15, False: 33]
  |  |  ------------------
  |  |  662|     15|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     15|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     15|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     15|			  "components (%i, expected %i)."),		\
  |  |  665|     15|			exif_tag_get_name (entry->tag),		\
  |  |  666|     15|			(int) entry->components, (int) target);		\
  |  |  667|     15|		break;							\
  |  |  668|     15|	}								\
  |  |  669|     48|}
  ------------------
 1149|     33|		v_byte = e->data[0];
 1150|     33|		if (v_byte == 3)
  ------------------
  |  Branch (1150:7): [True: 12, False: 21]
  ------------------
 1151|     12|			strncpy (val, _("DSC"), maxlen-1);
  ------------------
  |  |   31|     12|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1152|     21|		else
 1153|     21|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|     21|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1154|     21|				  "value %i)"), v_byte);
 1155|     33|		break;
 1156|     73|	case EXIF_TAG_COMPONENTS_CONFIGURATION:
  ------------------
  |  Branch (1156:2): [True: 73, False: 72.2k]
  ------------------
 1157|     73|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|     73|#define CF(entry,target,v,maxlen)					\
  |  |  647|     73|{									\
  |  |  648|     73|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 6, False: 67]
  |  |  ------------------
  |  |  649|      6|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      6|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      6|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      6|			"format ('%s', expected '%s')."),		\
  |  |  652|      6|			exif_tag_get_name (entry->tag),			\
  |  |  653|      6|			exif_format_get_name (entry->format),		\
  |  |  654|      6|			exif_format_get_name (target));			\
  |  |  655|      6|		break;							\
  |  |  656|      6|	}								\
  |  |  657|     73|}
  ------------------
 1158|     67|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|     67|#define CC(entry,target,v,maxlen)					\
  |  |  660|     67|{									\
  |  |  661|     67|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 14, False: 53]
  |  |  ------------------
  |  |  662|     14|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     14|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     14|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     14|			  "components (%i, expected %i)."),		\
  |  |  665|     14|			exif_tag_get_name (entry->tag),		\
  |  |  666|     14|			(int) entry->components, (int) target);		\
  |  |  667|     14|		break;							\
  |  |  668|     14|	}								\
  |  |  669|     67|}
  ------------------
 1159|    265|		for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (1159:15): [True: 212, False: 53]
  ------------------
 1160|    212|			switch (e->data[i]) {
 1161|     56|			case 0: c = _("-"); break;
  ------------------
  |  |   31|     56|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1161:4): [True: 56, False: 156]
  ------------------
 1162|     18|			case 1: c = _("Y"); break;
  ------------------
  |  |   31|     18|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1162:4): [True: 18, False: 194]
  ------------------
 1163|     40|			case 2: c = _("Cb"); break;
  ------------------
  |  |   31|     40|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1163:4): [True: 40, False: 172]
  ------------------
 1164|     34|			case 3: c = _("Cr"); break;
  ------------------
  |  |   31|     34|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1164:4): [True: 34, False: 178]
  ------------------
 1165|      3|			case 4: c = _("R"); break;
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1165:4): [True: 3, False: 209]
  ------------------
 1166|     16|			case 5: c = _("G"); break;
  ------------------
  |  |   31|     16|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1166:4): [True: 16, False: 196]
  ------------------
 1167|      4|			case 6: c = _("B"); break;
  ------------------
  |  |   31|      4|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1167:4): [True: 4, False: 208]
  ------------------
 1168|     41|			default: c = _("Reserved"); break;
  ------------------
  |  |   31|     41|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1168:4): [True: 41, False: 171]
  ------------------
 1169|    212|			}
 1170|    212|			strncat (val, c, maxlen-1 - strlen (val));
 1171|    212|			if (i < 3)
  ------------------
  |  Branch (1171:8): [True: 159, False: 53]
  ------------------
 1172|    159|				strncat (val, " ", maxlen-1 - strlen (val));
 1173|    212|		}
 1174|     53|		break;
 1175|    193|	case EXIF_TAG_EXPOSURE_BIAS_VALUE:
  ------------------
  |  Branch (1175:2): [True: 193, False: 72.1k]
  ------------------
 1176|    193|		CF (e, EXIF_FORMAT_SRATIONAL, val, maxlen)
  ------------------
  |  |  646|    193|#define CF(entry,target,v,maxlen)					\
  |  |  647|    193|{									\
  |  |  648|    193|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 11, False: 182]
  |  |  ------------------
  |  |  649|     11|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     11|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     11|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     11|			"format ('%s', expected '%s')."),		\
  |  |  652|     11|			exif_tag_get_name (entry->tag),			\
  |  |  653|     11|			exif_format_get_name (entry->format),		\
  |  |  654|     11|			exif_format_get_name (target));			\
  |  |  655|     11|		break;							\
  |  |  656|     11|	}								\
  |  |  657|    193|}
  ------------------
 1177|    182|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    182|#define CC(entry,target,v,maxlen)					\
  |  |  660|    182|{									\
  |  |  661|    182|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 20, False: 162]
  |  |  ------------------
  |  |  662|     20|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     20|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     20|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     20|			  "components (%i, expected %i)."),		\
  |  |  665|     20|			exif_tag_get_name (entry->tag),		\
  |  |  666|     20|			(int) entry->components, (int) target);		\
  |  |  667|     20|		break;							\
  |  |  668|     20|	}								\
  |  |  669|    182|}
  ------------------
 1178|    162|		v_srat = exif_get_srational (e->data, o);
 1179|    162|		if (!v_srat.denominator) {
  ------------------
  |  Branch (1179:7): [True: 46, False: 116]
  ------------------
 1180|     46|			exif_entry_format_value(e, val, maxlen);
 1181|     46|			break;
 1182|     46|		}
 1183|    116|		d = (double) v_srat.numerator / (double) v_srat.denominator;
 1184|    116|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|    116|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1185|    116|		break;
 1186|     40|	case EXIF_TAG_SCENE_TYPE:
  ------------------
  |  Branch (1186:2): [True: 40, False: 72.2k]
  ------------------
 1187|     40|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|     40|#define CF(entry,target,v,maxlen)					\
  |  |  647|     40|{									\
  |  |  648|     40|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 3, False: 37]
  |  |  ------------------
  |  |  649|      3|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      3|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      3|			"format ('%s', expected '%s')."),		\
  |  |  652|      3|			exif_tag_get_name (entry->tag),			\
  |  |  653|      3|			exif_format_get_name (entry->format),		\
  |  |  654|      3|			exif_format_get_name (target));			\
  |  |  655|      3|		break;							\
  |  |  656|      3|	}								\
  |  |  657|     40|}
  ------------------
 1188|     37|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|     37|#define CC(entry,target,v,maxlen)					\
  |  |  660|     37|{									\
  |  |  661|     37|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 4, False: 33]
  |  |  ------------------
  |  |  662|      4|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      4|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      4|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      4|			  "components (%i, expected %i)."),		\
  |  |  665|      4|			exif_tag_get_name (entry->tag),		\
  |  |  666|      4|			(int) entry->components, (int) target);		\
  |  |  667|      4|		break;							\
  |  |  668|      4|	}								\
  |  |  669|     37|}
  ------------------
 1189|     33|		v_byte = e->data[0];
 1190|     33|		if (v_byte == 1)
  ------------------
  |  Branch (1190:7): [True: 30, False: 3]
  ------------------
 1191|     30|			strncpy (val, _("Directly photographed"), maxlen-1);
  ------------------
  |  |   31|     30|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1192|      3|		else
 1193|      3|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1194|      3|				  "value %i)"), v_byte);
 1195|     33|		break;
 1196|    100|	case EXIF_TAG_YCBCR_SUB_SAMPLING:
  ------------------
  |  Branch (1196:2): [True: 100, False: 72.1k]
  ------------------
 1197|    100|		CF (e, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|    100|#define CF(entry,target,v,maxlen)					\
  |  |  647|    100|{									\
  |  |  648|    100|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 17, False: 83]
  |  |  ------------------
  |  |  649|     17|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     17|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     17|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     17|			"format ('%s', expected '%s')."),		\
  |  |  652|     17|			exif_tag_get_name (entry->tag),			\
  |  |  653|     17|			exif_format_get_name (entry->format),		\
  |  |  654|     17|			exif_format_get_name (target));			\
  |  |  655|     17|		break;							\
  |  |  656|     17|	}								\
  |  |  657|    100|}
  ------------------
 1198|     83|		CC (e, 2, val, maxlen)
  ------------------
  |  |  659|     83|#define CC(entry,target,v,maxlen)					\
  |  |  660|     83|{									\
  |  |  661|     83|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 36, False: 47]
  |  |  ------------------
  |  |  662|     36|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     36|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     36|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     36|			  "components (%i, expected %i)."),		\
  |  |  665|     36|			exif_tag_get_name (entry->tag),		\
  |  |  666|     36|			(int) entry->components, (int) target);		\
  |  |  667|     36|		break;							\
  |  |  668|     36|	}								\
  |  |  669|     83|}
  ------------------
 1199|     47|		v_short  = exif_get_short (e->data, o);
 1200|     47|		v_short2 = exif_get_short (
 1201|     47|			e->data + exif_format_get_size (e->format),
 1202|     47|			o);
 1203|     47|		if ((v_short == 2) && (v_short2 == 1))
  ------------------
  |  Branch (1203:7): [True: 27, False: 20]
  |  Branch (1203:25): [True: 3, False: 24]
  ------------------
 1204|      3|			strncpy (val, _("YCbCr4:2:2"), maxlen-1);
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1205|     44|		else if ((v_short == 2) && (v_short2 == 2))
  ------------------
  |  Branch (1205:12): [True: 24, False: 20]
  |  Branch (1205:30): [True: 3, False: 21]
  ------------------
 1206|      3|			strncpy (val, _("YCbCr4:2:0"), maxlen-1);
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1207|     41|		else
 1208|     41|			snprintf (val, maxlen, "%u, %u", v_short, v_short2);
 1209|     47|		break;
 1210|     19|	case EXIF_TAG_SUBJECT_AREA:
  ------------------
  |  Branch (1210:2): [True: 19, False: 72.2k]
  ------------------
 1211|     19|		CF (e, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|     19|#define CF(entry,target,v,maxlen)					\
  |  |  647|     19|{									\
  |  |  648|     19|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 7, False: 12]
  |  |  ------------------
  |  |  649|      7|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      7|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      7|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      7|			"format ('%s', expected '%s')."),		\
  |  |  652|      7|			exif_tag_get_name (entry->tag),			\
  |  |  653|      7|			exif_format_get_name (entry->format),		\
  |  |  654|      7|			exif_format_get_name (target));			\
  |  |  655|      7|		break;							\
  |  |  656|      7|	}								\
  |  |  657|     19|}
  ------------------
 1212|     12|		switch (e->components) {
 1213|      1|		case 2:
  ------------------
  |  Branch (1213:3): [True: 1, False: 11]
  ------------------
 1214|      1|			v_short  = exif_get_short (e->data, o);
 1215|      1|			v_short2 = exif_get_short (e->data + 2, o);
 1216|      1|			snprintf (val, maxlen, "(x,y) = (%i,%i)",
 1217|      1|				  v_short, v_short2);
 1218|      1|			break;
 1219|      1|		case 3:
  ------------------
  |  Branch (1219:3): [True: 1, False: 11]
  ------------------
 1220|      1|			v_short  = exif_get_short (e->data, o);
 1221|      1|			v_short2 = exif_get_short (e->data + 2, o);
 1222|      1|			v_short3 = exif_get_short (e->data + 4, o);
 1223|      1|			snprintf (val, maxlen, _("Within distance %i of "
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1224|      1|				"(x,y) = (%i,%i)"), v_short3, v_short,
 1225|      1|				v_short2);
 1226|      1|			break;
 1227|      1|		case 4:
  ------------------
  |  Branch (1227:3): [True: 1, False: 11]
  ------------------
 1228|      1|			v_short  = exif_get_short (e->data, o);
 1229|      1|			v_short2 = exif_get_short (e->data + 2, o);
 1230|      1|			v_short3 = exif_get_short (e->data + 4, o);
 1231|      1|			v_short4 = exif_get_short (e->data + 6, o);
 1232|      1|			snprintf (val, maxlen, _("Within rectangle "
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1233|      1|				"(width %i, height %i) around "
 1234|      1|				"(x,y) = (%i,%i)"), v_short3, v_short4,
 1235|      1|				v_short, v_short2);
 1236|      1|			break;
 1237|      9|		default:
  ------------------
  |  Branch (1237:3): [True: 9, False: 3]
  ------------------
 1238|      9|			snprintf (val, maxlen, _("Unexpected number "
  ------------------
  |  |   31|      9|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1239|      9|				"of components (%li, expected 2, 3, or 4)."),
 1240|      9|				e->components);	
 1241|     12|		}
 1242|     12|		break;
 1243|    165|	case EXIF_TAG_GPS_VERSION_ID:
  ------------------
  |  Branch (1243:2): [True: 165, False: 72.1k]
  ------------------
 1244|       |		/* This is only valid in the GPS IFD */
 1245|    165|		CF (e, EXIF_FORMAT_BYTE, val, maxlen)
  ------------------
  |  |  646|    165|#define CF(entry,target,v,maxlen)					\
  |  |  647|    165|{									\
  |  |  648|    165|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 118, False: 47]
  |  |  ------------------
  |  |  649|    118|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|    118|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|    118|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|    118|			"format ('%s', expected '%s')."),		\
  |  |  652|    118|			exif_tag_get_name (entry->tag),			\
  |  |  653|    118|			exif_format_get_name (entry->format),		\
  |  |  654|    118|			exif_format_get_name (target));			\
  |  |  655|    118|		break;							\
  |  |  656|    118|	}								\
  |  |  657|    165|}
  ------------------
 1246|     47|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|     47|#define CC(entry,target,v,maxlen)					\
  |  |  660|     47|{									\
  |  |  661|     47|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 42, False: 5]
  |  |  ------------------
  |  |  662|     42|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     42|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     42|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     42|			  "components (%i, expected %i)."),		\
  |  |  665|     42|			exif_tag_get_name (entry->tag),		\
  |  |  666|     42|			(int) entry->components, (int) target);		\
  |  |  667|     42|		break;							\
  |  |  668|     42|	}								\
  |  |  669|     47|}
  ------------------
 1247|      5|		v_byte = e->data[0];
 1248|      5|		snprintf (val, maxlen, "%u", v_byte);
 1249|     20|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (1249:15): [True: 15, False: 5]
  ------------------
 1250|     15|			v_byte = e->data[i];
 1251|     15|			snprintf (b, sizeof (b), ".%u", v_byte);
 1252|     15|			strncat (val, b, maxlen-1 - strlen (val));
 1253|     15|		}
 1254|      5|		break;
 1255|    198|	case EXIF_TAG_INTEROPERABILITY_VERSION:
  ------------------
  |  Branch (1255:2): [True: 198, False: 72.0k]
  ------------------
 1256|       |	/* a.k.a. case EXIF_TAG_GPS_LATITUDE: */
 1257|       |		/* This tag occurs in EXIF_IFD_INTEROPERABILITY */
 1258|    198|		if (e->format == EXIF_FORMAT_UNDEFINED) {
  ------------------
  |  Branch (1258:7): [True: 48, False: 150]
  ------------------
 1259|     48|			strncpy (val, (char *) e->data, MIN (maxlen-1, e->size));
  ------------------
  |  |  182|     48|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 3, False: 45]
  |  |  ------------------
  ------------------
 1260|     48|			break;
 1261|     48|		}
 1262|       |		/* EXIF_TAG_GPS_LATITUDE is the same numerically as
 1263|       |		 * EXIF_TAG_INTEROPERABILITY_VERSION but in EXIF_IFD_GPS
 1264|       |		 */
 1265|    150|		exif_entry_format_value(e, val, maxlen);
 1266|    150|		break;
 1267|     54|	case EXIF_TAG_GPS_ALTITUDE_REF:
  ------------------
  |  Branch (1267:2): [True: 54, False: 72.2k]
  ------------------
 1268|       |		/* This is only valid in the GPS IFD */
 1269|     54|		CF (e, EXIF_FORMAT_BYTE, val, maxlen)
  ------------------
  |  |  646|     54|#define CF(entry,target,v,maxlen)					\
  |  |  647|     54|{									\
  |  |  648|     54|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 15, False: 39]
  |  |  ------------------
  |  |  649|     15|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     15|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     15|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     15|			"format ('%s', expected '%s')."),		\
  |  |  652|     15|			exif_tag_get_name (entry->tag),			\
  |  |  653|     15|			exif_format_get_name (entry->format),		\
  |  |  654|     15|			exif_format_get_name (target));			\
  |  |  655|     15|		break;							\
  |  |  656|     15|	}								\
  |  |  657|     54|}
  ------------------
 1270|     39|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|     39|#define CC(entry,target,v,maxlen)					\
  |  |  660|     39|{									\
  |  |  661|     39|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 25, False: 14]
  |  |  ------------------
  |  |  662|     25|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     25|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     25|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     25|			  "components (%i, expected %i)."),		\
  |  |  665|     25|			exif_tag_get_name (entry->tag),		\
  |  |  666|     25|			(int) entry->components, (int) target);		\
  |  |  667|     25|		break;							\
  |  |  668|     25|	}								\
  |  |  669|     39|}
  ------------------
 1271|     14|		v_byte = e->data[0];
 1272|     14|		if (v_byte == 0)
  ------------------
  |  Branch (1272:7): [True: 2, False: 12]
  ------------------
 1273|      2|			strncpy (val, _("Sea level"), maxlen-1);
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1274|     12|		else if (v_byte == 1)
  ------------------
  |  Branch (1274:12): [True: 1, False: 11]
  ------------------
 1275|      1|			strncpy (val, _("Sea level reference"), maxlen-1);
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1276|     11|		else
 1277|     11|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|     11|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1278|     11|				  "value %i)"), v_byte);
 1279|     14|		break;
 1280|    353|	case EXIF_TAG_GPS_TIME_STAMP:
  ------------------
  |  Branch (1280:2): [True: 353, False: 71.9k]
  ------------------
 1281|       |		/* This is only valid in the GPS IFD */
 1282|    353|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    353|#define CF(entry,target,v,maxlen)					\
  |  |  647|    353|{									\
  |  |  648|    353|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 34, False: 319]
  |  |  ------------------
  |  |  649|     34|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     34|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     34|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     34|			"format ('%s', expected '%s')."),		\
  |  |  652|     34|			exif_tag_get_name (entry->tag),			\
  |  |  653|     34|			exif_format_get_name (entry->format),		\
  |  |  654|     34|			exif_format_get_name (target));			\
  |  |  655|     34|		break;							\
  |  |  656|     34|	}								\
  |  |  657|    353|}
  ------------------
 1283|    319|		CC (e, 3, val, maxlen)
  ------------------
  |  |  659|    319|#define CC(entry,target,v,maxlen)					\
  |  |  660|    319|{									\
  |  |  661|    319|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 11, False: 308]
  |  |  ------------------
  |  |  662|     11|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     11|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     11|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     11|			  "components (%i, expected %i)."),		\
  |  |  665|     11|			exif_tag_get_name (entry->tag),		\
  |  |  666|     11|			(int) entry->components, (int) target);		\
  |  |  667|     11|		break;							\
  |  |  668|     11|	}								\
  |  |  669|    319|}
  ------------------
 1284|       |
 1285|    308|		v_rat  = exif_get_rational (e->data, o);
 1286|    308|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1286:7): [True: 36, False: 272]
  ------------------
 1287|     36|			exif_entry_format_value(e, val, maxlen);
 1288|     36|			break;
 1289|     36|		}
 1290|    272|		i = v_rat.numerator / v_rat.denominator;
 1291|       |
 1292|    272|		v_rat = exif_get_rational (e->data +
 1293|    272|					     exif_format_get_size (e->format),
 1294|    272|					   o);
 1295|    272|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1295:7): [True: 39, False: 233]
  ------------------
 1296|     39|			exif_entry_format_value(e, val, maxlen);
 1297|     39|			break;
 1298|     39|		}
 1299|    233|		j = v_rat.numerator / v_rat.denominator;
 1300|       |
 1301|    233|		v_rat = exif_get_rational (e->data +
 1302|    233|					     2*exif_format_get_size (e->format),
 1303|    233|					     o);
 1304|    233|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1304:7): [True: 53, False: 180]
  ------------------
 1305|     53|			exif_entry_format_value(e, val, maxlen);
 1306|     53|			break;
 1307|     53|		}
 1308|    180|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1309|    180|		snprintf (val, maxlen, "%02u:%02u:%05.2f", i, j, d);
 1310|    180|		break;
 1311|       |
 1312|    114|	case EXIF_TAG_METERING_MODE:
  ------------------
  |  Branch (1312:2): [True: 114, False: 72.1k]
  ------------------
 1313|    316|	case EXIF_TAG_COMPRESSION:
  ------------------
  |  Branch (1313:2): [True: 202, False: 72.0k]
  ------------------
 1314|    356|	case EXIF_TAG_LIGHT_SOURCE:
  ------------------
  |  Branch (1314:2): [True: 40, False: 72.2k]
  ------------------
 1315|    380|	case EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT:
  ------------------
  |  Branch (1315:2): [True: 24, False: 72.2k]
  ------------------
 1316|  8.91k|	case EXIF_TAG_RESOLUTION_UNIT:
  ------------------
  |  Branch (1316:2): [True: 8.53k, False: 63.7k]
  ------------------
 1317|  8.95k|	case EXIF_TAG_EXPOSURE_PROGRAM:
  ------------------
  |  Branch (1317:2): [True: 41, False: 72.2k]
  ------------------
 1318|  8.96k|	case EXIF_TAG_SENSITIVITY_TYPE:
  ------------------
  |  Branch (1318:2): [True: 13, False: 72.2k]
  ------------------
 1319|  9.01k|	case EXIF_TAG_FLASH:
  ------------------
  |  Branch (1319:2): [True: 51, False: 72.2k]
  ------------------
 1320|  9.02k|	case EXIF_TAG_SUBJECT_DISTANCE_RANGE:
  ------------------
  |  Branch (1320:2): [True: 10, False: 72.2k]
  ------------------
 1321|  17.3k|	case EXIF_TAG_COLOR_SPACE:
  ------------------
  |  Branch (1321:2): [True: 8.35k, False: 63.9k]
  ------------------
 1322|  17.3k|	case EXIF_TAG_COMPOSITE_IMAGE:
  ------------------
  |  Branch (1322:2): [True: 2, False: 72.2k]
  ------------------
 1323|  17.3k|		CF (e,EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|  17.3k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  17.3k|{									\
  |  |  648|  17.3k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 51, False: 17.3k]
  |  |  ------------------
  |  |  649|     51|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     51|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     51|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     51|			"format ('%s', expected '%s')."),		\
  |  |  652|     51|			exif_tag_get_name (entry->tag),			\
  |  |  653|     51|			exif_format_get_name (entry->format),		\
  |  |  654|     51|			exif_format_get_name (target));			\
  |  |  655|     51|		break;							\
  |  |  656|     51|	}								\
  |  |  657|  17.3k|}
  ------------------
 1324|  17.3k|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|  17.3k|#define CC(entry,target,v,maxlen)					\
  |  |  660|  17.3k|{									\
  |  |  661|  17.3k|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 66, False: 17.2k]
  |  |  ------------------
  |  |  662|     66|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     66|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     66|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     66|			  "components (%i, expected %i)."),		\
  |  |  665|     66|			exif_tag_get_name (entry->tag),		\
  |  |  666|     66|			(int) entry->components, (int) target);		\
  |  |  667|     66|		break;							\
  |  |  668|     66|	}								\
  |  |  669|  17.3k|}
  ------------------
 1325|  17.2k|		v_short = exif_get_short (e->data, o);
 1326|       |
 1327|       |		/* Search the tag */
 1328|   127k|		for (i = 0; list2[i].tag && (list2[i].tag != e->tag); i++);
  ------------------
  |  Branch (1328:15): [True: 127k, False: 0]
  |  Branch (1328:31): [True: 109k, False: 17.2k]
  ------------------
 1329|  17.2k|		if (!list2[i].tag) {
  ------------------
  |  Branch (1329:7): [True: 0, False: 17.2k]
  ------------------
 1330|      0|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1331|      0|				  "value %i)"), v_short);
 1332|      0|			break;
 1333|      0|		}
 1334|       |
 1335|       |		/* Find the value */
 1336|  35.4k|		for (j = 0; list2[i].elem[j].values[0] &&
  ------------------
  |  Branch (1336:15): [True: 35.3k, False: 105]
  ------------------
 1337|  35.3k|			    (list2[i].elem[j].index < v_short); j++);
  ------------------
  |  Branch (1337:8): [True: 18.2k, False: 17.1k]
  ------------------
 1338|  17.2k|		if (list2[i].elem[j].index != v_short) {
  ------------------
  |  Branch (1338:7): [True: 296, False: 16.9k]
  ------------------
 1339|    296|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|    296|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1340|    296|				  "value %i)"), v_short);
 1341|    296|			break;
 1342|    296|		}
 1343|       |
 1344|       |		/* Find a short enough value */
 1345|  16.9k|		memset (val, 0, maxlen);
 1346|  42.5k|		for (k = 0; list2[i].elem[j].values[k]; k++) {
  ------------------
  |  Branch (1346:15): [True: 25.5k, False: 16.9k]
  ------------------
 1347|  25.5k|			size_t l = strlen (_(list2[i].elem[j].values[k]));
  ------------------
  |  |   31|  25.5k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1348|  25.5k|			if ((maxlen > l) && (strlen (val) < l))
  ------------------
  |  Branch (1348:8): [True: 25.5k, False: 0]
  |  Branch (1348:24): [True: 16.9k, False: 8.56k]
  ------------------
 1349|  16.9k|				strncpy (val, _(list2[i].elem[j].values[k]), maxlen-1);
  ------------------
  |  |   31|  16.9k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1350|  25.5k|		}
 1351|  16.9k|		if (!val[0]) snprintf (val, maxlen, "%i", v_short);
  ------------------
  |  Branch (1351:7): [True: 0, False: 16.9k]
  ------------------
 1352|       |
 1353|  16.9k|		break;
 1354|       |
 1355|     43|	case EXIF_TAG_PLANAR_CONFIGURATION:
  ------------------
  |  Branch (1355:2): [True: 43, False: 72.2k]
  ------------------
 1356|     59|	case EXIF_TAG_SENSING_METHOD:
  ------------------
  |  Branch (1356:2): [True: 16, False: 72.2k]
  ------------------
 1357|    149|	case EXIF_TAG_ORIENTATION:
  ------------------
  |  Branch (1357:2): [True: 90, False: 72.2k]
  ------------------
 1358|    250|	case EXIF_TAG_YCBCR_POSITIONING:
  ------------------
  |  Branch (1358:2): [True: 101, False: 72.1k]
  ------------------
 1359|    313|	case EXIF_TAG_PHOTOMETRIC_INTERPRETATION:
  ------------------
  |  Branch (1359:2): [True: 63, False: 72.2k]
  ------------------
 1360|    389|	case EXIF_TAG_CUSTOM_RENDERED:
  ------------------
  |  Branch (1360:2): [True: 76, False: 72.2k]
  ------------------
 1361|    440|	case EXIF_TAG_EXPOSURE_MODE:
  ------------------
  |  Branch (1361:2): [True: 51, False: 72.2k]
  ------------------
 1362|    499|	case EXIF_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (1362:2): [True: 59, False: 72.2k]
  ------------------
 1363|    542|	case EXIF_TAG_SCENE_CAPTURE_TYPE:
  ------------------
  |  Branch (1363:2): [True: 43, False: 72.2k]
  ------------------
 1364|    575|	case EXIF_TAG_GAIN_CONTROL:
  ------------------
  |  Branch (1364:2): [True: 33, False: 72.2k]
  ------------------
 1365|    631|	case EXIF_TAG_SATURATION:
  ------------------
  |  Branch (1365:2): [True: 56, False: 72.2k]
  ------------------
 1366|    661|	case EXIF_TAG_CONTRAST:
  ------------------
  |  Branch (1366:2): [True: 30, False: 72.2k]
  ------------------
 1367|    678|	case EXIF_TAG_SHARPNESS:
  ------------------
  |  Branch (1367:2): [True: 17, False: 72.2k]
  ------------------
 1368|    678|		CF (e, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|    678|#define CF(entry,target,v,maxlen)					\
  |  |  647|    678|{									\
  |  |  648|    678|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 108, False: 570]
  |  |  ------------------
  |  |  649|    108|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|    108|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|    108|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|    108|			"format ('%s', expected '%s')."),		\
  |  |  652|    108|			exif_tag_get_name (entry->tag),			\
  |  |  653|    108|			exif_format_get_name (entry->format),		\
  |  |  654|    108|			exif_format_get_name (target));			\
  |  |  655|    108|		break;							\
  |  |  656|    108|	}								\
  |  |  657|    678|}
  ------------------
 1369|    570|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    570|#define CC(entry,target,v,maxlen)					\
  |  |  660|    570|{									\
  |  |  661|    570|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 203, False: 367]
  |  |  ------------------
  |  |  662|    203|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|    203|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|    203|			  "components (%i, expected %i)."),		\
  |  |  665|    203|			exif_tag_get_name (entry->tag),		\
  |  |  666|    203|			(int) entry->components, (int) target);		\
  |  |  667|    203|		break;							\
  |  |  668|    203|	}								\
  |  |  669|    570|}
  ------------------
 1370|    367|		v_short = exif_get_short (e->data, o);
 1371|       |
 1372|       |		/* Search the tag */
 1373|  2.24k|		for (i = 0; list[i].tag && (list[i].tag != e->tag); i++);
  ------------------
  |  Branch (1373:15): [True: 2.24k, False: 0]
  |  Branch (1373:30): [True: 1.88k, False: 367]
  ------------------
 1374|    367|		if (!list[i].tag) {
  ------------------
  |  Branch (1374:7): [True: 0, False: 367]
  ------------------
 1375|      0|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1376|      0|				  "value %i)"), v_short);
 1377|      0|			break;
 1378|      0|		}
 1379|       |
 1380|       |		/* Find the value */
 1381|  1.24k|		for (j = 0; list[i].strings[j] && (j < v_short); j++);
  ------------------
  |  Branch (1381:15): [True: 1.11k, False: 133]
  |  Branch (1381:37): [True: 876, False: 234]
  ------------------
 1382|    367|		if (!list[i].strings[j])
  ------------------
  |  Branch (1382:7): [True: 133, False: 234]
  ------------------
 1383|    133|			snprintf (val, maxlen, "%i", v_short);
 1384|    234|		else if (!*list[i].strings[j])
  ------------------
  |  Branch (1384:12): [True: 26, False: 208]
  ------------------
 1385|     26|			snprintf (val, maxlen, _("Unknown value %i"), v_short);
  ------------------
  |  |   31|     26|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1386|    208|		else
 1387|    208|			strncpy (val, _(list[i].strings[j]), maxlen-1);
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1388|    367|		break;
 1389|       |
 1390|     17|	case EXIF_TAG_XP_TITLE:
  ------------------
  |  Branch (1390:2): [True: 17, False: 72.2k]
  ------------------
 1391|     53|	case EXIF_TAG_XP_COMMENT:
  ------------------
  |  Branch (1391:2): [True: 36, False: 72.2k]
  ------------------
 1392|     74|	case EXIF_TAG_XP_AUTHOR:
  ------------------
  |  Branch (1392:2): [True: 21, False: 72.2k]
  ------------------
 1393|    102|	case EXIF_TAG_XP_KEYWORDS:
  ------------------
  |  Branch (1393:2): [True: 28, False: 72.2k]
  ------------------
 1394|    132|	case EXIF_TAG_XP_SUBJECT:
  ------------------
  |  Branch (1394:2): [True: 30, False: 72.2k]
  ------------------
 1395|    132|	{
 1396|    132|		unsigned char *utf16;
 1397|    132|		unsigned int s;
 1398|       |
 1399|       |		/* Sanity check the size to prevent overflow. Note EXIF files are 64kb at most. */
 1400|    132|		if (e->size >= 65536 - sizeof(uint16_t)*2) break;
  ------------------
  |  Branch (1400:7): [True: 0, False: 132]
  ------------------
 1401|       |
 1402|       |		/* The tag may not be U+0000-terminated , so make a local
 1403|       |		   U+0000-terminated copy before converting it */
 1404|    132|		s = e->size+sizeof(uint16_t)+1;
 1405|    132|		utf16 = exif_mem_alloc (e->priv->mem, s);
 1406|    132|		if (!utf16) {
  ------------------
  |  Branch (1406:7): [True: 0, False: 132]
  ------------------
 1407|      0|			exif_entry_log (e, EXIF_LOG_CODE_NO_MEMORY,
 1408|      0|				"Could not allocate %lu byte(s).", (unsigned long)s);
 1409|      0|			break;
 1410|      0|		}
 1411|    132|		memcpy(utf16, e->data, e->size);
 1412|       |
 1413|       |		/* NUL terminate the string. If the size is odd (which isn't possible
 1414|       |		 * for a valid UTF16 string), then this will overwrite the high byte of
 1415|       |		 * the final half word, plus add a full zero NUL word at the end.
 1416|       |		 */
 1417|    132|		utf16[e->size] = 0;
 1418|    132|		utf16[e->size+1] = 0;
 1419|    132|		utf16[e->size+2] = 0;
 1420|       |
 1421|       |		/* Warning! The texts are converted from UTF16 to UTF8 */
 1422|       |		/* FIXME: use iconv to convert into the locale encoding */
 1423|    132|		exif_convert_utf16_to_utf8(val, maxlen, utf16, e->size+3);
 1424|    132|		exif_mem_free(e->priv->mem, utf16);
 1425|    132|		break;
 1426|    132|	}
 1427|       |
 1428|  34.3k|	default:
  ------------------
  |  Branch (1428:2): [True: 34.3k, False: 37.9k]
  ------------------
 1429|       |		/* Use a generic value formatting */
 1430|  34.3k|		exif_entry_format_value(e, val, maxlen);
 1431|  72.2k|	}
 1432|       |
 1433|  72.2k|	return val;
 1434|  72.2k|}
exif_entry_initialize:
 1475|  50.5k|{
 1476|  50.5k|	ExifRational r;
 1477|  50.5k|	ExifByteOrder o;
 1478|       |
 1479|  50.5k|	if (!e || !e->parent || e->data || !e->parent->parent)
  ------------------
  |  Branch (1479:6): [True: 0, False: 50.5k]
  |  Branch (1479:12): [True: 0, False: 50.5k]
  |  Branch (1479:26): [True: 0, False: 50.5k]
  |  Branch (1479:37): [True: 0, False: 50.5k]
  ------------------
 1480|      0|		return;
 1481|       |	/* We need the byte order */
 1482|  50.5k|	o = exif_data_get_byte_order (e->parent->parent);
 1483|       |
 1484|  50.5k|	e->tag = tag;
 1485|       |
 1486|  50.5k|	if(exif_entry_get_ifd(e) == EXIF_IFD_GPS) {
  ------------------
  |  |  182|  50.5k|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 50.5k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1486:5): [True: 0, False: 50.5k]
  ------------------
 1487|      0|	  exif_entry_initialize_gps(e, tag);
 1488|      0|      return;
 1489|      0|	}
 1490|       |
 1491|  50.5k|	switch (tag) {
 1492|       |
 1493|       |	/* LONG, 1 component, no default */
 1494|      0|	case EXIF_TAG_PIXEL_X_DIMENSION:
  ------------------
  |  Branch (1494:2): [True: 0, False: 50.5k]
  ------------------
 1495|      0|	case EXIF_TAG_PIXEL_Y_DIMENSION:
  ------------------
  |  Branch (1495:2): [True: 0, False: 50.5k]
  ------------------
 1496|      0|	case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (1496:2): [True: 0, False: 50.5k]
  ------------------
 1497|      0|	case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (1497:2): [True: 0, False: 50.5k]
  ------------------
 1498|      0|	case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (1498:2): [True: 0, False: 50.5k]
  ------------------
 1499|      0|	case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (1499:2): [True: 0, False: 50.5k]
  ------------------
 1500|      0|	case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (1500:2): [True: 0, False: 50.5k]
  ------------------
 1501|      0|	case EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY:
  ------------------
  |  Branch (1501:2): [True: 0, False: 50.5k]
  ------------------
 1502|      0|	case EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX:
  ------------------
  |  Branch (1502:2): [True: 0, False: 50.5k]
  ------------------
 1503|      0|	case EXIF_TAG_ISO_SPEED:
  ------------------
  |  Branch (1503:2): [True: 0, False: 50.5k]
  ------------------
 1504|      0|	case EXIF_TAG_ISO_SPEEDLatitudeYYY:
  ------------------
  |  Branch (1504:2): [True: 0, False: 50.5k]
  ------------------
 1505|      0|	case EXIF_TAG_ISO_SPEEDLatitudeZZZ:
  ------------------
  |  Branch (1505:2): [True: 0, False: 50.5k]
  ------------------
 1506|      0|		e->components = 1;
 1507|      0|		e->format = EXIF_FORMAT_LONG;
 1508|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1509|      0|		e->data = exif_entry_alloc (e, e->size);
 1510|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1510:7): [True: 0, False: 0]
  ------------------
 1511|      0|		break;
 1512|       |
 1513|       |	/* SHORT, 1 component, no default */
 1514|      0|	case EXIF_TAG_SUBJECT_LOCATION:
  ------------------
  |  Branch (1514:2): [True: 0, False: 50.5k]
  ------------------
 1515|      0|	case EXIF_TAG_SENSING_METHOD:
  ------------------
  |  Branch (1515:2): [True: 0, False: 50.5k]
  ------------------
 1516|      0|	case EXIF_TAG_PHOTOMETRIC_INTERPRETATION:
  ------------------
  |  Branch (1516:2): [True: 0, False: 50.5k]
  ------------------
 1517|    163|	case EXIF_TAG_COMPRESSION:
  ------------------
  |  Branch (1517:2): [True: 163, False: 50.3k]
  ------------------
 1518|    163|	case EXIF_TAG_EXPOSURE_MODE:
  ------------------
  |  Branch (1518:2): [True: 0, False: 50.5k]
  ------------------
 1519|    163|	case EXIF_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (1519:2): [True: 0, False: 50.5k]
  ------------------
 1520|    163|	case EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM:
  ------------------
  |  Branch (1520:2): [True: 0, False: 50.5k]
  ------------------
 1521|    163|	case EXIF_TAG_GAIN_CONTROL:
  ------------------
  |  Branch (1521:2): [True: 0, False: 50.5k]
  ------------------
 1522|    163|	case EXIF_TAG_SUBJECT_DISTANCE_RANGE:
  ------------------
  |  Branch (1522:2): [True: 0, False: 50.5k]
  ------------------
 1523|    163|	case EXIF_TAG_FLASH:
  ------------------
  |  Branch (1523:2): [True: 0, False: 50.5k]
  ------------------
 1524|    163|	case EXIF_TAG_ISO_SPEED_RATINGS:
  ------------------
  |  Branch (1524:2): [True: 0, False: 50.5k]
  ------------------
 1525|    163|	case EXIF_TAG_SENSITIVITY_TYPE:
  ------------------
  |  Branch (1525:2): [True: 0, False: 50.5k]
  ------------------
 1526|    163|	case EXIF_TAG_COMPOSITE_IMAGE:
  ------------------
  |  Branch (1526:2): [True: 0, False: 50.5k]
  ------------------
 1527|       |
 1528|       |	/* SHORT, 1 component, default 0 */
 1529|    163|	case EXIF_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (1529:2): [True: 0, False: 50.5k]
  ------------------
 1530|    163|	case EXIF_TAG_IMAGE_LENGTH:
  ------------------
  |  Branch (1530:2): [True: 0, False: 50.5k]
  ------------------
 1531|    163|	case EXIF_TAG_EXPOSURE_PROGRAM:
  ------------------
  |  Branch (1531:2): [True: 0, False: 50.5k]
  ------------------
 1532|    163|	case EXIF_TAG_LIGHT_SOURCE:
  ------------------
  |  Branch (1532:2): [True: 0, False: 50.5k]
  ------------------
 1533|    163|	case EXIF_TAG_METERING_MODE:
  ------------------
  |  Branch (1533:2): [True: 0, False: 50.5k]
  ------------------
 1534|    163|	case EXIF_TAG_CUSTOM_RENDERED:
  ------------------
  |  Branch (1534:2): [True: 0, False: 50.5k]
  ------------------
 1535|    163|	case EXIF_TAG_SCENE_CAPTURE_TYPE:
  ------------------
  |  Branch (1535:2): [True: 0, False: 50.5k]
  ------------------
 1536|    163|	case EXIF_TAG_CONTRAST:
  ------------------
  |  Branch (1536:2): [True: 0, False: 50.5k]
  ------------------
 1537|    163|	case EXIF_TAG_SATURATION:
  ------------------
  |  Branch (1537:2): [True: 0, False: 50.5k]
  ------------------
 1538|    163|	case EXIF_TAG_SHARPNESS:
  ------------------
  |  Branch (1538:2): [True: 0, False: 50.5k]
  ------------------
 1539|    163|		e->components = 1;
 1540|    163|		e->format = EXIF_FORMAT_SHORT;
 1541|    163|		e->size = exif_format_get_size (e->format) * e->components;
 1542|    163|		e->data = exif_entry_alloc (e, e->size);
 1543|    163|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1543:7): [True: 0, False: 163]
  ------------------
 1544|    163|		exif_set_short (e->data, o, 0);
 1545|    163|		break;
 1546|       |
 1547|       |	/* SHORT, 1 component, default 1 */
 1548|      0|	case EXIF_TAG_ORIENTATION:
  ------------------
  |  Branch (1548:2): [True: 0, False: 50.5k]
  ------------------
 1549|      0|	case EXIF_TAG_PLANAR_CONFIGURATION:
  ------------------
  |  Branch (1549:2): [True: 0, False: 50.5k]
  ------------------
 1550|      0|	case EXIF_TAG_YCBCR_POSITIONING:
  ------------------
  |  Branch (1550:2): [True: 0, False: 50.5k]
  ------------------
 1551|      0|		e->components = 1;
 1552|      0|		e->format = EXIF_FORMAT_SHORT;
 1553|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1554|      0|		e->data = exif_entry_alloc (e, e->size);
 1555|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1555:7): [True: 0, False: 0]
  ------------------
 1556|      0|		exif_set_short (e->data, o, 1);
 1557|      0|		break;
 1558|       |
 1559|       |	/* SHORT, 1 component, default 2 */
 1560|  8.47k|	case EXIF_TAG_RESOLUTION_UNIT:
  ------------------
  |  Branch (1560:2): [True: 8.47k, False: 42.0k]
  ------------------
 1561|  8.47k|	case EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT:
  ------------------
  |  Branch (1561:2): [True: 0, False: 50.5k]
  ------------------
 1562|  8.47k|		e->components = 1;
 1563|  8.47k|		e->format = EXIF_FORMAT_SHORT;
 1564|  8.47k|		e->size = exif_format_get_size (e->format) * e->components;
 1565|  8.47k|		e->data = exif_entry_alloc (e, e->size);
 1566|  8.47k|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1566:7): [True: 0, False: 8.47k]
  ------------------
 1567|  8.47k|		exif_set_short (e->data, o, 2);
 1568|  8.47k|		break;
 1569|       |
 1570|       |	/* SHORT, 1 component, default 3 */
 1571|      0|	case EXIF_TAG_SAMPLES_PER_PIXEL:
  ------------------
  |  Branch (1571:2): [True: 0, False: 50.5k]
  ------------------
 1572|      0|		e->components = 1;
 1573|      0|		e->format = EXIF_FORMAT_SHORT;
 1574|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1575|      0|		e->data = exif_entry_alloc (e, e->size);
 1576|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1576:7): [True: 0, False: 0]
  ------------------
 1577|      0|		exif_set_short (e->data, o, 3);
 1578|      0|		break;
 1579|       |
 1580|       |	/* SHORT, 1 component, default 0xffff */
 1581|  8.30k|	case EXIF_TAG_COLOR_SPACE:
  ------------------
  |  Branch (1581:2): [True: 8.30k, False: 42.2k]
  ------------------
 1582|  8.30k|		e->components = 1;
 1583|  8.30k|		e->format = EXIF_FORMAT_SHORT;
 1584|  8.30k|		e->size = exif_format_get_size (e->format) * e->components;
 1585|  8.30k|		e->data = exif_entry_alloc (e, e->size);
 1586|  8.30k|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1586:7): [True: 0, False: 8.30k]
  ------------------
 1587|  8.30k|		exif_set_short (e->data, o, 0xffff);
 1588|  8.30k|		break;
 1589|       |
 1590|       |	/* SHORT, 3 components, default 8 8 8 */
 1591|      0|	case EXIF_TAG_BITS_PER_SAMPLE:
  ------------------
  |  Branch (1591:2): [True: 0, False: 50.5k]
  ------------------
 1592|      0|		e->components = 3;
 1593|      0|		e->format = EXIF_FORMAT_SHORT;
 1594|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1595|      0|		e->data = exif_entry_alloc (e, e->size);
 1596|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1596:7): [True: 0, False: 0]
  ------------------
 1597|      0|		exif_set_short (e->data, o, 8);
 1598|      0|		exif_set_short (
 1599|      0|			e->data + exif_format_get_size (e->format),
 1600|      0|			o, 8);
 1601|      0|		exif_set_short (
 1602|      0|			e->data + 2 * exif_format_get_size (e->format),
 1603|      0|			o, 8);
 1604|      0|		break;
 1605|       |
 1606|       |	/* SHORT, 2 components, default 0 0 */
 1607|      0|	case EXIF_TAG_SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE:
  ------------------
  |  Branch (1607:2): [True: 0, False: 50.5k]
  ------------------
 1608|      0|		e->components = 2;
 1609|      0|		e->format = EXIF_FORMAT_SHORT;
 1610|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1611|      0|		e->data = exif_entry_alloc (e, e->size);
 1612|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1612:7): [True: 0, False: 0]
  ------------------
 1613|      0|		exif_set_short (e->data, o, 0);
 1614|      0|		exif_set_short (
 1615|      0|			e->data + exif_format_get_size (e->format),
 1616|      0|			o, 0);
 1617|      0|		break;
 1618|       |
 1619|       |	/* SHORT, 2 components, default 2 1 */
 1620|      0|	case EXIF_TAG_YCBCR_SUB_SAMPLING:
  ------------------
  |  Branch (1620:2): [True: 0, False: 50.5k]
  ------------------
 1621|      0|		e->components = 2;
 1622|      0|		e->format = EXIF_FORMAT_SHORT;
 1623|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1624|      0|		e->data = exif_entry_alloc (e, e->size);
 1625|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1625:7): [True: 0, False: 0]
  ------------------
 1626|      0|		exif_set_short (e->data, o, 2);
 1627|      0|		exif_set_short (
 1628|      0|			e->data + exif_format_get_size (e->format),
 1629|      0|			o, 1);
 1630|      0|		break;
 1631|       |
 1632|       |	/* SRATIONAL, 1 component, no default */
 1633|      0|	case EXIF_TAG_EXPOSURE_BIAS_VALUE:
  ------------------
  |  Branch (1633:2): [True: 0, False: 50.5k]
  ------------------
 1634|      0|	case EXIF_TAG_BRIGHTNESS_VALUE:
  ------------------
  |  Branch (1634:2): [True: 0, False: 50.5k]
  ------------------
 1635|      0|	case EXIF_TAG_SHUTTER_SPEED_VALUE:
  ------------------
  |  Branch (1635:2): [True: 0, False: 50.5k]
  ------------------
 1636|      0|		e->components = 1;
 1637|      0|		e->format = EXIF_FORMAT_SRATIONAL;
 1638|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1639|      0|		e->data = exif_entry_alloc (e, e->size);
 1640|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1640:7): [True: 0, False: 0]
  ------------------
 1641|      0|		break;
 1642|       |
 1643|       |	/* RATIONAL, 1 component, no default */
 1644|      0|	case EXIF_TAG_EXPOSURE_TIME:
  ------------------
  |  Branch (1644:2): [True: 0, False: 50.5k]
  ------------------
 1645|      0|	case EXIF_TAG_FOCAL_PLANE_X_RESOLUTION:
  ------------------
  |  Branch (1645:2): [True: 0, False: 50.5k]
  ------------------
 1646|      0|	case EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION:
  ------------------
  |  Branch (1646:2): [True: 0, False: 50.5k]
  ------------------
 1647|      0|	case EXIF_TAG_EXPOSURE_INDEX:
  ------------------
  |  Branch (1647:2): [True: 0, False: 50.5k]
  ------------------
 1648|      0|	case EXIF_TAG_FLASH_ENERGY:
  ------------------
  |  Branch (1648:2): [True: 0, False: 50.5k]
  ------------------
 1649|      0|	case EXIF_TAG_FNUMBER:
  ------------------
  |  Branch (1649:2): [True: 0, False: 50.5k]
  ------------------
 1650|      0|	case EXIF_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (1650:2): [True: 0, False: 50.5k]
  ------------------
 1651|      0|	case EXIF_TAG_SUBJECT_DISTANCE:
  ------------------
  |  Branch (1651:2): [True: 0, False: 50.5k]
  ------------------
 1652|      0|	case EXIF_TAG_MAX_APERTURE_VALUE:
  ------------------
  |  Branch (1652:2): [True: 0, False: 50.5k]
  ------------------
 1653|      0|	case EXIF_TAG_APERTURE_VALUE:
  ------------------
  |  Branch (1653:2): [True: 0, False: 50.5k]
  ------------------
 1654|      0|	case EXIF_TAG_COMPRESSED_BITS_PER_PIXEL:
  ------------------
  |  Branch (1654:2): [True: 0, False: 50.5k]
  ------------------
 1655|      0|	case EXIF_TAG_PRIMARY_CHROMATICITIES:
  ------------------
  |  Branch (1655:2): [True: 0, False: 50.5k]
  ------------------
 1656|      0|	case EXIF_TAG_DIGITAL_ZOOM_RATIO:
  ------------------
  |  Branch (1656:2): [True: 0, False: 50.5k]
  ------------------
 1657|      0|	case EXIF_TAG_GAMMA:
  ------------------
  |  Branch (1657:2): [True: 0, False: 50.5k]
  ------------------
 1658|      0|		e->components = 1;
 1659|      0|		e->format = EXIF_FORMAT_RATIONAL;
 1660|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1661|      0|		e->data = exif_entry_alloc (e, e->size);
 1662|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1662:7): [True: 0, False: 0]
  ------------------
 1663|      0|		break;
 1664|       |
 1665|       |	/* RATIONAL, 1 component, default 72/1 */
 1666|  8.46k|	case EXIF_TAG_X_RESOLUTION:
  ------------------
  |  Branch (1666:2): [True: 8.46k, False: 42.0k]
  ------------------
 1667|  16.9k|	case EXIF_TAG_Y_RESOLUTION:
  ------------------
  |  Branch (1667:2): [True: 8.49k, False: 42.0k]
  ------------------
 1668|  16.9k|		e->components = 1;
 1669|  16.9k|		e->format = EXIF_FORMAT_RATIONAL;
 1670|  16.9k|		e->size = exif_format_get_size (e->format) * e->components;
 1671|  16.9k|		e->data = exif_entry_alloc (e, e->size);
 1672|  16.9k|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1672:7): [True: 0, False: 16.9k]
  ------------------
 1673|  16.9k|		r.numerator = 72;
 1674|  16.9k|		r.denominator = 1;
 1675|  16.9k|		exif_set_rational (e->data, o, r);
 1676|  16.9k|		break;
 1677|       |
 1678|       |	/* RATIONAL, 2 components, no default */
 1679|      0|	case EXIF_TAG_WHITE_POINT:
  ------------------
  |  Branch (1679:2): [True: 0, False: 50.5k]
  ------------------
 1680|      0|		e->components = 2;
 1681|      0|		e->format = EXIF_FORMAT_RATIONAL;
 1682|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1683|      0|		e->data = exif_entry_alloc (e, e->size);
 1684|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1684:7): [True: 0, False: 0]
  ------------------
 1685|      0|		break;
 1686|       |
 1687|       |	/* RATIONAL, 4 components, no default */
 1688|      0|	case EXIF_TAG_LENS_SPECIFICATION:
  ------------------
  |  Branch (1688:2): [True: 0, False: 50.5k]
  ------------------
 1689|      0|		e->components = 4;
 1690|      0|		e->format = EXIF_FORMAT_RATIONAL;
 1691|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1692|      0|		e->data = exif_entry_alloc (e, e->size);
 1693|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1693:7): [True: 0, False: 0]
  ------------------
 1694|      0|		break;
 1695|       |
 1696|       |	/* RATIONAL, 6 components */
 1697|      0|	case EXIF_TAG_REFERENCE_BLACK_WHITE:
  ------------------
  |  Branch (1697:2): [True: 0, False: 50.5k]
  ------------------
 1698|      0|		e->components = 6;
 1699|      0|		e->format = EXIF_FORMAT_RATIONAL;
 1700|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1701|      0|		e->data = exif_entry_alloc (e, e->size);
 1702|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1702:7): [True: 0, False: 0]
  ------------------
 1703|      0|		r.denominator = 1;
 1704|      0|		r.numerator = 0;
 1705|      0|		exif_set_rational (e->data, o, r);
 1706|      0|		r.numerator = 255;
 1707|      0|		exif_set_rational (
 1708|      0|			e->data + exif_format_get_size (e->format), o, r);
 1709|      0|		r.numerator = 0;
 1710|      0|		exif_set_rational (
 1711|      0|			e->data + 2 * exif_format_get_size (e->format), o, r);
 1712|      0|		r.numerator = 255;
 1713|      0|		exif_set_rational (
 1714|      0|			e->data + 3 * exif_format_get_size (e->format), o, r);
 1715|      0|		r.numerator = 0;
 1716|      0|		exif_set_rational (
 1717|      0|			e->data + 4 * exif_format_get_size (e->format), o, r);
 1718|      0|		r.numerator = 255;
 1719|      0|		exif_set_rational (
 1720|      0|			e->data + 5 * exif_format_get_size (e->format), o, r);
 1721|      0|		break;
 1722|       |
 1723|       |	/* ASCII, 20 components */
 1724|      0|	case EXIF_TAG_DATE_TIME:
  ------------------
  |  Branch (1724:2): [True: 0, False: 50.5k]
  ------------------
 1725|      0|	case EXIF_TAG_DATE_TIME_ORIGINAL:
  ------------------
  |  Branch (1725:2): [True: 0, False: 50.5k]
  ------------------
 1726|      0|	case EXIF_TAG_DATE_TIME_DIGITIZED:
  ------------------
  |  Branch (1726:2): [True: 0, False: 50.5k]
  ------------------
 1727|      0|	{
 1728|      0|		time_t t;
 1729|      0|#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
 1730|      0|		struct tm tms;
 1731|      0|#endif
 1732|      0|		struct tm *tm;
 1733|       |
 1734|      0|		t = time (NULL);
 1735|       |#if defined(HAVE_LOCALTIME_S)
 1736|       |		localtime_s (&tms, &t);
 1737|       |		tm = &tms;
 1738|       |#elif defined(HAVE_LOCALTIME_R)
 1739|       |		tm = localtime_r (&t, &tms);
 1740|       |#else
 1741|       |		tm = localtime (&t);
 1742|       |#endif
 1743|      0|		e->components = 20;
 1744|      0|		e->format = EXIF_FORMAT_ASCII;
 1745|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1746|      0|		e->data = exif_entry_alloc (e, e->size);
 1747|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1747:7): [True: 0, False: 0]
  ------------------
 1748|      0|		snprintf ((char *) e->data, e->size,
 1749|      0|			  "%04i:%02i:%02i %02i:%02i:%02i",
 1750|      0|			  tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
 1751|      0|			  tm->tm_hour, tm->tm_min, tm->tm_sec);
 1752|      0|		break;
 1753|      0|	}
 1754|       |
 1755|       |	/* ASCII, no default */
 1756|      0|	case EXIF_TAG_SUB_SEC_TIME:
  ------------------
  |  Branch (1756:2): [True: 0, False: 50.5k]
  ------------------
 1757|      0|	case EXIF_TAG_SUB_SEC_TIME_ORIGINAL:
  ------------------
  |  Branch (1757:2): [True: 0, False: 50.5k]
  ------------------
 1758|      0|	case EXIF_TAG_SUB_SEC_TIME_DIGITIZED:
  ------------------
  |  Branch (1758:2): [True: 0, False: 50.5k]
  ------------------
 1759|      0|	case EXIF_TAG_OFFSET_TIME:
  ------------------
  |  Branch (1759:2): [True: 0, False: 50.5k]
  ------------------
 1760|      0|	case EXIF_TAG_OFFSET_TIME_ORIGINAL:
  ------------------
  |  Branch (1760:2): [True: 0, False: 50.5k]
  ------------------
 1761|      0|	case EXIF_TAG_OFFSET_TIME_DIGITIZED:
  ------------------
  |  Branch (1761:2): [True: 0, False: 50.5k]
  ------------------
 1762|      0|		e->components = 0;
 1763|      0|		e->format = EXIF_FORMAT_ASCII;
 1764|      0|		e->size = 0;
 1765|      0|		e->data = NULL;
 1766|      0|		break;
 1767|       |
 1768|       |	/* ASCII, default "[None]" */
 1769|      0|	case EXIF_TAG_IMAGE_DESCRIPTION:
  ------------------
  |  Branch (1769:2): [True: 0, False: 50.5k]
  ------------------
 1770|      0|	case EXIF_TAG_MAKE:
  ------------------
  |  Branch (1770:2): [True: 0, False: 50.5k]
  ------------------
 1771|      0|	case EXIF_TAG_MODEL:
  ------------------
  |  Branch (1771:2): [True: 0, False: 50.5k]
  ------------------
 1772|      0|	case EXIF_TAG_SOFTWARE:
  ------------------
  |  Branch (1772:2): [True: 0, False: 50.5k]
  ------------------
 1773|      0|	case EXIF_TAG_ARTIST:
  ------------------
  |  Branch (1773:2): [True: 0, False: 50.5k]
  ------------------
 1774|      0|	case EXIF_TAG_CAMERA_OWNER_NAME:
  ------------------
  |  Branch (1774:2): [True: 0, False: 50.5k]
  ------------------
 1775|      0|	case EXIF_TAG_BODY_SERIAL_NUMBER:
  ------------------
  |  Branch (1775:2): [True: 0, False: 50.5k]
  ------------------
 1776|      0|	case EXIF_TAG_LENS_MAKE:
  ------------------
  |  Branch (1776:2): [True: 0, False: 50.5k]
  ------------------
 1777|      0|	case EXIF_TAG_LENS_MODEL:
  ------------------
  |  Branch (1777:2): [True: 0, False: 50.5k]
  ------------------
 1778|      0|	case EXIF_TAG_LENS_SERIAL_NUMBER:
  ------------------
  |  Branch (1778:2): [True: 0, False: 50.5k]
  ------------------
 1779|      0|		e->components = strlen (_("[None]")) + 1;
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1780|      0|		e->format = EXIF_FORMAT_ASCII;
 1781|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1782|      0|		e->data = exif_entry_alloc (e, e->size);
 1783|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1783:7): [True: 0, False: 0]
  ------------------
 1784|      0|		strncpy ((char *)e->data, _("[None]"), e->size);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1785|      0|		break;
 1786|       |	/* ASCII, default "[None]\0[None]\0" */
 1787|      0|	case EXIF_TAG_COPYRIGHT:
  ------------------
  |  Branch (1787:2): [True: 0, False: 50.5k]
  ------------------
 1788|      0|		e->components = (strlen (_("[None]")) + 1) * 2;
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1789|      0|		e->format = EXIF_FORMAT_ASCII;
 1790|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1791|      0|		e->data = exif_entry_alloc (e, e->size);
 1792|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1792:7): [True: 0, False: 0]
  ------------------
 1793|      0|		strcpy (((char *)e->data) + 0, _("[None]"));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1794|      0|		strcpy (((char *)e->data) + strlen (_("[None]")) + 1, _("[None]"));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
              		strcpy (((char *)e->data) + strlen (_("[None]")) + 1, _("[None]"));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1795|      0|		break;
 1796|       |
 1797|       |	/* UNDEFINED, 1 component, default 1 */
 1798|      0|	case EXIF_TAG_SCENE_TYPE:
  ------------------
  |  Branch (1798:2): [True: 0, False: 50.5k]
  ------------------
 1799|      0|		e->components = 1;
 1800|      0|		e->format = EXIF_FORMAT_UNDEFINED;
 1801|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1802|      0|		e->data = exif_entry_alloc (e, e->size);
 1803|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1803:7): [True: 0, False: 0]
  ------------------
 1804|      0|		e->data[0] = 0x01;
 1805|      0|		break;
 1806|       |
 1807|       |	/* UNDEFINED, 1 component, default 3 */
 1808|      0|	case EXIF_TAG_FILE_SOURCE:
  ------------------
  |  Branch (1808:2): [True: 0, False: 50.5k]
  ------------------
 1809|      0|		e->components = 1;
 1810|      0|		e->format = EXIF_FORMAT_UNDEFINED;
 1811|      0|		e->size = exif_format_get_size (e->format) * e->components;
 1812|      0|		e->data = exif_entry_alloc (e, e->size);
 1813|      0|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1813:7): [True: 0, False: 0]
  ------------------
 1814|      0|		e->data[0] = 0x03;
 1815|      0|		break;
 1816|       |
 1817|       |	/* UNDEFINED, 4 components, default 48 49 48 48 */
 1818|  8.29k|        case EXIF_TAG_FLASH_PIX_VERSION:
  ------------------
  |  Branch (1818:9): [True: 8.29k, False: 42.2k]
  ------------------
 1819|  8.29k|                e->components = 4;
 1820|  8.29k|                e->format = EXIF_FORMAT_UNDEFINED;
 1821|  8.29k|                e->size = exif_format_get_size (e->format) * e->components;
 1822|  8.29k|                e->data = exif_entry_alloc (e, e->size);
 1823|  8.29k|                if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1823:21): [True: 0, False: 8.29k]
  ------------------
 1824|  8.29k|                memcpy (e->data, "0100", 4);
 1825|  8.29k|                break;
 1826|       |
 1827|       |        /* UNDEFINED, 4 components, default 48 50 49 48 */
 1828|  8.31k|        case EXIF_TAG_EXIF_VERSION:
  ------------------
  |  Branch (1828:9): [True: 8.31k, False: 42.1k]
  ------------------
 1829|  8.31k|                e->components = 4;
 1830|  8.31k|                e->format = EXIF_FORMAT_UNDEFINED;
 1831|  8.31k|                e->size = exif_format_get_size (e->format) * e->components;
 1832|  8.31k|                e->data = exif_entry_alloc (e, e->size);
 1833|  8.31k|                if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1833:21): [True: 0, False: 8.31k]
  ------------------
 1834|  8.31k|                memcpy (e->data, "0210", 4);
 1835|  8.31k|                break;
 1836|       |
 1837|       |        /* UNDEFINED, 4 components, default 1 2 3 0 */
 1838|      0|        case EXIF_TAG_COMPONENTS_CONFIGURATION:
  ------------------
  |  Branch (1838:9): [True: 0, False: 50.5k]
  ------------------
 1839|      0|                e->components = 4;
 1840|      0|                e->format = EXIF_FORMAT_UNDEFINED;
 1841|      0|                e->size = exif_format_get_size (e->format) * e->components;
 1842|      0|                e->data = exif_entry_alloc (e, e->size);
 1843|      0|                if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1843:21): [True: 0, False: 0]
  ------------------
 1844|      0|		e->data[0] = 1;
 1845|      0|		e->data[1] = 2;
 1846|      0|		e->data[2] = 3;
 1847|      0|		e->data[3] = 0;
 1848|      0|                break;
 1849|       |
 1850|       |	/* UNDEFINED, no components, no default */
 1851|       |	/* Use this if the tag is otherwise unsupported */
 1852|      0|	case EXIF_TAG_MAKER_NOTE:
  ------------------
  |  Branch (1852:2): [True: 0, False: 50.5k]
  ------------------
 1853|      0|	case EXIF_TAG_USER_COMMENT:
  ------------------
  |  Branch (1853:2): [True: 0, False: 50.5k]
  ------------------
 1854|      0|	default:
  ------------------
  |  Branch (1854:2): [True: 0, False: 50.5k]
  ------------------
 1855|      0|		e->components = 0;
 1856|      0|		e->format = EXIF_FORMAT_UNDEFINED;
 1857|      0|		e->size = 0;
 1858|       |		e->data = NULL;
 1859|      0|		break;
 1860|  50.5k|	}
 1861|  50.5k|}
exif-entry.c:exif_entry_log:
   56|  94.4k|{
   57|  94.4k|	va_list args;
   58|  94.4k|	ExifLog *l = NULL;
   59|       |
   60|  94.4k|	if (e && e->parent && e->parent->parent)
  ------------------
  |  Branch (60:6): [True: 94.4k, False: 0]
  |  Branch (60:11): [True: 94.4k, False: 0]
  |  Branch (60:24): [True: 94.4k, False: 0]
  ------------------
   61|  94.4k|		l = exif_data_get_log (e->parent->parent);
   62|  94.4k|	va_start (args, format);
   63|  94.4k|	exif_logv (l, code, "ExifEntry", format, args);
   64|       |	va_end (args);
   65|  94.4k|}
exif-entry.c:exif_entry_alloc:
   78|  50.8k|{
   79|  50.8k|	void *d;
   80|  50.8k|	ExifLog *l = NULL;
   81|       |
   82|  50.8k|	if (!e || !e->priv || !i) return NULL;
  ------------------
  |  Branch (82:6): [True: 0, False: 50.8k]
  |  Branch (82:12): [True: 0, False: 50.8k]
  |  Branch (82:24): [True: 0, False: 50.8k]
  ------------------
   83|       |
   84|  50.8k|	d = exif_mem_alloc (e->priv->mem, i);
   85|  50.8k|	if (d) return d;
  ------------------
  |  Branch (85:6): [True: 50.8k, False: 0]
  ------------------
   86|       |
   87|      0|	if (e->parent && e->parent->parent)
  ------------------
  |  Branch (87:6): [True: 0, False: 0]
  |  Branch (87:19): [True: 0, False: 0]
  ------------------
   88|      0|		l = exif_data_get_log (e->parent->parent);
   89|      0|	EXIF_LOG_NO_MEMORY (l, "ExifEntry", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
   90|       |	return NULL;
   91|  50.8k|}
exif-entry.c:exif_get_short_convert:
  187|  64.4k|{
  188|  64.4k|	switch (format) {
  189|    418|	case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (189:2): [True: 418, False: 64.0k]
  ------------------
  190|    418|		return (ExifShort) exif_get_long (buf, order);
  191|    547|	case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (191:2): [True: 547, False: 63.9k]
  ------------------
  192|    547|		return (ExifShort) exif_get_slong (buf, order);
  193|      0|	case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (193:2): [True: 0, False: 64.4k]
  ------------------
  194|      0|		return (ExifShort) exif_get_short (buf, order);
  195|  3.25k|	case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (195:2): [True: 3.25k, False: 61.2k]
  ------------------
  196|  3.25k|		return (ExifShort) exif_get_sshort (buf, order);
  197|  47.9k|	case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (197:2): [True: 47.9k, False: 16.5k]
  ------------------
  198|  60.2k|	case EXIF_FORMAT_SBYTE:
  ------------------
  |  Branch (198:2): [True: 12.3k, False: 52.1k]
  ------------------
  199|  60.2k|		return (ExifShort) buf[0];
  200|      0|	default:
  ------------------
  |  Branch (200:2): [True: 0, False: 64.4k]
  ------------------
  201|       |		/* Unsupported type */
  202|      0|		return (ExifShort) 0;
  203|  64.4k|	}
  204|  64.4k|}
exif-entry.c:exif_entry_realloc:
   95|    109|{
   96|    109|	void *d;
   97|    109|	ExifLog *l = NULL;
   98|       |
   99|    109|	if (!e || !e->priv) return NULL;
  ------------------
  |  Branch (99:6): [True: 0, False: 109]
  |  Branch (99:12): [True: 0, False: 109]
  ------------------
  100|       |
  101|    109|	if (!i) { exif_mem_free (e->priv->mem, d_orig); return NULL; }
  ------------------
  |  Branch (101:6): [True: 0, False: 109]
  ------------------
  102|       |
  103|    109|	d = exif_mem_realloc (e->priv->mem, d_orig, i);
  104|    109|	if (d) return d;
  ------------------
  |  Branch (104:6): [True: 109, False: 0]
  ------------------
  105|       |
  106|      0|	if (e->parent && e->parent->parent)
  ------------------
  |  Branch (106:6): [True: 0, False: 0]
  |  Branch (106:19): [True: 0, False: 0]
  ------------------
  107|      0|		l = exif_data_get_log (e->parent->parent);
  108|      0|	EXIF_LOG_NO_MEMORY (l, "ExifEntry", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  109|       |	return NULL;
  110|    109|}
exif-entry.c:match_repeated_char:
  633|    153|{
  634|    153|	int i;
  635|    644|	for (i=n; i; --i, ++data) {
  ------------------
  |  Branch (635:12): [True: 624, False: 20]
  ------------------
  636|    624|		if (*data == 0) {
  ------------------
  |  Branch (636:7): [True: 30, False: 594]
  ------------------
  637|     30|			i = 0;	/* all bytes before NUL matched */
  638|     30|			break;
  639|     30|		}
  640|    594|		if (*data != ch)
  ------------------
  |  Branch (640:7): [True: 103, False: 491]
  ------------------
  641|    103|			break;
  642|    594|	}
  643|    153|	return i;
  644|    153|}
exif-entry.c:exif_entry_format_value:
  454|  34.9k|{
  455|  34.9k|	ExifByte v_byte;
  456|  34.9k|	ExifShort v_short;
  457|  34.9k|	ExifSShort v_sshort;
  458|  34.9k|	ExifLong v_long;
  459|  34.9k|	ExifRational v_rat;
  460|  34.9k|	ExifSRational v_srat;
  461|  34.9k|	ExifSLong v_slong;
  462|  34.9k|	unsigned int i;
  463|  34.9k|	size_t len;
  464|  34.9k|	const ExifByteOrder o = exif_data_get_byte_order (e->parent->parent);
  465|       |
  466|  34.9k|	if (!e->size || !maxlen)
  ------------------
  |  Branch (466:6): [True: 0, False: 34.9k]
  |  Branch (466:18): [True: 0, False: 34.9k]
  ------------------
  467|      0|		return;
  468|  34.9k|	switch (e->format) {
  469|  1.38k|	case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (469:2): [True: 1.38k, False: 33.5k]
  ------------------
  470|  1.38k|		snprintf (val, maxlen, _("%i bytes undefined data"), e->size);
  ------------------
  |  |   31|  1.38k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  471|  1.38k|		break;
  472|  3.38k|	case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (472:2): [True: 3.38k, False: 31.5k]
  ------------------
  473|  4.96k|	case EXIF_FORMAT_SBYTE:
  ------------------
  |  Branch (473:2): [True: 1.58k, False: 33.3k]
  ------------------
  474|  4.96k|		v_byte = e->data[0];
  475|  4.96k|		snprintf (val, maxlen, "0x%02x", v_byte);
  476|  4.96k|		len = strlen (val);
  477|   250k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (477:15): [True: 245k, False: 4.88k]
  ------------------
  478|   245k|			v_byte = e->data[i];
  479|   245k|			snprintf (val+len, maxlen-len, ", 0x%02x", v_byte);
  480|   245k|			len += strlen (val+len);
  481|   245k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (481:8): [True: 88, False: 245k]
  ------------------
  482|   245k|		}
  483|  4.96k|		break;
  484|  2.30k|	case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (484:2): [True: 2.30k, False: 32.6k]
  ------------------
  485|  2.30k|		v_short = exif_get_short (e->data, o);
  486|  2.30k|		snprintf (val, maxlen, "%u", v_short);
  487|  2.30k|		len = strlen (val);
  488|   215k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (488:15): [True: 213k, False: 2.21k]
  ------------------
  489|   213k|			v_short = exif_get_short (e->data +
  490|   213k|				exif_format_get_size (e->format) * i, o);
  491|   213k|			snprintf (val+len, maxlen-len, ", %u", v_short);
  492|   213k|			len += strlen (val+len);
  493|   213k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (493:8): [True: 94, False: 213k]
  ------------------
  494|   213k|		}
  495|  2.30k|		break;
  496|    753|	case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (496:2): [True: 753, False: 34.1k]
  ------------------
  497|    753|		v_sshort = exif_get_sshort (e->data, o);
  498|    753|		snprintf (val, maxlen, "%i", v_sshort);
  499|    753|		len = strlen (val);
  500|   108k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (500:15): [True: 107k, False: 697]
  ------------------
  501|   107k|			v_sshort = exif_get_short (e->data +
  502|   107k|				exif_format_get_size (e->format) *
  503|   107k|				i, o);
  504|   107k|			snprintf (val+len, maxlen-len, ", %i", v_sshort);
  505|   107k|			len += strlen (val+len);
  506|   107k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (506:8): [True: 56, False: 107k]
  ------------------
  507|   107k|		}
  508|    753|		break;
  509|  1.02k|	case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (509:2): [True: 1.02k, False: 33.9k]
  ------------------
  510|  1.02k|		v_long = exif_get_long (e->data, o);
  511|  1.02k|		snprintf (val, maxlen, "%lu", (unsigned long) v_long);
  512|  1.02k|		len = strlen (val);
  513|  57.1k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (513:15): [True: 56.1k, False: 991]
  ------------------
  514|  56.1k|			v_long = exif_get_long (e->data +
  515|  56.1k|				exif_format_get_size (e->format) *
  516|  56.1k|				i, o);
  517|  56.1k|			snprintf (val+len, maxlen-len, ", %lu", (unsigned long) v_long);
  518|  56.1k|			len += strlen (val+len);
  519|  56.1k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (519:8): [True: 29, False: 56.1k]
  ------------------
  520|  56.1k|		}
  521|  1.02k|		break;
  522|    837|	case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (522:2): [True: 837, False: 34.0k]
  ------------------
  523|    837|		v_slong = exif_get_slong (e->data, o);
  524|    837|		snprintf (val, maxlen, "%li", (long) v_slong);
  525|    837|		len = strlen (val);
  526|  54.3k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (526:15): [True: 53.5k, False: 794]
  ------------------
  527|  53.5k|			v_slong = exif_get_slong (e->data +
  528|  53.5k|				exif_format_get_size (e->format) * i, o);
  529|  53.5k|			snprintf (val+len, maxlen-len, ", %li", (long) v_slong);
  530|  53.5k|			len += strlen (val+len);
  531|  53.5k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (531:8): [True: 43, False: 53.5k]
  ------------------
  532|  53.5k|		}
  533|    837|		break;
  534|  4.61k|	case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (534:2): [True: 4.61k, False: 30.3k]
  ------------------
  535|  4.61k|		strncpy (val, (char *) e->data, MIN (maxlen-1, e->size));
  ------------------
  |  |  182|  4.61k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 185, False: 4.43k]
  |  |  ------------------
  ------------------
  536|  4.61k|		val[MIN (maxlen-1, e->size)] = 0;
  ------------------
  |  |  182|  4.61k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 185, False: 4.43k]
  |  |  ------------------
  ------------------
  537|  4.61k|		break;
  538|  18.0k|	case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (538:2): [True: 18.0k, False: 16.9k]
  ------------------
  539|  18.0k|		len = 0;
  540|   104k|		for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (540:15): [True: 86.6k, False: 17.9k]
  ------------------
  541|  86.6k|			if (i > 0) {
  ------------------
  |  Branch (541:8): [True: 68.6k, False: 18.0k]
  ------------------
  542|  68.6k|				snprintf (val+len, maxlen-len, ", ");
  543|  68.6k|				len += strlen (val+len);
  544|  68.6k|			}
  545|  86.6k|			v_rat = exif_get_rational (
  546|  86.6k|				e->data + 8 * i, o);
  547|  86.6k|			if (v_rat.denominator) {
  ------------------
  |  Branch (547:8): [True: 80.1k, False: 6.56k]
  ------------------
  548|       |				/*
  549|       |				 * Choose the number of significant digits to
  550|       |				 * display based on the size of the denominator.
  551|       |				 * It is scaled so that denominators within the
  552|       |				 * range 13..120 will show 2 decimal points.
  553|       |				 */
  554|  80.1k|				int decimals = (int)(log10(v_rat.denominator)-0.08+1.0);
  555|  80.1k|				snprintf (val+len, maxlen-len, "%2.*f",
  556|  80.1k|					  decimals,
  557|  80.1k|					  (double) v_rat.numerator /
  558|  80.1k|					  (double) v_rat.denominator);
  559|  80.1k|			} else
  560|  6.56k|				snprintf (val+len, maxlen-len, "%lu/%lu",
  561|  6.56k|				  (unsigned long) v_rat.numerator,
  562|  6.56k|				  (unsigned long) v_rat.denominator);
  563|  86.6k|			len += strlen (val+len);
  564|  86.6k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (564:8): [True: 41, False: 86.6k]
  ------------------
  565|  86.6k|		}
  566|  18.0k|		break;
  567|    618|	case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (567:2): [True: 618, False: 34.3k]
  ------------------
  568|    618|		len = 0;
  569|  57.0k|		for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (569:15): [True: 56.5k, False: 570]
  ------------------
  570|  56.5k|			if (i > 0) {
  ------------------
  |  Branch (570:8): [True: 55.8k, False: 618]
  ------------------
  571|  55.8k|				snprintf (val+len, maxlen-len, ", ");
  572|  55.8k|				len += strlen (val+len);
  573|  55.8k|			}
  574|  56.5k|			v_srat = exif_get_srational (
  575|  56.5k|				e->data + 8 * i, o);
  576|  56.5k|			if (v_srat.denominator && v_srat.denominator > INT32_MIN) {
  ------------------
  |  Branch (576:8): [True: 52.2k, False: 4.31k]
  |  Branch (576:30): [True: 51.6k, False: 553]
  ------------------
  577|  51.6k|				int decimals = (int)(log10(abs(v_srat.denominator))-0.08+1.0);
  578|  51.6k|				snprintf (val+len, maxlen-len, "%2.*f",
  579|  51.6k|					  decimals,
  580|  51.6k|					  (double) v_srat.numerator /
  581|  51.6k|					  (double) v_srat.denominator);
  582|  51.6k|			} else
  583|  4.86k|				snprintf (val+len, maxlen-len, "%li/%li",
  584|  4.86k|				  (long) v_srat.numerator,
  585|  4.86k|				  (long) v_srat.denominator);
  586|  56.5k|			len += strlen (val+len);
  587|  56.5k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (587:8): [True: 48, False: 56.4k]
  ------------------
  588|  56.5k|		}
  589|    618|		break;
  590|    134|	case EXIF_FORMAT_DOUBLE:
  ------------------
  |  Branch (590:2): [True: 134, False: 34.7k]
  ------------------
  591|    397|	case EXIF_FORMAT_FLOAT:
  ------------------
  |  Branch (591:2): [True: 263, False: 34.6k]
  ------------------
  592|    397|	default:
  ------------------
  |  Branch (592:2): [True: 0, False: 34.9k]
  ------------------
  593|       |		snprintf (val, maxlen, _("%i bytes unsupported data type"),
  ------------------
  |  |   31|    397|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  594|    397|			  e->size);
  595|    397|		break;
  596|  34.9k|	}
  597|  34.9k|}

exif_format_get_name:
   56|  43.0k|{
   57|  43.0k|	unsigned int i;
   58|       |
   59|  43.0k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   269k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 257k, False: 12.0k]
  ------------------
   62|   257k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 31.0k, False: 226k]
  ------------------
   63|  31.0k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  31.0k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  12.0k|	return NULL;
   65|  43.0k|}
exif_format_get_size:
   69|  1.49M|{
   70|  1.49M|	unsigned int i;
   71|       |
   72|  9.77M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 9.36M, False: 408k]
  ------------------
   73|  9.36M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.08M, False: 8.27M]
  ------------------
   74|  1.08M|			return ExifFormatTable[i].size;
   75|   408k|	return 0;
   76|  1.49M|}

exif_ifd_get_name:
   43|  72.7M|{
   44|  72.7M|	unsigned int i;
   45|       |
   46|   323M|	for (i = 0; ExifIfdTable[i].name; i++)
  ------------------
  |  Branch (46:14): [True: 323M, False: 0]
  ------------------
   47|   323M|		if (ExifIfdTable[i].ifd == ifd)
  ------------------
  |  Branch (47:7): [True: 72.7M, False: 251M]
  ------------------
   48|  72.7M|			break;
   49|       |
   50|  72.7M|	return (ExifIfdTable[i].name);
   51|  72.7M|}

exif_loader_write:
  171|  11.1k|{
  172|  11.1k|	unsigned int i;
  173|       |
  174|  76.0k|begin:
  175|  76.0k|	if (!eld || (len && !buf)) 
  ------------------
  |  Branch (175:6): [True: 0, False: 76.0k]
  |  Branch (175:15): [True: 75.8k, False: 237]
  |  Branch (175:22): [True: 0, False: 75.8k]
  ------------------
  176|      0|		return 0;
  177|       |
  178|  76.0k|	switch (eld->state) {
  179|    194|	case EL_EXIF_FOUND:
  ------------------
  |  Branch (179:2): [True: 194, False: 75.8k]
  ------------------
  180|    194|		return exif_loader_copy (eld, buf, len);
  181|  1.04k|	case EL_SKIP_BYTES:
  ------------------
  |  Branch (181:2): [True: 1.04k, False: 75.0k]
  ------------------
  182|  1.04k|		if (eld->size > len) { 
  ------------------
  |  Branch (182:7): [True: 161, False: 885]
  ------------------
  183|    161|			eld->size -= len; 
  184|    161|			return 1; 
  185|    161|		}
  186|    885|		len -= eld->size;
  187|    885|		buf += eld->size;
  188|    885|		eld->size = 0;
  189|    885|		eld->b_len = 0;
  190|    885|		switch (eld->data_format) {
  191|     60|		case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (191:3): [True: 60, False: 825]
  ------------------
  192|     60|			eld->state = EL_READ_SIZE_BYTE_24;
  193|     60|			break;
  194|    825|		default:
  ------------------
  |  Branch (194:3): [True: 825, False: 60]
  ------------------
  195|    825|			eld->state = EL_READ;
  196|    825|			break;
  197|    885|		}
  198|    885|		break;
  199|       |
  200|  74.4k|	case EL_READ:
  ------------------
  |  Branch (200:2): [True: 74.4k, False: 1.62k]
  ------------------
  201|  74.8k|	default:
  ------------------
  |  Branch (201:2): [True: 388, False: 75.6k]
  ------------------
  202|  74.8k|		break;
  203|  76.0k|	}
  204|       |
  205|  75.7k|	if (!len)
  ------------------
  |  Branch (205:6): [True: 71, False: 75.6k]
  ------------------
  206|     71|		return 1;
  207|  75.6k|	exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
  208|  75.6k|		  "Scanning %i byte(s) of data...", len);
  209|       |
  210|       |	/*
  211|       |	 * First fill the small buffer. Only continue if the buffer
  212|       |	 * is filled. Note that EXIF data contains at least 12 bytes.
  213|       |	 */
  214|  75.6k|	i = MIN (len, sizeof (eld->b) - eld->b_len);
  ------------------
  |  |  182|  75.6k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 27, False: 75.6k]
  |  |  ------------------
  ------------------
  215|  75.6k|	if (i) {
  ------------------
  |  Branch (215:6): [True: 75.6k, False: 0]
  ------------------
  216|  75.6k|		memcpy (&eld->b[eld->b_len], buf, i);
  217|  75.6k|		eld->b_len += i;
  218|  75.6k|		if (eld->b_len < sizeof (eld->b)) 
  ------------------
  |  Branch (218:7): [True: 27, False: 75.6k]
  ------------------
  219|     27|			return 1;
  220|  75.6k|		buf += i;
  221|  75.6k|		len -= i;
  222|  75.6k|	}
  223|       |
  224|  75.6k|	switch (eld->data_format) {
  225|  11.4k|	case EL_DATA_FORMAT_UNKNOWN:
  ------------------
  |  Branch (225:2): [True: 11.4k, False: 64.1k]
  ------------------
  226|       |
  227|       |		/* Check the small buffer against known formats. */
  228|  11.4k|		if (!memcmp (eld->b, "FUJIFILM", 8)) {
  ------------------
  |  Branch (228:7): [True: 61, False: 11.3k]
  ------------------
  229|       |
  230|       |			/* Skip to byte 84. There is another offset there. */
  231|     61|			eld->data_format = EL_DATA_FORMAT_FUJI_RAW;
  232|     61|			eld->size = 84;
  233|     61|			eld->state = EL_SKIP_BYTES;
  234|     61|			eld->size = 84;
  235|       |
  236|  11.3k|		} else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) {
  ------------------
  |  Branch (236:14): [True: 10.4k, False: 926]
  ------------------
  237|       |
  238|       |			/* Read the size (2 bytes). */
  239|  10.4k|			eld->data_format = EL_DATA_FORMAT_EXIF;
  240|  10.4k|			eld->state = EL_READ_SIZE_BYTE_08;
  241|  10.4k|		}
  242|  75.6k|	default:
  ------------------
  |  Branch (242:2): [True: 64.1k, False: 11.4k]
  ------------------
  243|  75.6k|		break;
  244|  75.6k|	}
  245|       |
  246|   881k|	for (i = 0; i < sizeof (eld->b); i++) {
  ------------------
  |  Branch (246:14): [True: 816k, False: 64.9k]
  ------------------
  247|   816k|		switch (eld->state) {
  248|  10.5k|		case EL_EXIF_FOUND:
  ------------------
  |  Branch (248:3): [True: 10.5k, False: 805k]
  ------------------
  249|  10.5k|			if (!exif_loader_copy (eld, eld->b + i,
  ------------------
  |  Branch (249:8): [True: 10, False: 10.5k]
  ------------------
  250|  10.5k|					sizeof (eld->b) - i)) 
  251|     10|				return 0;
  252|  10.5k|			return exif_loader_copy (eld, buf, len);
  253|  7.40k|		case EL_SKIP_BYTES:
  ------------------
  |  Branch (253:3): [True: 7.40k, False: 808k]
  ------------------
  254|  7.40k|			switch (eld->size) {
  255|  4.44k|                            case 0:
  ------------------
  |  Branch (255:29): [True: 4.44k, False: 2.96k]
  ------------------
  256|  4.44k|			        eld->state = EL_READ;
  257|  4.44k|				i--;   /* reprocess this byte */
  258|  4.44k|				break;
  259|  1.06k|                            case 1:
  ------------------
  |  Branch (259:29): [True: 1.06k, False: 6.33k]
  ------------------
  260|  1.06k|                                eld->size = 0;
  261|  1.06k|			        eld->state = EL_READ;
  262|  1.06k|				break;
  263|  1.89k|                            default:
  ------------------
  |  Branch (263:29): [True: 1.89k, False: 5.50k]
  ------------------
  264|  1.89k|                                eld->size--;
  265|  1.89k|				break;
  266|  7.40k|			}
  267|  7.40k|			break;
  268|       |
  269|  7.40k|		case EL_READ_SIZE_BYTE_24:
  ------------------
  |  Branch (269:3): [True: 59, False: 816k]
  ------------------
  270|     59|			eld->size |= (unsigned int)eld->b[i] << 24;
  271|     59|			eld->state = EL_READ_SIZE_BYTE_16;
  272|     59|			break;
  273|     59|		case EL_READ_SIZE_BYTE_16:
  ------------------
  |  Branch (273:3): [True: 59, False: 816k]
  ------------------
  274|     59|			eld->size |= (unsigned int)eld->b[i] << 16;
  275|     59|			eld->state = EL_READ_SIZE_BYTE_08;
  276|     59|			break;
  277|  17.2k|		case EL_READ_SIZE_BYTE_08:
  ------------------
  |  Branch (277:3): [True: 17.2k, False: 798k]
  ------------------
  278|  17.2k|			eld->size |= (unsigned int)eld->b[i] << 8;
  279|  17.2k|			eld->state = EL_READ_SIZE_BYTE_00;
  280|  17.2k|			break;
  281|  17.2k|		case EL_READ_SIZE_BYTE_00:
  ------------------
  |  Branch (281:3): [True: 17.2k, False: 798k]
  ------------------
  282|  17.2k|			eld->size |= eld->b[i] << 0;
  283|  17.2k|			switch (eld->data_format) {
  284|  6.43k|			case EL_DATA_FORMAT_JPEG:
  ------------------
  |  Branch (284:4): [True: 6.43k, False: 10.8k]
  ------------------
  285|  6.43k|				eld->state = EL_SKIP_BYTES;
  286|  6.43k|				if (eld->size < 2) {
  ------------------
  |  Branch (286:9): [True: 2.29k, False: 4.14k]
  ------------------
  287|       |				    /* Actually it's malformed... */
  288|  2.29k|				    eld->size = 0;
  289|  2.29k|				} else
  290|  4.14k|				    eld->size -= 2;
  291|  6.43k|				break;
  292|     59|			case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (292:4): [True: 59, False: 17.2k]
  ------------------
  293|     59|				eld->data_format = EL_DATA_FORMAT_EXIF;
  294|     59|				eld->state = EL_SKIP_BYTES;
  295|     59|				if (eld->size < 86) {
  ------------------
  |  Branch (295:9): [True: 5, False: 54]
  ------------------
  296|       |				    /* Actually it's malformed... */
  297|      5|				    eld->size = 0;
  298|      5|				} else
  299|     54|				    eld->size -= 86;	/* and put this in an else */
  300|     59|				break;
  301|  10.7k|			case EL_DATA_FORMAT_EXIF:
  ------------------
  |  Branch (301:4): [True: 10.7k, False: 6.49k]
  ------------------
  302|  10.7k|				eld->state = EL_EXIF_FOUND;
  303|  10.7k|				break;
  304|      0|			default:
  ------------------
  |  Branch (304:4): [True: 0, False: 17.2k]
  ------------------
  305|      0|				break;
  306|  17.2k|			}
  307|  17.2k|			break;
  308|       |
  309|   763k|		default:
  ------------------
  |  Branch (309:3): [True: 763k, False: 52.6k]
  ------------------
  310|   763k|			switch (eld->b[i]) {
  311|  1.65k|			case JPEG_MARKER_APP1:
  ------------------
  |  |   46|  1.65k|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (311:4): [True: 1.65k, False: 761k]
  ------------------
  312|  1.65k|			  if (!memcmp (eld->b + i + 3, ExifHeader, MIN((ptrdiff_t)(sizeof(ExifHeader)), MAX(0, ((ptrdiff_t)(sizeof(eld->b))) - ((ptrdiff_t)i) - 3)))) {
  ------------------
  |  |  182|  3.30k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 539, False: 1.11k]
  |  |  |  Branch (182:29): [True: 7, False: 1.64k]
  |  |  |  Branch (182:42): [True: 7, False: 1.10k]
  |  |  ------------------
  ------------------
  |  Branch (312:10): [True: 305, False: 1.34k]
  ------------------
  313|    305|					eld->data_format = EL_DATA_FORMAT_EXIF;
  314|  1.34k|				} else {
  315|  1.34k|					eld->data_format = EL_DATA_FORMAT_JPEG; /* Probably JFIF - keep searching for APP1 EXIF*/
  316|  1.34k|				}
  317|  1.65k|				eld->size = 0;
  318|  1.65k|				eld->state = EL_READ_SIZE_BYTE_08;
  319|  1.65k|				break;
  320|    361|			case JPEG_MARKER_DCT:
  ------------------
  |  |   36|    361|#define JPEG_MARKER_DCT  0xc0
  ------------------
  |  Branch (320:4): [True: 361, False: 763k]
  ------------------
  321|    566|			case JPEG_MARKER_DHT:
  ------------------
  |  |   38|    566|#define JPEG_MARKER_DHT  0xc4
  ------------------
  |  Branch (321:4): [True: 205, False: 763k]
  ------------------
  322|    777|			case JPEG_MARKER_DQT:
  ------------------
  |  |   42|    777|#define JPEG_MARKER_DQT  0xdb
  ------------------
  |  Branch (322:4): [True: 211, False: 763k]
  ------------------
  323|  2.11k|			case JPEG_MARKER_APP0:
  ------------------
  |  |   44|  2.11k|#define JPEG_MARKER_APP0 0xe0
  ------------------
  |  Branch (323:4): [True: 1.34k, False: 762k]
  ------------------
  324|  2.49k|			case JPEG_MARKER_APP2:
  ------------------
  |  |   48|  2.49k|#define JPEG_MARKER_APP2 0xe2
  ------------------
  |  Branch (324:4): [True: 373, False: 763k]
  ------------------
  325|  2.70k|			case JPEG_MARKER_APP3:
  ------------------
  |  |   50|  2.70k|#define JPEG_MARKER_APP3 0xe3
  ------------------
  |  Branch (325:4): [True: 211, False: 763k]
  ------------------
  326|  3.18k|			case JPEG_MARKER_APP4:
  ------------------
  |  |   52|  3.18k|#define JPEG_MARKER_APP4 0xe4
  ------------------
  |  Branch (326:4): [True: 483, False: 763k]
  ------------------
  327|  3.39k|			case JPEG_MARKER_APP5:
  ------------------
  |  |   54|  3.39k|#define JPEG_MARKER_APP5 0xe5
  ------------------
  |  Branch (327:4): [True: 213, False: 763k]
  ------------------
  328|  3.84k|			case JPEG_MARKER_APP10:
  ------------------
  |  |   56|  3.84k|#define JPEG_MARKER_APP10 0xea
  ------------------
  |  Branch (328:4): [True: 445, False: 763k]
  ------------------
  329|  4.11k|			case JPEG_MARKER_APP11:
  ------------------
  |  |   58|  4.11k|#define JPEG_MARKER_APP11 0xeb
  ------------------
  |  Branch (329:4): [True: 273, False: 763k]
  ------------------
  330|  4.40k|			case JPEG_MARKER_APP13:
  ------------------
  |  |   60|  4.40k|#define JPEG_MARKER_APP13 0xed
  ------------------
  |  Branch (330:4): [True: 290, False: 763k]
  ------------------
  331|  4.83k|			case JPEG_MARKER_APP14:
  ------------------
  |  |   62|  4.83k|#define JPEG_MARKER_APP14 0xee
  ------------------
  |  Branch (331:4): [True: 429, False: 763k]
  ------------------
  332|  5.10k|			case JPEG_MARKER_COM:
  ------------------
  |  |   64|  5.10k|#define JPEG_MARKER_COM 0xfe
  ------------------
  |  Branch (332:4): [True: 269, False: 763k]
  ------------------
  333|  5.10k|				eld->data_format = EL_DATA_FORMAT_JPEG;
  334|  5.10k|				eld->size = 0;
  335|  5.10k|				eld->state = EL_READ_SIZE_BYTE_08;
  336|  5.10k|				break;
  337|   754k|			case 0xff:
  ------------------
  |  Branch (337:4): [True: 754k, False: 8.75k]
  ------------------
  338|   756k|			case JPEG_MARKER_SOI:
  ------------------
  |  |   40|   756k|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (338:4): [True: 1.91k, False: 761k]
  ------------------
  339|   756k|				break;
  340|     90|			default:
  ------------------
  |  Branch (340:4): [True: 90, False: 763k]
  ------------------
  341|     90|				exif_log (eld->log,
  342|     90|					EXIF_LOG_CODE_CORRUPT_DATA,
  343|     90|					"ExifLoader", _("The data supplied "
  ------------------
  |  |   31|     90|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  344|     90|						"does not seem to contain "
  345|     90|						"EXIF data. JPEG Marker type 0x%02x"), eld->b[i]);
  346|     90|				exif_loader_reset (eld);
  347|     90|				return 0;
  348|   763k|			}
  349|   816k|		}
  350|   816k|	}
  351|       |
  352|       |	/*
  353|       |	 * If we reach this point, the buffer has not been big enough
  354|       |	 * to read all data we need. Fill it with new data.
  355|       |	 */
  356|  64.9k|	eld->b_len = 0;
  357|  64.9k|	goto begin;
  358|  75.6k|}
exif_loader_new:
  362|  11.1k|{
  363|  11.1k|	ExifMem *mem = exif_mem_new_default ();
  364|  11.1k|	ExifLoader *l = exif_loader_new_mem (mem);
  365|       |
  366|  11.1k|	exif_mem_unref (mem);
  367|       |
  368|  11.1k|	return l;
  369|  11.1k|}
exif_loader_new_mem:
  373|  11.1k|{
  374|  11.1k|	ExifLoader *loader;
  375|       |
  376|  11.1k|	if (!mem) 
  ------------------
  |  Branch (376:6): [True: 0, False: 11.1k]
  ------------------
  377|      0|		return NULL;
  378|       |	
  379|  11.1k|	loader = exif_mem_alloc (mem, sizeof (ExifLoader));
  380|  11.1k|	if (!loader) 
  ------------------
  |  Branch (380:6): [True: 0, False: 11.1k]
  ------------------
  381|      0|		return NULL;
  382|  11.1k|	loader->ref_count = 1;
  383|       |
  384|  11.1k|	loader->mem = mem;
  385|  11.1k|	exif_mem_ref (mem);
  386|       |
  387|  11.1k|	return loader;
  388|  11.1k|}
exif_loader_unref:
  414|  11.1k|{
  415|  11.1k|	if (!loader) 
  ------------------
  |  Branch (415:6): [True: 0, False: 11.1k]
  ------------------
  416|      0|		return;
  417|  11.1k|	if (!--loader->ref_count)
  ------------------
  |  Branch (417:6): [True: 11.1k, False: 0]
  ------------------
  418|  11.1k|		exif_loader_free (loader);
  419|  11.1k|}
exif_loader_reset:
  423|  11.2k|{
  424|  11.2k|	if (!loader) 
  ------------------
  |  Branch (424:6): [True: 0, False: 11.2k]
  ------------------
  425|      0|		return;
  426|  11.2k|	exif_mem_free (loader->mem, loader->buf); loader->buf = NULL;
  427|  11.2k|	loader->size = 0;
  428|  11.2k|	loader->bytes_read = 0;
  429|  11.2k|	loader->state = 0;
  430|  11.2k|	loader->b_len = 0;
  431|  11.2k|	loader->data_format = EL_DATA_FORMAT_UNKNOWN;
  432|  11.2k|}
exif_loader_get_data:
  436|  11.1k|{
  437|  11.1k|	ExifData *ed;
  438|       |
  439|  11.1k|	if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) ||
  ------------------
  |  Branch (439:6): [True: 0, False: 11.1k]
  |  Branch (439:17): [True: 102, False: 11.0k]
  ------------------
  440|  11.0k|	    !loader->bytes_read)
  ------------------
  |  Branch (440:6): [True: 267, False: 10.7k]
  ------------------
  441|    369|		return NULL;
  442|       |
  443|  10.7k|	ed = exif_data_new_mem (loader->mem);
  444|  10.7k|	exif_data_log (ed, loader->log);
  445|  10.7k|	exif_data_load_data (ed, loader->buf, loader->bytes_read);
  446|       |
  447|  10.7k|	return ed;
  448|  11.1k|}
exif-loader.c:exif_loader_copy:
  151|  21.3k|{
  152|  21.3k|	if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) 
  ------------------
  |  Branch (152:6): [True: 0, False: 21.3k]
  |  Branch (152:15): [True: 21.2k, False: 43]
  |  Branch (152:22): [True: 0, False: 21.2k]
  |  Branch (152:31): [True: 3, False: 21.3k]
  ------------------
  153|      3|		return 0;
  154|       |
  155|       |	/* If needed, allocate the buffer. */
  156|  21.3k|	if (!eld->buf) 
  ------------------
  |  Branch (156:6): [True: 10.7k, False: 10.5k]
  ------------------
  157|  10.7k|		eld->buf = exif_loader_alloc (eld, eld->size);
  158|  21.3k|	if (!eld->buf) 
  ------------------
  |  Branch (158:6): [True: 0, False: 21.3k]
  ------------------
  159|      0|		return 0;
  160|       |
  161|       |	/* Copy memory */
  162|  21.3k|	len = MIN (len, eld->size - eld->bytes_read);
  ------------------
  |  |  182|  21.3k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 21.2k, False: 130]
  |  |  ------------------
  ------------------
  163|  21.3k|	memcpy (eld->buf + eld->bytes_read, buf, len);
  164|  21.3k|	eld->bytes_read += len;
  165|       |
  166|  21.3k|	return (eld->bytes_read >= eld->size) ? 0 : 1;
  ------------------
  |  Branch (166:9): [True: 130, False: 21.2k]
  ------------------
  167|  21.3k|}
exif-loader.c:exif_loader_alloc:
  109|  10.7k|{
  110|  10.7k|	void *d;
  111|       |
  112|  10.7k|	if (!l || !i) 
  ------------------
  |  Branch (112:6): [True: 0, False: 10.7k]
  |  Branch (112:12): [True: 0, False: 10.7k]
  ------------------
  113|      0|		return NULL;
  114|       |
  115|  10.7k|	d = exif_mem_alloc (l->mem, i);
  116|  10.7k|	if (d) 
  ------------------
  |  Branch (116:6): [True: 10.7k, False: 0]
  ------------------
  117|  10.7k|		return d;
  118|       |
  119|      0|	EXIF_LOG_NO_MEMORY (l->log, "ExifLog", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  120|       |	return NULL;
  121|  10.7k|}
exif-loader.c:exif_loader_free:
  399|  11.1k|{
  400|  11.1k|	ExifMem *mem;
  401|       |
  402|  11.1k|	if (!loader) 
  ------------------
  |  Branch (402:6): [True: 0, False: 11.1k]
  ------------------
  403|      0|		return;
  404|       |
  405|  11.1k|	mem = loader->mem;
  406|  11.1k|	exif_loader_reset (loader);
  407|  11.1k|	exif_log_unref (loader->log);
  408|  11.1k|	exif_mem_free (mem, loader);
  409|  11.1k|	exif_mem_unref (mem);
  410|  11.1k|}

exif_log_ref:
  100|  17.7k|{
  101|  17.7k|	if (!log) return;
  ------------------
  |  Branch (101:6): [True: 17.7k, False: 0]
  ------------------
  102|      0|	log->ref_count++;
  103|      0|}
exif_log_unref:
  107|  89.6k|{
  108|  89.6k|	if (!log) return;
  ------------------
  |  Branch (108:6): [True: 89.6k, False: 0]
  ------------------
  109|      0|	if (log->ref_count > 0) log->ref_count--;
  ------------------
  |  Branch (109:6): [True: 0, False: 0]
  ------------------
  110|      0|	if (!log->ref_count) exif_log_free (log);
  ------------------
  |  Branch (110:6): [True: 0, False: 0]
  ------------------
  111|      0|}
exif_log:
  139|   181M|{
  140|   181M|	va_list args;
  141|       |
  142|   181M|	va_start (args, format);
  143|   181M|	exif_logv (log, code, domain, format, args);
  144|       |	va_end (args);
  145|   181M|}
exif_logv:
  150|   181M|{
  151|   181M|	if (!log) return;
  ------------------
  |  Branch (151:6): [True: 181M, False: 0]
  ------------------
  152|      0|	if (!log->func) return;
  ------------------
  |  Branch (152:6): [True: 0, False: 0]
  ------------------
  153|      0|	log->func (log, code, domain, format, args, log->data);
  154|      0|}

exif_mem_new:
   58|  61.6k|{
   59|  61.6k|	ExifMem *mem;
   60|       |
   61|  61.6k|	if (!alloc_func && !realloc_func) 
  ------------------
  |  Branch (61:6): [True: 0, False: 61.6k]
  |  Branch (61:21): [True: 0, False: 0]
  ------------------
   62|      0|		return NULL;
   63|  61.6k|	mem = alloc_func ? alloc_func (sizeof (ExifMem)) :
  ------------------
  |  Branch (63:8): [True: 61.6k, False: 0]
  ------------------
   64|  61.6k|		           realloc_func (NULL, sizeof (ExifMem));
   65|  61.6k|	if (!mem) return NULL;
  ------------------
  |  Branch (65:6): [True: 0, False: 61.6k]
  ------------------
   66|  61.6k|	mem->ref_count = 1;
   67|       |
   68|  61.6k|	mem->alloc_func   = alloc_func;
   69|  61.6k|	mem->realloc_func = realloc_func;
   70|  61.6k|	mem->free_func    = free_func;
   71|       |
   72|  61.6k|	return mem;
   73|  61.6k|}
exif_mem_ref:
   77|   399k|{
   78|   399k|	if (!mem) return;
  ------------------
  |  Branch (78:6): [True: 0, False: 399k]
  ------------------
   79|   399k|	mem->ref_count++;
   80|   399k|}
exif_mem_unref:
   84|   461k|{
   85|   461k|	if (!mem) return;
  ------------------
  |  Branch (85:6): [True: 0, False: 461k]
  ------------------
   86|   461k|	if (!--mem->ref_count)
  ------------------
  |  Branch (86:6): [True: 61.6k, False: 399k]
  ------------------
   87|  61.6k|		exif_mem_free (mem, mem);
   88|   461k|}
exif_mem_free:
   92|  1.06M|{
   93|  1.06M|	if (!mem) return;
  ------------------
  |  Branch (93:6): [True: 0, False: 1.06M]
  ------------------
   94|  1.06M|	if (mem->free_func) {
  ------------------
  |  Branch (94:6): [True: 1.06M, False: 0]
  ------------------
   95|  1.06M|		mem->free_func (d);
   96|  1.06M|		return;
   97|  1.06M|	}
   98|  1.06M|}
exif_mem_alloc:
  102|   949k|{
  103|   949k|	if (!mem) return NULL;
  ------------------
  |  Branch (103:6): [True: 0, False: 949k]
  ------------------
  104|   949k|	if (mem->alloc_func || mem->realloc_func)
  ------------------
  |  Branch (104:6): [True: 949k, False: 0]
  |  Branch (104:25): [True: 0, False: 0]
  ------------------
  105|   949k|		return mem->alloc_func ? mem->alloc_func (ds) :
  ------------------
  |  Branch (105:10): [True: 949k, False: 0]
  ------------------
  106|   949k|					 mem->realloc_func (NULL, ds);
  107|      0|	return NULL;
  108|   949k|}
exif_mem_realloc:
  112|  73.6k|{
  113|  73.6k|	return (mem && mem->realloc_func) ? mem->realloc_func (d, ds) : NULL;
  ------------------
  |  Branch (113:10): [True: 73.6k, False: 0]
  |  Branch (113:17): [True: 73.6k, False: 0]
  ------------------
  114|  73.6k|}
exif_mem_new_default:
  118|  61.6k|{
  119|  61.6k|	return exif_mem_new (exif_mem_alloc_func, exif_mem_realloc_func,
  120|  61.6k|			     exif_mem_free_func);
  121|  61.6k|}
exif-mem.c:exif_mem_alloc_func:
   37|  1.01M|{
   38|  1.01M|	return calloc ((size_t) ds, 1);
   39|  1.01M|}
exif-mem.c:exif_mem_realloc_func:
   44|  73.6k|{
   45|  73.6k|	return realloc (d, (size_t) ds);
   46|  73.6k|}
exif-mem.c:exif_mem_free_func:
   51|  1.06M|{
   52|  1.06M|	free (d);
   53|  1.06M|}

exif_mnote_data_construct:
   38|  7.01k|{
   39|  7.01k|	if (!d || !mem) return;
  ------------------
  |  Branch (39:6): [True: 0, False: 7.01k]
  |  Branch (39:12): [True: 0, False: 7.01k]
  ------------------
   40|  7.01k|	if (d->priv) return;
  ------------------
  |  Branch (40:6): [True: 0, False: 7.01k]
  ------------------
   41|  7.01k|	d->priv = exif_mem_alloc (mem, sizeof (ExifMnoteDataPriv));
   42|  7.01k|	if (!d->priv) {
  ------------------
  |  Branch (42:6): [True: 0, False: 7.01k]
  ------------------
   43|      0|		EXIF_LOG_NO_MEMORY (d->log, "ExifMnoteData", sizeof (ExifMnoteDataPriv));
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
   44|      0|		return;
   45|      0|	}
   46|       |
   47|  7.01k|	d->priv->ref_count = 1;
   48|       |
   49|  7.01k|	d->mem = mem;
   50|  7.01k|	exif_mem_ref (mem);
   51|  7.01k|}
exif_mnote_data_ref:
   55|  7.01k|{
   56|  7.01k|	if (d && d->priv) d->priv->ref_count++;
  ------------------
  |  Branch (56:6): [True: 7.01k, False: 0]
  |  Branch (56:11): [True: 7.01k, False: 0]
  ------------------
   57|  7.01k|}
exif_mnote_data_unref:
   77|  14.0k|{
   78|  14.0k|	if (!d || !d->priv) return;
  ------------------
  |  Branch (78:6): [True: 0, False: 14.0k]
  |  Branch (78:12): [True: 0, False: 14.0k]
  ------------------
   79|  14.0k|	if (d->priv->ref_count > 0) d->priv->ref_count--;
  ------------------
  |  Branch (79:6): [True: 14.0k, False: 0]
  ------------------
   80|  14.0k|	if (!d->priv->ref_count)
  ------------------
  |  Branch (80:6): [True: 7.01k, False: 7.01k]
  ------------------
   81|  7.01k|		exif_mnote_data_free (d);
   82|  14.0k|}
exif_mnote_data_load:
   87|  7.01k|{
   88|  7.01k|	if (!d || !d->methods.load) return;
  ------------------
  |  Branch (88:6): [True: 0, False: 7.01k]
  |  Branch (88:12): [True: 0, False: 7.01k]
  ------------------
   89|  7.01k|	d->methods.load (d, buf, buf_size);
   90|  7.01k|}
exif_mnote_data_set_byte_order:
  102|  7.01k|{
  103|  7.01k|	if (!d || !d->methods.set_byte_order) return;
  ------------------
  |  Branch (103:6): [True: 0, False: 7.01k]
  |  Branch (103:12): [True: 0, False: 7.01k]
  ------------------
  104|  7.01k|	d->methods.set_byte_order (d, o);
  105|  7.01k|}
exif_mnote_data_set_offset:
  109|  7.01k|{
  110|  7.01k|	if (!d || !d->methods.set_offset) return;
  ------------------
  |  Branch (110:6): [True: 0, False: 7.01k]
  |  Branch (110:12): [True: 0, False: 7.01k]
  ------------------
  111|  7.01k|	d->methods.set_offset (d, o);
  112|  7.01k|}
exif_mnote_data_count:
  116|  7.01k|{
  117|  7.01k|	if (!d || !d->methods.count) return 0;
  ------------------
  |  Branch (117:6): [True: 0, False: 7.01k]
  |  Branch (117:12): [True: 0, False: 7.01k]
  ------------------
  118|  7.01k|	return d->methods.count (d);
  119|  7.01k|}
exif_mnote_data_get_name:
  130|  1.79M|{
  131|  1.79M|	if (!d || !d->methods.get_name) return NULL;
  ------------------
  |  Branch (131:6): [True: 0, False: 1.79M]
  |  Branch (131:12): [True: 0, False: 1.79M]
  ------------------
  132|  1.79M|	return d->methods.get_name (d, n);
  133|  1.79M|}
exif_mnote_data_get_title:
  137|  1.78M|{
  138|  1.78M|	if (!d || !d->methods.get_title) return NULL;
  ------------------
  |  Branch (138:6): [True: 0, False: 1.78M]
  |  Branch (138:12): [True: 0, False: 1.78M]
  ------------------
  139|  1.78M|	return d->methods.get_title (d, n);
  140|  1.78M|}
exif_mnote_data_get_description:
  144|  1.78M|{
  145|  1.78M|	if (!d || !d->methods.get_description) return NULL;
  ------------------
  |  Branch (145:6): [True: 0, False: 1.78M]
  |  Branch (145:12): [True: 0, False: 1.78M]
  ------------------
  146|  1.78M|	return d->methods.get_description (d, n);
  147|  1.78M|}
exif_mnote_data_get_value:
  151|  1.78M|{
  152|  1.78M|	if (!d || !d->methods.get_value) return NULL;
  ------------------
  |  Branch (152:6): [True: 0, False: 1.78M]
  |  Branch (152:12): [True: 0, False: 1.78M]
  ------------------
  153|  1.78M|	return d->methods.get_value (d, n, val, maxlen);
  154|  1.78M|}
exif_mnote_data_log:
  158|  7.01k|{
  159|  7.01k|	if (!d) return;
  ------------------
  |  Branch (159:6): [True: 0, False: 7.01k]
  ------------------
  160|  7.01k|	exif_log_unref (d->log);
  161|  7.01k|	d->log = log;
  162|  7.01k|	exif_log_ref (log);
  163|  7.01k|}
exif-mnote-data.c:exif_mnote_data_free:
   61|  7.01k|{
   62|  7.01k|	ExifMem *mem = d ? d->mem : NULL;
  ------------------
  |  Branch (62:17): [True: 7.01k, False: 0]
  ------------------
   63|       |
   64|  7.01k|	if (!d) return;
  ------------------
  |  Branch (64:6): [True: 0, False: 7.01k]
  ------------------
   65|  7.01k|	if (d->priv) {
  ------------------
  |  Branch (65:6): [True: 7.01k, False: 0]
  ------------------
   66|  7.01k|		if (d->methods.free) d->methods.free (d);
  ------------------
  |  Branch (66:7): [True: 7.01k, False: 0]
  ------------------
   67|  7.01k|		exif_mem_free (mem, d->priv);
   68|       |		d->priv = NULL;
   69|  7.01k|	}
   70|  7.01k|	exif_log_unref (d->log);
   71|  7.01k|	exif_mem_free (mem, d);
   72|  7.01k|	exif_mem_unref (mem);
   73|  7.01k|}

exif_tag_table_count:
  978|   403M|{
  979|   403M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   403M|}
exif_tag_table_get_tag:
  985|  5.67M|{
  986|  5.67M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.67M, False: 0]
  ------------------
  987|  5.67M|}
exif_tag_get_name_in_ifd:
 1043|   391M|{
 1044|   391M|	unsigned int i;
 1045|   391M|	int first;
 1046|       |
 1047|   391M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 391M]
  ------------------
 1048|      0|		return NULL;
 1049|   391M|	first = exif_tag_table_first(tag);
 1050|   391M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 36.8M, False: 355M]
  ------------------
 1051|  36.8M|		return NULL;
 1052|       |
 1053|   709M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 709M, False: 1.07k]
  ------------------
 1054|   709M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 355M, False: 354M]
  ------------------
 1055|   355M|		   if (RECORDED)
  ------------------
  |  | 1035|   355M|#define RECORDED \
  |  | 1036|   355M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 592k, False: 354M]
  |  |  ------------------
  |  | 1037|   355M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 354M]
  |  |  ------------------
  |  | 1038|   355M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.69k, False: 354M]
  |  |  ------------------
  |  | 1039|   355M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 12.4k, False: 354M]
  |  |  ------------------
  ------------------
 1056|   606k|			   break;
 1057|   355M|		} else
 1058|   354M|			return NULL; /* Recorded tag not found in the table */
 1059|   709M|	}
 1060|   607k|	return ExifTagTable[i].name;
 1061|   355M|}
exif_tag_get_name:
 1152|  70.7M|{
 1153|  70.7M|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|  70.7M|}
exif_tag_get_support_level_in_ifd:
 1261|  5.69M|{
 1262|  5.69M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.69M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.69M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.69M, False: 0]
  ------------------
 1266|  5.69M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.69M|}
exif-tag.c:exif_tag_table_first:
 1016|   397M|{
 1017|   397M|	int i;
 1018|   397M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   397M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   397M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 36.8M, False: 360M]
  ------------------
 1021|  36.8M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|   360M|	i = entry - ExifTagTable;
 1025|       |
 1026|       |	/* There may be other entries with the same tag number, so search
 1027|       |	 * backwards to find the first
 1028|       |	 */
 1029|   361M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 359M, False: 1.19M]
  |  Branch (1029:20): [True: 361k, False: 359M]
  ------------------
 1030|   361k|		--i;
 1031|   361k|	}
 1032|   360M|	return i;
 1033|   397M|}
exif-tag.c:match_tag:
 1003|  2.81G|{
 1004|  2.81G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.81G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  70.7M|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|  70.7M|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|  70.7M|		EXIF_IFD_EXIF,
 1134|  70.7M|		EXIF_IFD_0,
 1135|  70.7M|		EXIF_IFD_1,
 1136|  70.7M|		EXIF_IFD_INTEROPERABILITY,
 1137|  70.7M|		EXIF_IFD_GPS
 1138|  70.7M|	};
 1139|  70.7M|	int i;
 1140|   423M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 353M, False: 70.4M]
  ------------------
 1141|   353M|		const char *result = func(tag, ifds[i]);
 1142|   353M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 288k, False: 353M]
  ------------------
 1143|   288k|			return result;
 1144|   288k|		}
 1145|   353M|	}
 1146|  70.4M|	return (const char *) NULL;
 1147|  70.7M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.69M|{
 1228|  5.69M|	unsigned int i;
 1229|  5.69M|	int first = exif_tag_table_first(tag);
 1230|  5.69M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.69M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  9.68M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 9.67M, False: 16.8k]
  ------------------
 1234|  9.67M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.79M, False: 3.88M]
  ------------------
 1235|       |			/*
 1236|       |			 * Check whether the support level is the same for all possible
 1237|       |			 * data types and isn't marked not recorded.
 1238|       |			 */
 1239|  5.79M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.79M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.87M, False: 3.91M]
  ------------------
 1242|  1.87M|				unsigned int dt;
 1243|  9.29M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 7.49M, False: 1.79M]
  ------------------
 1244|  7.49M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 85.3k, False: 7.41M]
  ------------------
 1245|  85.3k|						break;
 1246|  7.49M|				}
 1247|  1.87M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.79M, False: 85.3k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.79M|					return supp;
 1250|  1.87M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.79M|		} else {
 1253|  3.88M|			break; /* We've reached the end of the matching tags */
 1254|  3.88M|		}
 1255|  9.67M|	}
 1256|  3.89M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.69M|}

exif_get_sshort:
   90|   244M|{
   91|   244M|	if (!buf) return 0;
  ------------------
  |  Branch (91:6): [True: 270, False: 244M]
  ------------------
   92|   244M|        switch (order) {
  ------------------
  |  Branch (92:17): [True: 244M, False: 0]
  ------------------
   93|   108M|        case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (93:9): [True: 108M, False: 136M]
  ------------------
   94|   108M|                return (((unsigned int)buf[0] << 8) | buf[1]);
   95|   136M|        case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (95:9): [True: 136M, False: 108M]
  ------------------
   96|   136M|                return (((unsigned int)buf[1] << 8) | buf[0]);
   97|   244M|        }
   98|       |
   99|       |	/* Won't be reached */
  100|      0|	return (0);
  101|   244M|}
exif_get_short:
  105|   244M|{
  106|   244M|	return (exif_get_sshort (buf, order) & 0xffff);
  107|   244M|}
exif_set_sshort:
  111|  81.4k|{
  112|  81.4k|	if (!b) return;
  ------------------
  |  Branch (112:6): [True: 0, False: 81.4k]
  ------------------
  113|  81.4k|	switch (order) {
  ------------------
  |  Branch (113:10): [True: 81.4k, False: 0]
  ------------------
  114|  4.10k|	case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (114:2): [True: 4.10k, False: 77.2k]
  ------------------
  115|  4.10k|		b[0] = (unsigned char) (value >> 8);
  116|  4.10k|		b[1] = (unsigned char) value;
  117|  4.10k|		break;
  118|  77.2k|	case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (118:2): [True: 77.2k, False: 4.10k]
  ------------------
  119|  77.2k|		b[0] = (unsigned char) value;
  120|  77.2k|		b[1] = (unsigned char) (value >> 8);
  121|  77.2k|		break;
  122|  81.4k|	}
  123|  81.4k|}
exif_set_short:
  127|  81.4k|{
  128|  81.4k|	exif_set_sshort (b, order, value);
  129|  81.4k|}
exif_get_slong:
  133|  71.7M|{
  134|  71.7M|	if (!b) return 0;
  ------------------
  |  Branch (134:6): [True: 289, False: 71.7M]
  ------------------
  135|  71.7M|        switch (order) {
  ------------------
  |  Branch (135:17): [True: 71.7M, False: 0]
  ------------------
  136|  70.5M|        case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (136:9): [True: 70.5M, False: 1.22M]
  ------------------
  137|  70.5M|                return (((uint32_t)b[0] << 24) | ((uint32_t)b[1] << 16) | ((uint32_t)b[2] << 8) | (uint32_t)b[3]);
  138|  1.22M|        case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (138:9): [True: 1.22M, False: 70.5M]
  ------------------
  139|  1.22M|                return (((uint32_t)b[3] << 24) | ((uint32_t)b[2] << 16) | ((uint32_t)b[1] << 8) | (uint32_t)b[0]);
  140|  71.7M|        }
  141|       |
  142|       |	/* Won't be reached */
  143|      0|	return (0);
  144|  71.7M|}
exif_set_slong:
  148|   113k|{
  149|   113k|	if (!b) return;
  ------------------
  |  Branch (149:6): [True: 0, False: 113k]
  ------------------
  150|   113k|	switch (order) {
  ------------------
  |  Branch (150:10): [True: 113k, False: 0]
  ------------------
  151|  6.43k|	case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (151:2): [True: 6.43k, False: 106k]
  ------------------
  152|  6.43k|		b[0] = (unsigned char) (value >> 24);
  153|  6.43k|		b[1] = (unsigned char) (value >> 16);
  154|  6.43k|		b[2] = (unsigned char) (value >> 8);
  155|  6.43k|		b[3] = (unsigned char) value;
  156|  6.43k|		break;
  157|   106k|	case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (157:2): [True: 106k, False: 6.43k]
  ------------------
  158|   106k|		b[3] = (unsigned char) (value >> 24);
  159|   106k|		b[2] = (unsigned char) (value >> 16);
  160|   106k|		b[1] = (unsigned char) (value >> 8);
  161|   106k|		b[0] = (unsigned char) value;
  162|   106k|		break;
  163|   113k|	}
  164|   113k|}
exif_get_long:
  168|  71.4M|{
  169|  71.4M|        return (exif_get_slong (buf, order) & 0xffffffff);
  170|  71.4M|}
exif_set_long:
  174|  72.2k|{
  175|  72.2k|	exif_set_slong (b, order, value);
  176|  72.2k|}
exif_get_srational:
  180|  77.1k|{
  181|  77.1k|	ExifSRational r;
  182|       |
  183|  77.1k|	r.numerator   = buf ? exif_get_slong (buf, order) : 0;
  ------------------
  |  Branch (183:18): [True: 76.9k, False: 195]
  ------------------
  184|  77.1k|	r.denominator = buf ? exif_get_slong (buf + 4, order) : 0;
  ------------------
  |  Branch (184:18): [True: 76.9k, False: 195]
  ------------------
  185|       |
  186|  77.1k|	return (r);
  187|  77.1k|}
exif_get_rational:
  191|   121k|{
  192|   121k|	ExifRational r;
  193|       |
  194|   121k|	r.numerator   = buf ? exif_get_long (buf, order) : 0;
  ------------------
  |  Branch (194:18): [True: 121k, False: 140]
  ------------------
  195|   121k|	r.denominator = buf ? exif_get_long (buf + 4, order) : 0;
  ------------------
  |  Branch (195:18): [True: 121k, False: 140]
  ------------------
  196|       |
  197|   121k|	return (r);
  198|   121k|}
exif_set_rational:
  203|  36.1k|{
  204|  36.1k|	if (!buf) return;
  ------------------
  |  Branch (204:6): [True: 0, False: 36.1k]
  ------------------
  205|  36.1k|	exif_set_long (buf, order, value.numerator);
  206|  36.1k|	exif_set_long (buf + 4, order, value.denominator);
  207|  36.1k|}
exif_set_srational:
  212|  20.4k|{
  213|  20.4k|	if (!buf) return;
  ------------------
  |  Branch (213:6): [True: 0, False: 20.4k]
  ------------------
  214|  20.4k|	exif_set_slong (buf, order, value.numerator);
  215|  20.4k|	exif_set_slong (buf + 4, order, value.denominator);
  216|  20.4k|}
exif_convert_utf16_to_utf8:
  223|    132|{
  224|    132|	if (!outlen) {
  ------------------
  |  Branch (224:6): [True: 0, False: 132]
  ------------------
  225|      0|		return;
  226|      0|	}
  227|   124k|	for (;;) {
  228|   124k|		ExifShort v;
  229|   124k|		if (inlen < 2)
  ------------------
  |  Branch (229:7): [True: 0, False: 124k]
  ------------------
  230|      0|			break;
  231|   124k|		v = exif_get_short(in, EXIF_BYTE_ORDER_INTEL);
  232|   124k|		if (!v)
  ------------------
  |  Branch (232:7): [True: 99, False: 124k]
  ------------------
  233|     99|			break;
  234|   124k|		if (v < 0x80) {
  ------------------
  |  Branch (234:7): [True: 1.17k, False: 123k]
  ------------------
  235|  1.17k|			if (outlen > 1) {
  ------------------
  |  Branch (235:8): [True: 1.16k, False: 10]
  ------------------
  236|  1.16k|				*out++ = (char)v;
  237|  1.16k|				outlen--;
  238|  1.16k|			} else {
  239|     10|				break;
  240|     10|			}
  241|   123k|		} else if (v < 0x800) {
  ------------------
  |  Branch (241:14): [True: 2.99k, False: 120k]
  ------------------
  242|  2.99k|			if (outlen > 2) {
  ------------------
  |  Branch (242:8): [True: 2.98k, False: 10]
  ------------------
  243|  2.98k|				*out++ = ((v >> 6) & 0x1F) | 0xC0;
  244|  2.98k|				*out++ = (v & 0x3F) | 0x80;
  245|  2.98k|				outlen -= 2;
  246|  2.98k|			} else {
  247|     10|				break;
  248|     10|			}
  249|   120k|		} else {
  250|   120k|			if (outlen > 3) {
  ------------------
  |  Branch (250:8): [True: 120k, False: 13]
  ------------------
  251|   120k|				*out++ = ((v >> 12) & 0x0F) | 0xE0;
  252|   120k|				*out++ = ((v >> 6) & 0x3F) | 0x80;
  253|   120k|				*out++ = (v & 0x3F) | 0x80;
  254|   120k|				outlen -= 3;
  255|   120k|			} else {
  256|     13|				break;
  257|     13|			}
  258|   120k|		}
  259|   124k|		in += 2;
  260|   124k|		inlen -= 2;
  261|   124k|	}
  262|    132|	*out = 0;
  263|    132|}

exif_mnote_data_fuji_identify:
  348|  2.33k|{
  349|  2.33k|	(void) ed;  /* unused */
  350|  2.33k|	return ((e->size >= 12) && !memcmp (e->data, "FUJIFILM", 8));
  ------------------
  |  Branch (350:10): [True: 1.98k, False: 353]
  |  Branch (350:29): [True: 1.04k, False: 933]
  ------------------
  351|  2.33k|}
exif_mnote_data_fuji_new:
  355|  1.04k|{
  356|  1.04k|	ExifMnoteData *d;
  357|       |
  358|  1.04k|	if (!mem) return NULL;
  ------------------
  |  Branch (358:6): [True: 0, False: 1.04k]
  ------------------
  359|       |
  360|  1.04k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataFuji));
  361|  1.04k|	if (!d) return NULL;
  ------------------
  |  Branch (361:6): [True: 0, False: 1.04k]
  ------------------
  362|       |
  363|  1.04k|	exif_mnote_data_construct (d, mem);
  364|       |
  365|       |	/* Set up function pointers */
  366|  1.04k|	d->methods.free            = exif_mnote_data_fuji_free;
  367|  1.04k|	d->methods.set_byte_order  = exif_mnote_data_fuji_set_byte_order;
  368|  1.04k|	d->methods.set_offset      = exif_mnote_data_fuji_set_offset;
  369|  1.04k|	d->methods.load            = exif_mnote_data_fuji_load;
  370|  1.04k|	d->methods.save            = exif_mnote_data_fuji_save;
  371|  1.04k|	d->methods.count           = exif_mnote_data_fuji_count;
  372|  1.04k|	d->methods.get_id          = exif_mnote_data_fuji_get_id;
  373|  1.04k|	d->methods.get_name        = exif_mnote_data_fuji_get_name;
  374|  1.04k|	d->methods.get_title       = exif_mnote_data_fuji_get_title;
  375|  1.04k|	d->methods.get_description = exif_mnote_data_fuji_get_description;
  376|  1.04k|	d->methods.get_value       = exif_mnote_data_fuji_get_value;
  377|       |
  378|  1.04k|	return d;
  379|  1.04k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_free:
   61|  1.04k|{
   62|  1.04k|	if (!n) return;
  ------------------
  |  Branch (62:6): [True: 0, False: 1.04k]
  ------------------
   63|       |
   64|  1.04k|	exif_mnote_data_fuji_clear ((ExifMnoteDataFuji *) n);
   65|  1.04k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_clear:
   41|  2.00k|{
   42|  2.00k|	ExifMnoteData *d = (ExifMnoteData *) n;
   43|  2.00k|	unsigned int i;
   44|       |
   45|  2.00k|	if (!n) return;
  ------------------
  |  Branch (45:6): [True: 0, False: 2.00k]
  ------------------
   46|       |
   47|  2.00k|	if (n->entries) {
  ------------------
  |  Branch (47:6): [True: 954, False: 1.04k]
  ------------------
   48|  18.6k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (48:15): [True: 17.7k, False: 954]
  ------------------
   49|  17.7k|			if (n->entries[i].data) {
  ------------------
  |  Branch (49:8): [True: 4.87k, False: 12.8k]
  ------------------
   50|  4.87k|				exif_mem_free (d->mem, n->entries[i].data);
   51|  4.87k|				n->entries[i].data = NULL;
   52|  4.87k|			}
   53|    954|		exif_mem_free (d->mem, n->entries);
   54|       |		n->entries = NULL;
   55|    954|		n->count = 0;
   56|    954|	}
   57|  2.00k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_set_byte_order:
  322|  1.04k|{
  323|  1.04k|	ExifByteOrder o_orig;
  324|  1.04k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  325|  1.04k|	unsigned int i;
  326|       |
  327|  1.04k|	if (!n) return;
  ------------------
  |  Branch (327:6): [True: 0, False: 1.04k]
  ------------------
  328|       |
  329|  1.04k|	o_orig = n->order;
  330|  1.04k|	n->order = o;
  331|  1.04k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (331:14): [True: 0, False: 1.04k]
  ------------------
  332|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (332:7): [True: 0, False: 0]
  |  Branch (332:35): [True: 0, False: 0]
  ------------------
  333|      0|			continue;
  334|      0|		n->entries[i].order = o;
  335|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  336|      0|				n->entries[i].components, o_orig, o);
  337|      0|	}
  338|  1.04k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_set_offset:
  342|  1.04k|{
  343|  1.04k|	if (n) ((ExifMnoteDataFuji *) n)->offset = o;
  ------------------
  |  Branch (343:6): [True: 1.04k, False: 0]
  ------------------
  344|  1.04k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_load:
  160|  1.04k|{
  161|  1.04k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji*) en;
  162|  1.04k|	ExifLong c;
  163|  1.04k|	size_t i, tcount, o, datao;
  164|       |
  165|  1.04k|	if (!n) return;
  ------------------
  |  Branch (165:6): [True: 0, False: 1.04k]
  ------------------
  166|       |
  167|  1.04k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (167:6): [True: 0, False: 1.04k]
  |  Branch (167:14): [True: 0, False: 1.04k]
  ------------------
  168|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  169|      0|			  "ExifMnoteDataFuji", "Short MakerNote");
  170|      0|		return;
  171|      0|	}
  172|  1.04k|	if (CHECKOVERFLOW(n->offset, buf_size, 6+8+4)) {
  ------------------
  |  |   33|  1.04k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 1.04k]
  |  |  |  Branch (33:81): [True: 0, False: 1.04k]
  |  |  |  Branch (33:112): [True: 2, False: 1.04k]
  |  |  ------------------
  ------------------
  173|      2|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  174|      2|			  "ExifMnoteDataFuji", "Short MakerNote");
  175|      2|		return;
  176|      2|	}
  177|  1.04k|	datao = 6 + n->offset;
  178|       |
  179|  1.04k|	n->order = EXIF_BYTE_ORDER_INTEL;
  180|       |
  181|  1.04k|	datao += exif_get_long (buf + datao + 8, EXIF_BYTE_ORDER_INTEL);
  182|  1.04k|	if (CHECKOVERFLOW(datao, buf_size, 2)) {
  ------------------
  |  |   33|  1.04k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 70, False: 977]
  |  |  |  Branch (33:81): [True: 0, False: 977]
  |  |  |  Branch (33:112): [True: 1, False: 976]
  |  |  ------------------
  ------------------
  183|     71|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  184|     71|			  "ExifMnoteDataFuji", "Short MakerNote");
  185|     71|		return;
  186|     71|	}
  187|       |
  188|       |	/* Read the number of tags */
  189|    976|	c = exif_get_short (buf + datao, EXIF_BYTE_ORDER_INTEL);
  190|    976|	datao += 2;
  191|       |
  192|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 50 named tags currently.
  193|       |	 * Fuji XT2 had 56 entries or so, GFX500 has 68. 150 seems a safe upper bound currently.
  194|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  195|    976|	if (c > 150) {
  ------------------
  |  Branch (195:6): [True: 22, False: 954]
  ------------------
  196|     22|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataFuji", "Too much tags (%d) in Fuji MakerNote", c);
  197|     22|		return;
  198|     22|	}
  199|       |
  200|       |	/* Remove any old entries */
  201|    954|	exif_mnote_data_fuji_clear (n);
  202|       |
  203|       |	/* Reserve enough space for all the possible MakerNote tags */
  204|    954|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteFujiEntry) * c);
  205|    954|	if (!n->entries) {
  ------------------
  |  Branch (205:6): [True: 0, False: 954]
  ------------------
  206|      0|		EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteDataFuji", sizeof (MnoteFujiEntry) * c);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  207|      0|		return;
  208|      0|	}
  209|       |
  210|       |	/* Parse all c entries, storing ones that are successfully parsed */
  211|    954|	tcount = 0;
  212|  20.5k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (212:25): [True: 20.4k, False: 61]
  ------------------
  213|  20.4k|		size_t s;
  214|       |
  215|  20.4k|		memset(&n->entries[tcount], 0, sizeof(MnoteFujiEntry));
  216|  20.4k|		if (CHECKOVERFLOW(o, buf_size, 12)) {
  ------------------
  |  |   33|  20.4k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 274, False: 20.2k]
  |  |  |  Branch (33:81): [True: 0, False: 20.2k]
  |  |  |  Branch (33:112): [True: 619, False: 19.5k]
  |  |  ------------------
  ------------------
  217|    893|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  218|    893|				  "ExifMnoteDataFuji", "Short MakerNote");
  219|    893|			break;
  220|    893|		}
  221|       |
  222|  19.5k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  223|  19.5k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  224|  19.5k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  225|  19.5k|		n->entries[tcount].order      = n->order;
  226|       |
  227|  19.5k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataFuji",
  228|  19.5k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  229|  19.5k|			  mnote_fuji_tag_get_name (n->entries[tcount].tag));
  230|       |
  231|       |		/* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  232|       |		 * we will check the buffer sizes closer later. */
  233|  19.5k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (233:8): [True: 8.41k, False: 11.1k]
  ------------------
  234|  8.41k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (234:4): [True: 1.16k, False: 7.24k]
  ------------------
  235|  19.5k|		) {
  236|  1.16k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  237|  1.16k|					  "ExifMnoteDataFuji", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  238|  1.16k|			continue;
  239|  1.16k|		}
  240|       |		/*
  241|       |		 * Size? If bigger than 4 bytes, the actual data is not
  242|       |		 * in the entry but somewhere else (offset).
  243|       |		 */
  244|  18.4k|		s = exif_format_get_size (n->entries[tcount].format) * n->entries[tcount].components;
  245|  18.4k|		n->entries[tcount].size = s;
  246|  18.4k|		if (s) {
  ------------------
  |  Branch (246:7): [True: 5.57k, False: 12.8k]
  ------------------
  247|  5.57k|			size_t dataofs = o + 8;
  248|  5.57k|			if (s > 4)
  ------------------
  |  Branch (248:8): [True: 2.94k, False: 2.62k]
  ------------------
  249|       |				/* The data in this case is merely a pointer */
  250|  2.94k|				dataofs = exif_get_long (buf + dataofs, n->order) + 6 + n->offset;
  251|       |
  252|  5.57k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  5.57k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 307, False: 5.26k]
  |  |  |  Branch (33:81): [True: 0, False: 5.26k]
  |  |  |  Branch (33:112): [True: 395, False: 4.87k]
  |  |  ------------------
  ------------------
  253|    702|				exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  254|    702|						  "ExifMnoteDataFuji", "Tag data past end of "
  255|    702|					  "buffer (%u >= %u)", (unsigned)(dataofs + s), buf_size);
  256|    702|				continue;
  257|    702|			}
  258|       |
  259|  4.87k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  260|  4.87k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (260:8): [True: 0, False: 4.87k]
  ------------------
  261|      0|				EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteDataFuji", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  262|      0|				continue;
  263|      0|			}
  264|  4.87k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  265|  4.87k|		}
  266|       |
  267|       |		/* Tag was successfully parsed */
  268|  17.7k|		++tcount;
  269|  17.7k|	}
  270|       |	/* Store the count of successfully parsed tags */
  271|    954|	n->count = tcount;
  272|    954|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_count:
  276|  1.04k|{
  277|  1.04k|	return n ? ((ExifMnoteDataFuji *) n)->count : 0;
  ------------------
  |  Branch (277:9): [True: 1.04k, False: 0]
  ------------------
  278|  1.04k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_name:
  292|  9.58k|{
  293|  9.58k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  294|       |
  295|  9.58k|	if (!n) return NULL;
  ------------------
  |  Branch (295:6): [True: 0, False: 9.58k]
  ------------------
  296|  9.58k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (296:6): [True: 0, False: 9.58k]
  ------------------
  297|  9.58k|	return mnote_fuji_tag_get_name (n->entries[i].tag);
  298|  9.58k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_title:
  302|  9.05k|{
  303|  9.05k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  304|       |	
  305|  9.05k|	if (!n) return NULL;
  ------------------
  |  Branch (305:6): [True: 0, False: 9.05k]
  ------------------
  306|  9.05k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (306:6): [True: 0, False: 9.05k]
  ------------------
  307|  9.05k|        return mnote_fuji_tag_get_title (n->entries[i].tag);
  308|  9.05k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_description:
  312|  9.05k|{
  313|  9.05k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  314|       |	
  315|  9.05k|	if (!n) return NULL;
  ------------------
  |  Branch (315:6): [True: 0, False: 9.05k]
  ------------------
  316|  9.05k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (316:6): [True: 0, False: 9.05k]
  ------------------
  317|  9.05k|        return mnote_fuji_tag_get_description (n->entries[i].tag);
  318|  9.05k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_value:
   69|  9.05k|{
   70|  9.05k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
   71|       |
   72|  9.05k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (72:6): [True: 0, False: 9.05k]
  |  Branch (72:12): [True: 0, False: 9.05k]
  ------------------
   73|  9.05k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (73:6): [True: 0, False: 9.05k]
  ------------------
   74|       |/*
   75|       |	exif_log (d->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataFuji",
   76|       |		  "Querying value for tag '%s'...",
   77|       |		  mnote_fuji_tag_get_name (n->entries[i].tag));
   78|       |*/
   79|  9.05k|	return mnote_fuji_entry_get_value (&n->entries[i], val, maxlen);
   80|  9.05k|}

mnote_fuji_entry_get_value:
  194|  9.05k|{
  195|  9.05k|	ExifLong  vl;
  196|  9.05k|	ExifSLong vsl;
  197|  9.05k|	ExifShort vs, vs2;
  198|  9.05k|	ExifSShort vss;
  199|  9.05k|	ExifRational vr;
  200|  9.05k|	ExifSRational vsr;
  201|  9.05k|	int i, j;
  202|       |
  203|  9.05k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 9.05k]
  ------------------
  204|  9.05k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 9.05k]
  ------------------
  205|       |
  206|  9.05k|	memset (val, 0, maxlen);
  207|  9.05k|	maxlen--;
  208|       |
  209|  9.05k|	switch (entry->tag) {
  210|  1.10k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.10k, False: 7.94k]
  ------------------
  211|  1.10k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.10k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.10k|{                                                               \
  |  |   35|  1.10k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 694, False: 412]
  |  |  ------------------
  |  |   36|    694|                snprintf (v, maxlen,	                        \
  |  |   37|    694|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    694|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    694|                        "expected '%s'."),                      \
  |  |   39|    694|                        exif_format_get_name (format),          \
  |  |   40|    694|                        exif_format_get_name (target));         \
  |  |   41|    694|                break;                                          \
  |  |   42|    694|        }                                                       \
  |  |   43|  1.10k|}
  ------------------
  212|    412|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    412|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    412|{                                                                       \
  |  |   47|    412|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 202, False: 210]
  |  |  ------------------
  |  |   48|    202|                snprintf (v, maxlen,                                    \
  |  |   49|    202|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    202|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    202|                break;                                                  \
  |  |   52|    202|        }                                                               \
  |  |   53|    412|}
  ------------------
  213|    210|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    210|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 210]
  |  |  ------------------
  ------------------
  214|    210|		break;
  215|    215|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 215, False: 8.83k]
  ------------------
  216|    636|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 421, False: 8.63k]
  ------------------
  217|    847|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 211, False: 8.84k]
  ------------------
  218|  1.16k|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 316, False: 8.73k]
  ------------------
  219|  1.37k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 208, False: 8.84k]
  ------------------
  220|  1.63k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 263, False: 8.78k]
  ------------------
  221|  2.12k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 486, False: 8.56k]
  ------------------
  222|  2.33k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 214, False: 8.83k]
  ------------------
  223|  2.43k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 98, False: 8.95k]
  ------------------
  224|  2.50k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 71, False: 8.98k]
  ------------------
  225|  2.57k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 71, False: 8.98k]
  ------------------
  226|  2.78k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 210, False: 8.84k]
  ------------------
  227|  2.98k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 200, False: 8.85k]
  ------------------
  228|  3.18k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 203, False: 8.84k]
  ------------------
  229|  3.49k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 310, False: 8.74k]
  ------------------
  230|  3.74k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 248, False: 8.80k]
  ------------------
  231|  3.95k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 208, False: 8.84k]
  ------------------
  232|  3.95k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  3.95k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  3.95k|{                                                               \
  |  |   35|  3.95k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 1.91k, False: 2.03k]
  |  |  ------------------
  |  |   36|  1.91k|                snprintf (v, maxlen,	                        \
  |  |   37|  1.91k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.91k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  1.91k|                        "expected '%s'."),                      \
  |  |   39|  1.91k|                        exif_format_get_name (format),          \
  |  |   40|  1.91k|                        exif_format_get_name (target));         \
  |  |   41|  1.91k|                break;                                          \
  |  |   42|  1.91k|        }                                                       \
  |  |   43|  3.95k|}
  ------------------
  233|  2.03k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  2.03k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  2.03k|{                                                                       \
  |  |   47|  2.03k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 268, False: 1.77k]
  |  |  ------------------
  |  |   48|    268|                snprintf (v, maxlen,                                    \
  |  |   49|    268|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    268|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    268|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    268|                break;                                                  \
  |  |   52|    268|        }                                                               \
  |  |   53|  2.03k|}
  ------------------
  234|  1.77k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  12.2k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 12.2k, False: 0]
  |  Branch (237:32): [True: 10.4k, False: 1.77k]
  ------------------
  238|  1.77k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.77k]
  ------------------
  239|      0|			snprintf (val, maxlen,
  240|      0|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  241|      0|		  	break;
  242|      0|		}
  243|       |
  244|       |		/* find the value */
  245|  6.56k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 5.72k, False: 836]
  ------------------
  246|  5.72k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 4.79k, False: 935]
  ------------------
  247|  1.77k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 1.07k, False: 700]
  ------------------
  248|  1.07k|			snprintf (val, maxlen,
  249|  1.07k|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|  1.07k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.07k|			break;
  251|  1.07k|		}
  252|    700|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    700|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    700|		break;
  254|    622|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 622, False: 8.42k]
  ------------------
  255|    622|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    622|#define CF(format,target,v,maxlen)                              \
  |  |   34|    622|{                                                               \
  |  |   35|    622|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 225, False: 397]
  |  |  ------------------
  |  |   36|    225|                snprintf (v, maxlen,	                        \
  |  |   37|    225|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    225|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    225|                        "expected '%s'."),                      \
  |  |   39|    225|                        exif_format_get_name (format),          \
  |  |   40|    225|                        exif_format_get_name (target));         \
  |  |   41|    225|                break;                                          \
  |  |   42|    225|        }                                                       \
  |  |   43|    622|}
  ------------------
  256|    397|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    397|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    397|{                                                                       \
  |  |   47|    397|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 202, False: 195]
  |  |  ------------------
  |  |   48|    202|                snprintf (v, maxlen,                                    \
  |  |   49|    202|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    202|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    202|                break;                                                  \
  |  |   52|    202|        }                                                               \
  |  |   53|    397|}
  ------------------
  257|    195|		vs = exif_get_short (entry->data, entry->order);
  258|    195|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    195|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    195|		break;
  261|    202|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 202, False: 8.84k]
  ------------------
  262|    972|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 770, False: 8.28k]
  ------------------
  263|    972|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|    972|#define CF(format,target,v,maxlen)                              \
  |  |   34|    972|{                                                               \
  |  |   35|    972|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 216, False: 756]
  |  |  ------------------
  |  |   36|    216|                snprintf (v, maxlen,	                        \
  |  |   37|    216|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    216|                        "expected '%s'."),                      \
  |  |   39|    216|                        exif_format_get_name (format),          \
  |  |   40|    216|                        exif_format_get_name (target));         \
  |  |   41|    216|                break;                                          \
  |  |   42|    216|        }                                                       \
  |  |   43|    972|}
  ------------------
  264|    756|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    756|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    756|{                                                                       \
  |  |   47|    756|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 76, False: 680]
  |  |  ------------------
  |  |   48|     76|                snprintf (v, maxlen,                                    \
  |  |   49|     76|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     76|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     76|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     76|                break;                                                  \
  |  |   52|     76|        }                                                               \
  |  |   53|    756|}
  ------------------
  265|    680|		vr = exif_get_rational (entry->data, entry->order);
  266|    680|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 232, False: 448]
  ------------------
  267|    448|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    448|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    448|			  vr.denominator);
  269|    448|		break;
  270|       |
  271|  2.39k|	default:
  ------------------
  |  Branch (271:2): [True: 2.39k, False: 6.65k]
  ------------------
  272|  2.39k|		switch (entry->format) {
  273|    270|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 270, False: 2.12k]
  ------------------
  274|    270|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    270|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 94, False: 176]
  |  |  ------------------
  ------------------
  275|    270|		  break;
  276|    222|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 222, False: 2.17k]
  ------------------
  277|    222|		  vs = exif_get_short (entry->data, entry->order);
  278|    222|		  snprintf (val, maxlen, "%hu", vs);
  279|    222|		  break;
  280|     70|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 70, False: 2.32k]
  ------------------
  281|     70|		  vss = exif_get_sshort (entry->data, entry->order);
  282|     70|		  snprintf (val, maxlen, "%hi", vss);
  283|     70|		  break;
  284|    195|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 195, False: 2.20k]
  ------------------
  285|    195|		  vl = exif_get_long (entry->data, entry->order);
  286|    195|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    195|		  break;
  288|     95|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 95, False: 2.30k]
  ------------------
  289|     95|		  vsl = exif_get_slong (entry->data, entry->order);
  290|     95|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|     95|		  break;
  292|    613|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 613, False: 1.78k]
  ------------------
  293|    613|		  vr = exif_get_rational (entry->data, entry->order);
  294|    613|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 174, False: 439]
  ------------------
  295|    439|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    439|						    vr.denominator);
  297|    439|		  break;
  298|    534|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 534, False: 1.86k]
  ------------------
  299|    534|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    534|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 229, False: 305]
  ------------------
  301|    305|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    305|			  vsr.denominator);
  303|    305|		  break;
  304|      1|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 1, False: 2.39k]
  ------------------
  305|    399|		default:
  ------------------
  |  Branch (305:3): [True: 398, False: 2.00k]
  ------------------
  306|    399|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    399|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    399| 			  entry->size);
  308|    399|		  break;
  309|  2.39k|		}
  310|  2.39k|		break;
  311|  9.05k|	}
  312|       |
  313|  9.05k|	return (val);
  314|  9.05k|}

mnote_fuji_tag_get_name:
   75|  29.1k|{
   76|  29.1k|	unsigned int i;
   77|       |
   78|   466k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (78:14): [True: 458k, False: 7.72k]
  ------------------
   79|   458k|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (79:7): [True: 21.4k, False: 437k]
  ------------------
   80|  7.72k|	return NULL;
   81|  29.1k|}
mnote_fuji_tag_get_title:
   85|  9.05k|{
   86|  9.05k|	unsigned int i;
   87|       |
   88|  9.05k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   89|  99.4k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (89:14): [True: 99.4k, False: 0]
  ------------------
   90|  99.4k|		if (table[i].tag == t) {
  ------------------
  |  Branch (90:7): [True: 9.05k, False: 90.3k]
  ------------------
   91|  9.05k|			if (!table[i].title)
  ------------------
  |  Branch (91:8): [True: 0, False: 9.05k]
  ------------------
   92|      0|				return NULL;
   93|  9.05k|			return _(table[i].title);
  ------------------
  |  |   31|  9.05k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   94|  9.05k|		}
   95|      0|	return NULL;
   96|  9.05k|}
mnote_fuji_tag_get_description:
  100|  9.05k|{
  101|  9.05k|	unsigned int i;
  102|       |
  103|  99.4k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (103:14): [True: 99.4k, False: 0]
  ------------------
  104|  99.4k|		if (table[i].tag == t) {
  ------------------
  |  Branch (104:7): [True: 9.05k, False: 90.3k]
  ------------------
  105|  9.05k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (105:8): [True: 0, False: 9.05k]
  |  Branch (105:33): [True: 8.17k, False: 873]
  ------------------
  106|  8.17k|				return "";
  107|    873|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  108|    873|			return _(table[i].description);
  ------------------
  |  |   31|    873|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  109|  9.05k|		}
  110|      0|	return NULL;
  111|  9.05k|}

exif_mnote_data_olympus_identify:
  627|  7.21k|{
  628|  7.21k|	int variant = exif_mnote_data_olympus_identify_variant(e->data, e->size);
  629|       |
  630|  7.21k|	if (variant == nikonV0) {
  ------------------
  |  Branch (630:6): [True: 491, False: 6.72k]
  ------------------
  631|       |		/* This variant needs some extra checking with the Make */
  632|    491|		char value[5];
  633|    491|		ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|    491|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 10, False: 481]
  |  |  ------------------
  |  |  254|    491|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|    491|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 54, False: 427]
  |  |  ------------------
  |  |  256|    481|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|    481|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 427]
  |  |  ------------------
  |  |  258|    427|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|    427|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 427]
  |  |  ------------------
  |  |  260|    427|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    427|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 427]
  |  |  ------------------
  |  |  262|    427|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  634|    491|		variant = unrecognized;
  635|       |
  636|    491|		if (em) {
  ------------------
  |  Branch (636:7): [True: 64, False: 427]
  ------------------
  637|     64|			const char *v = exif_entry_get_value (em, value, sizeof(value));
  638|     64|			if (v && (!strncmp (v, "Nikon", sizeof(value)) || 
  ------------------
  |  Branch (638:8): [True: 64, False: 0]
  |  Branch (638:14): [True: 0, False: 64]
  ------------------
  639|     64|					  !strncmp (v, "NIKON", sizeof(value)) ))
  ------------------
  |  Branch (639:8): [True: 0, False: 64]
  ------------------
  640|       |				/* When saved, this variant will be written out like the
  641|       |				 * alternative nikonV2 form above instead
  642|       |				 */
  643|      0|				variant = nikonV0;
  644|     64|		}
  645|    491|	}
  646|       |
  647|  7.21k|	return variant;
  648|  7.21k|}
exif_mnote_data_olympus_new:
  653|  3.97k|{
  654|  3.97k|	ExifMnoteData *d;
  655|       |
  656|  3.97k|	if (!mem) return NULL;
  ------------------
  |  Branch (656:6): [True: 0, False: 3.97k]
  ------------------
  657|       |	
  658|  3.97k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus));
  659|  3.97k|	if (!d) return NULL;
  ------------------
  |  Branch (659:6): [True: 0, False: 3.97k]
  ------------------
  660|       |
  661|  3.97k|	exif_mnote_data_construct (d, mem);
  662|       |
  663|       |	/* Set up function pointers */
  664|  3.97k|	d->methods.free            = exif_mnote_data_olympus_free;
  665|  3.97k|	d->methods.set_byte_order  = exif_mnote_data_olympus_set_byte_order;
  666|  3.97k|	d->methods.set_offset      = exif_mnote_data_olympus_set_offset;
  667|  3.97k|	d->methods.load            = exif_mnote_data_olympus_load;
  668|  3.97k|	d->methods.save            = exif_mnote_data_olympus_save;
  669|  3.97k|	d->methods.count           = exif_mnote_data_olympus_count;
  670|  3.97k|	d->methods.get_id          = exif_mnote_data_olympus_get_id;
  671|  3.97k|	d->methods.get_name        = exif_mnote_data_olympus_get_name;
  672|  3.97k|	d->methods.get_title       = exif_mnote_data_olympus_get_title;
  673|  3.97k|	d->methods.get_description = exif_mnote_data_olympus_get_description;
  674|  3.97k|	d->methods.get_value       = exif_mnote_data_olympus_get_value;
  675|       |
  676|  3.97k|	return d;
  677|  3.97k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_identify_variant:
  596|  11.1k|{
  597|       |	/* Olympus, Nikon, Sanyo, Epson */
  598|  11.1k|	if (buf_size >= 8) {
  ------------------
  |  Branch (598:6): [True: 10.9k, False: 234]
  ------------------
  599|       |		/* Match the terminating NUL character, too */
  600|  10.9k|		if (!memcmp (buf, "OLYMPUS", 8))
  ------------------
  |  Branch (600:7): [True: 970, False: 9.97k]
  ------------------
  601|    970|			   return olympusV2;
  602|  9.97k|		else if (!memcmp (buf, "OLYMP", 6))
  ------------------
  |  Branch (602:12): [True: 2.37k, False: 7.59k]
  ------------------
  603|  2.37k|			   return olympusV1;
  604|  7.59k|		else if (!memcmp (buf, "SANYO", 6))
  ------------------
  |  Branch (604:12): [True: 2.88k, False: 4.70k]
  ------------------
  605|  2.88k|			   return sanyoV1;
  606|  4.70k|		else if (!memcmp (buf, "EPSON", 6))
  ------------------
  |  Branch (606:12): [True: 1.28k, False: 3.42k]
  ------------------
  607|  1.28k|			   return epsonV1;
  608|  3.42k|		else if (!memcmp (buf, "Nikon", 6)) {
  ------------------
  |  Branch (608:12): [True: 374, False: 3.05k]
  ------------------
  609|    374|			switch (buf[6]) {
  610|    124|				case 1:  return nikonV1;
  ------------------
  |  Branch (610:5): [True: 124, False: 250]
  ------------------
  611|    240|				case 2:  return nikonV2;
  ------------------
  |  Branch (611:5): [True: 240, False: 134]
  ------------------
  612|     10|				default: return 0; /* Unrecognized Nikon variant */
  ------------------
  |  Branch (612:5): [True: 10, False: 364]
  ------------------
  613|    374|			}
  614|    374|		}
  615|  10.9k|	}
  616|       |
  617|       |	/* Another variant of Nikon */
  618|  3.28k|	if ((buf_size >= 2) && (buf[0] == 0x00) && (buf[1] == 0x1b)) {
  ------------------
  |  Branch (618:6): [True: 3.27k, False: 11]
  |  Branch (618:25): [True: 550, False: 2.72k]
  |  Branch (618:45): [True: 507, False: 43]
  ------------------
  619|    507|		return nikonV0;
  620|    507|	}
  621|       |
  622|  2.77k|	return unrecognized;
  623|  3.28k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_free:
   69|  3.97k|{
   70|  3.97k|	if (!n) return;
  ------------------
  |  Branch (70:6): [True: 0, False: 3.97k]
  ------------------
   71|       |
   72|  3.97k|	exif_mnote_data_olympus_clear ((ExifMnoteDataOlympus *) n);
   73|  3.97k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_clear:
   49|  7.70k|{
   50|  7.70k|	ExifMnoteData *d = (ExifMnoteData *) n;
   51|  7.70k|	unsigned int i;
   52|       |
   53|  7.70k|	if (!n) return;
  ------------------
  |  Branch (53:6): [True: 0, False: 7.70k]
  ------------------
   54|       |
   55|  7.70k|	if (n->entries) {
  ------------------
  |  Branch (55:6): [True: 3.73k, False: 3.97k]
  ------------------
   56|  94.9k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (56:15): [True: 91.2k, False: 3.73k]
  ------------------
   57|  91.2k|			if (n->entries[i].data) {
  ------------------
  |  Branch (57:8): [True: 36.5k, False: 54.6k]
  ------------------
   58|  36.5k|				exif_mem_free (d->mem, n->entries[i].data);
   59|  36.5k|				n->entries[i].data = NULL;
   60|  36.5k|			}
   61|  3.73k|		exif_mem_free (d->mem, n->entries);
   62|       |		n->entries = NULL;
   63|  3.73k|		n->count = 0;
   64|  3.73k|	}
   65|  7.70k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_byte_order:
  569|  3.97k|{
  570|  3.97k|	ExifByteOrder o_orig;
  571|  3.97k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  572|  3.97k|	unsigned int i;
  573|       |
  574|  3.97k|	if (!n) return;
  ------------------
  |  Branch (574:6): [True: 0, False: 3.97k]
  ------------------
  575|       |
  576|  3.97k|	o_orig = n->order;
  577|  3.97k|	n->order = o;
  578|  3.97k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (578:14): [True: 0, False: 3.97k]
  ------------------
  579|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (579:7): [True: 0, False: 0]
  |  Branch (579:35): [True: 0, False: 0]
  ------------------
  580|      0|			continue;
  581|      0|		n->entries[i].order = o;
  582|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  583|      0|				n->entries[i].components, o_orig, o);
  584|      0|	}
  585|  3.97k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_offset:
  589|  3.97k|{
  590|  3.97k|	if (n) ((ExifMnoteDataOlympus *) n)->offset = o;
  ------------------
  |  Branch (590:6): [True: 3.97k, False: 0]
  ------------------
  591|  3.97k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_load:
  242|  3.97k|{
  243|  3.97k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en;
  244|  3.97k|	ExifShort c;
  245|  3.97k|	size_t i, tcount, o, o2, datao = 6, base = 0;
  246|       |
  247|  3.97k|	if (!n) return;
  ------------------
  |  Branch (247:6): [True: 0, False: 3.97k]
  ------------------
  248|       |
  249|  3.97k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (249:6): [True: 0, False: 3.97k]
  |  Branch (249:14): [True: 0, False: 3.97k]
  ------------------
  250|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  251|      0|			  "ExifMnoteDataOlympus", "Short MakerNote");
  252|      0|		return;
  253|      0|	}
  254|  3.97k|	o2 = 6 + n->offset; /* Start of interesting data */
  255|  3.97k|	if (CHECKOVERFLOW(o2,buf_size,10)) {
  ------------------
  |  |   40|  3.97k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 3.97k]
  |  |  |  Branch (40:81): [True: 0, False: 3.97k]
  |  |  |  Branch (40:112): [True: 7, False: 3.96k]
  |  |  ------------------
  ------------------
  256|      7|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  257|      7|			  "ExifMnoteDataOlympus", "Short MakerNote");
  258|      7|		return;
  259|      7|	}
  260|       |
  261|       |	/*
  262|       |	 * Olympus headers start with "OLYMP" and need to have at least
  263|       |	 * a size of 22 bytes (6 for 'OLYMP', 2 other bytes, 2 for the
  264|       |	 * number of entries, and 12 for one entry.
  265|       |	 *
  266|       |	 * Sanyo format is identical and uses identical tags except that
  267|       |	 * header starts with "SANYO".
  268|       |	 *
  269|       |	 * Epson format is identical and uses identical tags except that
  270|       |	 * header starts with "EPSON".
  271|       |	 *
  272|       |	 * Nikon headers start with "Nikon" (6 bytes including '\0'), 
  273|       |	 * version number (1 or 2).
  274|       |	 * 
  275|       |	 * Version 1 continues with 0, 1, 0, number_of_tags,
  276|       |	 * or just with number_of_tags (models D1H, D1X...).
  277|       |	 * 
  278|       |	 * Version 2 continues with an unknown byte (0 or 10),
  279|       |	 * two unknown bytes (0), "MM" or "II", another byte 0 and 
  280|       |	 * lastly 0x2A.
  281|       |	 */
  282|  3.96k|	n->version = exif_mnote_data_olympus_identify_variant(buf+o2, buf_size-o2);
  283|  3.96k|	switch (n->version) {
  284|  1.17k|	case olympusV1:
  ------------------
  |  Branch (284:2): [True: 1.17k, False: 2.78k]
  ------------------
  285|  2.61k|	case sanyoV1:
  ------------------
  |  Branch (285:2): [True: 1.43k, False: 2.52k]
  ------------------
  286|  3.23k|	case epsonV1:
  ------------------
  |  Branch (286:2): [True: 622, False: 3.34k]
  ------------------
  287|  3.23k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  288|  3.23k|			"Parsing Olympus/Sanyo/Epson maker note v1...");
  289|       |
  290|       |		/* The number of entries is at position 8. */
  291|  3.23k|		if (buf[o2 + 6] == 1)
  ------------------
  |  Branch (291:7): [True: 139, False: 3.09k]
  ------------------
  292|    139|			n->order = EXIF_BYTE_ORDER_INTEL;
  293|  3.09k|		else if (buf[o2 + 6 + 1] == 1)
  ------------------
  |  Branch (293:12): [True: 24, False: 3.07k]
  ------------------
  294|     24|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  295|  3.23k|		o2 += 8;
  296|  3.23k|		c = exif_get_short (buf + o2, n->order);
  297|  3.23k|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (297:7): [True: 845, False: 2.39k]
  |  Branch (297:24): [True: 638, False: 207]
  ------------------
  298|    638|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (298:8): [True: 606, False: 32]
  ------------------
  299|    606|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  300|    606|			} else {
  301|     32|				n->order = EXIF_BYTE_ORDER_INTEL;
  302|     32|			}
  303|    638|		}
  304|  3.23k|		break;
  305|       |
  306|    483|	case olympusV2:
  ------------------
  |  Branch (306:2): [True: 483, False: 3.48k]
  ------------------
  307|       |		/* Olympus S760, S770 */
  308|    483|		datao = o2;
  309|    483|		o2 += 8;
  310|    483|		if (CHECKOVERFLOW(o2,buf_size,4)) return;
  ------------------
  |  |   40|    483|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 483]
  |  |  |  Branch (40:81): [True: 0, False: 483]
  |  |  |  Branch (40:112): [True: 2, False: 481]
  |  |  ------------------
  ------------------
  311|    481|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  312|    481|			"Parsing Olympus maker note v2 (0x%02x, %02x, %02x, %02x)...",
  313|    481|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  314|       |
  315|    481|		if ((buf[o2] == 'I') && (buf[o2 + 1] == 'I'))
  ------------------
  |  Branch (315:7): [True: 14, False: 467]
  |  Branch (315:27): [True: 4, False: 10]
  ------------------
  316|      4|			n->order = EXIF_BYTE_ORDER_INTEL;
  317|    477|		else if ((buf[o2] == 'M') && (buf[o2 + 1] == 'M'))
  ------------------
  |  Branch (317:12): [True: 12, False: 465]
  |  Branch (317:32): [True: 1, False: 11]
  ------------------
  318|      1|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  319|       |
  320|       |		/* The number of entries is at position 8+4. */
  321|    481|		o2 += 4;
  322|    481|		break;
  323|       |
  324|     60|	case nikonV1:
  ------------------
  |  Branch (324:2): [True: 60, False: 3.90k]
  ------------------
  325|     60|		o2 += 6;
  326|     60|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  327|     60|			"Parsing Nikon maker note v1 (0x%02x, %02x, %02x, "
  328|     60|			"%02x)...",
  329|     60|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  330|       |
  331|       |		/* Skip version number */
  332|     60|		o2 += 1;
  333|       |
  334|       |		/* Skip an unknown byte (00 or 0A). */
  335|     60|		o2 += 1;
  336|       |
  337|     60|		base = MNOTE_NIKON1_TAG_BASE;
  338|       |		/* Fix endianness, if needed */
  339|     60|		c = exif_get_short (buf + o2, n->order);
  340|     60|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (340:7): [True: 11, False: 49]
  |  Branch (340:24): [True: 7, False: 4]
  ------------------
  341|      7|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (341:8): [True: 3, False: 4]
  ------------------
  342|      3|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  343|      4|			} else {
  344|      4|				n->order = EXIF_BYTE_ORDER_INTEL;
  345|      4|			}
  346|      7|		}
  347|     60|		break;
  348|       |
  349|    130|	case nikonV2:
  ------------------
  |  Branch (349:2): [True: 130, False: 3.83k]
  ------------------
  350|    130|		o2 += 6;
  351|    130|		if (CHECKOVERFLOW(o2,buf_size,12)) return;
  ------------------
  |  |   40|    130|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 130]
  |  |  |  Branch (40:81): [True: 0, False: 130]
  |  |  |  Branch (40:112): [True: 1, False: 129]
  |  |  ------------------
  ------------------
  352|    129|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  353|    129|			"Parsing Nikon maker note v2 (0x%02x, %02x, %02x, "
  354|    129|			"%02x, %02x, %02x, %02x, %02x)...",
  355|    129|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3],
  356|    129|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  357|       |
  358|       |		/* Skip version number */
  359|    129|		o2 += 1;
  360|       |
  361|       |		/* Skip an unknown byte (00 or 0A). */
  362|    129|		o2 += 1;
  363|       |
  364|       |		/* Skip 2 unknown bytes (00 00). */
  365|    129|		o2 += 2;
  366|       |
  367|       |		/*
  368|       |		 * Byte order. From here the data offset
  369|       |		 * gets calculated.
  370|       |		 */
  371|    129|		datao = o2;
  372|    129|		if (!strncmp ((char *)&buf[o2], "II", 2))
  ------------------
  |  Branch (372:7): [True: 78, False: 51]
  ------------------
  373|     78|			n->order = EXIF_BYTE_ORDER_INTEL;
  374|     51|		else if (!strncmp ((char *)&buf[o2], "MM", 2))
  ------------------
  |  Branch (374:12): [True: 14, False: 37]
  ------------------
  375|     14|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  376|     37|		else {
  377|     37|			exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  378|     37|				"ExifMnoteDataOlympus", "Unknown "
  379|     37|				"byte order '%c%c'", buf[o2],
  380|     37|				buf[o2 + 1]);
  381|     37|			return;
  382|     37|		}
  383|     92|		o2 += 2;
  384|       |
  385|       |		/* Skip 2 unknown bytes (00 2A). */
  386|     92|		o2 += 2;
  387|       |
  388|       |		/* Go to where the number of entries is. */
  389|     92|		if (CHECKOVERFLOW(o2,buf_size,exif_get_long (buf + o2, n->order))) return;
  ------------------
  |  |   40|     92|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 92]
  |  |  |  Branch (40:81): [True: 48, False: 44]
  |  |  |  Branch (40:112): [True: 17, False: 27]
  |  |  ------------------
  ------------------
  390|     27|		o2 = datao + exif_get_long (buf + o2, n->order);
  391|     27|		break;
  392|       |
  393|     16|	case nikonV0:
  ------------------
  |  Branch (393:2): [True: 16, False: 3.94k]
  ------------------
  394|     16|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  395|     16|			"Parsing Nikon maker note v0 (0x%02x, %02x, %02x, "
  396|     16|			"%02x, %02x, %02x, %02x, %02x)...",
  397|     16|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
  398|     16|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  399|       |		/* 00 1b is # of entries in Motorola order - the rest should also be in MM order */
  400|     16|		n->order = EXIF_BYTE_ORDER_MOTOROLA;
  401|     16|		break;
  402|       |
  403|     38|	default:
  ------------------
  |  Branch (403:2): [True: 38, False: 3.92k]
  ------------------
  404|     38|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  405|     38|			"Unknown Olympus variant %i.", n->version);
  406|     38|		return;
  407|  3.96k|	}
  408|       |
  409|       |	/* Sanity check the offset */
  410|  3.82k|	if (CHECKOVERFLOW(o2,buf_size,2)) {
  ------------------
  |  |   40|  3.82k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 29, False: 3.79k]
  |  |  |  Branch (40:81): [True: 0, False: 3.79k]
  |  |  |  Branch (40:112): [True: 6, False: 3.78k]
  |  |  ------------------
  ------------------
  411|     35|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  412|     35|			  "ExifMnoteOlympus", "Short MakerNote");
  413|     35|		return;
  414|     35|	}
  415|       |
  416|       |	/* Read the number of tags */
  417|  3.78k|	c = exif_get_short (buf + o2, n->order);
  418|  3.78k|	o2 += 2;
  419|       |
  420|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 150 named tags currently.
  421|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  422|  3.78k|	if (c > 300) {
  ------------------
  |  Branch (422:6): [True: 57, False: 3.73k]
  ------------------
  423|     57|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Too much tags (%d) in Olympus MakerNote", c);
  424|     57|		return;
  425|     57|	}
  426|       |
  427|       |	/* Remove any old entries */
  428|  3.73k|	exif_mnote_data_olympus_clear (n);
  429|       |
  430|       |	/* Reserve enough space for all the possible MakerNote tags */
  431|  3.73k|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c);
  432|  3.73k|	if (!n->entries) {
  ------------------
  |  Branch (432:6): [True: 0, False: 3.73k]
  ------------------
  433|      0|		EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteOlympus", sizeof (MnoteOlympusEntry) * c);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  434|      0|		return;
  435|      0|	}
  436|       |
  437|       |	/* Parse all c entries, storing ones that are successfully parsed */
  438|  3.73k|	tcount = 0;
  439|   103k|	for (i = c, o = o2; i; --i, o += 12) {
  ------------------
  |  Branch (439:22): [True: 102k, False: 656]
  ------------------
  440|   102k|		size_t s;
  441|   102k|		memset(&n->entries[tcount], 0, sizeof(MnoteOlympusEntry));
  442|   102k|		if (CHECKOVERFLOW(o, buf_size, 12)) {
  ------------------
  |  |   40|   102k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.64k, False: 100k]
  |  |  |  Branch (40:81): [True: 0, False: 100k]
  |  |  |  Branch (40:112): [True: 1.42k, False: 99.4k]
  |  |  ------------------
  ------------------
  443|  3.07k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  444|  3.07k|				  "ExifMnoteOlympus", "Short MakerNote");
  445|  3.07k|			break;
  446|  3.07k|		}
  447|       |
  448|  99.4k|	    n->entries[tcount].tag        = exif_get_short (buf + o, n->order) + base;
  449|  99.4k|	    n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  450|  99.4k|	    n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  451|  99.4k|	    n->entries[tcount].order      = n->order;
  452|       |
  453|  99.4k|	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  454|  99.4k|		      "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  455|  99.4k|		      mnote_olympus_tag_get_name (n->entries[tcount].tag));
  456|       |/*	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  457|       |			    "0x%x %d %ld*(%d)",
  458|       |		    n->entries[tcount].tag,
  459|       |		    n->entries[tcount].format,
  460|       |		    n->entries[tcount].components,
  461|       |		    (int)exif_format_get_size(n->entries[tcount].format)); */
  462|       |
  463|       |	    /* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  464|       |	     * we will check the buffer sizes closer later. */
  465|  99.4k|	    if (exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (465:10): [True: 52.2k, False: 47.1k]
  ------------------
  466|  52.2k|		buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (466:3): [True: 5.85k, False: 46.4k]
  ------------------
  467|  99.4k|	    ) {
  468|  5.85k|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  469|  5.85k|		continue;
  470|  5.85k|	    }
  471|       |	    /*
  472|       |	     * Size? If bigger than 4 bytes, the actual data is not
  473|       |	     * in the entry but somewhere else (offset).
  474|       |	     */
  475|  93.6k|	    s = exif_format_get_size (n->entries[tcount].format) *
  476|  93.6k|		   			 n->entries[tcount].components;
  477|  93.6k|		n->entries[tcount].size = s;
  478|  93.6k|		if (s) {
  ------------------
  |  Branch (478:7): [True: 39.0k, False: 54.6k]
  ------------------
  479|  39.0k|			size_t dataofs = o + 8;
  480|  39.0k|			if (s > 4) {
  ------------------
  |  Branch (480:8): [True: 20.3k, False: 18.6k]
  ------------------
  481|       |				/* The data in this case is merely a pointer */
  482|  20.3k|				dataofs = exif_get_long (buf + dataofs, n->order) + datao;
  483|       |#ifdef EXIF_OVERCOME_SANYO_OFFSET_BUG
  484|       |				/* Some Sanyo models (e.g. VPC-C5, C40) suffer from a bug when
  485|       |				 * writing the offset for the MNOTE_OLYMPUS_TAG_THUMBNAILIMAGE
  486|       |				 * tag in its MakerNote. The offset is actually the absolute
  487|       |				 * position in the file instead of the position within the IFD.
  488|       |				 */
  489|       |			    if (dataofs > (buf_size - s) && n->version == sanyoV1) {
  490|       |					/* fix pointer */
  491|       |					dataofs -= datao + 6;
  492|       |					exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  493|       |						  "ExifMnoteOlympus",
  494|       |						  "Inconsistent thumbnail tag offset; attempting to recover");
  495|       |			    }
  496|       |#endif
  497|  20.3k|			}
  498|  39.0k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   40|  39.0k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.69k, False: 37.3k]
  |  |  |  Branch (40:81): [True: 0, False: 37.3k]
  |  |  |  Branch (40:112): [True: 720, False: 36.5k]
  |  |  ------------------
  ------------------
  499|  2.41k|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  500|  2.41k|					  "ExifMnoteOlympus",
  501|  2.41k|					  "Tag data past end of buffer (%u > %u)",
  502|  2.41k|					  (unsigned)(dataofs + s), buf_size);
  503|  2.41k|				continue;
  504|  2.41k|			}
  505|       |
  506|  36.5k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  507|  36.5k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (507:8): [True: 0, False: 36.5k]
  ------------------
  508|      0|				EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteOlympus", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  509|      0|				continue;
  510|      0|			}
  511|  36.5k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  512|  36.5k|		}
  513|       |
  514|       |		/* Tag was successfully parsed */
  515|  91.2k|		++tcount;
  516|  91.2k|	}
  517|       |	/* Store the count of successfully parsed tags */
  518|  3.73k|	n->count = tcount;
  519|  3.73k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_count:
  523|  3.97k|{
  524|  3.97k|	return n ? ((ExifMnoteDataOlympus *) n)->count : 0;
  ------------------
  |  Branch (524:9): [True: 3.97k, False: 0]
  ------------------
  525|  3.97k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_name:
  539|  54.7k|{
  540|  54.7k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  541|       |
  542|  54.7k|	if (!n) return NULL;
  ------------------
  |  Branch (542:6): [True: 0, False: 54.7k]
  ------------------
  543|  54.7k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (543:6): [True: 0, False: 54.7k]
  ------------------
  544|  54.7k|	return mnote_olympus_tag_get_name (n->entries[i].tag);
  545|  54.7k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_title:
  549|  53.4k|{
  550|  53.4k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  551|       |	
  552|  53.4k|	if (!n) return NULL;
  ------------------
  |  Branch (552:6): [True: 0, False: 53.4k]
  ------------------
  553|  53.4k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (553:6): [True: 0, False: 53.4k]
  ------------------
  554|  53.4k|        return mnote_olympus_tag_get_title (n->entries[i].tag);
  555|  53.4k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_description:
  559|  53.4k|{
  560|  53.4k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  561|       |	
  562|  53.4k|	if (!n) return NULL;
  ------------------
  |  Branch (562:6): [True: 0, False: 53.4k]
  ------------------
  563|  53.4k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (563:6): [True: 0, False: 53.4k]
  ------------------
  564|  53.4k|        return mnote_olympus_tag_get_description (n->entries[i].tag);
  565|  53.4k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_value:
   77|  53.4k|{
   78|  53.4k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
   79|       |
   80|  53.4k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (80:6): [True: 0, False: 53.4k]
  |  Branch (80:12): [True: 0, False: 53.4k]
  ------------------
   81|  53.4k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (81:6): [True: 0, False: 53.4k]
  ------------------
   82|       |/*
   83|       |	exif_log (d->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
   84|       |		  "Querying value for tag '%s'...",
   85|       |		  mnote_olympus_tag_get_name (n->entries[i].tag));
   86|       |*/
   87|  53.4k|	return mnote_olympus_entry_get_value (&n->entries[i], val, maxlen);
   88|  53.4k|}

mnote_olympus_entry_get_value:
  276|  53.4k|{
  277|  53.4k|	char         buf[30];
  278|  53.4k|	ExifLong     vl;
  279|  53.4k|	ExifSLong    vsl;
  280|  53.4k|	ExifShort    vs = 0;
  281|  53.4k|	ExifSShort   vss = 0;
  282|  53.4k|	ExifRational vr, vr2;
  283|  53.4k|	ExifSRational vsr;
  284|  53.4k|	int          i, j;
  285|  53.4k|	double       r, b;
  286|       |
  287|  53.4k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 53.4k]
  ------------------
  288|      0|		return (NULL);
  289|  53.4k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 53.4k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  53.4k|	memset (v, 0, maxlen);
  293|  53.4k|	maxlen--;
  294|       |
  295|  53.4k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 18.0k, False: 35.4k]
  |  Branch (295:24): [True: 3.96k, False: 14.0k]
  ------------------
  296|  3.96k|		return (v);
  297|       |
  298|  49.5k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 14.0k, False: 35.4k]
  |  Branch (298:24): [True: 0, False: 14.0k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  49.5k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    931|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 931, False: 48.5k]
  ------------------
  305|    931|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    931|#define CF(format,target,v,maxlen)                              \
  |  |   36|    931|{                                                               \
  |  |   37|    931|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 302, False: 629]
  |  |  ------------------
  |  |   38|    302|                snprintf (v, maxlen,	                        \
  |  |   39|    302|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    302|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    302|                        "expected '%s'."),                      \
  |  |   41|    302|                        exif_format_get_name (format),          \
  |  |   42|    302|                        exif_format_get_name (target));         \
  |  |   43|    302|                break;                                          \
  |  |   44|    302|        }                                                       \
  |  |   45|    931|}
  ------------------
  306|    629|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    629|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    629|{                                                                       \
  |  |   62|    629|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 199, False: 430]
  |  |  ------------------
  |  |   63|    199|                snprintf (v, maxlen,                                    \
  |  |   64|    199|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    199|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    199|                break;                                                  \
  |  |   67|    199|        }                                                               \
  |  |   68|    629|}
  ------------------
  307|    430|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    430|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 201, False: 229]
  ------------------
  309|    201|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|    201|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 201]
  |  |  ------------------
  ------------------
  310|    229|		} else {
  311|    229|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    229|		}
  313|    430|		break;
  314|    685|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 685, False: 48.8k]
  ------------------
  315|    685|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    685|#define CF(format,target,v,maxlen)                              \
  |  |   36|    685|{                                                               \
  |  |   37|    685|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 294, False: 391]
  |  |  ------------------
  |  |   38|    294|                snprintf (v, maxlen,	                        \
  |  |   39|    294|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    294|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    294|                        "expected '%s'."),                      \
  |  |   41|    294|                        exif_format_get_name (format),          \
  |  |   42|    294|                        exif_format_get_name (target));         \
  |  |   43|    294|                break;                                          \
  |  |   44|    294|        }                                                       \
  |  |   45|    685|}
  ------------------
  316|    391|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    391|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    391|{                                                                       \
  |  |   62|    391|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 196, False: 195]
  |  |  ------------------
  |  |   63|    196|                snprintf (v, maxlen,                                    \
  |  |   64|    196|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    196|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    196|                break;                                                  \
  |  |   67|    196|        }                                                               \
  |  |   68|    391|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|    195|                vs = exif_get_short (entry->data + 2, entry->order);
  319|    195|                snprintf (v, maxlen, "ISO %hd", vs);
  320|    195|                break;
  321|    486|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 486, False: 49.0k]
  ------------------
  322|    486|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    486|#define CF(format,target,v,maxlen)                              \
  |  |   36|    486|{                                                               \
  |  |   37|    486|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 205, False: 281]
  |  |  ------------------
  |  |   38|    205|                snprintf (v, maxlen,	                        \
  |  |   39|    205|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    205|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    205|                        "expected '%s'."),                      \
  |  |   41|    205|                        exif_format_get_name (format),          \
  |  |   42|    205|                        exif_format_get_name (target));         \
  |  |   43|    205|                break;                                          \
  |  |   44|    205|        }                                                       \
  |  |   45|    486|}
  ------------------
  323|    281|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    281|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    281|{                                                                       \
  |  |   62|    281|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 73, False: 208]
  |  |  ------------------
  |  |   63|     73|                snprintf (v, maxlen,                                    \
  |  |   64|     73|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     73|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     73|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     73|                break;                                                  \
  |  |   67|     73|        }                                                               \
  |  |   68|    281|}
  ------------------
  324|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  325|    208|                vs = exif_get_short (entry->data + 2, entry->order);
  326|    208|                snprintf (v, maxlen, "ISO2 %hd", vs);
  327|    208|                break;
  328|    223|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 223, False: 49.2k]
  ------------------
  329|    455|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 232, False: 49.2k]
  ------------------
  330|    710|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 255, False: 49.2k]
  ------------------
  331|    936|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 226, False: 49.2k]
  ------------------
  332|  1.20k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 273, False: 49.2k]
  ------------------
  333|  1.45k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 245, False: 49.2k]
  ------------------
  334|  1.68k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 229, False: 49.2k]
  ------------------
  335|  1.79k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 107, False: 49.3k]
  ------------------
  336|  2.05k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 263, False: 49.2k]
  ------------------
  337|  2.25k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 205, False: 49.2k]
  ------------------
  338|  2.50k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 251, False: 49.2k]
  ------------------
  339|  2.70k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 197, False: 49.3k]
  ------------------
  340|  2.77k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 66, False: 49.4k]
  ------------------
  341|  2.77k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  2.77k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.77k|{                                                               \
  |  |   37|  2.77k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.12k, False: 648]
  |  |  ------------------
  |  |   38|  2.12k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.12k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.12k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.12k|                        "expected '%s'."),                      \
  |  |   41|  2.12k|                        exif_format_get_name (format),          \
  |  |   42|  2.12k|                        exif_format_get_name (target));         \
  |  |   43|  2.12k|                break;                                          \
  |  |   44|  2.12k|        }                                                       \
  |  |   45|  2.77k|}
  ------------------
  342|    648|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    648|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 218, False: 430]
  |  |  ------------------
  ------------------
  343|    648|		break;
  344|    219|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 219, False: 49.2k]
  ------------------
  345|    338|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 119, False: 49.3k]
  ------------------
  346|    695|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 357, False: 49.1k]
  ------------------
  347|    695|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    695|#define CF(format,target,v,maxlen)                              \
  |  |   36|    695|{                                                               \
  |  |   37|    695|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 233, False: 462]
  |  |  ------------------
  |  |   38|    233|                snprintf (v, maxlen,	                        \
  |  |   39|    233|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    233|                        "expected '%s'."),                      \
  |  |   41|    233|                        exif_format_get_name (format),          \
  |  |   42|    233|                        exif_format_get_name (target));         \
  |  |   43|    233|                break;                                          \
  |  |   44|    233|        }                                                       \
  |  |   45|    695|}
  ------------------
  348|    462|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    462|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    462|{                                                                       \
  |  |   62|    462|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 267, False: 195]
  |  |  ------------------
  |  |   63|    267|                snprintf (v, maxlen,                                    \
  |  |   64|    267|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    267|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    267|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    267|                break;                                                  \
  |  |   67|    267|        }                                                               \
  |  |   68|    462|}
  ------------------
  349|    195|		vl =  exif_get_long (entry->data, entry->order);
  350|    195|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    195|		break;
  352|    520|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 520, False: 48.9k]
  ------------------
  353|  1.13k|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 611, False: 48.8k]
  ------------------
  354|  1.13k|		unsigned char h,m,l;
  355|  1.13k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  1.13k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.13k|{                                                               \
  |  |   37|  1.13k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 271, False: 860]
  |  |  ------------------
  |  |   38|    271|                snprintf (v, maxlen,	                        \
  |  |   39|    271|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    271|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    271|                        "expected '%s'."),                      \
  |  |   41|    271|                        exif_format_get_name (format),          \
  |  |   42|    271|                        exif_format_get_name (target));         \
  |  |   43|    271|                break;                                          \
  |  |   44|    271|        }                                                       \
  |  |   45|  1.13k|}
  ------------------
  356|    860|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    860|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    860|{                                                                       \
  |  |   62|    860|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 373, False: 487]
  |  |  ------------------
  |  |   63|    373|                snprintf (v, maxlen,                                    \
  |  |   64|    373|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    373|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    373|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    373|                break;                                                  \
  |  |   67|    373|        }                                                               \
  |  |   68|    860|}
  ------------------
  357|    487|		vl =  exif_get_long (entry->data, entry->order);
  358|    487|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    487|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 271, False: 216]
  ------------------
  360|    487|		break;
  361|    860|	}
  362|    224|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 224, False: 49.2k]
  ------------------
  363|    722|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 498, False: 49.0k]
  ------------------
  364|    722|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    722|#define CF(format,target,v,maxlen)                              \
  |  |   36|    722|{                                                               \
  |  |   37|    722|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 226, False: 496]
  |  |  ------------------
  |  |   38|    226|                snprintf (v, maxlen,	                        \
  |  |   39|    226|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    226|                        "expected '%s'."),                      \
  |  |   41|    226|                        exif_format_get_name (format),          \
  |  |   42|    226|                        exif_format_get_name (target));         \
  |  |   43|    226|                break;                                          \
  |  |   44|    226|        }                                                       \
  |  |   45|    722|}
  ------------------
  365|    496|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    496|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    496|{                                                                       \
  |  |   62|    496|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 296, False: 200]
  |  |  ------------------
  |  |   63|    296|                snprintf (v, maxlen,                                    \
  |  |   64|    296|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    296|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    296|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    296|                break;                                                  \
  |  |   67|    296|        }                                                               \
  |  |   68|    496|}
  ------------------
  366|    200|		vl =  exif_get_long (entry->data, entry->order);
  367|    200|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    200|		break;
  369|    710|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 710, False: 48.7k]
  ------------------
  370|    950|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 240, False: 49.2k]
  ------------------
  371|  1.15k|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 203, False: 49.2k]
  ------------------
  372|  1.35k|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 200, False: 49.3k]
  ------------------
  373|  1.56k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 209, False: 49.2k]
  ------------------
  374|  1.56k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.56k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.56k|{                                                               \
  |  |   37|  1.56k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 754, False: 808]
  |  |  ------------------
  |  |   38|    754|                snprintf (v, maxlen,	                        \
  |  |   39|    754|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    754|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    754|                        "expected '%s'."),                      \
  |  |   41|    754|                        exif_format_get_name (format),          \
  |  |   42|    754|                        exif_format_get_name (target));         \
  |  |   43|    754|                break;                                          \
  |  |   44|    754|        }                                                       \
  |  |   45|  1.56k|}
  ------------------
  375|    808|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    808|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    808|{                                                                       \
  |  |   62|    808|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 378, False: 430]
  |  |  ------------------
  |  |   63|    378|                snprintf (v, maxlen,                                    \
  |  |   64|    378|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    378|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    378|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    378|                break;                                                  \
  |  |   67|    378|        }                                                               \
  |  |   68|    808|}
  ------------------
  376|    430|		vs = exif_get_short (entry->data, entry->order);
  377|    430|		snprintf (v, maxlen, "%hd", vs);
  378|    430|		break;
  379|  1.10k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.10k, False: 48.4k]
  ------------------
  380|  1.10k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.10k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.10k|{                                                               \
  |  |   37|  1.10k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 209, False: 892]
  |  |  ------------------
  |  |   38|    209|                snprintf (v, maxlen,	                        \
  |  |   39|    209|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    209|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    209|                        "expected '%s'."),                      \
  |  |   41|    209|                        exif_format_get_name (format),          \
  |  |   42|    209|                        exif_format_get_name (target));         \
  |  |   43|    209|                break;                                          \
  |  |   44|    209|        }                                                       \
  |  |   45|  1.10k|}
  ------------------
  381|    892|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    892|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    892|{                                                                       \
  |  |   62|    892|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 102, False: 790]
  |  |  ------------------
  |  |   63|    102|                snprintf (v, maxlen,                                    \
  |  |   64|    102|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    102|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    102|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    102|                break;                                                  \
  |  |   67|    102|        }                                                               \
  |  |   68|    892|}
  ------------------
  382|    790|		vr = exif_get_rational (entry->data, entry->order);
  383|    790|		r = R2D(vr);
  ------------------
  |  |   82|    790|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 563, False: 227]
  |  |  ------------------
  ------------------
  384|    790|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    790|		b = R2D(vr);
  ------------------
  |  |   82|    790|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 402, False: 388]
  |  |  ------------------
  ------------------
  386|    790|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    790|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    790|		break;
  388|    825|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 825, False: 48.6k]
  ------------------
  389|    825|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|    825|#define CF(format,target,v,maxlen)                              \
  |  |   36|    825|{                                                               \
  |  |   37|    825|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 153, False: 672]
  |  |  ------------------
  |  |   38|    153|                snprintf (v, maxlen,	                        \
  |  |   39|    153|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    153|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    153|                        "expected '%s'."),                      \
  |  |   41|    153|                        exif_format_get_name (format),          \
  |  |   42|    153|                        exif_format_get_name (target));         \
  |  |   43|    153|                break;                                          \
  |  |   44|    153|        }                                                       \
  |  |   45|    825|}
  ------------------
  390|    672|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    672|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    672|{                                                                       \
  |  |   62|    672|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 200, False: 472]
  |  |  ------------------
  |  |   63|    200|                snprintf (v, maxlen,                                    \
  |  |   64|    200|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    200|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    200|                break;                                                  \
  |  |   67|    200|        }                                                               \
  |  |   68|    672|}
  ------------------
  391|    472|		vr = exif_get_rational (entry->data, entry->order);
  392|    472|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 66, False: 406]
  |  Branch (392:24): [True: 106, False: 300]
  ------------------
  393|    172|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    172|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    300|		} else {
  395|    300|			r = R2D(vr);
  ------------------
  |  |   82|    300|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 300, False: 0]
  |  |  ------------------
  ------------------
  396|    300|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    300|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    300|		}
  398|    472|		break;
  399|  1.56k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 1.56k, False: 47.9k]
  ------------------
  400|  1.56k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.56k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.56k|{                                                               \
  |  |   37|  1.56k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 260, False: 1.30k]
  |  |  ------------------
  |  |   38|    260|                snprintf (v, maxlen,	                        \
  |  |   39|    260|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    260|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    260|                        "expected '%s'."),                      \
  |  |   41|    260|                        exif_format_get_name (format),          \
  |  |   42|    260|                        exif_format_get_name (target));         \
  |  |   43|    260|                break;                                          \
  |  |   44|    260|        }                                                       \
  |  |   45|  1.56k|}
  ------------------
  401|  1.30k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.30k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.30k|{                                                                       \
  |  |   62|  1.30k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 172, False: 1.13k]
  |  |  ------------------
  |  |   63|    172|                snprintf (v, maxlen,                                    \
  |  |   64|    172|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    172|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    172|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    172|                break;                                                  \
  |  |   67|    172|        }                                                               \
  |  |   68|  1.30k|}
  ------------------
  402|  1.13k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.13k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.13k|		r = R2D(vr);
  ------------------
  |  |   82|  1.13k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 890, False: 244]
  |  |  ------------------
  ------------------
  405|  1.13k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.13k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 881, False: 253]
  |  |  ------------------
  ------------------
  406|  1.13k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.13k|		break;
  408|  1.18k|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 1.18k, False: 48.3k]
  ------------------
  409|  1.18k|		CF2 (entry->format, EXIF_FORMAT_BYTE, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   47|  1.18k|#define CF2(format,target1,target2,v,maxlen)                    \
  |  |   48|  1.18k|{                                                               \
  |  |   49|  1.18k|        if ((format != target1) && (format != target2)) {       \
  |  |  ------------------
  |  |  |  Branch (49:13): [True: 714, False: 470]
  |  |  |  Branch (49:36): [True: 243, False: 471]
  |  |  ------------------
  |  |   50|    243|                snprintf (v, maxlen,	                        \
  |  |   51|    243|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    243|                        "expected '%s' or '%s'."),              \
  |  |   53|    243|                        exif_format_get_name (format),          \
  |  |   54|    243|                        exif_format_get_name (target1),         \
  |  |   55|    243|                        exif_format_get_name (target2));        \
  |  |   56|    243|                break;                                          \
  |  |   57|    243|        }                                                       \
  |  |   58|  1.18k|}
  ------------------
  410|    941|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    941|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    941|{                                                                       \
  |  |   62|    941|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 252, False: 689]
  |  |  ------------------
  |  |   63|    252|                snprintf (v, maxlen,                                    \
  |  |   64|    252|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    252|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    252|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    252|                break;                                                  \
  |  |   67|    252|        }                                                               \
  |  |   68|    941|}
  ------------------
  411|    689|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 361, False: 328]
  ------------------
  412|    361|			vs = exif_get_short (entry->data, entry->order);
  413|    361|		} else {
  414|    328|			vs = entry->data[0];
  415|    328|		}
  416|    689|		snprintf (v, maxlen, "%hd", vs);
  417|    689|		break;
  418|  2.75k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.75k, False: 46.7k]
  ------------------
  419|  2.75k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.75k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.75k|{                                                               \
  |  |   37|  2.75k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 223, False: 2.53k]
  |  |  ------------------
  |  |   38|    223|                snprintf (v, maxlen,	                        \
  |  |   39|    223|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    223|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    223|                        "expected '%s'."),                      \
  |  |   41|    223|                        exif_format_get_name (format),          \
  |  |   42|    223|                        exif_format_get_name (target));         \
  |  |   43|    223|                break;                                          \
  |  |   44|    223|        }                                                       \
  |  |   45|  2.75k|}
  ------------------
  420|  2.53k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.53k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.53k|{                                                                       \
  |  |   62|  2.53k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 253, False: 2.28k]
  |  |  ------------------
  |  |   63|    253|                snprintf (v, maxlen,                                    \
  |  |   64|    253|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    253|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    253|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    253|                break;                                                  \
  |  |   67|    253|        }                                                               \
  |  |   68|  2.53k|}
  ------------------
  421|  2.28k|		switch (  *( entry->data+1)  ) {
  422|    230|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 230, False: 2.05k]
  ------------------
  423|    196|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 196, False: 2.08k]
  ------------------
  424|     77|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|     77|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 77, False: 2.20k]
  ------------------
  425|    197|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 197, False: 2.08k]
  ------------------
  426|    195|		  	case  4: strncpy (v, _("AF position: right"), maxlen); break;
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (426:6): [True: 195, False: 2.08k]
  ------------------
  427|    196|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 196, False: 2.08k]
  ------------------
  428|    146|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    146|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 146, False: 2.13k]
  ------------------
  429|    203|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 203, False: 2.08k]
  ------------------
  430|    195|		  	case  8: strncpy (v, _("AF position: lower-right"), maxlen); break;
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (430:6): [True: 195, False: 2.08k]
  ------------------
  431|    199|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 199, False: 2.08k]
  ------------------
  432|    195|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 195, False: 2.08k]
  ------------------
  433|    254|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    254|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 254, False: 2.02k]
  ------------------
  434|  2.28k|		}     
  435|  2.28k|		break;
  436|  2.28k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.46k, False: 48.0k]
  ------------------
  437|  1.46k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.46k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.46k|{                                                               \
  |  |   37|  1.46k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 296, False: 1.16k]
  |  |  ------------------
  |  |   38|    296|                snprintf (v, maxlen,	                        \
  |  |   39|    296|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    296|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    296|                        "expected '%s'."),                      \
  |  |   41|    296|                        exif_format_get_name (format),          \
  |  |   42|    296|                        exif_format_get_name (target));         \
  |  |   43|    296|                break;                                          \
  |  |   44|    296|        }                                                       \
  |  |   45|  1.46k|}
  ------------------
  438|  1.16k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.16k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.16k|{                                                                       \
  |  |   62|  1.16k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 203, False: 961]
  |  |  ------------------
  |  |   63|    203|                snprintf (v, maxlen,                                    \
  |  |   64|    203|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    203|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    203|                break;                                                  \
  |  |   67|    203|        }                                                               \
  |  |   68|  1.16k|}
  ------------------
  439|    961|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  13.4k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 13.4k, False: 0]
  |  Branch (441:32): [True: 12.4k, False: 961]
  ------------------
  442|  12.4k|			;
  443|    961|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 961]
  ------------------
  444|      0|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  445|      0|		  	break;
  446|      0|		}
  447|    961|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|    961|#define CF(format,target,v,maxlen)                              \
  |  |   36|    961|{                                                               \
  |  |   37|    961|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 961]
  |  |  ------------------
  |  |   38|      0|                snprintf (v, maxlen,	                        \
  |  |   39|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|      0|                        "expected '%s'."),                      \
  |  |   41|      0|                        exif_format_get_name (format),          \
  |  |   42|      0|                        exif_format_get_name (target));         \
  |  |   43|      0|                break;                                          \
  |  |   44|      0|        }                                                       \
  |  |   45|    961|}
  ------------------
  448|       |		/* find the value */
  449|  2.57k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.34k, False: 229]
  ------------------
  450|  2.34k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.61k, False: 732]
  ------------------
  451|    961|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 234, False: 727]
  ------------------
  452|    234|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    234|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    234|			break;
  454|    234|		}
  455|    727|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    727|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    727|		break;
  457|  1.41k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.41k, False: 48.0k]
  ------------------
  458|  1.41k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 978, False: 433]
  ------------------
  459|    978|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    978|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    978|{                                                                       \
  |  |   62|    978|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 171, False: 807]
  |  |  ------------------
  |  |   63|    171|                snprintf (v, maxlen,                                    \
  |  |   64|    171|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    171|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    171|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    171|                break;                                                  \
  |  |   67|    171|        }                                                               \
  |  |   68|    978|}
  ------------------
  460|    807|			vr = exif_get_rational (entry->data, entry->order);
  461|    807|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 224, False: 583]
  |  Branch (461:25): [True: 224, False: 359]
  ------------------
  462|    448|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    448|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    448|			} else {
  464|    359|				r = R2D(vr);
  ------------------
  |  |   82|    359|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 359, False: 0]
  |  |  ------------------
  ------------------
  465|    359|				snprintf (v, maxlen, "%2.2f", r);
  466|    359|			}
  467|    807|			break;
  468|    978|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    677|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 244, False: 49.2k]
  ------------------
  472|    895|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 218, False: 49.2k]
  ------------------
  473|  1.10k|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 214, False: 49.2k]
  ------------------
  474|  1.39k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 284, False: 49.2k]
  ------------------
  475|  1.47k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 84, False: 49.4k]
  ------------------
  476|  1.67k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 195, False: 49.3k]
  ------------------
  477|  1.89k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 225, False: 49.2k]
  ------------------
  478|  2.10k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 205, False: 49.2k]
  ------------------
  479|  2.33k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 234, False: 49.2k]
  ------------------
  480|  2.59k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 254, False: 49.2k]
  ------------------
  481|  2.82k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 235, False: 49.2k]
  ------------------
  482|  3.03k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 211, False: 49.2k]
  ------------------
  483|  3.25k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 220, False: 49.2k]
  ------------------
  484|  3.45k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 201, False: 49.3k]
  ------------------
  485|  3.83k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 375, False: 49.1k]
  ------------------
  486|  4.03k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 206, False: 49.2k]
  ------------------
  487|  4.28k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 246, False: 49.2k]
  ------------------
  488|  4.62k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 345, False: 49.1k]
  ------------------
  489|  4.82k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 199, False: 49.3k]
  ------------------
  490|  5.04k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 217, False: 49.2k]
  ------------------
  491|  5.28k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 237, False: 49.2k]
  ------------------
  492|  5.49k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 214, False: 49.2k]
  ------------------
  493|  5.87k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 377, False: 49.1k]
  ------------------
  494|  6.07k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 206, False: 49.2k]
  ------------------
  495|  6.29k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 212, False: 49.2k]
  ------------------
  496|  6.37k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 83, False: 49.4k]
  ------------------
  497|  6.63k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 260, False: 49.2k]
  ------------------
  498|  6.63k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  6.63k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  6.63k|{                                                                       \
  |  |   62|  6.63k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.45k, False: 4.17k]
  |  |  ------------------
  |  |   63|  2.45k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.45k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.45k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.45k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.45k|                break;                                                  \
  |  |   67|  2.45k|        }                                                               \
  |  |   68|  6.63k|}
  ------------------
  499|  4.17k|		switch (entry->format) {
  500|    692|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 692, False: 3.48k]
  ------------------
  501|  1.14k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 456, False: 3.72k]
  ------------------
  502|  1.14k|			vs = entry->data[0];
  503|  1.14k|			break;
  504|  2.04k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 2.04k, False: 2.12k]
  ------------------
  505|  2.04k|			vs = exif_get_short(entry->data, entry->order);
  506|  2.04k|			break;
  507|    980|		default:
  ------------------
  |  Branch (507:3): [True: 980, False: 3.19k]
  ------------------
  508|    980|			vs = 0;
  509|    980|			break;
  510|  4.17k|		}
  511|       |		/* search for the tag */
  512|  73.2k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 72.9k, False: 332]
  |  Branch (512:32): [True: 69.0k, False: 3.84k]
  ------------------
  513|  69.0k|			;
  514|  4.17k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 332, False: 3.84k]
  ------------------
  515|    332|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|    332|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|    332|		  	break;
  517|    332|		}
  518|  3.84k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  3.84k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  3.84k|{                                                               \
  |  |   37|  3.84k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 1.50k, False: 2.33k]
  |  |  ------------------
  |  |   38|  1.50k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.50k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.50k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.50k|                        "expected '%s'."),                      \
  |  |   41|  1.50k|                        exif_format_get_name (format),          \
  |  |   42|  1.50k|                        exif_format_get_name (target));         \
  |  |   43|  1.50k|                break;                                          \
  |  |   44|  1.50k|        }                                                       \
  |  |   45|  3.84k|}
  ------------------
  519|       |		/* find the value */
  520|  10.4k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 9.32k, False: 1.13k]
  ------------------
  521|  9.32k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 8.11k, False: 1.20k]
  ------------------
  522|  2.33k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.17k, False: 1.16k]
  ------------------
  523|  1.17k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.17k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.17k|			break;
  525|  1.17k|		}
  526|  1.16k|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|  1.16k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|  1.16k|		break;
  528|    203|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 203, False: 49.2k]
  ------------------
  529|    434|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 231, False: 49.2k]
  ------------------
  530|    672|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 238, False: 49.2k]
  ------------------
  531|    916|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 244, False: 49.2k]
  ------------------
  532|  1.13k|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 216, False: 49.2k]
  ------------------
  533|  1.36k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 237, False: 49.2k]
  ------------------
  534|  1.62k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 254, False: 49.2k]
  ------------------
  535|  1.81k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 196, False: 49.3k]
  ------------------
  536|  2.22k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 401, False: 49.1k]
  ------------------
  537|  2.22k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.22k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.22k|{                                                               \
  |  |   37|  2.22k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 513, False: 1.70k]
  |  |  ------------------
  |  |   38|    513|                snprintf (v, maxlen,	                        \
  |  |   39|    513|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    513|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    513|                        "expected '%s'."),                      \
  |  |   41|    513|                        exif_format_get_name (format),          \
  |  |   42|    513|                        exif_format_get_name (target));         \
  |  |   43|    513|                break;                                          \
  |  |   44|    513|        }                                                       \
  |  |   45|  2.22k|}
  ------------------
  538|  1.70k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.70k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.70k|{                                                                       \
  |  |   62|  1.70k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 578, False: 1.12k]
  |  |  ------------------
  |  |   63|    578|                snprintf (v, maxlen,                                    \
  |  |   64|    578|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    578|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    578|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    578|                break;                                                  \
  |  |   67|    578|        }                                                               \
  |  |   68|  1.70k|}
  ------------------
  539|  1.12k|		vs = exif_get_short (entry->data, entry->order);
  540|  1.12k|		switch (vs) {
  541|    353|		case 0:
  ------------------
  |  Branch (541:3): [True: 353, False: 776]
  ------------------
  542|    353|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    353|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    353|			break;
  544|    238|		case 1:
  ------------------
  |  Branch (544:3): [True: 238, False: 891]
  ------------------
  545|    238|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    238|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|    238|			break;
  547|    538|		default:
  ------------------
  |  Branch (547:3): [True: 538, False: 591]
  ------------------
  548|    538|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    538|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    538|			strncat (v, buf, maxlen - strlen (v));
  550|    538|			break;
  551|  1.12k|		}
  552|  1.12k|		break;
  553|  1.16k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.16k, False: 48.3k]
  ------------------
  554|  1.16k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.16k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.16k|{                                                               \
  |  |   37|  1.16k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 225, False: 939]
  |  |  ------------------
  |  |   38|    225|                snprintf (v, maxlen,	                        \
  |  |   39|    225|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    225|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    225|                        "expected '%s'."),                      \
  |  |   41|    225|                        exif_format_get_name (format),          \
  |  |   42|    225|                        exif_format_get_name (target));         \
  |  |   43|    225|                break;                                          \
  |  |   44|    225|        }                                                       \
  |  |   45|  1.16k|}
  ------------------
  555|    939|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    939|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    939|{                                                                       \
  |  |   62|    939|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 76, False: 863]
  |  |  ------------------
  |  |   63|     76|                snprintf (v, maxlen,                                    \
  |  |   64|     76|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     76|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     76|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     76|                break;                                                  \
  |  |   67|     76|        }                                                               \
  |  |   68|    939|}
  ------------------
  556|    863|		vs = exif_get_short (entry->data, entry->order);
  557|    863|		switch (vs) {
  558|    227|		case 0:
  ------------------
  |  Branch (558:3): [True: 227, False: 636]
  ------------------
  559|    227|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    227|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    227|			break;
  561|    210|		case 1:
  ------------------
  |  Branch (561:3): [True: 210, False: 653]
  ------------------
  562|    210|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|    210|			break;
  564|    214|		case 2:
  ------------------
  |  Branch (564:3): [True: 214, False: 649]
  ------------------
  565|    214|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|    214|			break;
  567|    212|		default:
  ------------------
  |  Branch (567:3): [True: 212, False: 651]
  ------------------
  568|    212|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    212|			strncat (v, buf, maxlen - strlen (v));
  570|    212|			break;
  571|    863|		}
  572|    863|		break;
  573|  1.65k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.65k, False: 47.8k]
  ------------------
  574|  1.65k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.65k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.65k|{                                                               \
  |  |   37|  1.65k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 228, False: 1.42k]
  |  |  ------------------
  |  |   38|    228|                snprintf (v, maxlen,	                        \
  |  |   39|    228|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    228|                        "expected '%s'."),                      \
  |  |   41|    228|                        exif_format_get_name (format),          \
  |  |   42|    228|                        exif_format_get_name (target));         \
  |  |   43|    228|                break;                                          \
  |  |   44|    228|        }                                                       \
  |  |   45|  1.65k|}
  ------------------
  575|  1.42k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.42k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.42k|{                                                                       \
  |  |   62|  1.42k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 263, False: 1.16k]
  |  |  ------------------
  |  |   63|    263|                snprintf (v, maxlen,                                    \
  |  |   64|    263|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    263|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    263|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    263|                break;                                                  \
  |  |   67|    263|        }                                                               \
  |  |   68|  1.42k|}
  ------------------
  576|  1.16k|		{
  577|  1.16k|			double ao,ac;
  578|  1.16k|			unsigned long fs,fl;
  579|  1.16k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.16k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.16k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 922, False: 239]
  |  |  ------------------
  ------------------
  581|  1.16k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.16k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.16k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 893, False: 268]
  |  |  ------------------
  ------------------
  583|  1.16k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.16k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.16k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 770, False: 391]
  |  |  ------------------
  ------------------
  585|  1.16k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.16k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.16k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 891, False: 270]
  |  |  ------------------
  ------------------
  587|  1.16k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.16k|		}
  589|  1.16k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.27k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.27k, False: 47.2k]
  ------------------
  593|  2.27k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.27k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.27k|{                                                               \
  |  |   37|  2.27k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 261, False: 2.01k]
  |  |  ------------------
  |  |   38|    261|                snprintf (v, maxlen,	                        \
  |  |   39|    261|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    261|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    261|                        "expected '%s'."),                      \
  |  |   41|    261|                        exif_format_get_name (format),          \
  |  |   42|    261|                        exif_format_get_name (target));         \
  |  |   43|    261|                break;                                          \
  |  |   44|    261|        }                                                       \
  |  |   45|  2.27k|}
  ------------------
  594|  2.01k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  2.01k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.01k|{                                                                       \
  |  |   62|  2.01k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 300, False: 1.71k]
  |  |  ------------------
  |  |   63|    300|                snprintf (v, maxlen,                                    \
  |  |   64|    300|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    300|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    300|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    300|                break;                                                  \
  |  |   67|    300|        }                                                               \
  |  |   68|  2.01k|}
  ------------------
  595|  1.71k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.71k|		switch (vl) {
  597|    226|		case 0:
  ------------------
  |  Branch (597:3): [True: 226, False: 1.48k]
  ------------------
  598|    226|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    226|			break;
  600|    212|		case 1:
  ------------------
  |  Branch (600:3): [True: 212, False: 1.50k]
  ------------------
  601|    212|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    212|			break;
  603|    325|		case 2:
  ------------------
  |  Branch (603:3): [True: 325, False: 1.38k]
  ------------------
  604|    325|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    325|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    325|			break;
  606|    303|		case 3:
  ------------------
  |  Branch (606:3): [True: 303, False: 1.41k]
  ------------------
  607|    303|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    303|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    303|			break;
  609|    647|		default:
  ------------------
  |  Branch (609:3): [True: 647, False: 1.06k]
  ------------------
  610|    647|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.71k|		}
  612|  1.71k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.71k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.71k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.71k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.71k|		switch (vl) {
  617|    201|		case 1:
  ------------------
  |  Branch (617:3): [True: 201, False: 1.51k]
  ------------------
  618|    201|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    201|			break;
  620|    322|		case 2:
  ------------------
  |  Branch (620:3): [True: 322, False: 1.39k]
  ------------------
  621|    322|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    322|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    322|			break;
  623|    195|		case 3:
  ------------------
  |  Branch (623:3): [True: 195, False: 1.51k]
  ------------------
  624|    195|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    195|			break;
  626|    196|		case 4:
  ------------------
  |  Branch (626:3): [True: 196, False: 1.51k]
  ------------------
  627|    196|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|    196|			break;
  629|    799|		default:
  ------------------
  |  Branch (629:3): [True: 799, False: 914]
  ------------------
  630|    799|			snprintf (buf, sizeof (buf), "%li",
  631|    799|				  (long int) vl);
  632|    799|			strncat (v, buf, maxlen - strlen (v));
  633|  1.71k|		}
  634|  1.71k|		break;
  635|  1.71k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.45k, False: 48.0k]
  ------------------
  636|  1.45k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 275, False: 1.18k]
  ------------------
  637|       |			/* Epson uses a single SHORT here */
  638|    275|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    275|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    275|{                                                                       \
  |  |   62|    275|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 209, False: 66]
  |  |  ------------------
  |  |   63|    209|                snprintf (v, maxlen,                                    \
  |  |   64|    209|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    209|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    209|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    209|                break;                                                  \
  |  |   67|    209|        }                                                               \
  |  |   68|    275|}
  ------------------
  639|     66|			vs = exif_get_short (entry->data, entry->order);
  640|     66|			sprintf (buf, "%hu", vs);
  641|     66|			strncat (v, buf, maxlen - strlen (v));
  642|  1.18k|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|  1.18k|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.18k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.18k|{                                                                       \
  |  |   62|  1.18k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 243, False: 941]
  |  |  ------------------
  |  |   63|    243|                snprintf (v, maxlen,                                    \
  |  |   64|    243|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    243|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    243|                break;                                                  \
  |  |   67|    243|        }                                                               \
  |  |   68|  1.18k|}
  ------------------
  645|    941|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    941|#define CF(format,target,v,maxlen)                              \
  |  |   36|    941|{                                                               \
  |  |   37|    941|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 730]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|    941|}
  ------------------
  646|  5.11k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 4.38k, False: 730]
  ------------------
  647|  4.38k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  4.38k|				sprintf (buf, "%hd ", vss);
  649|  4.38k|				strncat (v, buf, maxlen - strlen (v));
  650|  4.38k|			}
  651|    730|		}
  652|    796|		break;
  653|  1.22k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.22k, False: 48.2k]
  ------------------
  654|  1.22k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.22k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.22k|{                                                               \
  |  |   37|  1.22k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 69, False: 1.15k]
  |  |  ------------------
  |  |   38|     69|                snprintf (v, maxlen,	                        \
  |  |   39|     69|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     69|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     69|                        "expected '%s'."),                      \
  |  |   41|     69|                        exif_format_get_name (format),          \
  |  |   42|     69|                        exif_format_get_name (target));         \
  |  |   43|     69|                break;                                          \
  |  |   44|     69|        }                                                       \
  |  |   45|  1.22k|}
  ------------------
  655|  1.15k|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.15k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.15k|{                                                                       \
  |  |   62|  1.15k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 232, False: 920]
  |  |  ------------------
  |  |   63|    232|                snprintf (v, maxlen,                                    \
  |  |   64|    232|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    232|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    232|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    232|                break;                                                  \
  |  |   67|    232|        }                                                               \
  |  |   68|  1.15k|}
  ------------------
  656|  6.44k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 5.52k, False: 920]
  ------------------
  657|  5.52k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  5.52k|			sprintf (buf, "%hu ", vs);
  659|  5.52k|			strncat (v, buf, maxlen - strlen (v));
  660|  5.52k|		}
  661|    920|		break;
  662|    804|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 804, False: 48.6k]
  ------------------
  663|    804|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    804|#define CF(format,target,v,maxlen)                              \
  |  |   36|    804|{                                                               \
  |  |   37|    804|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 207, False: 597]
  |  |  ------------------
  |  |   38|    207|                snprintf (v, maxlen,	                        \
  |  |   39|    207|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    207|                        "expected '%s'."),                      \
  |  |   41|    207|                        exif_format_get_name (format),          \
  |  |   42|    207|                        exif_format_get_name (target));         \
  |  |   43|    207|                break;                                          \
  |  |   44|    207|        }                                                       \
  |  |   45|    804|}
  ------------------
  664|    597|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    597|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    597|{                                                                       \
  |  |   72|    597|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 76, False: 521]
  |  |  |  Branch (72:23): [True: 281, False: 240]
  |  |  ------------------
  |  |   73|    357|		snprintf (v, maxlen,                                    \
  |  |   74|    357|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    357|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    357|			"expected %i or %i)."), (int) number,		\
  |  |   76|    357|			(int) t1, (int) t2);  				\
  |  |   77|    357|		break;                                                  \
  |  |   78|    357|	}                                                               \
  |  |   79|    597|}
  ------------------
  665|    240|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    240|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 240]
  |  |  ------------------
  ------------------
  666|    240|		break;
  667|    659|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 659, False: 48.8k]
  ------------------
  668|    659|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    659|#define CF(format,target,v,maxlen)                              \
  |  |   36|    659|{                                                               \
  |  |   37|    659|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 77, False: 582]
  |  |  ------------------
  |  |   38|     77|                snprintf (v, maxlen,	                        \
  |  |   39|     77|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     77|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     77|                        "expected '%s'."),                      \
  |  |   41|     77|                        exif_format_get_name (format),          \
  |  |   42|     77|                        exif_format_get_name (target));         \
  |  |   43|     77|                break;                                          \
  |  |   44|     77|        }                                                       \
  |  |   45|    659|}
  ------------------
  669|    582|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    582|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 341, False: 241]
  |  |  ------------------
  ------------------
  670|    582|		break;
  671|    728|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 728, False: 48.7k]
  ------------------
  672|    728|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    728|#define CF(format,target,v,maxlen)                              \
  |  |   36|    728|{                                                               \
  |  |   37|    728|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 214, False: 514]
  |  |  ------------------
  |  |   38|    214|                snprintf (v, maxlen,	                        \
  |  |   39|    214|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    214|                        "expected '%s'."),                      \
  |  |   41|    214|                        exif_format_get_name (format),          \
  |  |   42|    214|                        exif_format_get_name (target));         \
  |  |   43|    214|                break;                                          \
  |  |   44|    214|        }                                                       \
  |  |   45|    728|}
  ------------------
  673|    514|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    514|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    514|{                                                                       \
  |  |   72|    514|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 102, False: 412]
  |  |  |  Branch (72:23): [True: 210, False: 202]
  |  |  ------------------
  |  |   73|    312|		snprintf (v, maxlen,                                    \
  |  |   74|    312|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    312|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    312|			"expected %i or %i)."), (int) number,		\
  |  |   76|    312|			(int) t1, (int) t2);  				\
  |  |   77|    312|		break;                                                  \
  |  |   78|    312|	}                                                               \
  |  |   79|    514|}
  ------------------
  674|    202|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    202|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 202]
  |  |  ------------------
  ------------------
  675|    202|		break;
  676|    676|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 676, False: 48.8k]
  ------------------
  677|    676|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    676|#define CF(format,target,v,maxlen)                              \
  |  |   36|    676|{                                                               \
  |  |   37|    676|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 236, False: 440]
  |  |  ------------------
  |  |   38|    236|                snprintf (v, maxlen,	                        \
  |  |   39|    236|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    236|                        "expected '%s'."),                      \
  |  |   41|    236|                        exif_format_get_name (format),          \
  |  |   42|    236|                        exif_format_get_name (target));         \
  |  |   43|    236|                break;                                          \
  |  |   44|    236|        }                                                       \
  |  |   45|    676|}
  ------------------
  678|    440|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    440|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    440|{                                                                       \
  |  |   62|    440|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 233, False: 207]
  |  |  ------------------
  |  |   63|    233|                snprintf (v, maxlen,                                    \
  |  |   64|    233|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    233|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    233|                break;                                                  \
  |  |   67|    233|        }                                                               \
  |  |   68|    440|}
  ------------------
  679|    207|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    207|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 207]
  |  |  ------------------
  ------------------
  680|    207|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 49.5k]
  ------------------
  682|      0|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|      0|#define CF(format,target,v,maxlen)                              \
  |  |   36|      0|{                                                               \
  |  |   37|      0|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|                snprintf (v, maxlen,	                        \
  |  |   39|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|      0|                        "expected '%s'."),                      \
  |  |   41|      0|                        exif_format_get_name (format),          \
  |  |   42|      0|                        exif_format_get_name (target));         \
  |  |   43|      0|                break;                                          \
  |  |   44|      0|        }                                                       \
  |  |   45|      0|}
  ------------------
  683|      0|		CC (entry->components, 30, v, maxlen)
  ------------------
  |  |   60|      0|#define CC(number,target,v,maxlen)                                      \
  |  |   61|      0|{                                                                       \
  |  |   62|      0|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   63|      0|                snprintf (v, maxlen,                                    \
  |  |   64|      0|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|      0|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|      0|                break;                                                  \
  |  |   67|      0|        }                                                               \
  |  |   68|      0|}
  ------------------
  684|      0|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (684:13): [True: 0, False: 0]
  ------------------
  685|      0|			vl = exif_get_long (entry->data+4*i, entry->order);
  686|      0|			sprintf (buf, "%lu ", (unsigned long)vl);
  687|      0|			strncat (v, buf, maxlen - strlen (v));
  688|      0|		}
  689|      0|		break;
  690|  1.21k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.21k, False: 48.2k]
  ------------------
  691|  1.21k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.21k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.21k|{                                                               \
  |  |   37|  1.21k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 110, False: 1.10k]
  |  |  ------------------
  |  |   38|    110|                snprintf (v, maxlen,	                        \
  |  |   39|    110|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    110|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    110|                        "expected '%s'."),                      \
  |  |   41|    110|                        exif_format_get_name (format),          \
  |  |   42|    110|                        exif_format_get_name (target));         \
  |  |   43|    110|                break;                                          \
  |  |   44|    110|        }                                                       \
  |  |   45|  1.21k|}
  ------------------
  692|  1.10k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.10k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.10k|{                                                                       \
  |  |   62|  1.10k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 254, False: 851]
  |  |  ------------------
  |  |   63|    254|                snprintf (v, maxlen,                                    \
  |  |   64|    254|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    254|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    254|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    254|                break;                                                  \
  |  |   67|    254|        }                                                               \
  |  |   68|  1.10k|}
  ------------------
  693|    851|		vr = exif_get_rational (entry->data, entry->order);
  694|    851|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 204, False: 647]
  |  Branch (694:24): [True: 242, False: 405]
  ------------------
  695|    446|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    446|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    446|		}
  697|    405|		else {
  698|    405|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    405|			snprintf (v, maxlen, "%li mm", tmp);
  700|    405|		}
  701|    851|		break;
  702|  2.33k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.33k, False: 47.1k]
  ------------------
  703|  2.33k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.33k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.33k|{                                                               \
  |  |   37|  2.33k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 228, False: 2.10k]
  |  |  ------------------
  |  |   38|    228|                snprintf (v, maxlen,	                        \
  |  |   39|    228|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    228|                        "expected '%s'."),                      \
  |  |   41|    228|                        exif_format_get_name (format),          \
  |  |   42|    228|                        exif_format_get_name (target));         \
  |  |   43|    228|                break;                                          \
  |  |   44|    228|        }                                                       \
  |  |   45|  2.33k|}
  ------------------
  704|  2.10k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  2.10k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.10k|{                                                                       \
  |  |   62|  2.10k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 215, False: 1.89k]
  |  |  ------------------
  |  |   63|    215|                snprintf (v, maxlen,                                    \
  |  |   64|    215|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    215|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    215|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    215|                break;                                                  \
  |  |   67|    215|        }                                                               \
  |  |   68|  2.10k|}
  ------------------
  705|  1.89k|		vs = exif_get_short (entry->data, entry->order);
  706|  1.89k|		switch (vs) {
  707|    198|		case 1:
  ------------------
  |  Branch (707:3): [True: 198, False: 1.69k]
  ------------------
  708|    198|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    198|			break;
  710|  1.27k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.27k, False: 623]
  ------------------
  711|  1.27k|			{
  712|  1.27k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.27k|				unsigned long colorTemp = 0;
  714|  1.27k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 1.05k, False: 212]
  ------------------
  715|    194|				case 2:
  ------------------
  |  Branch (715:5): [True: 194, False: 1.07k]
  ------------------
  716|    194|					colorTemp = 3000;
  717|    194|					break;
  718|     68|				case 3:
  ------------------
  |  Branch (718:5): [True: 68, False: 1.20k]
  ------------------
  719|     68|					colorTemp = 3700;
  720|     68|					break;
  721|    229|				case 4:
  ------------------
  |  Branch (721:5): [True: 229, False: 1.04k]
  ------------------
  722|    229|					colorTemp = 4000;
  723|    229|					break;
  724|     66|				case 5:
  ------------------
  |  Branch (724:5): [True: 66, False: 1.20k]
  ------------------
  725|     66|					colorTemp = 4500;
  726|     66|					break;
  727|    198|				case 6:
  ------------------
  |  Branch (727:5): [True: 198, False: 1.07k]
  ------------------
  728|    198|					colorTemp = 5500;
  729|    198|					break;
  730|    109|				case 7:
  ------------------
  |  Branch (730:5): [True: 109, False: 1.16k]
  ------------------
  731|    109|					colorTemp = 6500;
  732|    109|					break;
  733|    195|				case 9:
  ------------------
  |  Branch (733:5): [True: 195, False: 1.07k]
  ------------------
  734|    195|					colorTemp = 7500;
  735|    195|					break;
  736|  1.27k|				}
  737|  1.27k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 1.05k, False: 212]
  ------------------
  738|  1.05k|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|  1.05k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|  1.05k|				}
  740|    212|				else {
  741|    212|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|    212|				}
  743|       |
  744|  1.27k|			}
  745|      0|			break;
  746|    198|		case 3:
  ------------------
  |  Branch (746:3): [True: 198, False: 1.69k]
  ------------------
  747|    198|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    198|			break;
  749|    227|		default:
  ------------------
  |  Branch (749:3): [True: 227, False: 1.66k]
  ------------------
  750|    227|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    227|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    227|			break;
  752|  1.89k|		}
  753|  1.89k|		break;
  754|  1.89k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 380, False: 49.1k]
  ------------------
  755|    811|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 431, False: 49.0k]
  ------------------
  756|    811|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    811|#define CF(format,target,v,maxlen)                              \
  |  |   36|    811|{                                                               \
  |  |   37|    811|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 253, False: 558]
  |  |  ------------------
  |  |   38|    253|                snprintf (v, maxlen,	                        \
  |  |   39|    253|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    253|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    253|                        "expected '%s'."),                      \
  |  |   41|    253|                        exif_format_get_name (format),          \
  |  |   42|    253|                        exif_format_get_name (target));         \
  |  |   43|    253|                break;                                          \
  |  |   44|    253|        }                                                       \
  |  |   45|    811|}
  ------------------
  757|    558|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    558|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    558|{                                                                       \
  |  |   62|    558|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 231, False: 327]
  |  |  ------------------
  |  |   63|    231|                snprintf (v, maxlen,                                    \
  |  |   64|    231|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    231|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    231|                break;                                                  \
  |  |   67|    231|        }                                                               \
  |  |   68|    558|}
  ------------------
  758|    327|		vs = exif_get_short (entry->data, entry->order);
  759|    327|		snprintf (v, maxlen, "%hu ", vs);
  760|    327|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    327|		sprintf (buf, "%hu", vs);
  762|    327|		strncat (v, buf, maxlen - strlen (v));
  763|    327|		break;
  764|    200|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 200, False: 49.3k]
  ------------------
  765|    767|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 567, False: 48.9k]
  ------------------
  766|    767|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    767|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    767|{                                                                       \
  |  |   62|    767|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 271, False: 496]
  |  |  ------------------
  |  |   63|    271|                snprintf (v, maxlen,                                    \
  |  |   64|    271|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    271|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    271|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    271|                break;                                                  \
  |  |   67|    271|        }                                                               \
  |  |   68|    767|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|  1.40k|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 908, False: 48.5k]
  ------------------
  770|  1.40k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.40k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.40k|{                                                               \
  |  |   37|  1.40k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 272, False: 1.13k]
  |  |  ------------------
  |  |   38|    272|                snprintf (v, maxlen,	                        \
  |  |   39|    272|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    272|                        "expected '%s'."),                      \
  |  |   41|    272|                        exif_format_get_name (format),          \
  |  |   42|    272|                        exif_format_get_name (target));         \
  |  |   43|    272|                break;                                          \
  |  |   44|    272|        }                                                       \
  |  |   45|  1.40k|}
  ------------------
  771|  1.13k|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 647, False: 485]
  ------------------
  772|    647|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    647|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    647|{                                                                       \
  |  |   62|    647|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 380, False: 267]
  |  |  ------------------
  |  |   63|    380|                snprintf (v, maxlen,                                    \
  |  |   64|    380|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    380|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    380|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    380|                break;                                                  \
  |  |   67|    380|        }                                                               \
  |  |   68|    647|}
  ------------------
  773|  5.09k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 4.34k, False: 752]
  ------------------
  774|  4.34k|			vs = exif_get_short (entry->data+2*i, entry->order);
  775|  4.34k|			sprintf (buf, "%hu ", vs);
  776|  4.34k|			strncat (v, buf, maxlen - strlen (v));
  777|  4.34k|		}
  778|    752|		break;
  779|    195|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 195, False: 49.3k]
  ------------------
  780|    508|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 313, False: 49.1k]
  ------------------
  781|    706|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 198, False: 49.3k]
  ------------------
  782|  1.20k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 501, False: 49.0k]
  ------------------
  783|  1.20k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.20k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.20k|{                                                               \
  |  |   37|  1.20k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 540, False: 667]
  |  |  ------------------
  |  |   38|    540|                snprintf (v, maxlen,	                        \
  |  |   39|    540|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    540|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    540|                        "expected '%s'."),                      \
  |  |   41|    540|                        exif_format_get_name (format),          \
  |  |   42|    540|                        exif_format_get_name (target));         \
  |  |   43|    540|                break;                                          \
  |  |   44|    540|        }                                                       \
  |  |   45|  1.20k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.57k|	default:
  ------------------
  |  Branch (786:2): [True: 3.90k, False: 45.5k]
  ------------------
  787|  4.57k|		switch (entry->format) {
  788|    491|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 491, False: 4.08k]
  ------------------
  789|    491|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    491|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 239, False: 252]
  |  |  ------------------
  ------------------
  790|    491|			break;
  791|    450|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 450, False: 4.12k]
  ------------------
  792|    450|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    450|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    450|{                                                                       \
  |  |   62|    450|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 240, False: 210]
  |  |  ------------------
  |  |   63|    240|                snprintf (v, maxlen,                                    \
  |  |   64|    240|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    240|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    240|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    240|                break;                                                  \
  |  |   67|    240|        }                                                               \
  |  |   68|    450|}
  ------------------
  793|    210|			vs = exif_get_short (entry->data, entry->order);
  794|    210|			snprintf (v, maxlen, "%hu", vs);
  795|    210|			break;
  796|    427|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 427, False: 4.14k]
  ------------------
  797|    427|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    427|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    427|{                                                                       \
  |  |   62|    427|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 227, False: 200]
  |  |  ------------------
  |  |   63|    227|                snprintf (v, maxlen,                                    \
  |  |   64|    227|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    227|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    227|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    227|                break;                                                  \
  |  |   67|    227|        }                                                               \
  |  |   68|    427|}
  ------------------
  798|    200|			vss = exif_get_sshort (entry->data, entry->order);
  799|    200|			snprintf (v, maxlen, "%hi", vss);
  800|    200|			break;
  801|    419|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 419, False: 4.15k]
  ------------------
  802|    419|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    419|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    419|{                                                                       \
  |  |   62|    419|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 219, False: 200]
  |  |  ------------------
  |  |   63|    219|                snprintf (v, maxlen,                                    \
  |  |   64|    219|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    219|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    219|                break;                                                  \
  |  |   67|    219|        }                                                               \
  |  |   68|    419|}
  ------------------
  803|    200|			vl = exif_get_long (entry->data, entry->order);
  804|    200|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    200|			break;
  806|    427|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 427, False: 4.14k]
  ------------------
  807|    427|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    427|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    427|{                                                                       \
  |  |   62|    427|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 232, False: 195]
  |  |  ------------------
  |  |   63|    232|                snprintf (v, maxlen,                                    \
  |  |   64|    232|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    232|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    232|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    232|                break;                                                  \
  |  |   67|    232|        }                                                               \
  |  |   68|    427|}
  ------------------
  808|    195|			vsl = exif_get_slong (entry->data, entry->order);
  809|    195|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|    195|			break;
  811|    875|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 875, False: 3.70k]
  ------------------
  812|    875|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    875|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    875|{                                                                       \
  |  |   62|    875|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 177, False: 698]
  |  |  ------------------
  |  |   63|    177|                snprintf (v, maxlen,                                    \
  |  |   64|    177|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    177|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    177|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    177|                break;                                                  \
  |  |   67|    177|        }                                                               \
  |  |   68|    875|}
  ------------------
  813|    698|			vr = exif_get_rational (entry->data, entry->order);
  814|    698|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 297, False: 401]
  ------------------
  815|    297|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    297|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    401|			} else {
  817|    401|				r = R2D(vr);
  ------------------
  |  |   82|    401|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 401, False: 0]
  |  |  ------------------
  ------------------
  818|    401|				snprintf (v, maxlen, "%2.3f", r);
  819|    401|			}
  820|    698|			break;
  821|    800|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 800, False: 3.77k]
  ------------------
  822|    800|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    800|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    800|{                                                                       \
  |  |   62|    800|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 257, False: 543]
  |  |  ------------------
  |  |   63|    257|                snprintf (v, maxlen,                                    \
  |  |   64|    257|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    257|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    257|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    257|                break;                                                  \
  |  |   67|    257|        }                                                               \
  |  |   68|    800|}
  ------------------
  823|    543|			vsr = exif_get_srational (entry->data, entry->order);
  824|    543|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 219, False: 324]
  ------------------
  825|    219|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  826|    324|			} else {
  827|    324|				r = R2D(vsr);
  ------------------
  |  |   82|    324|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 324, False: 0]
  |  |  ------------------
  ------------------
  828|    324|				snprintf (v, maxlen, "%2.3f", r);
  829|    324|			}
  830|    543|			break;
  831|    242|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 242, False: 4.33k]
  ------------------
  832|    687|		default:
  ------------------
  |  Branch (832:3): [True: 445, False: 4.13k]
  ------------------
  833|    687|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    687|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    687|				  entry->size);
  835|  26.1k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 25.4k, False: 687]
  ------------------
  836|  25.4k|				sprintf (buf, "%02x", entry->data[i]);
  837|  25.4k|				strncat (v, buf, maxlen - strlen (v));
  838|  25.4k|			}
  839|    687|			break;
  840|  4.57k|		}
  841|  4.57k|		break;
  842|  49.5k|	}
  843|       |
  844|  49.5k|	return (v);
  845|  49.5k|}

mnote_olympus_tag_get_name:
  232|   154k|{
  233|   154k|	unsigned int i;
  234|       |
  235|  16.2M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (235:14): [True: 16.1M, False: 23.6k]
  ------------------
  236|  16.1M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (236:7): [True: 130k, False: 16.0M]
  ------------------
  237|  23.6k|	return NULL;
  238|   154k|}
mnote_olympus_tag_get_title:
  242|  53.4k|{
  243|  53.4k|	unsigned int i;
  244|       |
  245|  53.4k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  246|  4.58M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (246:14): [True: 4.58M, False: 0]
  ------------------
  247|  4.58M|		if (table[i].tag == t) {
  ------------------
  |  Branch (247:7): [True: 53.4k, False: 4.52M]
  ------------------
  248|  53.4k|			if (!table[i].title)
  ------------------
  |  Branch (248:8): [True: 0, False: 53.4k]
  ------------------
  249|      0|				return NULL;
  250|  53.4k|			return _(table[i].title);
  ------------------
  |  |   31|  53.4k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  251|  53.4k|		}
  252|      0|	return NULL;
  253|  53.4k|}
mnote_olympus_tag_get_description:
  257|  53.4k|{
  258|  53.4k|	unsigned int i;
  259|       |
  260|  4.58M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (260:14): [True: 4.58M, False: 0]
  ------------------
  261|  4.58M|		if (table[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 53.4k, False: 4.52M]
  ------------------
  262|  53.4k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (262:8): [True: 211, False: 53.2k]
  |  Branch (262:33): [True: 52.3k, False: 939]
  ------------------
  263|  52.5k|				return "";
  264|    939|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  265|    939|			return _(table[i].description);
  ------------------
  |  |   31|    939|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  53.4k|		}
  267|      0|	return NULL;
  268|  53.4k|}

exif_mnote_data_pentax_identify:
  429|  1.28k|{
  430|  1.28k|	(void) ed;  /* unused */
  431|  1.28k|	if ((e->size >= 8) && !memcmp (e->data, "AOC", 4)) {
  ------------------
  |  Branch (431:6): [True: 1.06k, False: 220]
  |  Branch (431:24): [True: 576, False: 490]
  ------------------
  432|    576|		if (((e->data[4] == 'I') && (e->data[5] == 'I')) ||
  ------------------
  |  Branch (432:8): [True: 215, False: 361]
  |  Branch (432:31): [True: 3, False: 212]
  ------------------
  433|    573|		    ((e->data[4] == 'M') && (e->data[5] == 'M')))
  ------------------
  |  Branch (433:8): [True: 20, False: 553]
  |  Branch (433:31): [True: 3, False: 17]
  ------------------
  434|      6|			return pentaxV3;
  435|    570|		else
  436|       |			/* Uses Casio v2 tags */
  437|    570|			return pentaxV2;
  438|    576|	}
  439|       |
  440|    710|	if ((e->size >= 8) && !memcmp (e->data, "QVC", 4))
  ------------------
  |  Branch (440:6): [True: 490, False: 220]
  |  Branch (440:24): [True: 22, False: 468]
  ------------------
  441|     22|		return casioV2;
  442|       |
  443|       |	/* This isn't a very robust test, so make sure it's done last */
  444|       |	/* Maybe we should additionally check for a make of Asahi or Pentax */
  445|    688|	if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b))
  ------------------
  |  Branch (445:6): [True: 677, False: 11]
  |  Branch (445:24): [True: 520, False: 157]
  |  Branch (445:48): [True: 488, False: 32]
  ------------------
  446|    488|		return pentaxV1;
  447|       |
  448|    200|	return 0;
  449|    688|}
exif_mnote_data_pentax_new:
  453|  1.08k|{
  454|  1.08k|	ExifMnoteData *d;
  455|       |
  456|  1.08k|	if (!mem) return NULL;
  ------------------
  |  Branch (456:6): [True: 0, False: 1.08k]
  ------------------
  457|       |
  458|  1.08k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataPentax));
  459|  1.08k|	if (!d) return NULL;
  ------------------
  |  Branch (459:6): [True: 0, False: 1.08k]
  ------------------
  460|       |
  461|  1.08k|	exif_mnote_data_construct (d, mem);
  462|       |
  463|       |	/* Set up function pointers */
  464|  1.08k|	d->methods.free            = exif_mnote_data_pentax_free;
  465|  1.08k|	d->methods.set_byte_order  = exif_mnote_data_pentax_set_byte_order;
  466|  1.08k|	d->methods.set_offset      = exif_mnote_data_pentax_set_offset;
  467|  1.08k|	d->methods.load            = exif_mnote_data_pentax_load;
  468|  1.08k|	d->methods.save            = exif_mnote_data_pentax_save;
  469|  1.08k|	d->methods.count           = exif_mnote_data_pentax_count;
  470|  1.08k|	d->methods.get_id          = exif_mnote_data_pentax_get_id;
  471|  1.08k|	d->methods.get_name        = exif_mnote_data_pentax_get_name;
  472|  1.08k|	d->methods.get_title       = exif_mnote_data_pentax_get_title;
  473|  1.08k|	d->methods.get_description = exif_mnote_data_pentax_get_description;
  474|  1.08k|	d->methods.get_value       = exif_mnote_data_pentax_get_value;
  475|       |
  476|  1.08k|	return d;
  477|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_free:
   57|  1.08k|{
   58|  1.08k|	if (!n) return;
  ------------------
  |  Branch (58:6): [True: 0, False: 1.08k]
  ------------------
   59|       |
   60|  1.08k|	exif_mnote_data_pentax_clear ((ExifMnoteDataPentax *) n);
   61|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_clear:
   37|  2.05k|{
   38|  2.05k|	ExifMnoteData *d = (ExifMnoteData *) n;
   39|  2.05k|	unsigned int i;
   40|       |
   41|  2.05k|	if (!n) return;
  ------------------
  |  Branch (41:6): [True: 0, False: 2.05k]
  ------------------
   42|       |
   43|  2.05k|	if (n->entries) {
  ------------------
  |  Branch (43:6): [True: 966, False: 1.08k]
  ------------------
   44|  19.9k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (44:15): [True: 19.0k, False: 966]
  ------------------
   45|  19.0k|			if (n->entries[i].data) {
  ------------------
  |  Branch (45:8): [True: 7.12k, False: 11.8k]
  ------------------
   46|  7.12k|				exif_mem_free (d->mem, n->entries[i].data);
   47|  7.12k|				n->entries[i].data = NULL;
   48|  7.12k|			}
   49|    966|		exif_mem_free (d->mem, n->entries);
   50|       |		n->entries = NULL;
   51|    966|		n->count = 0;
   52|    966|	}
   53|  2.05k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_byte_order:
  409|  1.08k|{
  410|  1.08k|	ExifByteOrder o_orig;
  411|  1.08k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
  412|  1.08k|	unsigned int i;
  413|       |
  414|  1.08k|	if (!n) return;
  ------------------
  |  Branch (414:6): [True: 0, False: 1.08k]
  ------------------
  415|       |
  416|  1.08k|	o_orig = n->order;
  417|  1.08k|	n->order = o;
  418|  1.08k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (418:14): [True: 0, False: 1.08k]
  ------------------
  419|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (419:7): [True: 0, False: 0]
  |  Branch (419:35): [True: 0, False: 0]
  ------------------
  420|      0|			continue;
  421|      0|		n->entries[i].order = o;
  422|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  423|      0|				n->entries[i].components, o_orig, o);
  424|      0|	}
  425|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_offset:
  403|  1.08k|{
  404|  1.08k|	if (d) ((ExifMnoteDataPentax *) d)->offset = o;
  ------------------
  |  Branch (404:6): [True: 1.08k, False: 0]
  ------------------
  405|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_load:
  220|  1.08k|{
  221|  1.08k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) en;
  222|  1.08k|	size_t i, tcount, o, datao, base = 0;
  223|  1.08k|	ExifShort c;
  224|       |
  225|  1.08k|	if (!n) return;
  ------------------
  |  Branch (225:6): [True: 0, False: 1.08k]
  ------------------
  226|       |
  227|  1.08k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (227:6): [True: 0, False: 1.08k]
  |  Branch (227:14): [True: 0, False: 1.08k]
  ------------------
  228|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  229|      0|			  "ExifMnoteDataPentax", "Short MakerNote");
  230|      0|		return;
  231|      0|	}
  232|  1.08k|	datao = 6 + n->offset;
  233|  1.08k|	if (CHECKOVERFLOW(datao, buf_size, 8)) {
  ------------------
  |  |   33|  1.08k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 1.08k]
  |  |  |  Branch (33:81): [True: 0, False: 1.08k]
  |  |  |  Branch (33:112): [True: 7, False: 1.07k]
  |  |  ------------------
  ------------------
  234|      7|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  235|      7|			  "ExifMnoteDataPentax", "Short MakerNote");
  236|      7|		return;
  237|      7|	}
  238|       |
  239|       |	/* Detect variant of Pentax/Casio MakerNote found */
  240|  1.07k|	if (!memcmp(buf + datao, "AOC", 4)) {
  ------------------
  |  Branch (240:6): [True: 552, False: 527]
  ------------------
  241|    552|		if ((buf[datao + 4] == 'I') && (buf[datao + 5] == 'I')) {
  ------------------
  |  Branch (241:7): [True: 207, False: 345]
  |  Branch (241:34): [True: 3, False: 204]
  ------------------
  242|      3|			n->version = pentaxV3;
  243|      3|			n->order = EXIF_BYTE_ORDER_INTEL;
  244|    549|		} else if ((buf[datao + 4] == 'M') && (buf[datao + 5] == 'M')) {
  ------------------
  |  Branch (244:14): [True: 20, False: 529]
  |  Branch (244:41): [True: 3, False: 17]
  ------------------
  245|      3|			n->version = pentaxV3;
  246|      3|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  247|    546|		} else {
  248|       |			/* Uses Casio v2 tags */
  249|    546|			n->version = pentaxV2;
  250|    546|		}
  251|    552|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  252|    552|			"Parsing Pentax maker note v%d...", (int)n->version);
  253|    552|		datao += 4 + 2;
  254|    552|		base = MNOTE_PENTAX2_TAG_BASE;
  255|    552|	} else if (!memcmp(buf + datao, "QVC", 4)) {
  ------------------
  |  Branch (255:13): [True: 21, False: 506]
  ------------------
  256|     21|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  257|     21|			"Parsing Casio maker note v2...");
  258|     21|		n->version = casioV2;
  259|     21|		base = MNOTE_CASIO2_TAG_BASE;
  260|     21|		datao += 4 + 2;
  261|    506|	} else {
  262|       |		/* probably assert(!memcmp(buf + datao, "\x00\x1b", 2)) */
  263|    506|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  264|    506|			"Parsing Pentax maker note v1...");
  265|    506|		n->version = pentaxV1;
  266|    506|	}
  267|       |
  268|       |	/* Read the number of tags */
  269|  1.07k|	c = exif_get_short (buf + datao, n->order);
  270|  1.07k|	datao += 2;
  271|       |
  272|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 102 named tags currently.
  273|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  274|  1.07k|	if (c > 200) {
  ------------------
  |  Branch (274:6): [True: 113, False: 966]
  ------------------
  275|    113|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataPentax", "Too much tags (%d) in Pentax MakerNote", c);
  276|    113|		return;
  277|    113|	}
  278|       |
  279|       |
  280|       |	/* Remove any old entries */
  281|    966|	exif_mnote_data_pentax_clear (n);
  282|       |
  283|       |	/* Reserve enough space for all the possible MakerNote tags */
  284|    966|	n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c);
  285|    966|	if (!n->entries) {
  ------------------
  |  Branch (285:6): [True: 0, False: 966]
  ------------------
  286|      0|		EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteDataPentax", sizeof (MnotePentaxEntry) * c);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  287|      0|		return;
  288|      0|	}
  289|       |
  290|       |	/* Parse all c entries, storing ones that are successfully parsed */
  291|    966|	tcount = 0;
  292|  20.7k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (292:25): [True: 20.6k, False: 19]
  ------------------
  293|  20.6k|		size_t s;
  294|       |
  295|  20.6k|		memset(&n->entries[tcount], 0, sizeof(MnotePentaxEntry));
  296|  20.6k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   33|  20.6k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 303, False: 20.3k]
  |  |  |  Branch (33:81): [True: 0, False: 20.3k]
  |  |  |  Branch (33:112): [True: 434, False: 19.9k]
  |  |  ------------------
  ------------------
  297|    737|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  298|    737|				  "ExifMnoteDataPentax", "Short MakerNote");
  299|    737|			break;
  300|    737|		}
  301|       |
  302|  19.9k|		n->entries[tcount].tag        = exif_get_short (buf + o + 0, n->order) + base;
  303|  19.9k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  304|  19.9k|		n->entries[tcount].components = exif_get_long  (buf + o + 4, n->order);
  305|  19.9k|		n->entries[tcount].order      = n->order;
  306|       |
  307|  19.9k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnotePentax",
  308|  19.9k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  309|  19.9k|			  mnote_pentax_tag_get_name (n->entries[tcount].tag));
  310|       |
  311|       |		/* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  312|       |		 * we will check the buffer sizes closer later. */
  313|  19.9k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (313:8): [True: 10.1k, False: 9.83k]
  ------------------
  314|  10.1k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (314:4): [True: 210, False: 9.91k]
  ------------------
  315|  19.9k|		) {
  316|    210|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  317|    210|				  "ExifMnoteDataPentax", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  318|    210|			break;
  319|    210|		}
  320|       |		/*
  321|       |		 * Size? If bigger than 4 bytes, the actual data is not
  322|       |		 * in the entry but somewhere else (offset).
  323|       |		 */
  324|  19.7k|		s = exif_format_get_size (n->entries[tcount].format) *
  325|  19.7k|                                      n->entries[tcount].components;
  326|  19.7k|		n->entries[tcount].size = s;
  327|  19.7k|		if (s) {
  ------------------
  |  Branch (327:7): [True: 7.85k, False: 11.8k]
  ------------------
  328|  7.85k|			size_t dataofs = o + 8;
  329|  7.85k|			if (s > 4)
  ------------------
  |  Branch (329:8): [True: 2.67k, False: 5.17k]
  ------------------
  330|       |				/* The data in this case is merely a pointer */
  331|  2.67k|			   	dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  332|       |
  333|  7.85k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  7.85k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 488, False: 7.36k]
  |  |  |  Branch (33:81): [True: 0, False: 7.36k]
  |  |  |  Branch (33:112): [True: 241, False: 7.12k]
  |  |  ------------------
  ------------------
  334|    729|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  335|    729|						  "ExifMnoteDataPentax", "Tag data past end "
  336|    729|					  "of buffer (%u > %u)", (unsigned)(dataofs + s), buf_size);
  337|    729|				continue;
  338|    729|			}
  339|       |
  340|  7.12k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  341|  7.12k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (341:8): [True: 0, False: 7.12k]
  ------------------
  342|      0|				EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteDataPentax", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  343|      0|				continue;
  344|      0|			}
  345|  7.12k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  346|  7.12k|		}
  347|       |
  348|       |		/* Tag was successfully parsed */
  349|  19.0k|		++tcount;
  350|  19.0k|	}
  351|       |	/* Store the count of successfully parsed tags */
  352|    966|	n->count = tcount;
  353|    966|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_count:
  357|  1.08k|{
  358|  1.08k|	return n ? ((ExifMnoteDataPentax *) n)->count : 0;
  ------------------
  |  Branch (358:9): [True: 1.08k, False: 0]
  ------------------
  359|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_name:
  373|  13.4k|{
  374|  13.4k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  375|       |
  376|  13.4k|	if (!note) return NULL;
  ------------------
  |  Branch (376:6): [True: 0, False: 13.4k]
  ------------------
  377|  13.4k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (377:6): [True: 0, False: 13.4k]
  ------------------
  378|  13.4k|	return mnote_pentax_tag_get_name (note->entries[n].tag);
  379|  13.4k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_title:
  383|  13.1k|{
  384|  13.1k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  385|       |
  386|  13.1k|	if (!note) return NULL;
  ------------------
  |  Branch (386:6): [True: 0, False: 13.1k]
  ------------------
  387|  13.1k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (387:6): [True: 0, False: 13.1k]
  ------------------
  388|  13.1k|	return mnote_pentax_tag_get_title (note->entries[n].tag);
  389|  13.1k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_description:
  393|  13.1k|{
  394|  13.1k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  395|       |	
  396|  13.1k|	if (!note) return NULL;
  ------------------
  |  Branch (396:6): [True: 0, False: 13.1k]
  ------------------
  397|  13.1k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (397:6): [True: 0, False: 13.1k]
  ------------------
  398|  13.1k|	return mnote_pentax_tag_get_description (note->entries[n].tag);
  399|  13.1k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_value:
   65|  13.1k|{
   66|  13.1k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
   67|       |
   68|  13.1k|	if (!n) return NULL;
  ------------------
  |  Branch (68:6): [True: 0, False: 13.1k]
  ------------------
   69|  13.1k|	if (n->count <= i) return NULL;
  ------------------
  |  Branch (69:6): [True: 0, False: 13.1k]
  ------------------
   70|  13.1k|	return mnote_pentax_entry_get_value (&n->entries[i], val, maxlen);
   71|  13.1k|}

mnote_pentax_entry_get_value:
  312|  13.1k|{
  313|  13.1k|	ExifLong vl;
  314|  13.1k|	ExifSLong vsl;
  315|  13.1k|	ExifShort vs, vs2;
  316|  13.1k|	ExifSShort vss;
  317|  13.1k|	int i = 0, j = 0;
  318|       |
  319|  13.1k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 13.1k]
  ------------------
  320|  13.1k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 13.1k]
  ------------------
  321|       |
  322|  13.1k|	memset (val, 0, maxlen);
  323|  13.1k|	maxlen--;
  324|       |
  325|  13.1k|	switch (entry->tag) {
  326|    576|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 576, False: 12.5k]
  ------------------
  327|    857|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 281, False: 12.8k]
  ------------------
  328|  1.06k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 212, False: 12.8k]
  ------------------
  329|  1.29k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 224, False: 12.8k]
  ------------------
  330|  1.51k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 220, False: 12.8k]
  ------------------
  331|  1.73k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 220, False: 12.8k]
  ------------------
  332|  1.97k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 239, False: 12.8k]
  ------------------
  333|  2.18k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 208, False: 12.8k]
  ------------------
  334|  2.41k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 238, False: 12.8k]
  ------------------
  335|  2.62k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 210, False: 12.8k]
  ------------------
  336|  3.01k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 382, False: 12.7k]
  ------------------
  337|  3.36k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 354, False: 12.7k]
  ------------------
  338|  3.79k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 428, False: 12.6k]
  ------------------
  339|  4.04k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 248, False: 12.8k]
  ------------------
  340|  4.26k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 226, False: 12.8k]
  ------------------
  341|  4.61k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 351, False: 12.7k]
  ------------------
  342|  4.95k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 339, False: 12.7k]
  ------------------
  343|  5.49k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 538, False: 12.5k]
  ------------------
  344|  6.08k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 594, False: 12.5k]
  ------------------
  345|  6.30k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 215, False: 12.8k]
  ------------------
  346|  6.30k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  6.30k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  6.30k|{                                                               \
  |  |   39|  6.30k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 3.15k, False: 3.15k]
  |  |  ------------------
  |  |   40|  3.15k|		snprintf (v, maxlen,	                        \
  |  |   41|  3.15k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  3.15k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  3.15k|			"expected '%s'."),                      \
  |  |   43|  3.15k|			exif_format_get_name (format),          \
  |  |   44|  3.15k|			exif_format_get_name (target));         \
  |  |   45|  3.15k|		break;                                          \
  |  |   46|  3.15k|	}                                                       \
  |  |   47|  6.30k|}
  ------------------
  347|  3.15k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.15k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.15k|{                                                                       \
  |  |   61|  3.15k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.12k, False: 2.02k]
  |  |  |  Branch (61:24): [True: 258, False: 868]
  |  |  ------------------
  |  |   62|    258|		snprintf (v, maxlen,                                    \
  |  |   63|    258|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    258|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    258|			"expected %i or %i)."), (int) number,		\
  |  |   65|    258|			(int) t1, (int) t2);  				\
  |  |   66|    258|		break;                                                  \
  |  |   67|    258|	}                                                               \
  |  |   68|  3.15k|}
  ------------------
  348|  2.89k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 2.02k, False: 868]
  ------------------
  349|  2.02k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  26.4k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 26.4k, False: 0]
  |  Branch (352:33): [True: 24.4k, False: 2.02k]
  ------------------
  353|  2.02k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 2.02k]
  ------------------
  354|      0|				snprintf (val, maxlen,
  355|      0|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  356|      0|			  	break;
  357|      0|			}
  358|       |
  359|       |			/* find the value */
  360|  13.8k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 12.7k, False: 1.09k]
  ------------------
  361|  12.7k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 11.7k, False: 928]
  ------------------
  362|  2.02k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.38k, False: 638]
  ------------------
  363|  1.38k|				snprintf (val, maxlen,
  364|  1.38k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.38k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.38k|				break;
  366|  1.38k|			}
  367|    638|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    638|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|    868|		} else {
  369|       |			/* Two-component values */
  370|    868|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|    868|#define CF(format,target,v,maxlen)                              \
  |  |   38|    868|{                                                               \
  |  |   39|    868|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 868]
  |  |  ------------------
  |  |   40|      0|		snprintf (v, maxlen,	                        \
  |  |   41|      0|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|      0|			"expected '%s'."),                      \
  |  |   43|      0|			exif_format_get_name (format),          \
  |  |   44|      0|			exif_format_get_name (target));         \
  |  |   45|      0|		break;                                          \
  |  |   46|      0|	}                                                       \
  |  |   47|    868|}
  ------------------
  371|    868|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|    868|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    868|{                                                                       \
  |  |   61|    868|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 868, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 868]
  |  |  ------------------
  |  |   62|      0|		snprintf (v, maxlen,                                    \
  |  |   63|      0|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|      0|			"expected %i or %i)."), (int) number,		\
  |  |   65|      0|			(int) t1, (int) t2);  				\
  |  |   66|      0|		break;                                                  \
  |  |   67|      0|	}                                                               \
  |  |   68|    868|}
  ------------------
  372|    868|			vs = exif_get_short (entry->data, entry->order);
  373|    868|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  1.81k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.45k, False: 363]
  |  Branch (376:34): [True: 948, False: 505]
  ------------------
  377|    868|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 363, False: 505]
  ------------------
  378|    363|				snprintf (val, maxlen,
  379|    363|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    363|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    363|			  	break;
  381|    363|			}
  382|       |
  383|       |			/* find the value */
  384|  1.98k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 1.98k, False: 0]
  |  Branch (384:45): [True: 0, False: 1.98k]
  ------------------
  385|  1.98k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.70k, False: 281]
  |  Branch (385:46): [True: 1.48k, False: 224]
  ------------------
  386|    505|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 295, False: 210]
  |  Branch (386:44): [True: 0, False: 210]
  ------------------
  387|    295|				snprintf (val, maxlen,
  388|    295|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    295|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    295|				break;
  390|    295|			}
  391|    210|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    210|		}
  393|    848|		break;
  394|       |
  395|    848|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 846, False: 12.2k]
  ------------------
  396|    846|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    846|#define CF(format,target,v,maxlen)                              \
  |  |   38|    846|{                                                               \
  |  |   39|    846|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 266, False: 580]
  |  |  ------------------
  |  |   40|    266|		snprintf (v, maxlen,	                        \
  |  |   41|    266|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    266|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    266|			"expected '%s'."),                      \
  |  |   43|    266|			exif_format_get_name (format),          \
  |  |   44|    266|			exif_format_get_name (target));         \
  |  |   45|    266|		break;                                          \
  |  |   46|    266|	}                                                       \
  |  |   47|    846|}
  ------------------
  397|    580|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    580|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    580|{                                                                       \
  |  |   51|    580|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 375, False: 205]
  |  |  ------------------
  |  |   52|    375|		snprintf (v, maxlen,                                    \
  |  |   53|    375|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    375|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    375|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    375|		break;                                                  \
  |  |   56|    375|	}                                                               \
  |  |   57|    580|}
  ------------------
  398|    205|		vl = exif_get_long (entry->data, entry->order);
  399|    205|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|    205|		break;
  401|    716|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 716, False: 12.3k]
  ------------------
  402|    716|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    716|#define CF(format,target,v,maxlen)                              \
  |  |   38|    716|{                                                               \
  |  |   39|    716|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 251, False: 465]
  |  |  ------------------
  |  |   40|    251|		snprintf (v, maxlen,	                        \
  |  |   41|    251|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    251|			"expected '%s'."),                      \
  |  |   43|    251|			exif_format_get_name (format),          \
  |  |   44|    251|			exif_format_get_name (target));         \
  |  |   45|    251|		break;                                          \
  |  |   46|    251|	}                                                       \
  |  |   47|    716|}
  ------------------
  403|    465|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    465|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    465|{                                                                       \
  |  |   51|    465|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 216, False: 249]
  |  |  ------------------
  |  |   52|    216|		snprintf (v, maxlen,                                    \
  |  |   53|    216|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    216|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    216|		break;                                                  \
  |  |   56|    216|	}                                                               \
  |  |   57|    465|}
  ------------------
  404|    249|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    249|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|    249|			entry->size);
  406|    249|		break;
  407|    406|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 406, False: 12.6k]
  ------------------
  408|  1.15k|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 747, False: 12.3k]
  ------------------
  409|  1.15k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|  1.15k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.15k|{                                                               \
  |  |   39|  1.15k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 402, False: 751]
  |  |  ------------------
  |  |   40|    402|		snprintf (v, maxlen,	                        \
  |  |   41|    402|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    402|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    402|			"expected '%s'."),                      \
  |  |   43|    402|			exif_format_get_name (format),          \
  |  |   44|    402|			exif_format_get_name (target));         \
  |  |   45|    402|		break;                                          \
  |  |   46|    402|	}                                                       \
  |  |   47|  1.15k|}
  ------------------
  410|    751|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    751|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    751|{                                                                       \
  |  |   51|    751|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 503, False: 248]
  |  |  ------------------
  |  |   52|    503|		snprintf (v, maxlen,                                    \
  |  |   53|    503|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    503|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    503|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    503|		break;                                                  \
  |  |   56|    503|	}                                                               \
  |  |   57|    751|}
  ------------------
  411|    248|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    248|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 248]
  |  |  ------------------
  ------------------
  412|    248|		break;
  413|    521|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 521, False: 12.5k]
  ------------------
  414|    521|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    521|#define CF(format,target,v,maxlen)                              \
  |  |   38|    521|{                                                               \
  |  |   39|    521|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 249, False: 272]
  |  |  ------------------
  |  |   40|    249|		snprintf (v, maxlen,	                        \
  |  |   41|    249|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    249|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    249|			"expected '%s'."),                      \
  |  |   43|    249|			exif_format_get_name (format),          \
  |  |   44|    249|			exif_format_get_name (target));         \
  |  |   45|    249|		break;                                          \
  |  |   46|    249|	}                                                       \
  |  |   47|    521|}
  ------------------
  415|    272|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    272|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    272|{                                                                       \
  |  |   51|    272|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 204, False: 68]
  |  |  ------------------
  |  |   52|    204|		snprintf (v, maxlen,                                    \
  |  |   53|    204|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    204|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    204|		break;                                                  \
  |  |   56|    204|	}                                                               \
  |  |   57|    272|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|     68|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|     68|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|     68|		break;
  420|    650|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 650, False: 12.4k]
  ------------------
  421|    650|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    650|#define CF(format,target,v,maxlen)                              \
  |  |   38|    650|{                                                               \
  |  |   39|    650|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 231, False: 419]
  |  |  ------------------
  |  |   40|    231|		snprintf (v, maxlen,	                        \
  |  |   41|    231|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    231|			"expected '%s'."),                      \
  |  |   43|    231|			exif_format_get_name (format),          \
  |  |   44|    231|			exif_format_get_name (target));         \
  |  |   45|    231|		break;                                          \
  |  |   46|    231|	}                                                       \
  |  |   47|    650|}
  ------------------
  422|    419|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    419|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    419|{                                                                       \
  |  |   61|    419|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 188, False: 231]
  |  |  |  Branch (61:24): [True: 115, False: 73]
  |  |  ------------------
  |  |   62|    115|		snprintf (v, maxlen,                                    \
  |  |   63|    115|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    115|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    115|			"expected %i or %i)."), (int) number,		\
  |  |   65|    115|			(int) t1, (int) t2);  				\
  |  |   66|    115|		break;                                                  \
  |  |   67|    115|	}                                                               \
  |  |   68|    419|}
  ------------------
  423|    304|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    304|		break;
  425|  2.91k|	default:
  ------------------
  |  Branch (425:2): [True: 2.91k, False: 10.1k]
  ------------------
  426|  2.91k|		switch (entry->format) {
  427|    286|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 286, False: 2.63k]
  ------------------
  428|    286|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    286|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 69, False: 217]
  |  |  ------------------
  ------------------
  429|    286|		  break;
  430|    512|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 512, False: 2.40k]
  ------------------
  431|    512|		  {
  432|    512|			const unsigned char *data = entry->data;
  433|    512|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    512|			sizeleft = entry->size;
  436|   100k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 100k, False: 512]
  ------------------
  437|   100k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 100k]
  ------------------
  438|      0|					break;
  439|   100k|				vs = exif_get_short (data, entry->order);
  440|   100k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|   100k|				len = strlen(val);
  442|   100k|				data += 2;
  443|   100k|				sizeleft -= 2;
  444|   100k|			}
  445|    512|		  }
  446|    512|		  break;
  447|    627|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 627, False: 2.28k]
  ------------------
  448|    627|		  {
  449|    627|			const unsigned char *data = entry->data;
  450|    627|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    627|			sizeleft = entry->size;
  453|  44.9k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 44.2k, False: 627]
  ------------------
  454|  44.2k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 44.2k]
  ------------------
  455|      0|					break;
  456|  44.2k|				vss = exif_get_sshort (data, entry->order);
  457|  44.2k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  44.2k|				len = strlen(val);
  459|  44.2k|				data += 2;
  460|  44.2k|				sizeleft -= 2;
  461|  44.2k|			}
  462|    627|		  }
  463|    627|		  break;
  464|    487|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 487, False: 2.42k]
  ------------------
  465|    487|		  {
  466|    487|			const unsigned char *data = entry->data;
  467|    487|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    487|			sizeleft = entry->size;
  470|  46.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 45.8k, False: 487]
  ------------------
  471|  45.8k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 45.8k]
  ------------------
  472|      0|					break;
  473|  45.8k|				vl = exif_get_long (data, entry->order);
  474|  45.8k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  45.8k|				len = strlen(val);
  476|  45.8k|				data += 4;
  477|  45.8k|				sizeleft -= 4;
  478|  45.8k|			}
  479|    487|		  }
  480|    487|		  break;
  481|    485|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 485, False: 2.43k]
  ------------------
  482|    485|		  {
  483|    485|			const unsigned char *data = entry->data;
  484|    485|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    485|			sizeleft = entry->size;
  487|  42.9k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 42.5k, False: 485]
  ------------------
  488|  42.5k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 42.5k]
  ------------------
  489|      0|					break;
  490|  42.5k|				vsl = exif_get_slong (data, entry->order);
  491|  42.5k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  42.5k|				len = strlen(val);
  493|  42.5k|				data += 4;
  494|  42.5k|				sizeleft -= 4;
  495|  42.5k|			}
  496|    485|		  }
  497|    485|		  break;
  498|      8|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 8, False: 2.90k]
  ------------------
  499|    519|		default:
  ------------------
  |  Branch (499:3): [True: 511, False: 2.40k]
  ------------------
  500|    519|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    519|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    519|			  entry->size);
  502|    519|		  break;
  503|  2.91k|		}
  504|  2.91k|		break;
  505|  13.1k|	}
  506|       |
  507|  13.1k|	return val;
  508|  13.1k|}

mnote_pentax_tag_get_name:
  145|  33.4k|{
  146|  33.4k|	unsigned int i;
  147|       |
  148|  1.51M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (148:14): [True: 1.50M, False: 5.44k]
  ------------------
  149|  1.50M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (149:7): [True: 27.9k, False: 1.47M]
  ------------------
  150|  5.44k|	return NULL;
  151|  33.4k|}
mnote_pentax_tag_get_title:
  155|  13.1k|{
  156|  13.1k|	unsigned int i;
  157|       |
  158|  13.1k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  159|   431k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (159:14): [True: 431k, False: 0]
  ------------------
  160|   431k|		if (table[i].tag == t) {
  ------------------
  |  Branch (160:7): [True: 13.1k, False: 418k]
  ------------------
  161|  13.1k|			if (!table[i].title)
  ------------------
  |  Branch (161:8): [True: 0, False: 13.1k]
  ------------------
  162|      0|				return NULL;
  163|  13.1k|			return _(table[i].title);
  ------------------
  |  |   31|  13.1k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  164|  13.1k|		}
  165|      0|	return NULL;
  166|  13.1k|}
mnote_pentax_tag_get_description:
  170|  13.1k|{
  171|  13.1k|	unsigned int i;
  172|       |
  173|   431k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (173:14): [True: 431k, False: 0]
  ------------------
  174|   431k|		if (table[i].tag == t) {
  ------------------
  |  Branch (174:7): [True: 13.1k, False: 418k]
  ------------------
  175|  13.1k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (175:8): [True: 846, False: 12.2k]
  |  Branch (175:33): [True: 12.0k, False: 183]
  ------------------
  176|  12.9k|				return "";
  177|    183|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  178|    183|			return _(table[i].description);
  ------------------
  |  |   31|    183|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  179|  13.1k|		}
  180|      0|	return NULL;
  181|  13.1k|}

