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

exif_mnote_data_canon_identify:
  400|  2.91k|{
  401|  2.91k|	char value[8];
  402|       |
  403|  2.91k|	ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|  2.91k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 802, False: 2.11k]
  |  |  ------------------
  |  |  254|  2.91k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  2.91k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 151, False: 1.96k]
  |  |  ------------------
  |  |  256|  2.11k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  2.11k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 1.96k]
  |  |  ------------------
  |  |  258|  1.96k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  1.96k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 1.96k]
  |  |  ------------------
  |  |  260|  1.96k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  1.96k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 1.96k]
  |  |  ------------------
  |  |  262|  1.96k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  404|  2.91k|	if (!em) 
  ------------------
  |  Branch (404:6): [True: 1.96k, False: 953]
  ------------------
  405|  1.96k|		return 0;
  406|       |
  407|    953|	(void) e;  /* unused */
  408|    953|	return !strcmp (exif_entry_get_value (em, value, sizeof (value)), "Canon");
  409|  2.91k|}
exif_mnote_data_canon_new:
  413|    806|{
  414|    806|	ExifMnoteData *d;
  415|    806|	ExifMnoteDataCanon *dc;
  416|       |
  417|    806|	if (!mem) return NULL;
  ------------------
  |  Branch (417:6): [True: 0, False: 806]
  ------------------
  418|       |
  419|    806|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataCanon));
  420|    806|	if (!d)
  ------------------
  |  Branch (420:6): [True: 0, False: 806]
  ------------------
  421|      0|		return NULL;
  422|       |
  423|    806|	exif_mnote_data_construct (d, mem);
  424|       |
  425|       |	/* Set up function pointers */
  426|    806|	d->methods.free            = exif_mnote_data_canon_free;
  427|    806|	d->methods.set_byte_order  = exif_mnote_data_canon_set_byte_order;
  428|    806|	d->methods.set_offset      = exif_mnote_data_canon_set_offset;
  429|    806|	d->methods.load            = exif_mnote_data_canon_load;
  430|    806|	d->methods.save            = exif_mnote_data_canon_save;
  431|    806|	d->methods.count           = exif_mnote_data_canon_count;
  432|    806|	d->methods.get_id          = exif_mnote_data_canon_get_id;
  433|    806|	d->methods.get_name        = exif_mnote_data_canon_get_name;
  434|    806|	d->methods.get_title       = exif_mnote_data_canon_get_title;
  435|    806|	d->methods.get_description = exif_mnote_data_canon_get_description;
  436|    806|	d->methods.get_value       = exif_mnote_data_canon_get_value;
  437|       |
  438|    806|	dc = (ExifMnoteDataCanon*)d;
  439|    806|	dc->options = o;
  440|    806|	return d;
  441|    806|}
exif-mnote-data-canon.c:exif_mnote_data_canon_free:
   62|    806|{
   63|    806|	if (!n) return;
  ------------------
  |  Branch (63:6): [True: 0, False: 806]
  ------------------
   64|       |
   65|    806|	exif_mnote_data_canon_clear ((ExifMnoteDataCanon *) n);
   66|    806|}
exif-mnote-data-canon.c:exif_mnote_data_canon_clear:
   42|  1.59k|{
   43|  1.59k|	ExifMnoteData *d = (ExifMnoteData *) n;
   44|  1.59k|	unsigned int i;
   45|       |
   46|  1.59k|	if (!n) return;
  ------------------
  |  Branch (46:6): [True: 0, False: 1.59k]
  ------------------
   47|       |
   48|  1.59k|	if (n->entries) {
  ------------------
  |  Branch (48:6): [True: 792, False: 806]
  ------------------
   49|  11.7k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (49:15): [True: 10.9k, False: 792]
  ------------------
   50|  10.9k|			if (n->entries[i].data) {
  ------------------
  |  Branch (50:8): [True: 10.9k, False: 0]
  ------------------
   51|  10.9k|				exif_mem_free (d->mem, n->entries[i].data);
   52|  10.9k|				n->entries[i].data = NULL;
   53|  10.9k|			}
   54|    792|		exif_mem_free (d->mem, n->entries);
   55|       |		n->entries = NULL;
   56|    792|		n->count = 0;
   57|    792|	}
   58|  1.59k|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_byte_order:
  101|    806|{
  102|    806|	ExifByteOrder o_orig;
  103|    806|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) d;
  104|    806|	unsigned int i;
  105|       |
  106|    806|	if (!n) return;
  ------------------
  |  Branch (106:6): [True: 0, False: 806]
  ------------------
  107|       |
  108|    806|	o_orig = n->order;
  109|    806|	n->order = o;
  110|    806|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (110:14): [True: 0, False: 806]
  ------------------
  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|    806|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_offset:
  121|    806|{
  122|    806|	if (n) ((ExifMnoteDataCanon *) n)->offset = o;
  ------------------
  |  Branch (122:6): [True: 806, False: 0]
  ------------------
  123|    806|}
exif-mnote-data-canon.c:exif_mnote_data_canon_load:
  210|    806|{
  211|    806|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
  212|    806|	ExifShort c;
  213|    806|	size_t i, tcount, o, datao;
  214|    806|	long failsafe_size = 0;
  215|       |
  216|    806|	if (!n) return;
  ------------------
  |  Branch (216:6): [True: 0, False: 806]
  ------------------
  217|       |
  218|    806|	if (!buf || !buf_size) {
  ------------------
  |  Branch (218:6): [True: 0, False: 806]
  |  Branch (218:14): [True: 0, False: 806]
  ------------------
  219|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  220|      0|			  "ExifMnoteCanon", "Short MakerNote");
  221|      0|		return;
  222|      0|	}
  223|    806|	if (CHECKOVERFLOW(n->offset, buf_size, 8)) {
  ------------------
  |  |   35|    806|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 0, False: 806]
  |  |  |  Branch (35:81): [True: 0, False: 806]
  |  |  |  Branch (35:112): [True: 0, False: 806]
  |  |  ------------------
  ------------------
  224|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  225|      0|			  "ExifMnoteCanon", "Short MakerNote");
  226|      0|		return;
  227|      0|	}
  228|    806|	datao = 6 + n->offset;
  229|       |
  230|       |	/* Read the number of tags */
  231|    806|	c = exif_get_short (buf + datao, n->order);
  232|    806|	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|    806|	if (c > 250) {
  ------------------
  |  Branch (236:6): [True: 14, False: 792]
  ------------------
  237|     14|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Too much tags (%d) in Canon MakerNote", c);
  238|     14|		return;
  239|     14|	}
  240|       |
  241|       |	/* Remove any old entries */
  242|    792|	exif_mnote_data_canon_clear (n);
  243|       |
  244|       |	/* Reserve enough space for all the possible MakerNote tags */
  245|    792|	n->entries = exif_mem_alloc (ne->mem, sizeof (MnoteCanonEntry) * c);
  246|    792|	if (!n->entries) {
  ------------------
  |  Branch (246:6): [True: 0, False: 792]
  ------------------
  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|    792|	tcount = 0;
  253|  47.4k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (253:25): [True: 47.2k, False: 121]
  ------------------
  254|  47.2k|		size_t s;
  255|       |
  256|  47.2k|		memset(&n->entries[tcount], 0, sizeof(MnoteCanonEntry));
  257|  47.2k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   35|  47.2k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 275, False: 47.0k]
  |  |  |  Branch (35:81): [True: 0, False: 47.0k]
  |  |  |  Branch (35:112): [True: 390, False: 46.6k]
  |  |  ------------------
  ------------------
  258|    665|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  259|    665|				"ExifMnoteCanon", "Short MakerNote");
  260|    665|			break;
  261|    665|		}
  262|       |
  263|  46.6k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  264|  46.6k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  265|  46.6k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  266|  46.6k|		n->entries[tcount].order      = n->order;
  267|       |
  268|  46.6k|		exif_log (ne->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteCanon",
  269|  46.6k|			"Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  270|  46.6k|			 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|  46.6k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (274:8): [True: 16.3k, False: 30.2k]
  ------------------
  275|  16.3k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (275:4): [True: 3.61k, False: 12.7k]
  ------------------
  276|  46.6k|		) {
  277|  3.61k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  278|  3.61k|				  "ExifMnoteCanon", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  279|  3.61k|			continue;
  280|  3.61k|		}
  281|       |
  282|       |		/*
  283|       |		 * Size? If bigger than 4 bytes, the actual data is not
  284|       |		 * in the entry but somewhere else (offset).
  285|       |		 */
  286|  43.0k|		s = exif_format_get_size (n->entries[tcount].format) * 
  287|  43.0k|								  n->entries[tcount].components;
  288|  43.0k|		n->entries[tcount].size = s;
  289|  43.0k|		if (!s) {
  ------------------
  |  Branch (289:7): [True: 30.6k, False: 12.4k]
  ------------------
  290|  30.6k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  291|  30.6k|				  "ExifMnoteCanon",
  292|  30.6k|				  "Invalid zero-length tag size");
  293|  30.6k|			continue;
  294|       |
  295|  30.6k|		} else {
  296|  12.4k|			size_t dataofs = o + 8;
  297|  12.4k|			if (s > 4) dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  ------------------
  |  Branch (297:8): [True: 9.13k, False: 3.27k]
  ------------------
  298|       |
  299|  12.4k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   35|  12.4k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 783, False: 11.6k]
  |  |  |  Branch (35:81): [True: 0, False: 11.6k]
  |  |  |  Branch (35:112): [True: 641, False: 10.9k]
  |  |  ------------------
  ------------------
  300|  1.42k|				exif_log (ne->log, EXIF_LOG_CODE_DEBUG,
  301|  1.42k|					"ExifMnoteCanon",
  302|  1.42k|					"Tag data past end of buffer (%u > %u)",
  303|  1.42k|					(unsigned)(dataofs + s), buf_size);
  304|  1.42k|				continue;
  305|  1.42k|			}
  306|       |
  307|  10.9k|			n->entries[tcount].data = exif_mem_alloc (ne->mem, s);
  308|  10.9k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (308:8): [True: 0, False: 10.9k]
  ------------------
  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|  10.9k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  313|  10.9k|		}
  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|  10.9k|		failsafe_size += mnote_canon_entry_count_values(&n->entries[tcount]);
  322|       |
  323|  10.9k|		if (failsafe_size > FAILSAFE_SIZE_MAX) {
  ------------------
  |  |   38|  10.9k|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  |  Branch (323:7): [True: 6, False: 10.9k]
  ------------------
  324|       |			/* Abort if the total size of the data in the tags extraordinarily large, */
  325|      6|			exif_mem_free (ne->mem, n->entries[tcount].data);
  326|      6|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  327|      6|					  "ExifMnoteCanon", "Failsafe tag size overflow (%lu > %ld)",
  328|      6|					  failsafe_size, FAILSAFE_SIZE_MAX);
  ------------------
  |  |   38|      6|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  329|      6|			break;
  330|      6|		}
  331|       |
  332|       |		/* Tag was successfully parsed */
  333|  10.9k|		++tcount;
  334|  10.9k|	}
  335|       |	/* Store the count of successfully parsed tags */
  336|    792|	n->count = tcount;
  337|    792|}
exif-mnote-data-canon.c:exif_mnote_data_canon_count:
  341|    806|{
  342|    806|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) n;
  343|    806|	unsigned int i, c;
  344|       |
  345|  11.7k|	for (i = c = 0; dc && (i < dc->count); i++)
  ------------------
  |  Branch (345:18): [True: 11.7k, False: 0]
  |  Branch (345:24): [True: 10.9k, False: 806]
  ------------------
  346|  10.9k|		c += mnote_canon_entry_count_values (&dc->entries[i]);
  347|    806|	return c;
  348|    806|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_tags:
   71|  5.94M|{
   72|  5.94M|	unsigned int from = 0, to;
   73|       |
   74|  5.94M|	if (s) *s = 0;
  ------------------
  |  Branch (74:6): [True: 4.46M, False: 1.48M]
  ------------------
   75|       |
   76|  5.94M|	if (!dc || !m) return;
  ------------------
  |  Branch (76:6): [True: 0, False: 5.94M]
  |  Branch (76:13): [True: 0, False: 5.94M]
  ------------------
   77|  94.9M|	for (*m = 0; *m < dc->count; (*m)++) {
  ------------------
  |  Branch (77:15): [True: 94.9M, False: 0]
  ------------------
   78|  94.9M|		to = from + mnote_canon_entry_count_values (&dc->entries[*m]);
   79|  94.9M|		if (to > n) {
  ------------------
  |  Branch (79:7): [True: 5.94M, False: 88.9M]
  ------------------
   80|  5.94M|			if (s) *s = n - from;
  ------------------
  |  Branch (80:8): [True: 4.46M, False: 1.48M]
  ------------------
   81|  5.94M|			break;
   82|  5.94M|		}
   83|  88.9M|		from = to;
   84|  88.9M|	}
   85|  5.94M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_name:
  364|  1.48M|{
  365|  1.48M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  366|  1.48M|	unsigned int m, s;
  367|       |
  368|  1.48M|	if (!dc) return NULL;
  ------------------
  |  Branch (368:6): [True: 0, False: 1.48M]
  ------------------
  369|  1.48M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  370|  1.48M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (370:6): [True: 0, False: 1.48M]
  ------------------
  371|  1.48M|	return mnote_canon_tag_get_name_sub (dc->entries[m].tag, s, dc->options);
  372|  1.48M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_title:
  376|  1.48M|{
  377|  1.48M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  378|  1.48M|	unsigned int m, s;
  379|       |
  380|  1.48M|	if (!dc) return NULL;
  ------------------
  |  Branch (380:6): [True: 0, False: 1.48M]
  ------------------
  381|  1.48M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  382|  1.48M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (382:6): [True: 0, False: 1.48M]
  ------------------
  383|  1.48M|	return mnote_canon_tag_get_title_sub (dc->entries[m].tag, s, dc->options);
  384|  1.48M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_description:
  388|  1.48M|{
  389|  1.48M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  390|  1.48M|	unsigned int m;
  391|       |
  392|  1.48M|	if (!dc) return NULL;
  ------------------
  |  Branch (392:6): [True: 0, False: 1.48M]
  ------------------
  393|  1.48M|	exif_mnote_data_canon_get_tags (dc, i, &m, NULL);
  394|  1.48M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (394:6): [True: 0, False: 1.48M]
  ------------------
  395|  1.48M|	return mnote_canon_tag_get_description (dc->entries[m].tag);
  396|  1.48M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_value:
   89|  1.48M|{
   90|  1.48M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
   91|  1.48M|	unsigned int m, s;
   92|       |
   93|  1.48M|	if (!dc) return NULL;
  ------------------
  |  Branch (93:6): [True: 0, False: 1.48M]
  ------------------
   94|  1.48M|	exif_mnote_data_canon_get_tags (dc, n, &m, &s);
   95|  1.48M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (95:6): [True: 0, False: 1.48M]
  ------------------
   96|  1.48M|	return mnote_canon_entry_get_value (&dc->entries[m], s, val, maxlen);
   97|  1.48M|}

mnote_canon_entry_count_values:
  505|  94.9M|{
  506|  94.9M|	unsigned int  val;
  507|       |
  508|  94.9M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 94.9M]
  ------------------
  509|       |
  510|  94.9M|	switch (entry->tag) {
  511|   161k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 161k, False: 94.7M]
  ------------------
  512|   162k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 733, False: 94.9M]
  ------------------
  513|   162k|		return entry->components;
  514|  3.94M|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 3.94M, False: 91.0M]
  ------------------
  515|  5.31M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.36M, False: 93.5M]
  ------------------
  516|  90.9M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 85.6M, False: 9.26M]
  ------------------
  517|  91.0M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 99.9k, False: 94.8M]
  ------------------
  518|  91.0M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 68.4k, False: 91.0M]
  ------------------
  519|       |
  520|  91.0M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|  91.0M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|  91.0M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 86.4M, False: 4.61M]
  |  |  ------------------
  ------------------
  523|  3.69M|	default:
  ------------------
  |  Branch (523:2): [True: 3.69M, False: 91.2M]
  ------------------
  524|  3.69M|		return 1;
  525|  94.9M|	}
  526|  94.9M|}
mnote_canon_entry_get_value:
  552|  1.48M|{
  553|  1.48M|	char buf[128];
  554|  1.48M|	ExifLong vl;
  555|  1.48M|	ExifSLong vsl;
  556|  1.48M|	ExifShort vs, n;
  557|  1.48M|	ExifSShort vss;
  558|  1.48M|	unsigned char *data;
  559|  1.48M|	size_t	size;
  560|  1.48M|	double d;
  561|       |
  562|  1.48M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.48M]
  ------------------
  563|      0|		return NULL;
  564|  1.48M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.48M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.48M|	data = entry->data;
  568|  1.48M|	size = entry->size;
  569|       |
  570|  1.48M|	memset (val, 0, maxlen);
  571|  1.48M|	maxlen--;
  572|       |
  573|  1.48M|	switch (entry->tag) {
  574|  3.32k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 3.32k, False: 1.48M]
  ------------------
  575|  3.32k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.32k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.32k|{                                                               \
  |  |   38|  3.32k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.32k]
  |  |  ------------------
  |  |   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|  3.32k|}
  ------------------
  576|       |
  577|  3.32k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 3.32k]
  ------------------
  578|  3.32k|		n = exif_get_short (data, entry->order) / 2;
  579|  3.32k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 3.32k]
  ------------------
  580|       |
  581|  3.32k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.32k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.32k|{                                                                       \
  |  |   50|  3.32k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 390, False: 2.93k]
  |  |  ------------------
  |  |   51|    390|                snprintf (v, maxlen,                                    \
  |  |   52|    390|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    390|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    390|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    390|                break;                                                  \
  |  |   55|    390|        }                                                               \
  |  |   56|  3.32k|}
  ------------------
  582|       |
  583|  2.93k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.93k]
  ------------------
  584|  2.93k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.93k|		switch (t) {
  586|    599|		case 1:
  ------------------
  |  Branch (586:3): [True: 599, False: 2.33k]
  ------------------
  587|    599|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 213, False: 386]
  ------------------
  588|    213|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    213|				break;
  590|    213|			}
  591|    386|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    386|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    386|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.93k]
  ------------------
  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.93k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.93k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.93k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.93k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.93k]
  ------------------
  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.93k]
  ------------------
  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.93k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.93k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.93k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  2.33k|		default:
  ------------------
  |  Branch (621:3): [True: 2.33k, False: 599]
  ------------------
  622|  2.33k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.93k|		}
  624|  2.93k|		break;
  625|       |
  626|  2.93k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.33k, False: 1.48M]
  ------------------
  627|  1.33k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.33k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.33k|{                                                               \
  |  |   38|  1.33k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 298, False: 1.04k]
  |  |  ------------------
  |  |   39|    298|                snprintf (v, maxlen,                            \
  |  |   40|    298|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    298|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    298|                        "expected '%s'."),                      \
  |  |   42|    298|                        exif_format_get_name (format),          \
  |  |   43|    298|                        exif_format_get_name (target));         \
  |  |   44|    298|                break;                                          \
  |  |   45|    298|        }                                                       \
  |  |   46|  1.33k|}
  ------------------
  628|  1.04k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.04k]
  ------------------
  629|  1.04k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.04k|		switch (t) {
  631|    260|		case 1:
  ------------------
  |  Branch (631:3): [True: 260, False: 780]
  ------------------
  632|    260|			snprintf (val, maxlen, "%u", vs);
  633|    260|			break;
  634|    254|		case 2:
  ------------------
  |  Branch (634:3): [True: 254, False: 786]
  ------------------
  635|    506|		case 3:
  ------------------
  |  Branch (635:3): [True: 252, False: 788]
  ------------------
  636|    506|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    506|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    506|			break;
  638|    274|		default:
  ------------------
  |  Branch (638:3): [True: 274, False: 766]
  ------------------
  639|    274|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.04k|		}
  641|  1.04k|		break;
  642|       |
  643|  8.66k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 8.66k, False: 1.47M]
  ------------------
  644|  8.66k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  8.66k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  8.66k|{                                                               \
  |  |   38|  8.66k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 8.66k]
  |  |  ------------------
  |  |   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|  8.66k|}
  ------------------
  645|  8.66k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 8.66k]
  ------------------
  646|  8.66k|		n = exif_get_short (data, entry->order) / 2;
  647|  8.66k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 8.66k]
  ------------------
  648|  8.66k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  8.66k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  8.66k|{                                                                       \
  |  |   50|  8.66k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.71k, False: 6.94k]
  |  |  ------------------
  |  |   51|  1.71k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.71k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.71k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.71k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.71k|                break;                                                  \
  |  |   55|  1.71k|        }                                                               \
  |  |   56|  8.66k|}
  ------------------
  649|  6.94k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 6.94k]
  ------------------
  650|  6.94k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  6.94k|		switch (t) {
  652|    804|		case 0:
  ------------------
  |  Branch (652:3): [True: 804, False: 6.14k]
  ------------------
  653|    804|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    804|			break;
  655|    804|		case 1:
  ------------------
  |  Branch (655:3): [True: 804, False: 6.14k]
  ------------------
  656|    804|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    804|			break;
  658|    804|		case 2:
  ------------------
  |  Branch (658:3): [True: 804, False: 6.14k]
  ------------------
  659|  1.53k|		case 5:
  ------------------
  |  Branch (659:3): [True: 731, False: 6.21k]
  ------------------
  660|  1.53k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 6.94k]
  ------------------
  661|  1.53k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 6.94k]
  ------------------
  662|  1.53k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.53k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.53k|			break;
  664|    804|		case 3:
  ------------------
  |  Branch (664:3): [True: 804, False: 6.14k]
  ------------------
  665|    804|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 6.94k]
  ------------------
  666|    804|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    804|			break;
  668|    804|		case 4:
  ------------------
  |  Branch (668:3): [True: 804, False: 6.14k]
  ------------------
  669|    804|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 6.94k]
  ------------------
  670|    804|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    804|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 330, False: 474]
  ------------------
  672|    330|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    330|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    474|			else
  674|    474|				snprintf (val, maxlen, "%.0f", d);
  675|    804|			break;
  676|    730|		case 8:
  ------------------
  |  Branch (676:3): [True: 730, False: 6.21k]
  ------------------
  677|    730|			snprintf (val, maxlen, "%u", vss);
  678|    730|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 6.94k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 6.94k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 6.94k]
  ------------------
  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: 6.94k]
  ------------------
  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.46k|		default:
  ------------------
  |  Branch (693:3): [True: 1.46k, False: 5.48k]
  ------------------
  694|  1.46k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  6.94k|		}
  696|  6.94k|		break;
  697|       |
  698|  6.94k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.48M]
  ------------------
  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|    535|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 535, False: 1.48M]
  ------------------
  706|    535|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    535|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    535|{                                                                       \
  |  |   50|    535|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 84, False: 451]
  |  |  ------------------
  |  |   51|     84|                snprintf (v, maxlen,                                    \
  |  |   52|     84|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     84|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|     84|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|     84|                break;                                                  \
  |  |   55|     84|        }                                                               \
  |  |   56|    535|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    805|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 354, False: 1.48M]
  ------------------
  710|    805|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    805|#define CF(format,target,v,maxlen)                              \
  |  |   37|    805|{                                                               \
  |  |   38|    805|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 324, False: 481]
  |  |  ------------------
  |  |   39|    324|                snprintf (v, maxlen,                            \
  |  |   40|    324|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    324|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    324|                        "expected '%s'."),                      \
  |  |   42|    324|                        exif_format_get_name (format),          \
  |  |   43|    324|                        exif_format_get_name (target));         \
  |  |   44|    324|                break;                                          \
  |  |   45|    324|        }                                                       \
  |  |   46|    805|}
  ------------------
  711|    481|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    481|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 215, False: 266]
  |  |  ------------------
  ------------------
  712|    481|		break;
  713|       |
  714|    588|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 588, False: 1.48M]
  ------------------
  715|    588|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    588|#define CF(format,target,v,maxlen)                              \
  |  |   37|    588|{                                                               \
  |  |   38|    588|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 236, False: 352]
  |  |  ------------------
  |  |   39|    236|                snprintf (v, maxlen,                            \
  |  |   40|    236|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    236|                        "expected '%s'."),                      \
  |  |   42|    236|                        exif_format_get_name (format),          \
  |  |   43|    236|                        exif_format_get_name (target));         \
  |  |   44|    236|                break;                                          \
  |  |   45|    236|        }                                                       \
  |  |   46|    588|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    352|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    352|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 71, False: 281]
  |  |  ------------------
  ------------------
  718|    352|		break;
  719|       |
  720|    798|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 798, False: 1.48M]
  ------------------
  721|    798|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    798|#define CF(format,target,v,maxlen)                              \
  |  |   37|    798|{                                                               \
  |  |   38|    798|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 261, False: 537]
  |  |  ------------------
  |  |   39|    261|                snprintf (v, maxlen,                            \
  |  |   40|    261|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    261|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    261|                        "expected '%s'."),                      \
  |  |   42|    261|                        exif_format_get_name (format),          \
  |  |   43|    261|                        exif_format_get_name (target));         \
  |  |   44|    261|                break;                                          \
  |  |   45|    261|        }                                                       \
  |  |   46|    798|}
  ------------------
  722|    537|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    537|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    537|{                                                                       \
  |  |   50|    537|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 312, False: 225]
  |  |  ------------------
  |  |   51|    312|                snprintf (v, maxlen,                                    \
  |  |   52|    312|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    312|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    312|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    312|                break;                                                  \
  |  |   55|    312|        }                                                               \
  |  |   56|    537|}
  ------------------
  723|    225|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 225]
  ------------------
  724|    225|		vl = exif_get_long (data, entry->order);
  725|    225|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    225|				(unsigned long) vl/10000,
  727|    225|				(unsigned long) vl%10000);
  728|    225|		break;
  729|       |
  730|    622|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 622, False: 1.48M]
  ------------------
  731|    622|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    622|#define CF(format,target,v,maxlen)                              \
  |  |   37|    622|{                                                               \
  |  |   38|    622|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 253, False: 369]
  |  |  ------------------
  |  |   39|    253|                snprintf (v, maxlen,                            \
  |  |   40|    253|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    253|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    253|                        "expected '%s'."),                      \
  |  |   42|    253|                        exif_format_get_name (format),          \
  |  |   43|    253|                        exif_format_get_name (target));         \
  |  |   44|    253|                break;                                          \
  |  |   45|    253|        }                                                       \
  |  |   46|    622|}
  ------------------
  732|    369|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    369|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    369|{                                                                       \
  |  |   50|    369|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 277, False: 92]
  |  |  ------------------
  |  |   51|    277|                snprintf (v, maxlen,                                    \
  |  |   52|    277|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    277|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    277|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    277|                break;                                                  \
  |  |   55|    277|        }                                                               \
  |  |   56|    369|}
  ------------------
  733|     92|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 92]
  ------------------
  734|     92|		vl = exif_get_long (data, entry->order);
  735|     92|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|     92|		break;
  737|       |
  738|  1.46M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.46M, False: 21.3k]
  ------------------
  739|  1.46M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.46M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.46M|{                                                               \
  |  |   38|  1.46M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.46M]
  |  |  ------------------
  |  |   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.46M|}
  ------------------
  740|  1.46M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.46M]
  ------------------
  741|  1.46M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.46M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.46M]
  ------------------
  743|  1.46M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.46M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.46M|{                                                                       \
  |  |   50|  1.46M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.45M, False: 10.2k]
  |  |  ------------------
  |  |   51|  1.45M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.45M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.45M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.45M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.45M|                break;                                                  \
  |  |   55|  1.45M|        }                                                               \
  |  |   56|  1.46M|}
  ------------------
  744|  10.2k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 10.2k]
  ------------------
  745|  10.2k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  10.2k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  10.2k|		strncat (val, buf, maxlen - strlen (val));
  748|  10.2k|		break;
  749|       |
  750|  2.91k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.91k, False: 1.48M]
  ------------------
  751|  2.91k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.91k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.91k|{                                                               \
  |  |   38|  2.91k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.91k]
  |  |  ------------------
  |  |   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.91k|}
  ------------------
  752|  2.91k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.91k]
  ------------------
  753|  2.91k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.91k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.91k]
  ------------------
  755|  2.91k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.91k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.91k|{                                                                       \
  |  |   50|  2.91k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 738, False: 2.17k]
  |  |  ------------------
  |  |   51|    738|                snprintf (v, maxlen,                                    \
  |  |   52|    738|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    738|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    738|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    738|                break;                                                  \
  |  |   55|    738|        }                                                               \
  |  |   56|  2.91k|}
  ------------------
  756|  2.17k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 2.17k]
  ------------------
  757|  2.17k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  2.17k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  2.17k|		break;
  760|       |
  761|  2.20k|	default:
  ------------------
  |  Branch (761:2): [True: 2.20k, False: 1.48M]
  ------------------
  762|  2.20k|		switch (entry->format) {
  763|    209|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 209, False: 1.99k]
  ------------------
  764|    209|		  {
  765|    209|			size_t i, len = strlen(val);
  766|  67.6k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 67.4k, False: 209]
  ------------------
  767|  67.4k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 67.4k]
  ------------------
  768|      0|					break;
  769|  67.4k|				vs = exif_get_short (data, entry->order);
  770|  67.4k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  67.4k|				len = strlen(val);
  772|  67.4k|				data += 2;
  773|  67.4k|				size -= 2;
  774|  67.4k|			}
  775|    209|		  }
  776|    209|		  break;
  777|    265|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 265, False: 1.93k]
  ------------------
  778|    265|		  {
  779|    265|			size_t i, len = strlen(val);
  780|  52.5k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 52.2k, False: 265]
  ------------------
  781|  52.2k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 52.2k]
  ------------------
  782|      0|					break;
  783|  52.2k|				vss = exif_get_sshort (data, entry->order);
  784|  52.2k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  52.2k|				data += 2;
  786|  52.2k|				size -= 2;
  787|  52.2k|			}
  788|    265|		  }
  789|    265|		  break;
  790|    327|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 327, False: 1.87k]
  ------------------
  791|    327|		  {
  792|    327|			size_t i, len = strlen(val);
  793|  35.8k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 35.5k, False: 327]
  ------------------
  794|  35.5k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 35.5k]
  ------------------
  795|      0|					break;
  796|  35.5k|				vl = exif_get_long (data, entry->order);
  797|  35.5k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  35.5k|				data += 4;
  799|  35.5k|				size -= 4;
  800|  35.5k|			}
  801|    327|		  }
  802|    327|		  break;
  803|    459|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 459, False: 1.74k]
  ------------------
  804|    459|		  {
  805|    459|			size_t i, len = strlen(val);
  806|  32.7k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 32.3k, False: 459]
  ------------------
  807|  32.3k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 32.3k]
  ------------------
  808|      0|					break;
  809|  32.3k|				vsl = exif_get_slong (data, entry->order);
  810|  32.3k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  32.3k|				data += 4;
  812|  32.3k|				size -= 4;
  813|  32.3k|			}
  814|    459|		  }
  815|    459|		  break;
  816|    707|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 707, False: 1.49k]
  ------------------
  817|    707|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    707|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 101, False: 606]
  |  |  ------------------
  ------------------
  818|    707|			break;
  819|    233|		default:
  ------------------
  |  Branch (819:3): [True: 233, False: 1.96k]
  ------------------
  820|    233|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    233|			  entry->size);
  822|    233|		  break;
  823|  2.20k|		}
  824|  2.20k|		break;
  825|  1.48M|	}
  826|  1.48M|	return val;
  827|  1.48M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  6.24k|{
  445|  6.24k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  92.5k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 91.6k, False: 877]
  |  Branch (448:32): [True: 64.8k, False: 26.8k]
  ------------------
  449|  87.6k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 23.5k, False: 3.35k]
  |  Branch (449:31): [True: 22.8k, False: 673]
  ------------------
  450|  87.6k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 22.8k, False: 64.8k]
  |  Branch (450:33): [True: 1.34k, False: 21.5k]
  ------------------
  451|  1.34k|			break;
  452|  1.34k|		}
  453|  87.6k|	}
  454|  6.24k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.28k, False: 3.95k]
  |  Branch (454:32): [True: 1.34k, False: 943]
  |  Branch (454:58): [True: 1.34k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.34k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.34k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.90k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.90k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.90k|	}
  461|  6.24k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    804|{
  535|    804|	return pow (2, x / 2.);
  536|    804|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    804|{
  547|    804|	return 3.125 * pow (2, x);
  548|    804|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    804|{
  541|    804|	return 1.0 / pow (2, x);
  542|    804|}

mnote_canon_tag_get_name:
  212|  1.51M|{
  213|  1.51M|	unsigned int i;
  214|       |
  215|  21.5M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (215:14): [True: 21.5M, False: 22.4k]
  ------------------
  216|  21.5M|		if (table[i].tag == t) return table[i].name; /* do not translate */
  ------------------
  |  Branch (216:7): [True: 1.49M, False: 20.0M]
  ------------------
  217|  22.4k|	return NULL;
  218|  1.51M|}
mnote_canon_tag_get_name_sub:
  222|  1.48M|{
  223|  1.48M|	unsigned int i;
  224|  1.48M|	int tag_found = 0;
  225|       |
  226|   127M|	for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
  ------------------
  |  Branch (226:14): [True: 125M, False: 1.47M]
  ------------------
  227|   125M|		if (table_sub[i].tag == t) {
  ------------------
  |  Branch (227:7): [True: 76.4k, False: 125M]
  ------------------
  228|  76.4k|			if (table_sub[i].subtag == s)
  ------------------
  |  Branch (228:8): [True: 16.2k, False: 60.2k]
  ------------------
  229|  16.2k|				return table_sub[i].name;
  230|  60.2k|			tag_found = 1;
  231|  60.2k|		}
  232|   125M|	}
  233|  1.47M|	if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
  ------------------
  |  Branch (233:6): [True: 1.47M, False: 73]
  |  Branch (233:20): [True: 0, False: 73]
  ------------------
  234|  1.47M|		return mnote_canon_tag_get_name (t);
  235|     73|	else
  236|     73|		return NULL;
  237|  1.47M|}
mnote_canon_tag_get_title:
  241|  1.47M|{
  242|  1.47M|	unsigned int i;
  243|       |
  244|  1.47M|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  245|  19.1M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (245:14): [True: 19.1M, False: 0]
  ------------------
  246|  19.1M|		if (table[i].tag == t) {
  ------------------
  |  Branch (246:7): [True: 1.47M, False: 17.6M]
  ------------------
  247|  1.47M|			if (!table[i].title)
  ------------------
  |  Branch (247:8): [True: 0, False: 1.47M]
  ------------------
  248|      0|				return NULL;
  249|  1.47M|			return _(table[i].title);
  ------------------
  |  |   31|  1.47M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.47M|		}
  251|      0|	return NULL;
  252|  1.47M|}
mnote_canon_tag_get_title_sub:
  256|  1.48M|{
  257|  1.48M|	unsigned int i;
  258|  1.48M|	int tag_found = 0;
  259|       |
  260|   127M|	for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
  ------------------
  |  Branch (260:14): [True: 125M, False: 1.47M]
  ------------------
  261|   125M|		if (table_sub[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 75.4k, False: 125M]
  ------------------
  262|  75.4k|			if (table_sub[i].subtag == s) {
  ------------------
  |  Branch (262:8): [True: 16.2k, False: 59.2k]
  ------------------
  263|  16.2k|				if (!table_sub[i].name)
  ------------------
  |  Branch (263:9): [True: 0, False: 16.2k]
  ------------------
  264|      0|					return NULL;
  265|  16.2k|				return _(table_sub[i].name);
  ------------------
  |  |   31|  16.2k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  16.2k|			}
  267|  59.2k|			tag_found = 1;
  268|  59.2k|		}
  269|   125M|	}
  270|  1.47M|	if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
  ------------------
  |  Branch (270:6): [True: 1.47M, False: 0]
  |  Branch (270:20): [True: 0, False: 0]
  ------------------
  271|  1.47M|		return mnote_canon_tag_get_title (t);
  272|      0|	else
  273|      0|		return NULL;
  274|  1.47M|}
mnote_canon_tag_get_description:
  278|  1.48M|{
  279|  1.48M|	unsigned int i;
  280|       |
  281|  19.1M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (281:14): [True: 19.1M, False: 0]
  ------------------
  282|  19.1M|		if (table[i].tag == t) {
  ------------------
  |  Branch (282:7): [True: 1.48M, False: 17.6M]
  ------------------
  283|  1.48M|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (283:8): [True: 0, False: 1.48M]
  |  Branch (283:33): [True: 1.48M, False: 0]
  ------------------
  284|  1.48M|				return "";
  285|      0|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  286|      0|			return _(table[i].description);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  287|  1.48M|		}
  288|      0|	return NULL;
  289|  1.48M|}

exif_content_new_mem:
   57|  47.1k|{
   58|  47.1k|	ExifContent *content;
   59|       |
   60|  47.1k|	if (!mem) return NULL;
  ------------------
  |  Branch (60:6): [True: 0, False: 47.1k]
  ------------------
   61|       |
   62|  47.1k|	content = exif_mem_alloc (mem, (ExifLong) sizeof (ExifContent));
   63|  47.1k|	if (!content)
  ------------------
  |  Branch (63:6): [True: 0, False: 47.1k]
  ------------------
   64|      0|		return NULL;
   65|  47.1k|	content->priv = exif_mem_alloc (mem,
   66|  47.1k|				(ExifLong) sizeof (ExifContentPrivate));
   67|  47.1k|	if (!content->priv) {
  ------------------
  |  Branch (67:6): [True: 0, False: 47.1k]
  ------------------
   68|      0|		exif_mem_free (mem, content);
   69|      0|		return NULL;
   70|      0|	}
   71|       |
   72|  47.1k|	content->priv->ref_count = 1;
   73|       |
   74|  47.1k|	content->priv->mem = mem;
   75|  47.1k|	exif_mem_ref (mem);
   76|       |
   77|  47.1k|	return content;
   78|  47.1k|}
exif_content_unref:
   91|  47.1k|{
   92|  47.1k|	if (!content)
  ------------------
  |  Branch (92:6): [True: 0, False: 47.1k]
  ------------------
   93|      0|		return;
   94|       |
   95|  47.1k|	content->priv->ref_count--;
   96|  47.1k|	if (!content->priv->ref_count)
  ------------------
  |  Branch (96:6): [True: 47.1k, False: 0]
  ------------------
   97|  47.1k|		exif_content_free (content);
   98|  47.1k|}
exif_content_free:
  102|  47.1k|{
  103|  47.1k|	ExifMem *mem = (content && content->priv) ? content->priv->mem : NULL;
  ------------------
  |  Branch (103:18): [True: 47.1k, False: 0]
  |  Branch (103:29): [True: 47.1k, False: 0]
  ------------------
  104|  47.1k|	unsigned int i;
  105|       |
  106|  47.1k|	if (!content) return;
  ------------------
  |  Branch (106:6): [True: 0, False: 47.1k]
  ------------------
  107|       |
  108|   117k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (108:14): [True: 70.3k, False: 47.1k]
  ------------------
  109|  70.3k|		exif_entry_unref (content->entries[i]);
  110|  47.1k|	exif_mem_free (mem, content->entries);
  111|       |
  112|  47.1k|	if (content->priv) {
  ------------------
  |  Branch (112:6): [True: 47.1k, False: 0]
  ------------------
  113|  47.1k|		exif_log_unref (content->priv->log);
  114|  47.1k|	}
  115|       |
  116|  47.1k|	exif_mem_free (mem, content->priv);
  117|  47.1k|	exif_mem_free (mem, content);
  118|  47.1k|	exif_mem_unref (mem);
  119|  47.1k|}
exif_content_add_entry:
  142|  81.5k|{
  143|  81.5k|	ExifEntry **entries;
  144|  81.5k|	unsigned int s;
  145|  81.5k|	if (!c || !c->priv || !entry || entry->parent) return;
  ------------------
  |  Branch (145:6): [True: 0, False: 81.5k]
  |  Branch (145:12): [True: 0, False: 81.5k]
  |  Branch (145:24): [True: 0, False: 81.5k]
  |  Branch (145:34): [True: 0, False: 81.5k]
  ------------------
  146|       |
  147|       |	/* One tag can only be added once to an IFD. */
  148|  81.5k|	if (exif_content_get_entry (c, entry->tag)) {
  ------------------
  |  Branch (148:6): [True: 9.57k, False: 71.9k]
  ------------------
  149|  9.57k|		exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "ExifContent",
  150|  9.57k|			"An attempt has been made to add "
  151|  9.57k|			"the tag '%s' twice to an IFD. This is against "
  152|  9.57k|			"specification.", exif_tag_get_name (entry->tag));
  153|  9.57k|		return;
  154|  9.57k|	}
  155|       |
  156|  71.9k|	s = sizeof (ExifEntry*) * (c->count + 1);
  157|  71.9k|	entries = exif_mem_realloc (c->priv->mem, c->entries, s);
  158|  71.9k|	if (!entries) {
  ------------------
  |  Branch (158:6): [True: 0, False: 71.9k]
  ------------------
  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|  71.9k|	entry->parent = c;
  163|  71.9k|	entries[c->count++] = entry;
  164|  71.9k|	c->entries = entries;
  165|  71.9k|	exif_entry_ref (entry);
  166|  71.9k|}
exif_content_remove_entry:
  170|  1.62k|{
  171|  1.62k|	unsigned int i;
  172|  1.62k|	ExifEntry **t, *temp;
  173|       |
  174|  1.62k|	if (!c || !c->priv || !e || (e->parent != c)) return;
  ------------------
  |  Branch (174:6): [True: 0, False: 1.62k]
  |  Branch (174:12): [True: 0, False: 1.62k]
  |  Branch (174:24): [True: 0, False: 1.62k]
  |  Branch (174:30): [True: 0, False: 1.62k]
  ------------------
  175|       |
  176|       |	/* Search the entry */
  177|  8.36k|	for (i = 0; i < c->count; i++)
  ------------------
  |  Branch (177:14): [True: 8.36k, False: 0]
  ------------------
  178|  8.36k|			if (c->entries[i] == e)
  ------------------
  |  Branch (178:8): [True: 1.62k, False: 6.73k]
  ------------------
  179|  1.62k|					break;
  180|       |
  181|  1.62k|	if (i == c->count)
  ------------------
  |  Branch (181:6): [True: 0, False: 1.62k]
  ------------------
  182|      0|			return;
  183|       |
  184|       |	/* Remove the entry */
  185|  1.62k|	temp = c->entries[c->count-1];
  186|  1.62k|	if (c->count > 1) {
  ------------------
  |  Branch (186:6): [True: 1.04k, False: 581]
  ------------------
  187|  1.04k|		const unsigned int s = sizeof(ExifEntry*) * (c->count - 1);
  188|  1.04k|		t = exif_mem_realloc (c->priv->mem, c->entries, s);
  189|  1.04k|		if (!t) {
  ------------------
  |  Branch (189:7): [True: 0, False: 1.04k]
  ------------------
  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|  1.04k|		c->entries = t;
  194|  1.04k|		c->count--;
  195|  1.04k|		if (i != c->count) { /* we deallocated the last slot already */ 
  ------------------
  |  Branch (195:7): [True: 0, False: 1.04k]
  ------------------
  196|      0|			memmove (&t[i], &t[i + 1], sizeof (ExifEntry*) * (c->count - i - 1));
  197|      0|			t[c->count-1] = temp;
  198|      0|		} 
  199|  1.04k|	} else {
  200|    581|		exif_mem_free (c->priv->mem, c->entries);
  201|    581|		c->entries = NULL;
  202|    581|		c->count = 0;
  203|    581|	}
  204|  1.62k|	e->parent = NULL;
  205|  1.62k|	exif_entry_unref (e);
  206|  1.62k|}
exif_content_get_entry:
  210|   172k|{
  211|   172k|	unsigned int i;
  212|       |
  213|   172k|	if (!content)
  ------------------
  |  Branch (213:6): [True: 0, False: 172k]
  ------------------
  214|      0|		return (NULL);
  215|       |
  216|   497k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (216:14): [True: 350k, False: 147k]
  ------------------
  217|   350k|		if (content->entries[i]->tag == tag)
  ------------------
  |  Branch (217:7): [True: 25.6k, False: 324k]
  ------------------
  218|  25.6k|			return (content->entries[i]);
  219|   147k|	return (NULL);
  220|   172k|}
exif_content_foreach_entry:
  225|   107k|{
  226|   107k|	unsigned int i;
  227|       |
  228|   107k|	if (!content || !func)
  ------------------
  |  Branch (228:6): [True: 0, False: 107k]
  |  Branch (228:18): [True: 0, False: 107k]
  ------------------
  229|      0|		return;
  230|       |
  231|   220k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (231:14): [True: 112k, False: 107k]
  ------------------
  232|   112k|		func (content->entries[i], data);
  233|   107k|}
exif_content_log:
  237|  47.1k|{
  238|  47.1k|	if (!content || !content->priv || !log || content->priv->log == log)
  ------------------
  |  Branch (238:6): [True: 0, False: 47.1k]
  |  Branch (238:18): [True: 0, False: 47.1k]
  |  Branch (238:36): [True: 47.1k, False: 0]
  |  Branch (238:44): [True: 0, False: 0]
  ------------------
  239|  47.1k|		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|   135k|{
  249|   135k|	if (!c || !c->parent) return EXIF_IFD_COUNT;
  ------------------
  |  Branch (249:6): [True: 0, False: 135k]
  |  Branch (249:12): [True: 0, False: 135k]
  ------------------
  250|       |
  251|   135k|	return 
  252|   135k|		((c)->parent->ifd[EXIF_IFD_EXIF] == (c)) ? EXIF_IFD_EXIF :
  ------------------
  |  Branch (252:3): [True: 50.2k, False: 85.0k]
  ------------------
  253|   135k|		((c)->parent->ifd[EXIF_IFD_0] == (c)) ? EXIF_IFD_0 :
  ------------------
  |  Branch (253:3): [True: 40.7k, False: 44.2k]
  ------------------
  254|  85.0k|		((c)->parent->ifd[EXIF_IFD_1] == (c)) ? EXIF_IFD_1 :
  ------------------
  |  Branch (254:3): [True: 9.60k, False: 34.6k]
  ------------------
  255|  44.2k|		((c)->parent->ifd[EXIF_IFD_GPS] == (c)) ? EXIF_IFD_GPS :
  ------------------
  |  Branch (255:3): [True: 18.0k, False: 16.5k]
  ------------------
  256|  34.6k|		((c)->parent->ifd[EXIF_IFD_INTEROPERABILITY] == (c)) ? EXIF_IFD_INTEROPERABILITY :
  ------------------
  |  Branch (256:3): [True: 16.5k, False: 0]
  ------------------
  257|  16.5k|		EXIF_IFD_COUNT;
  258|   135k|}
exif_content_fix:
  292|  30.3k|{
  293|  30.3k|	ExifIfd ifd = exif_content_get_ifd (c);
  294|  30.3k|	ExifDataType dt;
  295|  30.3k|	ExifEntry *e;
  296|  30.3k|	unsigned int i, num;
  297|       |
  298|  30.3k|	if (!c)
  ------------------
  |  Branch (298:6): [True: 0, False: 30.3k]
  ------------------
  299|      0|		return;
  300|       |
  301|  30.3k|	dt = exif_data_get_data_type (c->parent);
  302|       |
  303|       |	/*
  304|       |	 * First of all, fix all existing entries.
  305|       |	 */
  306|  30.3k|	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|  30.3k|	do {
  316|  30.3k|		num = c->count;
  317|  30.3k|		exif_content_foreach_entry (c, remove_not_recorded, NULL);
  318|  30.3k|	} while (num != c->count);
  ------------------
  |  Branch (318:11): [True: 0, False: 30.3k]
  ------------------
  319|       |
  320|       |	/*
  321|       |	 * Then check for non-existing mandatory tags and create them if needed
  322|       |	 */
  323|  30.3k|	num = exif_tag_table_count();
  324|  5.16M|	for (i = 0; i < num; ++i) {
  ------------------
  |  Branch (324:14): [True: 5.13M, False: 30.3k]
  ------------------
  325|  5.13M|		const ExifTag t = exif_tag_table_get_tag (i);
  326|  5.13M|		if (exif_tag_get_support_level_in_ifd (t, ifd, dt) ==
  ------------------
  |  Branch (326:7): [True: 46.0k, False: 5.08M]
  ------------------
  327|  5.13M|			EXIF_SUPPORT_LEVEL_MANDATORY) {
  328|  46.0k|			if (exif_content_get_entry (c, t))
  ------------------
  |  Branch (328:8): [True: 672, False: 45.3k]
  ------------------
  329|       |				/* This tag already exists */
  330|    672|				continue;
  331|  45.3k|			exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "exif-content",
  332|  45.3k|					"Tag '%s' is mandatory in IFD '%s' and has therefore been added.",
  333|  45.3k|					exif_tag_get_name_in_ifd (t, ifd), exif_ifd_get_name (ifd));
  334|  45.3k|			e = exif_entry_new ();
  335|  45.3k|			exif_content_add_entry (c, e);
  336|  45.3k|			exif_entry_initialize (e, t);
  337|  45.3k|			exif_entry_unref (e);
  338|  45.3k|		}
  339|  5.13M|	}
  340|  30.3k|}
exif-content.c:fix_func:
  262|  20.9k|{
  263|  20.9k|	exif_entry_fix (e);
  264|  20.9k|}
exif-content.c:remove_not_recorded:
  274|  20.9k|{
  275|  20.9k|	ExifIfd ifd = exif_entry_get_ifd(e) ;
  ------------------
  |  |  182|  20.9k|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 20.9k, False: 0]
  |  |  ------------------
  ------------------
  276|  20.9k|	ExifContent *c = e->parent;
  277|  20.9k|	ExifDataType dt = exif_data_get_data_type (c->parent);
  278|  20.9k|	ExifTag t = e->tag;
  279|       |
  280|  20.9k|	if (exif_tag_get_support_level_in_ifd (t, ifd, dt) ==
  ------------------
  |  Branch (280:6): [True: 0, False: 20.9k]
  ------------------
  281|  20.9k|			 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|  20.9k|}

exif_data_get_mnote_data:
   93|  9.42k|{
   94|  9.42k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 9.42k, False: 0]
  |  Branch (94:15): [True: 9.42k, False: 0]
  ------------------
   95|  9.42k|}
exif_data_new_mem:
  110|  9.42k|{
  111|  9.42k|	ExifData *data;
  112|  9.42k|	unsigned int i;
  113|       |
  114|  9.42k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 9.42k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  9.42k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  9.42k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 9.42k]
  ------------------
  119|      0|		return (NULL);
  120|  9.42k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  9.42k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 9.42k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  9.42k|	data->priv->ref_count = 1;
  126|       |
  127|  9.42k|	data->priv->mem = mem;
  128|  9.42k|	exif_mem_ref (mem);
  129|       |
  130|  56.5k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 47.1k, False: 9.42k]
  ------------------
  131|  47.1k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  47.1k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 47.1k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  47.1k|		data->ifd[i]->parent = data;
  137|  47.1k|	}
  138|       |
  139|       |	/* Default options */
  140|  9.42k|#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|  9.42k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  9.42k|#endif
  147|  9.42k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  9.42k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  9.42k|	return (data);
  153|  9.42k|}
exif_data_load_data:
  858|  9.42k|{
  859|  9.42k|	unsigned int l;
  860|  9.42k|	ExifLong offset;
  861|  9.42k|	ExifShort n;
  862|  9.42k|	const unsigned char *d = d_orig;
  863|  9.42k|	unsigned int len, fullds;
  864|       |
  865|  9.42k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 9.42k]
  |  Branch (865:15): [True: 0, False: 9.42k]
  |  Branch (865:30): [True: 0, False: 9.42k]
  |  Branch (865:36): [True: 0, False: 9.42k]
  ------------------
  866|      0|		return;
  867|       |
  868|  9.42k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  9.42k|		  "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|  9.42k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 20, False: 9.40k]
  ------------------
  876|     20|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     20|#define LOG_TOO_SMALL \
  |  |  852|     20|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     20|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     20|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     20|		return;
  878|     20|	}
  879|  9.40k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 9.24k, False: 167]
  ------------------
  880|  9.24k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  9.24k|			  "Found EXIF header at start.");
  882|  9.24k|	} else {
  883|    898|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 882, False: 16]
  ------------------
  884|  1.32k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.31k, False: 5]
  |  Branch (884:17): [True: 440, False: 877]
  ------------------
  885|    440|				d++;
  886|    440|				ds--;
  887|    440|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|    882|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|    877|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 877, False: 5]
  |  Branch (890:14): [True: 281, False: 596]
  ------------------
  891|    281|				d++;
  892|    281|				ds--;
  893|    281|				continue;
  894|    281|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    601|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    596|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 596, False: 5]
  |  Branch (897:14): [True: 301, False: 295]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    301|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 277, False: 24]
  |  Branch (904:22): [True: 48, False: 229]
  ------------------
  905|     48|					break;
  906|       |				/* fallthrough */
  907|    301|			}
  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|    553|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 544, False: 9]
  |  Branch (913:19): [True: 490, False: 54]
  |  Branch (913:35): [True: 484, False: 6]
  ------------------
  914|    484|				d++;
  915|    484|				ds--;
  916|    484|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    484|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 34, False: 450]
  ------------------
  918|     34|					return;
  919|    450|				d += l;
  920|    450|				ds -= l;
  921|    450|				continue;
  922|    484|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     69|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     69|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     69|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     69|			return;
  928|    553|		}
  929|     64|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 16, False: 48]
  ------------------
  930|     16|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     16|#define LOG_TOO_SMALL \
  |  |  852|     16|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     16|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     16|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     16|			return;
  932|     16|		}
  933|     48|		d++;
  934|     48|		ds--;
  935|     48|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     48|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 29, False: 19]
  ------------------
  937|     29|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     29|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     29|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     29|			return;
  940|     29|		}
  941|     19|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 3, False: 16]
  ------------------
  942|      3|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  943|      3|				  "ExifData", _("APP Tag too short."));
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  944|      3|			return;
  945|      3|		}
  946|     16|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     16|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     16|			  len);
  949|     16|		d += 2;
  950|     16|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     16|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  9.25k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 4, False: 9.25k]
  ------------------
  958|      4|		LOG_TOO_SMALL;
  ------------------
  |  |  851|      4|#define LOG_TOO_SMALL \
  |  |  852|      4|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|      4|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      4|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  959|      4|		return;
  960|      4|	}
  961|  9.25k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 9.25k]
  ------------------
  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|  9.25k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  9.25k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  9.25k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 31, False: 9.22k]
  ------------------
  972|     31|		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|  9.22k|	fullds = ds;
  978|  9.22k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 10, False: 9.21k]
  ------------------
  979|     10|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  9.22k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 7.21k, False: 2.01k]
  ------------------
  983|  7.21k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.01k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 1.95k, False: 62]
  ------------------
  985|  1.95k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
  986|     62|	else {
  987|     62|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  988|     62|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     62|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  989|     62|		return;
  990|     62|	}
  991|       |
  992|       |	/* Fixed value */
  993|  9.16k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 19, False: 9.14k]
  ------------------
  994|     19|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  9.14k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  9.14k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  9.14k|		  "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|  9.14k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 50, False: 9.09k]
  |  Branch (1002:21): [True: 8, False: 9.08k]
  ------------------
 1003|     58|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  9.08k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  9.08k|	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|  9.08k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 1.54k, False: 7.53k]
  ------------------
 1012|  1.54k|		return;
 1013|       |
 1014|  7.53k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  7.53k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 7.34k, False: 191]
  ------------------
 1016|  7.34k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  7.34k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  7.34k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.71k, False: 5.63k]
  ------------------
 1021|  1.71k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.71k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  5.63k|		} else {
 1024|  5.63k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  5.63k|		}
 1026|  7.34k|	}
 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|  7.53k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  7.53k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 7.53k, False: 0]
  ------------------
 1038|  7.53k|		exif_data_fix (data);
 1039|  7.53k|}
exif_data_unref:
 1111|  9.42k|{
 1112|  9.42k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 9.42k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  9.42k|	data->priv->ref_count--;
 1116|  9.42k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 9.42k, False: 0]
  ------------------
 1117|  9.42k|		exif_data_free (data);
 1118|  9.42k|}
exif_data_free:
 1122|  9.42k|{
 1123|  9.42k|	unsigned int i;
 1124|  9.42k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 9.42k, False: 0]
  |  Branch (1124:26): [True: 9.42k, False: 0]
  ------------------
 1125|       |
 1126|  9.42k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 9.42k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  56.5k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 47.1k, False: 9.42k]
  ------------------
 1130|  47.1k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 47.1k, False: 0]
  ------------------
 1131|  47.1k|			exif_content_unref (data->ifd[i]);
 1132|  47.1k|			data->ifd[i] = NULL;
 1133|  47.1k|		}
 1134|  47.1k|	}
 1135|       |
 1136|  9.42k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 233, False: 9.19k]
  ------------------
 1137|    233|		exif_mem_free (mem, data->data);
 1138|    233|		data->data = NULL;
 1139|    233|	}
 1140|       |
 1141|  9.42k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 9.42k, False: 0]
  ------------------
 1142|  9.42k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 9.42k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  9.42k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 6.39k, False: 3.03k]
  ------------------
 1147|  6.39k|			exif_mnote_data_unref (data->priv->md);
 1148|  6.39k|			data->priv->md = NULL;
 1149|  6.39k|		}
 1150|  9.42k|		exif_mem_free (mem, data->priv);
 1151|  9.42k|		exif_mem_free (mem, data);
 1152|  9.42k|	}
 1153|       |
 1154|  9.42k|	exif_mem_unref (mem);
 1155|  9.42k|}
exif_data_get_byte_order:
 1186|   153k|{
 1187|   153k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 153k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   153k|	return (data->priv->order);
 1191|   153k|}
exif_data_foreach_content:
 1196|  16.9k|{
 1197|  16.9k|	unsigned int i;
 1198|       |
 1199|  16.9k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 16.9k]
  |  Branch (1199:15): [True: 0, False: 16.9k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   101k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 84.8k, False: 16.9k]
  ------------------
 1203|  84.8k|		func (data->ifd[i], user_data);
 1204|  16.9k|}
exif_data_log:
 1246|  9.42k|{
 1247|  9.42k|	unsigned int i;
 1248|       |
 1249|  9.42k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 9.42k]
  |  Branch (1249:15): [True: 0, False: 9.42k]
  ------------------
 1250|      0|		return;
 1251|  9.42k|	exif_log_unref (data->priv->log);
 1252|  9.42k|	data->priv->log = log;
 1253|  9.42k|	exif_log_ref (log);
 1254|       |
 1255|  56.5k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 47.1k, False: 9.42k]
  ------------------
 1256|  47.1k|		exif_content_log (data->ifd[i], log);
 1257|  9.42k|}
exif_data_get_log:
 1263|  86.1k|{
 1264|  86.1k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 86.1k]
  |  Branch (1264:15): [True: 0, False: 86.1k]
  ------------------
 1265|      0|		return NULL;
 1266|  86.1k|	return data->priv->log;
 1267|  86.1k|}
exif_data_set_option:
 1309|  18.8k|{
 1310|  18.8k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 18.8k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  18.8k|	d->priv->options |= o;
 1314|  18.8k|}
exif_data_fix:
 1355|  7.53k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  7.53k|}
exif_data_set_data_type:
 1361|  9.42k|{
 1362|  9.42k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 9.42k]
  |  Branch (1362:12): [True: 0, False: 9.42k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  9.42k|	d->priv->data_type = dt;
 1366|  9.42k|}
exif_data_get_data_type:
 1370|  51.3k|{
 1371|  51.3k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1371:10): [True: 51.3k, False: 0]
  |  Branch (1371:15): [True: 51.3k, False: 0]
  ------------------
 1372|  51.3k|}
exif-data.c:exif_data_load_data_content:
  401|  37.4M|{
  402|  37.4M|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  403|  37.4M|	ExifShort n;
  404|  37.4M|	ExifEntry *entry;
  405|  37.4M|	unsigned int i;
  406|  37.4M|	ExifTag tag;
  407|       |
  408|  37.4M|	if (!data || !data->priv) 
  ------------------
  |  Branch (408:6): [True: 0, False: 37.4M]
  |  Branch (408:15): [True: 0, False: 37.4M]
  ------------------
  409|      0|		return;
  410|       |
  411|       |	/* check for valid ExifIfd enum range */
  412|  37.4M|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (412:6): [True: 0, False: 37.4M]
  |  Branch (412:26): [True: 0, False: 37.4M]
  ------------------
  413|      0|	  return;
  414|       |
  415|  37.4M|	if (recursion_cost > 170) {
  ------------------
  |  Branch (415:6): [True: 34.7M, False: 2.65M]
  ------------------
  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.7M|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  428|  34.7M|			  "Deep/expensive recursion detected!");
  429|  34.7M|		return;
  430|  34.7M|	}
  431|       |
  432|       |	/* Read the number of entries */
  433|  2.65M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  2.65M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 3, False: 2.65M]
  |  |  |  Branch (53:81): [True: 0, False: 2.65M]
  |  |  |  Branch (53:112): [True: 691, False: 2.65M]
  |  |  ------------------
  ------------------
  434|    694|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|    694|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|    694|		return;
  437|    694|	}
  438|  2.65M|	n = exif_get_short (d + offset, data->priv->order);
  439|  2.65M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  2.65M|	          "Loading %hu entries...", n);
  441|  2.65M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  2.65M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  2.65M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 323, False: 2.65M]
  |  |  |  Branch (53:81): [True: 2.63M, False: 19.0k]
  |  |  |  Branch (53:112): [True: 907, False: 18.1k]
  |  |  ------------------
  ------------------
  445|  2.63M|		n = (ds - offset) / 12;
  446|  2.63M|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  447|  2.63M|				  "Short data; only loading %hu entries...", n);
  448|  2.63M|	}
  449|       |
  450|   113M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (450:14): [True: 111M, False: 2.65M]
  ------------------
  451|       |
  452|   111M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   111M|		switch (tag) {
  454|  1.15M|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 1.15M, False: 109M]
  ------------------
  455|  36.2M|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (455:3): [True: 35.1M, False: 75.9M]
  ------------------
  456|  71.8M|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (456:3): [True: 35.5M, False: 75.4M]
  ------------------
  457|  71.8M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (457:3): [True: 6.09k, False: 111M]
  ------------------
  458|  71.8M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 8.31k, False: 111M]
  ------------------
  459|  71.8M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  71.8M|					   data->priv->order);
  461|  71.8M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 5.16k, False: 71.8M]
  ------------------
  462|  5.16k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  5.16k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  5.16k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 3.08k, False: 2.07k]
  ------------------
  465|  3.08k|					return;
  466|  2.07k|				break;
  467|  5.16k|			}
  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|  71.8M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  71.8M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  71.8M|				  exif_tag_get_name(tag), o);
  474|  71.8M|			switch (tag) {
  475|  1.15M|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 1.15M, False: 70.6M]
  ------------------
  476|  1.15M|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|  1.15M|#define CHECK_REC(i) 					\
  |  |  357|  1.15M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 4.32k, False: 1.14M]
  |  |  ------------------
  |  |  358|  4.32k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  4.32k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  4.32k|		"'%s' detected. Skipping...",		\
  |  |  361|  4.32k|		exif_ifd_get_name (i));			\
  |  |  362|  4.32k|	break;						\
  |  |  363|  1.14M|}							\
  |  |  364|  1.14M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 4.61k, False: 1.14M]
  |  |  ------------------
  |  |  365|  4.61k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  4.61k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  4.61k|		"'%s' multiple times detected. "	\
  |  |  368|  4.61k|		"Skipping...",				\
  |  |  369|  4.61k|		exif_ifd_get_name (i));			\
  |  |  370|  4.61k|	break;						\
  |  |  371|  4.61k|}
  ------------------
  477|  1.14M|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|  1.14M|					recursion_cost + level_cost(n));
  479|  1.14M|				break;
  480|  35.1M|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (480:4): [True: 35.1M, False: 36.7M]
  ------------------
  481|  35.1M|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  356|  35.1M|#define CHECK_REC(i) 					\
  |  |  357|  35.1M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.0M, False: 18.0M]
  |  |  ------------------
  |  |  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|  18.0M|}							\
  |  |  364|  18.0M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 1.14k, False: 18.0M]
  |  |  ------------------
  |  |  365|  1.14k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  1.14k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  1.14k|		"'%s' multiple times detected. "	\
  |  |  368|  1.14k|		"Skipping...",				\
  |  |  369|  1.14k|		exif_ifd_get_name (i));			\
  |  |  370|  1.14k|	break;						\
  |  |  371|  1.14k|}
  ------------------
  482|  18.0M|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  483|  18.0M|					recursion_cost + level_cost(n));
  484|  18.0M|				break;
  485|  35.5M|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (485:4): [True: 35.5M, False: 36.2M]
  ------------------
  486|  35.5M|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  356|  35.5M|#define CHECK_REC(i) 					\
  |  |  357|  35.5M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.3M, False: 18.2M]
  |  |  ------------------
  |  |  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|  18.2M|}							\
  |  |  364|  18.2M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 1.06k, False: 18.2M]
  |  |  ------------------
  |  |  365|  1.06k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  1.06k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  1.06k|		"'%s' multiple times detected. "	\
  |  |  368|  1.06k|		"Skipping...",				\
  |  |  369|  1.06k|		exif_ifd_get_name (i));			\
  |  |  370|  1.06k|	break;						\
  |  |  371|  1.06k|}
  ------------------
  487|  18.2M|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  488|  18.2M|					recursion_cost + level_cost(n));
  489|  18.2M|				break;
  490|  7.47k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 7.47k, False: 71.8M]
  ------------------
  491|  7.47k|				thumbnail_offset = o;
  492|  7.47k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 6.61k, False: 867]
  |  Branch (492:29): [True: 1.62k, False: 4.98k]
  ------------------
  493|  1.62k|					exif_data_load_data_thumbnail (data, d,
  494|  1.62k|								       ds, thumbnail_offset,
  495|  1.62k|								       thumbnail_length);
  496|  7.47k|				break;
  497|  4.95k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 4.95k, False: 71.8M]
  ------------------
  498|  4.95k|				thumbnail_length = o;
  499|  4.95k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 3.84k, False: 1.10k]
  |  Branch (499:29): [True: 3.23k, False: 615]
  ------------------
  500|  3.23k|					exif_data_load_data_thumbnail (data, d,
  501|  3.23k|								       ds, thumbnail_offset,
  502|  3.23k|								       thumbnail_length);
  503|  4.95k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 71.8M]
  ------------------
  505|      0|				return;
  506|  71.8M|			}
  507|  71.8M|			break;
  508|  71.8M|		default:
  ------------------
  |  Branch (508:3): [True: 39.1M, False: 71.8M]
  ------------------
  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|  39.1M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.8M, False: 336k]
  ------------------
  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.8M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (521:9): [True: 304k, False: 38.5M]
  ------------------
  522|   304k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   304k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   304k|						  exif_ifd_get_name (ifd));
  525|   304k|					break;
  526|   304k|				}
  527|  38.5M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  528|  38.5M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  529|  38.5M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  530|  38.5M|					  exif_ifd_get_name (ifd));
  531|  38.5M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (531:9): [True: 38.5M, False: 0]
  ------------------
  532|  38.5M|					break;
  533|  38.5M|			}
  534|   336k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   336k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 336k]
  ------------------
  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|   336k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 36.1k, False: 300k]
  ------------------
  541|   336k|						   offset + 12 * i))
  542|  36.1k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   336k|			exif_entry_unref (entry);
  544|   336k|			break;
  545|   111M|		}
  546|   111M|	}
  547|  2.65M|}
exif-data.c:level_cost:
  380|  37.4M|{
  381|  37.4M|    static const double log_1_1 = 0.09531017980432493;
  382|       |
  383|       |	/* Adding 0.1 protects against the case where n==1 */
  384|  37.4M|	return ceil(log(n + 0.1)/log_1_1);
  385|  37.4M|}
exif-data.c:exif_data_load_data_thumbnail:
  334|  4.85k|{
  335|       |	/* Sanity checks */
  336|  4.85k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 4.85k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  4.85k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  4.85k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 4.85k]
  |  |  |  Branch (53:81): [True: 0, False: 4.85k]
  |  |  |  Branch (53:112): [True: 1.59k, False: 3.26k]
  |  |  ------------------
  ------------------
  341|  1.59k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  1.59k|		return;
  343|  1.59k|	}
  344|  3.26k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 3.02k, False: 233]
  ------------------
  345|  3.02k|		exif_mem_free (data->priv->mem, data->data);
  346|  3.26k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 3.26k]
  ------------------
  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|  3.26k|	data->size = s;
  352|  3.26k|	memcpy (data->data, d + o, s);
  353|  3.26k|}
exif-data.c:exif_data_load_data_entry:
  169|   336k|{
  170|   336k|	unsigned int s, doff;
  171|       |
  172|   336k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   336k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   336k|	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|   336k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   336k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   336k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   336k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   336k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 219k, False: 117k]
  |  Branch (186:33): [True: 51.1k, False: 66.1k]
  ------------------
  187|   270k|		return 0;
  188|   270k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  66.1k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 51.8k, False: 14.3k]
  ------------------
  195|  51.8k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  14.3k|	else
  197|  14.3k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  66.1k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 25.4k, False: 40.7k]
  ------------------
  201|  25.4k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  25.4k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  25.4k|		return 0;
  204|  25.4k|	}
  205|       |
  206|  40.7k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 4.62k, False: 36.1k]
  ------------------
  207|  4.62k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  4.62k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  4.62k|		return 0;
  210|  4.62k|	}
  211|       |
  212|  36.1k|	entry->data = exif_data_alloc (data, s);
  213|  36.1k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 36.1k, False: 0]
  ------------------
  214|  36.1k|		entry->size = s;
  215|  36.1k|		memcpy (entry->data, d + doff, s);
  216|  36.1k|	} 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|  36.1k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.27k, False: 27.8k]
  ------------------
  223|  8.27k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.27k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.27k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 7.37k, False: 902]
  ------------------
  227|  7.37k|			exif_log (data->priv->log,
  228|  7.37k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  7.37k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  7.37k|					       "%02x %02x %02x...).",
  231|  7.37k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  7.37k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  7.37k|					       entry->data[6]);
  234|  7.37k|		}
  235|  8.27k|		data->priv->offset_mnote = doff;
  236|  8.27k|	}
  237|  36.1k|	return 1;
  238|  36.1k|}
exif-data.c:interpret_maker_note:
  802|  7.53k|{
  803|  7.53k|	int mnoteid;
  804|  7.53k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  7.53k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 7.53k]
  |  |  ------------------
  |  |  254|  7.53k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  7.53k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 7.53k]
  |  |  ------------------
  |  |  256|  7.53k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  7.53k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 6.57k, False: 969]
  |  |  ------------------
  |  |  258|  7.53k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  7.53k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 969]
  |  |  ------------------
  |  |  260|    969|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    969|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 969]
  |  |  ------------------
  |  |  262|    969|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  805|  7.53k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 969, False: 6.57k]
  ------------------
  806|    969|		return;
  807|       |	
  808|  6.57k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 3.65k, False: 2.91k]
  ------------------
  809|  3.65k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  3.65k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  3.65k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  3.65k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 806, False: 2.10k]
  ------------------
  814|    806|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    806|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    806|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  817|       |
  818|  2.10k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (818:13): [True: 977, False: 1.13k]
  ------------------
  819|    977|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|    977|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|    977|		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.13k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (825:13): [True: 952, False: 180]
  ------------------
  826|    952|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|    952|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|    952|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|    952|	}
  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|  6.57k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 6.39k, False: 180]
  ------------------
  842|  6.39k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  6.39k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  6.39k|						data->priv->order);
  845|  6.39k|		exif_mnote_data_set_offset (data->priv->md,
  846|  6.39k|					    data->priv->offset_mnote);
  847|  6.39k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  6.39k|	}
  849|  6.57k|}
exif-data.c:exif_data_alloc:
   77|  39.4k|{
   78|  39.4k|	void *d;
   79|       |
   80|  39.4k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 39.4k]
  |  Branch (80:15): [True: 0, False: 39.4k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  39.4k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  39.4k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 39.4k, False: 0]
  ------------------
   85|  39.4k|		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|  39.4k|}
exif-data.c:fix_func:
 1327|  37.6k|{
 1328|  37.6k|	switch (exif_content_get_ifd (c)) {
 1329|  7.53k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 7.53k, False: 30.1k]
  ------------------
 1330|  7.53k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 205, False: 7.33k]
  ------------------
 1331|    205|			exif_content_fix (c);
 1332|  7.33k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 581, False: 6.75k]
  ------------------
 1333|    581|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    581|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    581|				  "removed.");
 1336|  2.20k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.62k, False: 581]
  ------------------
 1337|  1.62k|				unsigned int cnt = c->count;
 1338|  1.62k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.62k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.62k]
  ------------------
 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.62k|			}
 1346|    581|		}
 1347|  7.53k|		break;
 1348|  30.1k|	default:
  ------------------
  |  Branch (1348:2): [True: 30.1k, False: 7.53k]
  ------------------
 1349|  30.1k|		exif_content_fix (c);
 1350|  37.6k|	}
 1351|  37.6k|}

exif_entry_new:
  114|  45.3k|{
  115|  45.3k|	ExifMem *mem = exif_mem_new_default ();
  116|  45.3k|	ExifEntry *e = exif_entry_new_mem (mem);
  117|       |
  118|  45.3k|	exif_mem_unref (mem);
  119|       |
  120|  45.3k|	return e;
  121|  45.3k|}
exif_entry_new_mem:
  125|   381k|{
  126|   381k|	ExifEntry *e = NULL;
  127|       |
  128|   381k|	e = exif_mem_alloc (mem, sizeof (ExifEntry));
  129|   381k|	if (!e) return NULL;
  ------------------
  |  Branch (129:6): [True: 0, False: 381k]
  ------------------
  130|   381k|	e->priv = exif_mem_alloc (mem, sizeof (ExifEntryPrivate));
  131|   381k|	if (!e->priv) { exif_mem_free (mem, e); return NULL; }
  ------------------
  |  Branch (131:6): [True: 0, False: 381k]
  ------------------
  132|   381k|	e->priv->ref_count = 1;
  133|       |
  134|   381k|	e->priv->mem = mem;
  135|   381k|	exif_mem_ref (mem);
  136|       |
  137|   381k|	return e;
  138|   381k|}
exif_entry_ref:
  142|  71.9k|{
  143|  71.9k|	if (!e) return;
  ------------------
  |  Branch (143:6): [True: 0, False: 71.9k]
  ------------------
  144|       |
  145|  71.9k|	e->priv->ref_count++;
  146|  71.9k|}
exif_entry_unref:
  150|   453k|{
  151|   453k|	if (!e) return;
  ------------------
  |  Branch (151:6): [True: 0, False: 453k]
  ------------------
  152|       |
  153|   453k|	e->priv->ref_count--;
  154|   453k|	if (!e->priv->ref_count)
  ------------------
  |  Branch (154:6): [True: 381k, False: 71.9k]
  ------------------
  155|   381k|		exif_entry_free (e);
  156|   453k|}
exif_entry_free:
  160|   381k|{
  161|   381k|	if (!e) return;
  ------------------
  |  Branch (161:6): [True: 0, False: 381k]
  ------------------
  162|       |
  163|   381k|	if (e->priv) {
  ------------------
  |  Branch (163:6): [True: 381k, False: 0]
  ------------------
  164|   381k|		ExifMem *mem = e->priv->mem;
  165|   381k|		if (e->data)
  ------------------
  |  Branch (165:7): [True: 81.5k, False: 300k]
  ------------------
  166|  81.5k|			exif_mem_free (mem, e->data);
  167|   381k|		exif_mem_free (mem, e->priv);
  168|   381k|		exif_mem_free (mem, e);
  169|   381k|		exif_mem_unref (mem);
  170|   381k|	}
  171|   381k|}
exif_entry_fix:
  208|  20.9k|{
  209|  20.9k|	unsigned int i, newsize;
  210|  20.9k|	unsigned char *newdata;
  211|  20.9k|	ExifByteOrder o;
  212|  20.9k|	ExifRational r;
  213|  20.9k|	ExifSRational sr;
  214|       |
  215|  20.9k|	if (!e || !e->priv) return;
  ------------------
  |  Branch (215:6): [True: 0, False: 20.9k]
  |  Branch (215:12): [True: 0, False: 20.9k]
  ------------------
  216|       |
  217|  20.9k|	switch (e->tag) {
  218|       |	
  219|       |	/* These tags all need to be of format SHORT. */
  220|     60|	case EXIF_TAG_YCBCR_SUB_SAMPLING:
  ------------------
  |  Branch (220:2): [True: 60, False: 20.8k]
  ------------------
  221|     73|	case EXIF_TAG_SUBJECT_AREA:
  ------------------
  |  Branch (221:2): [True: 13, False: 20.9k]
  ------------------
  222|    163|	case EXIF_TAG_COLOR_SPACE:
  ------------------
  |  Branch (222:2): [True: 90, False: 20.8k]
  ------------------
  223|    228|	case EXIF_TAG_PLANAR_CONFIGURATION:
  ------------------
  |  Branch (223:2): [True: 65, False: 20.8k]
  ------------------
  224|    250|	case EXIF_TAG_SENSING_METHOD:
  ------------------
  |  Branch (224:2): [True: 22, False: 20.9k]
  ------------------
  225|    418|	case EXIF_TAG_ORIENTATION:
  ------------------
  |  Branch (225:2): [True: 168, False: 20.7k]
  ------------------
  226|    578|	case EXIF_TAG_YCBCR_POSITIONING:
  ------------------
  |  Branch (226:2): [True: 160, False: 20.7k]
  ------------------
  227|    627|	case EXIF_TAG_PHOTOMETRIC_INTERPRETATION:
  ------------------
  |  Branch (227:2): [True: 49, False: 20.8k]
  ------------------
  228|    728|	case EXIF_TAG_CUSTOM_RENDERED:
  ------------------
  |  Branch (228:2): [True: 101, False: 20.8k]
  ------------------
  229|    806|	case EXIF_TAG_EXPOSURE_MODE:
  ------------------
  |  Branch (229:2): [True: 78, False: 20.8k]
  ------------------
  230|    904|	case EXIF_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (230:2): [True: 98, False: 20.8k]
  ------------------
  231|    979|	case EXIF_TAG_SCENE_CAPTURE_TYPE:
  ------------------
  |  Branch (231:2): [True: 75, False: 20.8k]
  ------------------
  232|  1.02k|	case EXIF_TAG_GAIN_CONTROL:
  ------------------
  |  Branch (232:2): [True: 48, False: 20.8k]
  ------------------
  233|  1.10k|	case EXIF_TAG_SATURATION:
  ------------------
  |  Branch (233:2): [True: 78, False: 20.8k]
  ------------------
  234|  1.14k|	case EXIF_TAG_CONTRAST:
  ------------------
  |  Branch (234:2): [True: 41, False: 20.8k]
  ------------------
  235|  1.17k|	case EXIF_TAG_SHARPNESS:
  ------------------
  |  Branch (235:2): [True: 25, False: 20.9k]
  ------------------
  236|  1.22k|	case EXIF_TAG_ISO_SPEED_RATINGS:
  ------------------
  |  Branch (236:2): [True: 51, False: 20.8k]
  ------------------
  237|  1.22k|		switch (e->format) {
  238|     81|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (238:3): [True: 81, False: 1.14k]
  ------------------
  239|    114|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (239:3): [True: 33, False: 1.18k]
  ------------------
  240|    229|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (240:3): [True: 115, False: 1.10k]
  ------------------
  241|    349|		case EXIF_FORMAT_SBYTE:
  ------------------
  |  Branch (241:3): [True: 120, False: 1.10k]
  ------------------
  242|    411|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (242:3): [True: 62, False: 1.16k]
  ------------------
  243|    411|			if (!e->parent || !e->parent->parent) break;
  ------------------
  |  Branch (243:8): [True: 0, False: 411]
  |  Branch (243:22): [True: 0, False: 411]
  ------------------
  244|    411|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  245|    411|				_("Tag '%s' was of format '%s' (which is "
  ------------------
  |  |   31|    411|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  246|    411|				"against specification) and has been "
  247|    411|				"changed to format '%s'."),
  248|    411|				exif_tag_get_name_in_ifd(e->tag,
  249|    411|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|    411|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 411, False: 0]
  |  |  ------------------
  ------------------
  250|    411|				exif_format_get_name (e->format),
  251|    411|				exif_format_get_name (EXIF_FORMAT_SHORT));
  252|       |
  253|    411|			o = exif_data_get_byte_order (e->parent->parent);
  254|    411|			newsize = e->components * exif_format_get_size (EXIF_FORMAT_SHORT);
  255|    411|			newdata = exif_entry_alloc (e, newsize);
  256|    411|			if (!newdata) {
  ------------------
  |  Branch (256:8): [True: 0, False: 411]
  ------------------
  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|  86.5k|			for (i = 0; i < e->components; i++)
  ------------------
  |  Branch (262:16): [True: 86.1k, False: 411]
  ------------------
  263|  86.1k|				exif_set_short (
  264|  86.1k|					newdata + i *
  265|  86.1k|					exif_format_get_size (
  266|  86.1k|					 EXIF_FORMAT_SHORT), o,
  267|  86.1k|					 exif_get_short_convert (
  268|  86.1k|					  e->data + i *
  269|  86.1k|					  exif_format_get_size (e->format),
  270|  86.1k|					  e->format, o));
  271|       |
  272|    411|			exif_mem_free (e->priv->mem, e->data);
  273|    411|			e->data = newdata;
  274|    411|			e->size = newsize;
  275|    411|			e->format = EXIF_FORMAT_SHORT;
  276|    411|			break;
  277|    681|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (277:3): [True: 681, False: 541]
  ------------------
  278|       |			/* No conversion necessary */
  279|    681|			break;
  280|    130|		default:
  ------------------
  |  Branch (280:3): [True: 130, False: 1.09k]
  ------------------
  281|    130|			exif_entry_log (e, EXIF_LOG_CODE_CORRUPT_DATA,
  282|    130|				_("Tag '%s' is of format '%s' (which is "
  ------------------
  |  |   31|    130|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  283|    130|				"against specification) but cannot be changed "
  284|    130|				"to format '%s'."),
  285|    130|				exif_tag_get_name_in_ifd(e->tag,
  286|    130|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|    130|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 130, False: 0]
  |  |  ------------------
  ------------------
  287|    130|				exif_format_get_name (e->format),
  288|    130|				exif_format_get_name (EXIF_FORMAT_SHORT));
  289|    130|			break;
  290|  1.22k|		}
  291|  1.22k|		break;
  292|       |
  293|       |	/* All these tags need to be of format 'Rational'. */
  294|  1.22k|	case EXIF_TAG_FNUMBER:
  ------------------
  |  Branch (294:2): [True: 187, False: 20.7k]
  ------------------
  295|    271|	case EXIF_TAG_APERTURE_VALUE:
  ------------------
  |  Branch (295:2): [True: 84, False: 20.8k]
  ------------------
  296|    494|	case EXIF_TAG_EXPOSURE_TIME:
  ------------------
  |  Branch (296:2): [True: 223, False: 20.7k]
  ------------------
  297|    645|	case EXIF_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (297:2): [True: 151, False: 20.7k]
  ------------------
  298|    645|		switch (e->format) {
  299|    109|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (299:3): [True: 109, False: 536]
  ------------------
  300|    109|			if (!e->parent || !e->parent->parent) break;
  ------------------
  |  Branch (300:8): [True: 0, False: 109]
  |  Branch (300:22): [True: 0, False: 109]
  ------------------
  301|    109|			o = exif_data_get_byte_order (e->parent->parent);
  302|  15.6k|			for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (302:16): [True: 15.5k, False: 109]
  ------------------
  303|  15.5k|				sr = exif_get_srational (e->data + i * 
  304|  15.5k|					exif_format_get_size (
  305|  15.5k|						EXIF_FORMAT_SRATIONAL), o);
  306|  15.5k|				r.numerator = (ExifLong) sr.numerator;
  307|  15.5k|				r.denominator = (ExifLong) sr.denominator;
  308|  15.5k|				exif_set_rational (e->data + i *
  309|  15.5k|					exif_format_get_size (
  310|  15.5k|						EXIF_FORMAT_RATIONAL), o, r);
  311|  15.5k|			}
  312|    109|			e->format = EXIF_FORMAT_RATIONAL;
  313|    109|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  314|    109|				_("Tag '%s' was of format '%s' (which is "
  ------------------
  |  |   31|    109|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  315|    109|				"against specification) and has been "
  316|    109|				"changed to format '%s'."),
  317|    109|				exif_tag_get_name_in_ifd(e->tag,
  318|    109|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|    109|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 109, False: 0]
  |  |  ------------------
  ------------------
  319|    109|				exif_format_get_name (EXIF_FORMAT_SRATIONAL),
  320|    109|				exif_format_get_name (EXIF_FORMAT_RATIONAL));
  321|    109|			break;
  322|    536|		default:
  ------------------
  |  Branch (322:3): [True: 536, False: 109]
  ------------------
  323|    536|			break;
  324|    645|		}
  325|    645|		break;
  326|       |
  327|       |	/* All these tags need to be of format 'SRational'. */
  328|    645|	case EXIF_TAG_EXPOSURE_BIAS_VALUE:
  ------------------
  |  Branch (328:2): [True: 223, False: 20.7k]
  ------------------
  329|    400|	case EXIF_TAG_BRIGHTNESS_VALUE:
  ------------------
  |  Branch (329:2): [True: 177, False: 20.7k]
  ------------------
  330|    564|	case EXIF_TAG_SHUTTER_SPEED_VALUE:
  ------------------
  |  Branch (330:2): [True: 164, False: 20.7k]
  ------------------
  331|    564|		switch (e->format) {
  332|    238|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (332:3): [True: 238, False: 326]
  ------------------
  333|    238|			if (!e->parent || !e->parent->parent) break;
  ------------------
  |  Branch (333:8): [True: 0, False: 238]
  |  Branch (333:22): [True: 0, False: 238]
  ------------------
  334|    238|			o = exif_data_get_byte_order (e->parent->parent);
  335|  20.5k|			for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (335:16): [True: 20.2k, False: 238]
  ------------------
  336|  20.2k|				r = exif_get_rational (e->data + i * 
  337|  20.2k|					exif_format_get_size (
  338|  20.2k|						EXIF_FORMAT_RATIONAL), o);
  339|  20.2k|				sr.numerator = (ExifLong) r.numerator;
  340|  20.2k|				sr.denominator = (ExifLong) r.denominator;
  341|  20.2k|				exif_set_srational (e->data + i *
  342|  20.2k|					exif_format_get_size (
  343|  20.2k|						EXIF_FORMAT_SRATIONAL), o, sr);
  344|  20.2k|			}
  345|    238|			e->format = EXIF_FORMAT_SRATIONAL;
  346|    238|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  347|    238|				_("Tag '%s' was of format '%s' (which is "
  ------------------
  |  |   31|    238|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  348|    238|				"against specification) and has been "
  349|    238|				"changed to format '%s'."),
  350|    238|				exif_tag_get_name_in_ifd(e->tag,
  351|    238|							exif_entry_get_ifd(e)),
  ------------------
  |  |  182|    238|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 238, False: 0]
  |  |  ------------------
  ------------------
  352|    238|				exif_format_get_name (EXIF_FORMAT_RATIONAL),
  353|    238|				exif_format_get_name (EXIF_FORMAT_SRATIONAL));
  354|    238|			break;
  355|    326|		default:
  ------------------
  |  Branch (355:3): [True: 326, False: 238]
  ------------------
  356|    326|			break;
  357|    564|		}
  358|    564|		break;
  359|       |
  360|    564|	case EXIF_TAG_USER_COMMENT:
  ------------------
  |  Branch (360:2): [True: 178, False: 20.7k]
  ------------------
  361|       |
  362|       |		/* Format needs to be UNDEFINED. */
  363|    178|		if (e->format != EXIF_FORMAT_UNDEFINED) {
  ------------------
  |  Branch (363:7): [True: 83, False: 95]
  ------------------
  364|     83|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  365|     83|				_("Tag 'UserComment' had invalid format '%s'. "
  ------------------
  |  |   31|     83|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  366|     83|				"Format has been set to 'undefined'."),
  367|     83|				exif_format_get_name (e->format));
  368|     83|			e->format = EXIF_FORMAT_UNDEFINED;
  369|     83|		}
  370|       |
  371|       |		/* Some packages like Canon ZoomBrowser EX 4.5 store
  372|       |		   only one zero byte followed by 7 bytes of rubbish */
  373|    178|		if ((e->size >= 8) && (e->data[0] == 0)) {
  ------------------
  |  Branch (373:7): [True: 173, False: 5]
  |  Branch (373:25): [True: 53, False: 120]
  ------------------
  374|     53|			memcpy(e->data, "\0\0\0\0\0\0\0\0", 8);
  375|     53|		}
  376|       |
  377|       |		/* There need to be at least 8 bytes. */
  378|    178|		if (e->size < 8) {
  ------------------
  |  Branch (378:7): [True: 5, False: 173]
  ------------------
  379|      5|			e->data = exif_entry_realloc (e, e->data, 8 + e->size);
  380|      5|			if (!e->data) {
  ------------------
  |  Branch (380:8): [True: 0, False: 5]
  ------------------
  381|      0|				clear_entry(e);
  382|      0|				return;
  383|      0|			}
  384|       |
  385|       |			/* Assume ASCII */
  386|      5|			memmove (e->data + 8, e->data, e->size);
  387|      5|			memcpy (e->data, "ASCII\0\0\0", 8);
  388|      5|			e->size += 8;
  389|      5|			e->components += 8;
  390|      5|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  391|      5|				_("Tag 'UserComment' has been expanded to at "
  ------------------
  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|      5|				"least 8 bytes in order to follow the "
  393|      5|				"specification."));
  394|      5|			break;
  395|      5|		}
  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|  16.8k|		for (i = 0; (i < e->size) && !e->data[i]; i++);
  ------------------
  |  Branch (402:15): [True: 16.8k, False: 11]
  |  Branch (402:32): [True: 16.6k, False: 162]
  ------------------
  403|    501|		if (!i) for ( ; (i < e->size) && (e->data[i] == ' '); i++);
  ------------------
  |  Branch (403:7): [True: 120, False: 53]
  |  Branch (403:19): [True: 499, False: 2]
  |  Branch (403:36): [True: 381, False: 118]
  ------------------
  404|    173|		if ((i >= 8) && (i < e->size)) {
  ------------------
  |  Branch (404:7): [True: 61, False: 112]
  |  Branch (404:19): [True: 48, False: 13]
  ------------------
  405|     48|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  406|     48|				_("Tag 'UserComment' is not empty but does not "
  ------------------
  |  |   31|     48|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  407|     48|				"start with a format identifier. "
  408|     48|				"This has been fixed."));
  409|     48|			memcpy (e->data, "ASCII\0\0\0", 8);
  410|     48|			break;
  411|     48|		}
  412|       |
  413|       |		/* 
  414|       |		 * First 8 bytes need to follow the specification. If they don't, 
  415|       |		 * assume ASCII.
  416|       |		 */
  417|    125|		if (memcmp (e->data, "ASCII\0\0\0"     , 8) &&
  ------------------
  |  Branch (417:7): [True: 123, False: 2]
  ------------------
  418|    123|		    memcmp (e->data, "UNICODE\0"       , 8) &&
  ------------------
  |  Branch (418:7): [True: 120, False: 3]
  ------------------
  419|    120|		    memcmp (e->data, "JIS\0\0\0\0\0"   , 8) &&
  ------------------
  |  Branch (419:7): [True: 118, False: 2]
  ------------------
  420|    118|		    memcmp (e->data, "\0\0\0\0\0\0\0\0", 8)) {
  ------------------
  |  Branch (420:7): [True: 107, False: 11]
  ------------------
  421|    107|			e->data = exif_entry_realloc (e, e->data, 8 + e->size);
  422|    107|			if (!e->data) {
  ------------------
  |  Branch (422:8): [True: 0, False: 107]
  ------------------
  423|      0|				clear_entry(e);
  424|      0|				break;
  425|      0|			}
  426|       |
  427|       |			/* Assume ASCII */
  428|    107|			memmove (e->data + 8, e->data, e->size);
  429|    107|			memcpy (e->data, "ASCII\0\0\0", 8);
  430|    107|			e->size += 8;
  431|    107|			e->components += 8;
  432|    107|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  433|    107|				_("Tag 'UserComment' did not start with a "
  ------------------
  |  |   31|    107|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  434|    107|				"format identifier. This has been fixed."));
  435|    107|			break;
  436|    107|		}
  437|       |
  438|     18|		break;
  439|  18.3k|	default:
  ------------------
  |  Branch (439:2): [True: 18.3k, False: 2.60k]
  ------------------
  440|  18.3k|		break;
  441|  20.9k|	}
  442|  20.9k|}
exif_entry_get_value:
  855|  71.3k|{
  856|  71.3k|	unsigned int i, j, k;
  857|  71.3k|	ExifShort v_short, v_short2, v_short3, v_short4;
  858|  71.3k|	ExifByte v_byte;
  859|  71.3k|	ExifRational v_rat;
  860|  71.3k|	ExifSRational v_srat;
  861|  71.3k|	char b[64];
  862|  71.3k|	const char *c;
  863|  71.3k|	ExifByteOrder o;
  864|  71.3k|	double d;
  865|  71.3k|	ExifEntry *entry;
  866|  71.3k|	static const struct {
  867|  71.3k|		char label[5];
  868|  71.3k|		char major, minor;
  869|  71.3k|	} versions[] = {
  870|  71.3k|		{"0110", 1,  1},
  871|  71.3k|		{"0120", 1,  2},
  872|  71.3k|		{"0200", 2,  0},
  873|  71.3k|		{"0210", 2,  1},
  874|  71.3k|		{"0220", 2,  2},
  875|  71.3k|		{"0221", 2, 21},
  876|  71.3k|		{"0230", 2,  3},
  877|  71.3k|		{"0231", 2, 31},
  878|  71.3k|		{"0232", 2, 32},
  879|  71.3k|		{""    , 0,  0}
  880|  71.3k|	};
  881|       |
  882|  71.3k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  883|       |
  884|  71.3k|	if (!e || !e->parent || !e->parent->parent || !maxlen || !val)
  ------------------
  |  Branch (884:6): [True: 0, False: 71.3k]
  |  Branch (884:12): [True: 0, False: 71.3k]
  |  Branch (884:26): [True: 0, False: 71.3k]
  |  Branch (884:48): [True: 0, False: 71.3k]
  |  Branch (884:59): [True: 0, False: 71.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|  71.3k|	memset (val, 0, maxlen);
  891|       |
  892|       |	/* We need the byte order */
  893|  71.3k|	o = exif_data_get_byte_order (e->parent->parent);
  894|       |
  895|       |	/* Sanity check */
  896|  71.3k|	if (e->size != e->components * exif_format_get_size (e->format)) {
  ------------------
  |  Branch (896:6): [True: 18, False: 71.3k]
  ------------------
  897|     18|		snprintf (val, maxlen, _("Invalid size of entry (%i, "
  ------------------
  |  |   31|     18|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  898|     18|			"expected %li x %i)."), e->size, e->components,
  899|     18|				exif_format_get_size (e->format));
  900|     18|		return val;
  901|     18|	}
  902|       |
  903|  71.3k|	switch (e->tag) {
  904|    275|	case EXIF_TAG_USER_COMMENT:
  ------------------
  |  Branch (904:2): [True: 275, False: 71.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|    275|		if ((e->format != EXIF_FORMAT_ASCII) || 
  ------------------
  |  Branch (912:7): [True: 238, False: 37]
  ------------------
  913|     37|		    (e->size <= 8) ||
  ------------------
  |  Branch (913:7): [True: 1, False: 36]
  ------------------
  914|     36|		    ( memcmp (e->data, "ASCII\0\0\0"  , 8) &&
  ------------------
  |  Branch (914:9): [True: 35, False: 1]
  ------------------
  915|     35|		      memcmp (e->data, "UNICODE\0"    , 8) &&
  ------------------
  |  Branch (915:9): [True: 34, False: 1]
  ------------------
  916|     34|		      memcmp (e->data, "JIS\0\0\0\0\0", 8) &&
  ------------------
  |  Branch (916:9): [True: 33, False: 1]
  ------------------
  917|     33|		      memcmp (e->data, "\0\0\0\0\0\0\0\0", 8)))
  ------------------
  |  Branch (917:9): [True: 29, False: 4]
  ------------------
  918|    268|			CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|    268|#define CF(entry,target,v,maxlen)					\
  |  |  647|    268|{									\
  |  |  648|    268|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 36, False: 232]
  |  |  ------------------
  |  |  649|     36|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     36|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     36|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     36|			"format ('%s', expected '%s')."),		\
  |  |  652|     36|			exif_tag_get_name (entry->tag),			\
  |  |  653|     36|			exif_format_get_name (entry->format),		\
  |  |  654|     36|			exif_format_get_name (target));			\
  |  |  655|     36|		break;							\
  |  |  656|     36|	}								\
  |  |  657|    268|}
  ------------------
  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|    239|		if ((e->size >= 8) && !memcmp (e->data, "ASCII\0\0\0", 8)) {
  ------------------
  |  Branch (925:7): [True: 234, False: 5]
  |  Branch (925:25): [True: 147, False: 87]
  ------------------
  926|    147|			strncpy (val, (char *) e->data + 8, MIN (e->size - 8, maxlen-1));
  ------------------
  |  |  182|    147|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 113, False: 34]
  |  |  ------------------
  ------------------
  927|    147|			break;
  928|    147|		}
  929|     92|		if ((e->size >= 8) && !memcmp (e->data, "UNICODE\0", 8)) {
  ------------------
  |  Branch (929:7): [True: 87, False: 5]
  |  Branch (929:25): [True: 4, False: 83]
  ------------------
  930|      4|			strncpy (val, _("Unsupported UNICODE string"), maxlen-1);
  ------------------
  |  |   31|      4|#  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|      4|			break;
  936|      4|		}
  937|     88|		if ((e->size >= 8) && !memcmp (e->data, "JIS\0\0\0\0\0", 8)) {
  ------------------
  |  Branch (937:7): [True: 83, False: 5]
  |  Branch (937:25): [True: 3, False: 80]
  ------------------
  938|      3|			strncpy (val, _("Unsupported JIS string"), maxlen-1);
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|       |		/* FIXME: use iconv to convert into the locale encoding */
  940|      3|			break;
  941|      3|		}
  942|       |
  943|       |		/* Check if there is really some information in the tag. */
  944|  2.30k|		for (i = 0; (i < e->size) &&
  ------------------
  |  Branch (944:15): [True: 2.29k, False: 10]
  ------------------
  945|  2.29k|			    (!e->data[i] || (e->data[i] == ' ')); i++);
  ------------------
  |  Branch (945:9): [True: 1.93k, False: 368]
  |  Branch (945:24): [True: 293, False: 75]
  ------------------
  946|     85|		if (i == e->size) break;
  ------------------
  |  Branch (946:7): [True: 10, False: 75]
  ------------------
  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|     75|		exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  955|     75|			_("Tag UserComment contains data but is "
  ------------------
  |  |   31|     75|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  956|     75|			  "against specification."));
  957|  83.7k| 		for (j = 0; (i < e->size) && (j < maxlen-1); i++, j++) {
  ------------------
  |  Branch (957:16): [True: 83.6k, False: 71]
  |  Branch (957:33): [True: 83.6k, False: 4]
  ------------------
  958|  83.6k|			exif_entry_log (e, EXIF_LOG_CODE_DEBUG,
  959|  83.6k|				_("Byte at position %i: 0x%02x"), i, e->data[i]);
  ------------------
  |  |   31|  83.6k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  960|  83.6k| 			val[j] = isprint (e->data[i]) ? e->data[i] : '.';
  ------------------
  |  Branch (960:14): [True: 11.7k, False: 71.8k]
  ------------------
  961|  83.6k|		}
  962|     75|		break;
  963|       |
  964|  7.55k|	case EXIF_TAG_EXIF_VERSION:
  ------------------
  |  Branch (964:2): [True: 7.55k, False: 63.7k]
  ------------------
  965|  7.55k|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|  7.55k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  7.55k|{									\
  |  |  648|  7.55k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 10, False: 7.54k]
  |  |  ------------------
  |  |  649|     10|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     10|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     10|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     10|			"format ('%s', expected '%s')."),		\
  |  |  652|     10|			exif_tag_get_name (entry->tag),			\
  |  |  653|     10|			exif_format_get_name (entry->format),		\
  |  |  654|     10|			exif_format_get_name (target));			\
  |  |  655|     10|		break;							\
  |  |  656|     10|	}								\
  |  |  657|  7.55k|}
  ------------------
  966|  7.54k|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|  7.54k|#define CC(entry,target,v,maxlen)					\
  |  |  660|  7.54k|{									\
  |  |  661|  7.54k|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 5, False: 7.53k]
  |  |  ------------------
  |  |  662|      5|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      5|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      5|			  "components (%i, expected %i)."),		\
  |  |  665|      5|			exif_tag_get_name (entry->tag),		\
  |  |  666|      5|			(int) entry->components, (int) target);		\
  |  |  667|      5|		break;							\
  |  |  668|      5|	}								\
  |  |  669|  7.54k|}
  ------------------
  967|  7.53k|		strncpy (val, _("Unknown Exif Version"), maxlen-1);
  ------------------
  |  |   31|  7.53k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  968|  30.4k|		for (i = 0; *versions[i].label; i++) {
  ------------------
  |  Branch (968:15): [True: 30.3k, False: 30]
  ------------------
  969|  30.3k|			if (!memcmp (e->data, versions[i].label, 4)) {
  ------------------
  |  Branch (969:8): [True: 7.50k, False: 22.8k]
  ------------------
  970|  7.50k|    				snprintf (val, maxlen,
  971|  7.50k|					_("Exif Version %d.%d"),
  ------------------
  |  |   31|  7.50k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  972|  7.50k|					versions[i].major,
  973|  7.50k|					versions[i].minor);
  974|  7.50k|    				break;
  975|  7.50k|			}
  976|  30.3k|		}
  977|  7.53k|		break;
  978|  7.55k|	case EXIF_TAG_FLASH_PIX_VERSION:
  ------------------
  |  Branch (978:2): [True: 7.55k, False: 63.7k]
  ------------------
  979|  7.55k|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|  7.55k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  7.55k|{									\
  |  |  648|  7.55k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 9, False: 7.54k]
  |  |  ------------------
  |  |  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|  7.55k|}
  ------------------
  980|  7.54k|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|  7.54k|#define CC(entry,target,v,maxlen)					\
  |  |  660|  7.54k|{									\
  |  |  661|  7.54k|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 3, False: 7.54k]
  |  |  ------------------
  |  |  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|  7.54k|}
  ------------------
  981|  7.54k|		if (!memcmp (e->data, "0100", 4))
  ------------------
  |  Branch (981:7): [True: 7.51k, False: 30]
  ------------------
  982|  7.51k|			strncpy (val, _("FlashPix Version 1.0"), maxlen-1);
  ------------------
  |  |   31|  7.51k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  983|     30|		else if (!memcmp (e->data, "0101", 4))
  ------------------
  |  Branch (983:12): [True: 1, False: 29]
  ------------------
  984|      1|			strncpy (val, _("FlashPix Version 1.01"), maxlen-1);
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  985|     29|		else
  986|     29|			strncpy (val, _("Unknown FlashPix Version"), maxlen-1);
  ------------------
  |  |   31|     29|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  987|  7.54k|		break;
  988|    129|	case EXIF_TAG_COPYRIGHT:
  ------------------
  |  Branch (988:2): [True: 129, False: 71.1k]
  ------------------
  989|    129|		CF (e, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |  646|    129|#define CF(entry,target,v,maxlen)					\
  |  |  647|    129|{									\
  |  |  648|    129|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 15, False: 114]
  |  |  ------------------
  |  |  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|    129|}
  ------------------
  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|    114|		if (e->size && e->data && match_repeated_char(e->data, ' ', e->size))
  ------------------
  |  Branch (996:7): [True: 114, False: 0]
  |  Branch (996:18): [True: 114, False: 0]
  |  Branch (996:29): [True: 69, False: 45]
  ------------------
  997|     69|			strncpy (val, (char *) e->data, MIN (maxlen-1, e->size));
  ------------------
  |  |  182|     69|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 6, False: 63]
  |  |  ------------------
  ------------------
  998|     45|		else
  999|     45|			strncpy (val, _("[None]"), maxlen-1);
  ------------------
  |  |   31|     45|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1000|    114|		strncat (val, " ", maxlen-1 - strlen (val));
 1001|    114|		strncat (val, _("(Photographer)"), maxlen-1 - strlen (val));
  ------------------
  |  |   31|    114|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1002|       |
 1003|       |		/* Second part: Editor. */
 1004|    114|		strncat (val, " - ", maxlen-1 - strlen (val));
 1005|    114|		k = 0;
 1006|    114|		if (e->size && e->data) {
  ------------------
  |  Branch (1006:7): [True: 114, False: 0]
  |  Branch (1006:18): [True: 114, False: 0]
  ------------------
 1007|    114|			const unsigned char *tagdata = memchr(e->data, 0, e->size);
 1008|    114|			if (tagdata++) {
  ------------------
  |  Branch (1008:8): [True: 93, False: 21]
  ------------------
 1009|     93|				unsigned int editor_ofs = tagdata - e->data;
 1010|     93|				unsigned int remaining = e->size - editor_ofs;
 1011|     93|				if (match_repeated_char(tagdata, ' ', remaining)) {
  ------------------
  |  Branch (1011:9): [True: 57, False: 36]
  ------------------
 1012|     57|					strncat (val, (const char*)tagdata, MIN (maxlen-1 - strlen (val), remaining));
  ------------------
  |  |  182|     57|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 10, False: 47]
  |  |  ------------------
  ------------------
 1013|     57|					++k;
 1014|     57|				}
 1015|     93|			}
 1016|    114|		}
 1017|    114|		if (!k)
  ------------------
  |  Branch (1017:7): [True: 57, False: 57]
  ------------------
 1018|     57|			strncat (val, _("[None]"), maxlen-1 - strlen (val));
  ------------------
  |  |   31|     57|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1019|    114|		strncat (val, " ", maxlen-1 - strlen (val));
 1020|    114|		strncat (val, _("(Editor)"), maxlen-1 - strlen (val));
  ------------------
  |  |   31|    114|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1021|       |
 1022|    114|		break;
 1023|    239|	case EXIF_TAG_FNUMBER:
  ------------------
  |  Branch (1023:2): [True: 239, False: 71.0k]
  ------------------
 1024|    239|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    239|#define CF(entry,target,v,maxlen)					\
  |  |  647|    239|{									\
  |  |  648|    239|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 9, False: 230]
  |  |  ------------------
  |  |  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|    239|}
  ------------------
 1025|    230|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    230|#define CC(entry,target,v,maxlen)					\
  |  |  660|    230|{									\
  |  |  661|    230|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 16, False: 214]
  |  |  ------------------
  |  |  662|     16|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     16|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     16|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     16|			  "components (%i, expected %i)."),		\
  |  |  665|     16|			exif_tag_get_name (entry->tag),		\
  |  |  666|     16|			(int) entry->components, (int) target);		\
  |  |  667|     16|		break;							\
  |  |  668|     16|	}								\
  |  |  669|    230|}
  ------------------
 1026|    214|		v_rat = exif_get_rational (e->data, o);
 1027|    214|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1027:7): [True: 42, False: 172]
  ------------------
 1028|     42|			exif_entry_format_value(e, val, maxlen);
 1029|     42|			break;
 1030|     42|		}
 1031|    172|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1032|    172|		snprintf (val, maxlen, "f/%.01f", d);
 1033|    172|		break;
 1034|    119|	case EXIF_TAG_APERTURE_VALUE:
  ------------------
  |  Branch (1034:2): [True: 119, False: 71.2k]
  ------------------
 1035|    368|	case EXIF_TAG_MAX_APERTURE_VALUE:
  ------------------
  |  Branch (1035:2): [True: 249, False: 71.0k]
  ------------------
 1036|    368|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    368|#define CF(entry,target,v,maxlen)					\
  |  |  647|    368|{									\
  |  |  648|    368|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 13, False: 355]
  |  |  ------------------
  |  |  649|     13|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     13|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     13|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     13|			"format ('%s', expected '%s')."),		\
  |  |  652|     13|			exif_tag_get_name (entry->tag),			\
  |  |  653|     13|			exif_format_get_name (entry->format),		\
  |  |  654|     13|			exif_format_get_name (target));			\
  |  |  655|     13|		break;							\
  |  |  656|     13|	}								\
  |  |  657|    368|}
  ------------------
 1037|    355|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    355|#define CC(entry,target,v,maxlen)					\
  |  |  660|    355|{									\
  |  |  661|    355|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 18, False: 337]
  |  |  ------------------
  |  |  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|    355|}
  ------------------
 1038|    337|		v_rat = exif_get_rational (e->data, o);
 1039|    337|		if (!v_rat.denominator || (0x80000000 == v_rat.numerator)) {
  ------------------
  |  Branch (1039:7): [True: 60, False: 277]
  |  Branch (1039:29): [True: 3, False: 274]
  ------------------
 1040|     63|			exif_entry_format_value(e, val, maxlen);
 1041|     63|			break;
 1042|     63|		}
 1043|    274|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1044|    274|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|    274|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1045|    274|		snprintf (b, sizeof (b), _(" (f/%.01f)"), pow (2, d / 2.));
  ------------------
  |  |   31|    274|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1046|    274|		strncat (val, b, maxlen-1 - strlen (val));
 1047|    274|		break;
 1048|    329|	case EXIF_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (1048:2): [True: 329, False: 70.9k]
  ------------------
 1049|    329|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    329|#define CF(entry,target,v,maxlen)					\
  |  |  647|    329|{									\
  |  |  648|    329|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 8, False: 321]
  |  |  ------------------
  |  |  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|    329|}
  ------------------
 1050|    321|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    321|#define CC(entry,target,v,maxlen)					\
  |  |  660|    321|{									\
  |  |  661|    321|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 23, False: 298]
  |  |  ------------------
  |  |  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|    321|}
  ------------------
 1051|    298|		v_rat = exif_get_rational (e->data, o);
 1052|    298|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1052:7): [True: 36, False: 262]
  ------------------
 1053|     36|			exif_entry_format_value(e, val, maxlen);
 1054|     36|			break;
 1055|     36|		}
 1056|       |
 1057|       |		/*
 1058|       |		 * For calculation of the 35mm equivalent,
 1059|       |		 * Minolta cameras need a multiplier that depends on the
 1060|       |		 * camera model.
 1061|       |		 */
 1062|    262|		d = 0.;
 1063|    262|		entry = exif_content_get_entry (
 1064|    262|			e->parent->parent->ifd[EXIF_IFD_0], EXIF_TAG_MAKE);
 1065|    262|		if (entry && entry->data && entry->size >= 7 &&
  ------------------
  |  Branch (1065:7): [True: 169, False: 93]
  |  Branch (1065:16): [True: 169, False: 0]
  |  Branch (1065:31): [True: 156, False: 13]
  ------------------
 1066|    156|		    !strncmp ((char *)entry->data, "Minolta", 7)) {
  ------------------
  |  Branch (1066:7): [True: 64, False: 92]
  ------------------
 1067|     64|			entry = exif_content_get_entry (
 1068|     64|					e->parent->parent->ifd[EXIF_IFD_0],
 1069|     64|					EXIF_TAG_MODEL);
 1070|     64|			if (entry && entry->data && entry->size >= 8) {
  ------------------
  |  Branch (1070:8): [True: 59, False: 5]
  |  Branch (1070:17): [True: 59, False: 0]
  |  Branch (1070:32): [True: 56, False: 3]
  ------------------
 1071|     56|				if (!strncmp ((char *)entry->data, "DiMAGE 7", 8))
  ------------------
  |  Branch (1071:9): [True: 1, False: 55]
  ------------------
 1072|      1|					d = 3.9;
 1073|     55|				else if (!strncmp ((char *)entry->data, "DiMAGE 5", 8))
  ------------------
  |  Branch (1073:14): [True: 1, False: 54]
  ------------------
 1074|      1|					d = 4.9;
 1075|     56|			}
 1076|     64|		}
 1077|    262|		if (d)
  ------------------
  |  Branch (1077:7): [True: 2, False: 260]
  ------------------
 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|    260|		else
 1082|    260|			b[0] = 0;
 1083|       |
 1084|    262|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1085|    262|		snprintf (val, maxlen, "%.1f mm", d);
 1086|    262|		strncat (val, b, maxlen-1 - strlen (val));
 1087|    262|		break;
 1088|    158|	case EXIF_TAG_SUBJECT_DISTANCE:
  ------------------
  |  Branch (1088:2): [True: 158, False: 71.1k]
  ------------------
 1089|    158|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    158|#define CF(entry,target,v,maxlen)					\
  |  |  647|    158|{									\
  |  |  648|    158|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 9, False: 149]
  |  |  ------------------
  |  |  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|    158|}
  ------------------
 1090|    149|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    149|#define CC(entry,target,v,maxlen)					\
  |  |  660|    149|{									\
  |  |  661|    149|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 5, False: 144]
  |  |  ------------------
  |  |  662|      5|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|      5|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|      5|			  "components (%i, expected %i)."),		\
  |  |  665|      5|			exif_tag_get_name (entry->tag),		\
  |  |  666|      5|			(int) entry->components, (int) target);		\
  |  |  667|      5|		break;							\
  |  |  668|      5|	}								\
  |  |  669|    149|}
  ------------------
 1091|    144|		v_rat = exif_get_rational (e->data, o);
 1092|    144|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1092:7): [True: 39, False: 105]
  ------------------
 1093|     39|			exif_entry_format_value(e, val, maxlen);
 1094|     39|			break;
 1095|     39|		}
 1096|    105|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1097|    105|		snprintf (val, maxlen, "%.1f m", d);
 1098|    105|		break;
 1099|    262|	case EXIF_TAG_EXPOSURE_TIME:
  ------------------
  |  Branch (1099:2): [True: 262, False: 71.0k]
  ------------------
 1100|    262|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    262|#define CF(entry,target,v,maxlen)					\
  |  |  647|    262|{									\
  |  |  648|    262|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 5, False: 257]
  |  |  ------------------
  |  |  649|      5|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      5|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      5|			"format ('%s', expected '%s')."),		\
  |  |  652|      5|			exif_tag_get_name (entry->tag),			\
  |  |  653|      5|			exif_format_get_name (entry->format),		\
  |  |  654|      5|			exif_format_get_name (target));			\
  |  |  655|      5|		break;							\
  |  |  656|      5|	}								\
  |  |  657|    262|}
  ------------------
 1101|    257|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    257|#define CC(entry,target,v,maxlen)					\
  |  |  660|    257|{									\
  |  |  661|    257|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 21, False: 236]
  |  |  ------------------
  |  |  662|     21|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     21|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     21|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     21|			  "components (%i, expected %i)."),		\
  |  |  665|     21|			exif_tag_get_name (entry->tag),		\
  |  |  666|     21|			(int) entry->components, (int) target);		\
  |  |  667|     21|		break;							\
  |  |  668|     21|	}								\
  |  |  669|    257|}
  ------------------
 1102|    236|		v_rat = exif_get_rational (e->data, o);
 1103|    236|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1103:7): [True: 42, False: 194]
  ------------------
 1104|     42|			exif_entry_format_value(e, val, maxlen);
 1105|     42|			break;
 1106|     42|		}
 1107|    194|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1108|    194|		if (d < 1 && d)
  ------------------
  |  Branch (1108:7): [True: 98, False: 96]
  |  Branch (1108:16): [True: 89, False: 9]
  ------------------
 1109|     89|			snprintf (val, maxlen, _("1/%.0f"), 1. / d);
  ------------------
  |  |   31|     89|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1110|    105|		else
 1111|    105|			snprintf (val, maxlen, "%.0f", d);
 1112|    194|		strncat (val, _(" sec."), maxlen-1 - strlen (val));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1113|    194|		break;
 1114|    177|	case EXIF_TAG_SHUTTER_SPEED_VALUE:
  ------------------
  |  Branch (1114:2): [True: 177, False: 71.1k]
  ------------------
 1115|    177|		CF (e, EXIF_FORMAT_SRATIONAL, val, maxlen)
  ------------------
  |  |  646|    177|#define CF(entry,target,v,maxlen)					\
  |  |  647|    177|{									\
  |  |  648|    177|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 5, False: 172]
  |  |  ------------------
  |  |  649|      5|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      5|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      5|			"format ('%s', expected '%s')."),		\
  |  |  652|      5|			exif_tag_get_name (entry->tag),			\
  |  |  653|      5|			exif_format_get_name (entry->format),		\
  |  |  654|      5|			exif_format_get_name (target));			\
  |  |  655|      5|		break;							\
  |  |  656|      5|	}								\
  |  |  657|    177|}
  ------------------
 1116|    172|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    172|#define CC(entry,target,v,maxlen)					\
  |  |  660|    172|{									\
  |  |  661|    172|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 8, False: 164]
  |  |  ------------------
  |  |  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|    172|}
  ------------------
 1117|    164|		v_srat = exif_get_srational (e->data, o);
 1118|    164|		if (!v_srat.denominator) {
  ------------------
  |  Branch (1118:7): [True: 40, False: 124]
  ------------------
 1119|     40|			exif_entry_format_value(e, val, maxlen);
 1120|     40|			break;
 1121|     40|		}
 1122|    124|		d = (double) v_srat.numerator / (double) v_srat.denominator;
 1123|    124|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|    124|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1124|    124|		if (pow (2, d))
  ------------------
  |  Branch (1124:7): [True: 120, False: 4]
  ------------------
 1125|    120|			d = 1. / pow (2, d);
 1126|    124|		if (d < 1 && d)
  ------------------
  |  Branch (1126:7): [True: 91, False: 33]
  |  Branch (1126:16): [True: 71, False: 20]
  ------------------
 1127|     71|		  snprintf (b, sizeof (b), _(" (1/%.0f sec.)"), 1. / d);
  ------------------
  |  |   31|     71|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1128|     53|		else
 1129|     53|		  snprintf (b, sizeof (b), _(" (%.0f sec.)"), d);
  ------------------
  |  |   31|     53|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1130|    124|		strncat (val, b, maxlen-1 - strlen (val));
 1131|    124|		break;
 1132|    197|	case EXIF_TAG_BRIGHTNESS_VALUE:
  ------------------
  |  Branch (1132:2): [True: 197, False: 71.1k]
  ------------------
 1133|    197|		CF (e, EXIF_FORMAT_SRATIONAL, val, maxlen)
  ------------------
  |  |  646|    197|#define CF(entry,target,v,maxlen)					\
  |  |  647|    197|{									\
  |  |  648|    197|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 15, False: 182]
  |  |  ------------------
  |  |  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|    197|}
  ------------------
 1134|    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: 30, False: 152]
  |  |  ------------------
  |  |  662|     30|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     30|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     30|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     30|			  "components (%i, expected %i)."),		\
  |  |  665|     30|			exif_tag_get_name (entry->tag),		\
  |  |  666|     30|			(int) entry->components, (int) target);		\
  |  |  667|     30|		break;							\
  |  |  668|     30|	}								\
  |  |  669|    182|}
  ------------------
 1135|    152|		v_srat = exif_get_srational (e->data, o);
 1136|    152|		if (!v_srat.denominator) {
  ------------------
  |  Branch (1136:7): [True: 41, False: 111]
  ------------------
 1137|     41|			exif_entry_format_value(e, val, maxlen);
 1138|     41|			break;
 1139|     41|		}
 1140|    111|		d = (double) v_srat.numerator / (double) v_srat.denominator;
 1141|    111|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|    111|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1142|    111|		snprintf (b, sizeof (b), _(" (%.02f cd/m^2)"),
  ------------------
  |  |   31|    111|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1143|    111|			1. / (M_PI * 0.3048 * 0.3048) * pow (2, d));
 1144|    111|		strncat (val, b, maxlen-1 - strlen (val));
 1145|    111|		break;
 1146|     69|	case EXIF_TAG_FILE_SOURCE:
  ------------------
  |  Branch (1146:2): [True: 69, False: 71.2k]
  ------------------
 1147|     69|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|     69|#define CF(entry,target,v,maxlen)					\
  |  |  647|     69|{									\
  |  |  648|     69|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 2, False: 67]
  |  |  ------------------
  |  |  649|      2|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      2|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      2|			"format ('%s', expected '%s')."),		\
  |  |  652|      2|			exif_tag_get_name (entry->tag),			\
  |  |  653|      2|			exif_format_get_name (entry->format),		\
  |  |  654|      2|			exif_format_get_name (target));			\
  |  |  655|      2|		break;							\
  |  |  656|      2|	}								\
  |  |  657|     69|}
  ------------------
 1148|     67|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|     67|#define CC(entry,target,v,maxlen)					\
  |  |  660|     67|{									\
  |  |  661|     67|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 13, False: 54]
  |  |  ------------------
  |  |  662|     13|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     13|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     13|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     13|			  "components (%i, expected %i)."),		\
  |  |  665|     13|			exif_tag_get_name (entry->tag),		\
  |  |  666|     13|			(int) entry->components, (int) target);		\
  |  |  667|     13|		break;							\
  |  |  668|     13|	}								\
  |  |  669|     67|}
  ------------------
 1149|     54|		v_byte = e->data[0];
 1150|     54|		if (v_byte == 3)
  ------------------
  |  Branch (1150:7): [True: 37, False: 17]
  ------------------
 1151|     37|			strncpy (val, _("DSC"), maxlen-1);
  ------------------
  |  |   31|     37|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1152|     17|		else
 1153|     17|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|     17|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1154|     17|				  "value %i)"), v_byte);
 1155|     54|		break;
 1156|    144|	case EXIF_TAG_COMPONENTS_CONFIGURATION:
  ------------------
  |  Branch (1156:2): [True: 144, False: 71.1k]
  ------------------
 1157|    144|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|    144|#define CF(entry,target,v,maxlen)					\
  |  |  647|    144|{									\
  |  |  648|    144|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 6, False: 138]
  |  |  ------------------
  |  |  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|    144|}
  ------------------
 1158|    138|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|    138|#define CC(entry,target,v,maxlen)					\
  |  |  660|    138|{									\
  |  |  661|    138|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 22, False: 116]
  |  |  ------------------
  |  |  662|     22|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     22|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     22|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     22|			  "components (%i, expected %i)."),		\
  |  |  665|     22|			exif_tag_get_name (entry->tag),		\
  |  |  666|     22|			(int) entry->components, (int) target);		\
  |  |  667|     22|		break;							\
  |  |  668|     22|	}								\
  |  |  669|    138|}
  ------------------
 1159|    580|		for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (1159:15): [True: 464, False: 116]
  ------------------
 1160|    464|			switch (e->data[i]) {
 1161|    118|			case 0: c = _("-"); break;
  ------------------
  |  |   31|    118|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1161:4): [True: 118, False: 346]
  ------------------
 1162|     90|			case 1: c = _("Y"); break;
  ------------------
  |  |   31|     90|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1162:4): [True: 90, False: 374]
  ------------------
 1163|     99|			case 2: c = _("Cb"); break;
  ------------------
  |  |   31|     99|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1163:4): [True: 99, False: 365]
  ------------------
 1164|    102|			case 3: c = _("Cr"); break;
  ------------------
  |  |   31|    102|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1164:4): [True: 102, False: 362]
  ------------------
 1165|      6|			case 4: c = _("R"); break;
  ------------------
  |  |   31|      6|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1165:4): [True: 6, False: 458]
  ------------------
 1166|      9|			case 5: c = _("G"); break;
  ------------------
  |  |   31|      9|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1166:4): [True: 9, False: 455]
  ------------------
 1167|      4|			case 6: c = _("B"); break;
  ------------------
  |  |   31|      4|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1167:4): [True: 4, False: 460]
  ------------------
 1168|     36|			default: c = _("Reserved"); break;
  ------------------
  |  |   31|     36|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (1168:4): [True: 36, False: 428]
  ------------------
 1169|    464|			}
 1170|    464|			strncat (val, c, maxlen-1 - strlen (val));
 1171|    464|			if (i < 3)
  ------------------
  |  Branch (1171:8): [True: 348, False: 116]
  ------------------
 1172|    348|				strncat (val, " ", maxlen-1 - strlen (val));
 1173|    464|		}
 1174|    116|		break;
 1175|    238|	case EXIF_TAG_EXPOSURE_BIAS_VALUE:
  ------------------
  |  Branch (1175:2): [True: 238, False: 71.0k]
  ------------------
 1176|    238|		CF (e, EXIF_FORMAT_SRATIONAL, val, maxlen)
  ------------------
  |  |  646|    238|#define CF(entry,target,v,maxlen)					\
  |  |  647|    238|{									\
  |  |  648|    238|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 7, False: 231]
  |  |  ------------------
  |  |  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|    238|}
  ------------------
 1177|    231|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    231|#define CC(entry,target,v,maxlen)					\
  |  |  660|    231|{									\
  |  |  661|    231|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 18, False: 213]
  |  |  ------------------
  |  |  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|    231|}
  ------------------
 1178|    213|		v_srat = exif_get_srational (e->data, o);
 1179|    213|		if (!v_srat.denominator) {
  ------------------
  |  Branch (1179:7): [True: 53, False: 160]
  ------------------
 1180|     53|			exif_entry_format_value(e, val, maxlen);
 1181|     53|			break;
 1182|     53|		}
 1183|    160|		d = (double) v_srat.numerator / (double) v_srat.denominator;
 1184|    160|		snprintf (val, maxlen, _("%.02f EV"), d);
  ------------------
  |  |   31|    160|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1185|    160|		break;
 1186|     60|	case EXIF_TAG_SCENE_TYPE:
  ------------------
  |  Branch (1186:2): [True: 60, False: 71.2k]
  ------------------
 1187|     60|		CF (e, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |  646|     60|#define CF(entry,target,v,maxlen)					\
  |  |  647|     60|{									\
  |  |  648|     60|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 2, False: 58]
  |  |  ------------------
  |  |  649|      2|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|      2|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|      2|			"format ('%s', expected '%s')."),		\
  |  |  652|      2|			exif_tag_get_name (entry->tag),			\
  |  |  653|      2|			exif_format_get_name (entry->format),		\
  |  |  654|      2|			exif_format_get_name (target));			\
  |  |  655|      2|		break;							\
  |  |  656|      2|	}								\
  |  |  657|     60|}
  ------------------
 1188|     58|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|     58|#define CC(entry,target,v,maxlen)					\
  |  |  660|     58|{									\
  |  |  661|     58|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 9, False: 49]
  |  |  ------------------
  |  |  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|     58|}
  ------------------
 1189|     49|		v_byte = e->data[0];
 1190|     49|		if (v_byte == 1)
  ------------------
  |  Branch (1190:7): [True: 46, False: 3]
  ------------------
 1191|     46|			strncpy (val, _("Directly photographed"), maxlen-1);
  ------------------
  |  |   31|     46|#  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|     49|		break;
 1196|     94|	case EXIF_TAG_YCBCR_SUB_SAMPLING:
  ------------------
  |  Branch (1196:2): [True: 94, False: 71.2k]
  ------------------
 1197|     94|		CF (e, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|     94|#define CF(entry,target,v,maxlen)					\
  |  |  647|     94|{									\
  |  |  648|     94|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 21, False: 73]
  |  |  ------------------
  |  |  649|     21|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     21|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     21|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     21|			"format ('%s', expected '%s')."),		\
  |  |  652|     21|			exif_tag_get_name (entry->tag),			\
  |  |  653|     21|			exif_format_get_name (entry->format),		\
  |  |  654|     21|			exif_format_get_name (target));			\
  |  |  655|     21|		break;							\
  |  |  656|     21|	}								\
  |  |  657|     94|}
  ------------------
 1198|     73|		CC (e, 2, val, maxlen)
  ------------------
  |  |  659|     73|#define CC(entry,target,v,maxlen)					\
  |  |  660|     73|{									\
  |  |  661|     73|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 37, False: 36]
  |  |  ------------------
  |  |  662|     37|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     37|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     37|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     37|			  "components (%i, expected %i)."),		\
  |  |  665|     37|			exif_tag_get_name (entry->tag),		\
  |  |  666|     37|			(int) entry->components, (int) target);		\
  |  |  667|     37|		break;							\
  |  |  668|     37|	}								\
  |  |  669|     73|}
  ------------------
 1199|     36|		v_short  = exif_get_short (e->data, o);
 1200|     36|		v_short2 = exif_get_short (
 1201|     36|			e->data + exif_format_get_size (e->format),
 1202|     36|			o);
 1203|     36|		if ((v_short == 2) && (v_short2 == 1))
  ------------------
  |  Branch (1203:7): [True: 22, False: 14]
  |  Branch (1203:25): [True: 5, False: 17]
  ------------------
 1204|      5|			strncpy (val, _("YCbCr4:2:2"), maxlen-1);
  ------------------
  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1205|     31|		else if ((v_short == 2) && (v_short2 == 2))
  ------------------
  |  Branch (1205:12): [True: 17, False: 14]
  |  Branch (1205:30): [True: 3, False: 14]
  ------------------
 1206|      3|			strncpy (val, _("YCbCr4:2:0"), maxlen-1);
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1207|     28|		else
 1208|     28|			snprintf (val, maxlen, "%u, %u", v_short, v_short2);
 1209|     36|		break;
 1210|     19|	case EXIF_TAG_SUBJECT_AREA:
  ------------------
  |  Branch (1210:2): [True: 19, False: 71.3k]
  ------------------
 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|      3|		case 4:
  ------------------
  |  Branch (1227:3): [True: 3, False: 9]
  ------------------
 1228|      3|			v_short  = exif_get_short (e->data, o);
 1229|      3|			v_short2 = exif_get_short (e->data + 2, o);
 1230|      3|			v_short3 = exif_get_short (e->data + 4, o);
 1231|      3|			v_short4 = exif_get_short (e->data + 6, o);
 1232|      3|			snprintf (val, maxlen, _("Within rectangle "
  ------------------
  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1233|      3|				"(width %i, height %i) around "
 1234|      3|				"(x,y) = (%i,%i)"), v_short3, v_short4,
 1235|      3|				v_short, v_short2);
 1236|      3|			break;
 1237|      7|		default:
  ------------------
  |  Branch (1237:3): [True: 7, False: 5]
  ------------------
 1238|      7|			snprintf (val, maxlen, _("Unexpected number "
  ------------------
  |  |   31|      7|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1239|      7|				"of components (%li, expected 2, 3, or 4)."),
 1240|      7|				e->components);	
 1241|     12|		}
 1242|     12|		break;
 1243|    198|	case EXIF_TAG_GPS_VERSION_ID:
  ------------------
  |  Branch (1243:2): [True: 198, False: 71.1k]
  ------------------
 1244|       |		/* This is only valid in the GPS IFD */
 1245|    198|		CF (e, EXIF_FORMAT_BYTE, val, maxlen)
  ------------------
  |  |  646|    198|#define CF(entry,target,v,maxlen)					\
  |  |  647|    198|{									\
  |  |  648|    198|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 149, False: 49]
  |  |  ------------------
  |  |  649|    149|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|    149|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|    149|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|    149|			"format ('%s', expected '%s')."),		\
  |  |  652|    149|			exif_tag_get_name (entry->tag),			\
  |  |  653|    149|			exif_format_get_name (entry->format),		\
  |  |  654|    149|			exif_format_get_name (target));			\
  |  |  655|    149|		break;							\
  |  |  656|    149|	}								\
  |  |  657|    198|}
  ------------------
 1246|     49|		CC (e, 4, val, maxlen)
  ------------------
  |  |  659|     49|#define CC(entry,target,v,maxlen)					\
  |  |  660|     49|{									\
  |  |  661|     49|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 40, False: 9]
  |  |  ------------------
  |  |  662|     40|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     40|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     40|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     40|			  "components (%i, expected %i)."),		\
  |  |  665|     40|			exif_tag_get_name (entry->tag),		\
  |  |  666|     40|			(int) entry->components, (int) target);		\
  |  |  667|     40|		break;							\
  |  |  668|     40|	}								\
  |  |  669|     49|}
  ------------------
 1247|      9|		v_byte = e->data[0];
 1248|      9|		snprintf (val, maxlen, "%u", v_byte);
 1249|     36|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (1249:15): [True: 27, False: 9]
  ------------------
 1250|     27|			v_byte = e->data[i];
 1251|     27|			snprintf (b, sizeof (b), ".%u", v_byte);
 1252|     27|			strncat (val, b, maxlen-1 - strlen (val));
 1253|     27|		}
 1254|      9|		break;
 1255|    281|	case EXIF_TAG_INTEROPERABILITY_VERSION:
  ------------------
  |  Branch (1255:2): [True: 281, False: 71.0k]
  ------------------
 1256|       |	/* a.k.a. case EXIF_TAG_GPS_LATITUDE: */
 1257|       |		/* This tag occurs in EXIF_IFD_INTEROPERABILITY */
 1258|    281|		if (e->format == EXIF_FORMAT_UNDEFINED) {
  ------------------
  |  Branch (1258:7): [True: 44, False: 237]
  ------------------
 1259|     44|			strncpy (val, (char *) e->data, MIN (maxlen-1, e->size));
  ------------------
  |  |  182|     44|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 3, False: 41]
  |  |  ------------------
  ------------------
 1260|     44|			break;
 1261|     44|		}
 1262|       |		/* EXIF_TAG_GPS_LATITUDE is the same numerically as
 1263|       |		 * EXIF_TAG_INTEROPERABILITY_VERSION but in EXIF_IFD_GPS
 1264|       |		 */
 1265|    237|		exif_entry_format_value(e, val, maxlen);
 1266|    237|		break;
 1267|     94|	case EXIF_TAG_GPS_ALTITUDE_REF:
  ------------------
  |  Branch (1267:2): [True: 94, False: 71.2k]
  ------------------
 1268|       |		/* This is only valid in the GPS IFD */
 1269|     94|		CF (e, EXIF_FORMAT_BYTE, val, maxlen)
  ------------------
  |  |  646|     94|#define CF(entry,target,v,maxlen)					\
  |  |  647|     94|{									\
  |  |  648|     94|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 14, False: 80]
  |  |  ------------------
  |  |  649|     14|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     14|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     14|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     14|			"format ('%s', expected '%s')."),		\
  |  |  652|     14|			exif_tag_get_name (entry->tag),			\
  |  |  653|     14|			exif_format_get_name (entry->format),		\
  |  |  654|     14|			exif_format_get_name (target));			\
  |  |  655|     14|		break;							\
  |  |  656|     14|	}								\
  |  |  657|     94|}
  ------------------
 1270|     80|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|     80|#define CC(entry,target,v,maxlen)					\
  |  |  660|     80|{									\
  |  |  661|     80|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 41, False: 39]
  |  |  ------------------
  |  |  662|     41|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     41|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     41|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     41|			  "components (%i, expected %i)."),		\
  |  |  665|     41|			exif_tag_get_name (entry->tag),		\
  |  |  666|     41|			(int) entry->components, (int) target);		\
  |  |  667|     41|		break;							\
  |  |  668|     41|	}								\
  |  |  669|     80|}
  ------------------
 1271|     39|		v_byte = e->data[0];
 1272|     39|		if (v_byte == 0)
  ------------------
  |  Branch (1272:7): [True: 25, False: 14]
  ------------------
 1273|     25|			strncpy (val, _("Sea level"), maxlen-1);
  ------------------
  |  |   31|     25|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1274|     14|		else if (v_byte == 1)
  ------------------
  |  Branch (1274:12): [True: 1, False: 13]
  ------------------
 1275|      1|			strncpy (val, _("Sea level reference"), maxlen-1);
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1276|     13|		else
 1277|     13|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|     13|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1278|     13|				  "value %i)"), v_byte);
 1279|     39|		break;
 1280|    346|	case EXIF_TAG_GPS_TIME_STAMP:
  ------------------
  |  Branch (1280:2): [True: 346, False: 70.9k]
  ------------------
 1281|       |		/* This is only valid in the GPS IFD */
 1282|    346|		CF (e, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |  646|    346|#define CF(entry,target,v,maxlen)					\
  |  |  647|    346|{									\
  |  |  648|    346|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 43, False: 303]
  |  |  ------------------
  |  |  649|     43|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     43|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     43|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     43|			"format ('%s', expected '%s')."),		\
  |  |  652|     43|			exif_tag_get_name (entry->tag),			\
  |  |  653|     43|			exif_format_get_name (entry->format),		\
  |  |  654|     43|			exif_format_get_name (target));			\
  |  |  655|     43|		break;							\
  |  |  656|     43|	}								\
  |  |  657|    346|}
  ------------------
 1283|    303|		CC (e, 3, val, maxlen)
  ------------------
  |  |  659|    303|#define CC(entry,target,v,maxlen)					\
  |  |  660|    303|{									\
  |  |  661|    303|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 10, False: 293]
  |  |  ------------------
  |  |  662|     10|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     10|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     10|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     10|			  "components (%i, expected %i)."),		\
  |  |  665|     10|			exif_tag_get_name (entry->tag),		\
  |  |  666|     10|			(int) entry->components, (int) target);		\
  |  |  667|     10|		break;							\
  |  |  668|     10|	}								\
  |  |  669|    303|}
  ------------------
 1284|       |
 1285|    293|		v_rat  = exif_get_rational (e->data, o);
 1286|    293|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1286:7): [True: 32, False: 261]
  ------------------
 1287|     32|			exif_entry_format_value(e, val, maxlen);
 1288|     32|			break;
 1289|     32|		}
 1290|    261|		i = v_rat.numerator / v_rat.denominator;
 1291|       |
 1292|    261|		v_rat = exif_get_rational (e->data +
 1293|    261|					     exif_format_get_size (e->format),
 1294|    261|					   o);
 1295|    261|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1295:7): [True: 30, False: 231]
  ------------------
 1296|     30|			exif_entry_format_value(e, val, maxlen);
 1297|     30|			break;
 1298|     30|		}
 1299|    231|		j = v_rat.numerator / v_rat.denominator;
 1300|       |
 1301|    231|		v_rat = exif_get_rational (e->data +
 1302|    231|					     2*exif_format_get_size (e->format),
 1303|    231|					     o);
 1304|    231|		if (!v_rat.denominator) {
  ------------------
  |  Branch (1304:7): [True: 48, False: 183]
  ------------------
 1305|     48|			exif_entry_format_value(e, val, maxlen);
 1306|     48|			break;
 1307|     48|		}
 1308|    183|		d = (double) v_rat.numerator / (double) v_rat.denominator;
 1309|    183|		snprintf (val, maxlen, "%02u:%02u:%05.2f", i, j, d);
 1310|    183|		break;
 1311|       |
 1312|    218|	case EXIF_TAG_METERING_MODE:
  ------------------
  |  Branch (1312:2): [True: 218, False: 71.1k]
  ------------------
 1313|    456|	case EXIF_TAG_COMPRESSION:
  ------------------
  |  Branch (1313:2): [True: 238, False: 71.0k]
  ------------------
 1314|    553|	case EXIF_TAG_LIGHT_SOURCE:
  ------------------
  |  Branch (1314:2): [True: 97, False: 71.2k]
  ------------------
 1315|    588|	case EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT:
  ------------------
  |  Branch (1315:2): [True: 35, False: 71.2k]
  ------------------
 1316|  8.35k|	case EXIF_TAG_RESOLUTION_UNIT:
  ------------------
  |  Branch (1316:2): [True: 7.77k, False: 63.5k]
  ------------------
 1317|  8.47k|	case EXIF_TAG_EXPOSURE_PROGRAM:
  ------------------
  |  Branch (1317:2): [True: 116, False: 71.2k]
  ------------------
 1318|  8.48k|	case EXIF_TAG_SENSITIVITY_TYPE:
  ------------------
  |  Branch (1318:2): [True: 11, False: 71.3k]
  ------------------
 1319|  8.60k|	case EXIF_TAG_FLASH:
  ------------------
  |  Branch (1319:2): [True: 120, False: 71.2k]
  ------------------
 1320|  8.62k|	case EXIF_TAG_SUBJECT_DISTANCE_RANGE:
  ------------------
  |  Branch (1320:2): [True: 20, False: 71.3k]
  ------------------
 1321|  16.1k|	case EXIF_TAG_COLOR_SPACE:
  ------------------
  |  Branch (1321:2): [True: 7.54k, False: 63.7k]
  ------------------
 1322|  16.1k|	case EXIF_TAG_COMPOSITE_IMAGE:
  ------------------
  |  Branch (1322:2): [True: 4, False: 71.3k]
  ------------------
 1323|  16.1k|		CF (e,EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|  16.1k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  16.1k|{									\
  |  |  648|  16.1k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 95, False: 16.0k]
  |  |  ------------------
  |  |  649|     95|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|     95|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|     95|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|     95|			"format ('%s', expected '%s')."),		\
  |  |  652|     95|			exif_tag_get_name (entry->tag),			\
  |  |  653|     95|			exif_format_get_name (entry->format),		\
  |  |  654|     95|			exif_format_get_name (target));			\
  |  |  655|     95|		break;							\
  |  |  656|     95|	}								\
  |  |  657|  16.1k|}
  ------------------
 1324|  16.0k|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|  16.0k|#define CC(entry,target,v,maxlen)					\
  |  |  660|  16.0k|{									\
  |  |  661|  16.0k|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 92, False: 15.9k]
  |  |  ------------------
  |  |  662|     92|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|     92|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|     92|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|     92|			  "components (%i, expected %i)."),		\
  |  |  665|     92|			exif_tag_get_name (entry->tag),		\
  |  |  666|     92|			(int) entry->components, (int) target);		\
  |  |  667|     92|		break;							\
  |  |  668|     92|	}								\
  |  |  669|  16.0k|}
  ------------------
 1325|  15.9k|		v_short = exif_get_short (e->data, o);
 1326|       |
 1327|       |		/* Search the tag */
 1328|   116k|		for (i = 0; list2[i].tag && (list2[i].tag != e->tag); i++);
  ------------------
  |  Branch (1328:15): [True: 116k, False: 0]
  |  Branch (1328:31): [True: 100k, False: 15.9k]
  ------------------
 1329|  15.9k|		if (!list2[i].tag) {
  ------------------
  |  Branch (1329:7): [True: 0, False: 15.9k]
  ------------------
 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|  34.2k|		for (j = 0; list2[i].elem[j].values[0] &&
  ------------------
  |  Branch (1336:15): [True: 34.0k, False: 168]
  ------------------
 1337|  34.0k|			    (list2[i].elem[j].index < v_short); j++);
  ------------------
  |  Branch (1337:8): [True: 18.2k, False: 15.8k]
  ------------------
 1338|  15.9k|		if (list2[i].elem[j].index != v_short) {
  ------------------
  |  Branch (1338:7): [True: 390, False: 15.6k]
  ------------------
 1339|    390|			snprintf (val, maxlen, _("Internal error (unknown "
  ------------------
  |  |   31|    390|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1340|    390|				  "value %i)"), v_short);
 1341|    390|			break;
 1342|    390|		}
 1343|       |
 1344|       |		/* Find a short enough value */
 1345|  15.6k|		memset (val, 0, maxlen);
 1346|  39.0k|		for (k = 0; list2[i].elem[j].values[k]; k++) {
  ------------------
  |  Branch (1346:15): [True: 23.4k, False: 15.6k]
  ------------------
 1347|  23.4k|			size_t l = strlen (_(list2[i].elem[j].values[k]));
  ------------------
  |  |   31|  23.4k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1348|  23.4k|			if ((maxlen > l) && (strlen (val) < l))
  ------------------
  |  Branch (1348:8): [True: 23.4k, False: 0]
  |  Branch (1348:24): [True: 15.6k, False: 7.84k]
  ------------------
 1349|  15.6k|				strncpy (val, _(list2[i].elem[j].values[k]), maxlen-1);
  ------------------
  |  |   31|  15.6k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1350|  23.4k|		}
 1351|  15.6k|		if (!val[0]) snprintf (val, maxlen, "%i", v_short);
  ------------------
  |  Branch (1351:7): [True: 0, False: 15.6k]
  ------------------
 1352|       |
 1353|  15.6k|		break;
 1354|       |
 1355|     81|	case EXIF_TAG_PLANAR_CONFIGURATION:
  ------------------
  |  Branch (1355:2): [True: 81, False: 71.2k]
  ------------------
 1356|    106|	case EXIF_TAG_SENSING_METHOD:
  ------------------
  |  Branch (1356:2): [True: 25, False: 71.3k]
  ------------------
 1357|    294|	case EXIF_TAG_ORIENTATION:
  ------------------
  |  Branch (1357:2): [True: 188, False: 71.1k]
  ------------------
 1358|    477|	case EXIF_TAG_YCBCR_POSITIONING:
  ------------------
  |  Branch (1358:2): [True: 183, False: 71.1k]
  ------------------
 1359|    529|	case EXIF_TAG_PHOTOMETRIC_INTERPRETATION:
  ------------------
  |  Branch (1359:2): [True: 52, False: 71.2k]
  ------------------
 1360|    643|	case EXIF_TAG_CUSTOM_RENDERED:
  ------------------
  |  Branch (1360:2): [True: 114, False: 71.2k]
  ------------------
 1361|    732|	case EXIF_TAG_EXPOSURE_MODE:
  ------------------
  |  Branch (1361:2): [True: 89, False: 71.2k]
  ------------------
 1362|    845|	case EXIF_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (1362:2): [True: 113, False: 71.2k]
  ------------------
 1363|    929|	case EXIF_TAG_SCENE_CAPTURE_TYPE:
  ------------------
  |  Branch (1363:2): [True: 84, False: 71.2k]
  ------------------
 1364|    983|	case EXIF_TAG_GAIN_CONTROL:
  ------------------
  |  Branch (1364:2): [True: 54, False: 71.2k]
  ------------------
 1365|  1.07k|	case EXIF_TAG_SATURATION:
  ------------------
  |  Branch (1365:2): [True: 94, False: 71.2k]
  ------------------
 1366|  1.12k|	case EXIF_TAG_CONTRAST:
  ------------------
  |  Branch (1366:2): [True: 48, False: 71.2k]
  ------------------
 1367|  1.15k|	case EXIF_TAG_SHARPNESS:
  ------------------
  |  Branch (1367:2): [True: 29, False: 71.2k]
  ------------------
 1368|  1.15k|		CF (e, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |  646|  1.15k|#define CF(entry,target,v,maxlen)					\
  |  |  647|  1.15k|{									\
  |  |  648|  1.15k|	if (entry->format != target) {					\
  |  |  ------------------
  |  |  |  Branch (648:6): [True: 172, False: 982]
  |  |  ------------------
  |  |  649|    172|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  650|    172|			_("The tag '%s' contains data of an invalid "	\
  |  |  ------------------
  |  |  |  |   31|    172|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  651|    172|			"format ('%s', expected '%s')."),		\
  |  |  652|    172|			exif_tag_get_name (entry->tag),			\
  |  |  653|    172|			exif_format_get_name (entry->format),		\
  |  |  654|    172|			exif_format_get_name (target));			\
  |  |  655|    172|		break;							\
  |  |  656|    172|	}								\
  |  |  657|  1.15k|}
  ------------------
 1369|    982|		CC (e, 1, val, maxlen)
  ------------------
  |  |  659|    982|#define CC(entry,target,v,maxlen)					\
  |  |  660|    982|{									\
  |  |  661|    982|	if (entry->components != target) {				\
  |  |  ------------------
  |  |  |  Branch (661:6): [True: 255, False: 727]
  |  |  ------------------
  |  |  662|    255|		exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,	\
  |  |  663|    255|			_("The tag '%s' contains an invalid number of "	\
  |  |  ------------------
  |  |  |  |   31|    255|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |  664|    255|			  "components (%i, expected %i)."),		\
  |  |  665|    255|			exif_tag_get_name (entry->tag),		\
  |  |  666|    255|			(int) entry->components, (int) target);		\
  |  |  667|    255|		break;							\
  |  |  668|    255|	}								\
  |  |  669|    982|}
  ------------------
 1370|    727|		v_short = exif_get_short (e->data, o);
 1371|       |
 1372|       |		/* Search the tag */
 1373|  4.34k|		for (i = 0; list[i].tag && (list[i].tag != e->tag); i++);
  ------------------
  |  Branch (1373:15): [True: 4.34k, False: 0]
  |  Branch (1373:30): [True: 3.61k, False: 727]
  ------------------
 1374|    727|		if (!list[i].tag) {
  ------------------
  |  Branch (1374:7): [True: 0, False: 727]
  ------------------
 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|  2.04k|		for (j = 0; list[i].strings[j] && (j < v_short); j++);
  ------------------
  |  Branch (1381:15): [True: 1.86k, False: 187]
  |  Branch (1381:37): [True: 1.32k, False: 540]
  ------------------
 1382|    727|		if (!list[i].strings[j])
  ------------------
  |  Branch (1382:7): [True: 187, False: 540]
  ------------------
 1383|    187|			snprintf (val, maxlen, "%i", v_short);
 1384|    540|		else if (!*list[i].strings[j])
  ------------------
  |  Branch (1384:12): [True: 34, False: 506]
  ------------------
 1385|     34|			snprintf (val, maxlen, _("Unknown value %i"), v_short);
  ------------------
  |  |   31|     34|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1386|    506|		else
 1387|    506|			strncpy (val, _(list[i].strings[j]), maxlen-1);
  ------------------
  |  |   31|    506|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1388|    727|		break;
 1389|       |
 1390|     18|	case EXIF_TAG_XP_TITLE:
  ------------------
  |  Branch (1390:2): [True: 18, False: 71.3k]
  ------------------
 1391|     45|	case EXIF_TAG_XP_COMMENT:
  ------------------
  |  Branch (1391:2): [True: 27, False: 71.3k]
  ------------------
 1392|     69|	case EXIF_TAG_XP_AUTHOR:
  ------------------
  |  Branch (1392:2): [True: 24, False: 71.3k]
  ------------------
 1393|     86|	case EXIF_TAG_XP_KEYWORDS:
  ------------------
  |  Branch (1393:2): [True: 17, False: 71.3k]
  ------------------
 1394|    114|	case EXIF_TAG_XP_SUBJECT:
  ------------------
  |  Branch (1394:2): [True: 28, False: 71.2k]
  ------------------
 1395|    114|	{
 1396|    114|		unsigned char *utf16;
 1397|    114|		unsigned int s;
 1398|       |
 1399|       |		/* Sanity check the size to prevent overflow. Note EXIF files are 64kb at most. */
 1400|    114|		if (e->size >= 65536 - sizeof(uint16_t)*2) break;
  ------------------
  |  Branch (1400:7): [True: 0, False: 114]
  ------------------
 1401|       |
 1402|       |		/* The tag may not be U+0000-terminated , so make a local
 1403|       |		   U+0000-terminated copy before converting it */
 1404|    114|		s = e->size+sizeof(uint16_t)+1;
 1405|    114|		utf16 = exif_mem_alloc (e->priv->mem, s);
 1406|    114|		if (!utf16) {
  ------------------
  |  Branch (1406:7): [True: 0, False: 114]
  ------------------
 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|    114|		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|    114|		utf16[e->size] = 0;
 1418|    114|		utf16[e->size+1] = 0;
 1419|    114|		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|    114|		exif_convert_utf16_to_utf8(val, maxlen, utf16, e->size+3);
 1424|    114|		exif_mem_free(e->priv->mem, utf16);
 1425|    114|		break;
 1426|    114|	}
 1427|       |
 1428|  35.0k|	default:
  ------------------
  |  Branch (1428:2): [True: 35.0k, False: 36.2k]
  ------------------
 1429|       |		/* Use a generic value formatting */
 1430|  35.0k|		exif_entry_format_value(e, val, maxlen);
 1431|  71.3k|	}
 1432|       |
 1433|  71.3k|	return val;
 1434|  71.3k|}
exif_entry_initialize:
 1475|  45.3k|{
 1476|  45.3k|	ExifRational r;
 1477|  45.3k|	ExifByteOrder o;
 1478|       |
 1479|  45.3k|	if (!e || !e->parent || e->data || !e->parent->parent)
  ------------------
  |  Branch (1479:6): [True: 0, False: 45.3k]
  |  Branch (1479:12): [True: 0, False: 45.3k]
  |  Branch (1479:26): [True: 0, False: 45.3k]
  |  Branch (1479:37): [True: 0, False: 45.3k]
  ------------------
 1480|      0|		return;
 1481|       |	/* We need the byte order */
 1482|  45.3k|	o = exif_data_get_byte_order (e->parent->parent);
 1483|       |
 1484|  45.3k|	e->tag = tag;
 1485|       |
 1486|  45.3k|	if(exif_entry_get_ifd(e) == EXIF_IFD_GPS) {
  ------------------
  |  |  182|  45.3k|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 45.3k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1486:5): [True: 0, False: 45.3k]
  ------------------
 1487|      0|	  exif_entry_initialize_gps(e, tag);
 1488|      0|      return;
 1489|      0|	}
 1490|       |
 1491|  45.3k|	switch (tag) {
 1492|       |
 1493|       |	/* LONG, 1 component, no default */
 1494|      0|	case EXIF_TAG_PIXEL_X_DIMENSION:
  ------------------
  |  Branch (1494:2): [True: 0, False: 45.3k]
  ------------------
 1495|      0|	case EXIF_TAG_PIXEL_Y_DIMENSION:
  ------------------
  |  Branch (1495:2): [True: 0, False: 45.3k]
  ------------------
 1496|      0|	case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (1496:2): [True: 0, False: 45.3k]
  ------------------
 1497|      0|	case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (1497:2): [True: 0, False: 45.3k]
  ------------------
 1498|      0|	case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (1498:2): [True: 0, False: 45.3k]
  ------------------
 1499|      0|	case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (1499:2): [True: 0, False: 45.3k]
  ------------------
 1500|      0|	case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (1500:2): [True: 0, False: 45.3k]
  ------------------
 1501|      0|	case EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY:
  ------------------
  |  Branch (1501:2): [True: 0, False: 45.3k]
  ------------------
 1502|      0|	case EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX:
  ------------------
  |  Branch (1502:2): [True: 0, False: 45.3k]
  ------------------
 1503|      0|	case EXIF_TAG_ISO_SPEED:
  ------------------
  |  Branch (1503:2): [True: 0, False: 45.3k]
  ------------------
 1504|      0|	case EXIF_TAG_ISO_SPEEDLatitudeYYY:
  ------------------
  |  Branch (1504:2): [True: 0, False: 45.3k]
  ------------------
 1505|      0|	case EXIF_TAG_ISO_SPEEDLatitudeZZZ:
  ------------------
  |  Branch (1505:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1515|      0|	case EXIF_TAG_SENSING_METHOD:
  ------------------
  |  Branch (1515:2): [True: 0, False: 45.3k]
  ------------------
 1516|      0|	case EXIF_TAG_PHOTOMETRIC_INTERPRETATION:
  ------------------
  |  Branch (1516:2): [True: 0, False: 45.3k]
  ------------------
 1517|    194|	case EXIF_TAG_COMPRESSION:
  ------------------
  |  Branch (1517:2): [True: 194, False: 45.1k]
  ------------------
 1518|    194|	case EXIF_TAG_EXPOSURE_MODE:
  ------------------
  |  Branch (1518:2): [True: 0, False: 45.3k]
  ------------------
 1519|    194|	case EXIF_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (1519:2): [True: 0, False: 45.3k]
  ------------------
 1520|    194|	case EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM:
  ------------------
  |  Branch (1520:2): [True: 0, False: 45.3k]
  ------------------
 1521|    194|	case EXIF_TAG_GAIN_CONTROL:
  ------------------
  |  Branch (1521:2): [True: 0, False: 45.3k]
  ------------------
 1522|    194|	case EXIF_TAG_SUBJECT_DISTANCE_RANGE:
  ------------------
  |  Branch (1522:2): [True: 0, False: 45.3k]
  ------------------
 1523|    194|	case EXIF_TAG_FLASH:
  ------------------
  |  Branch (1523:2): [True: 0, False: 45.3k]
  ------------------
 1524|    194|	case EXIF_TAG_ISO_SPEED_RATINGS:
  ------------------
  |  Branch (1524:2): [True: 0, False: 45.3k]
  ------------------
 1525|    194|	case EXIF_TAG_SENSITIVITY_TYPE:
  ------------------
  |  Branch (1525:2): [True: 0, False: 45.3k]
  ------------------
 1526|    194|	case EXIF_TAG_COMPOSITE_IMAGE:
  ------------------
  |  Branch (1526:2): [True: 0, False: 45.3k]
  ------------------
 1527|       |
 1528|       |	/* SHORT, 1 component, default 0 */
 1529|    194|	case EXIF_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (1529:2): [True: 0, False: 45.3k]
  ------------------
 1530|    194|	case EXIF_TAG_IMAGE_LENGTH:
  ------------------
  |  Branch (1530:2): [True: 0, False: 45.3k]
  ------------------
 1531|    194|	case EXIF_TAG_EXPOSURE_PROGRAM:
  ------------------
  |  Branch (1531:2): [True: 0, False: 45.3k]
  ------------------
 1532|    194|	case EXIF_TAG_LIGHT_SOURCE:
  ------------------
  |  Branch (1532:2): [True: 0, False: 45.3k]
  ------------------
 1533|    194|	case EXIF_TAG_METERING_MODE:
  ------------------
  |  Branch (1533:2): [True: 0, False: 45.3k]
  ------------------
 1534|    194|	case EXIF_TAG_CUSTOM_RENDERED:
  ------------------
  |  Branch (1534:2): [True: 0, False: 45.3k]
  ------------------
 1535|    194|	case EXIF_TAG_SCENE_CAPTURE_TYPE:
  ------------------
  |  Branch (1535:2): [True: 0, False: 45.3k]
  ------------------
 1536|    194|	case EXIF_TAG_CONTRAST:
  ------------------
  |  Branch (1536:2): [True: 0, False: 45.3k]
  ------------------
 1537|    194|	case EXIF_TAG_SATURATION:
  ------------------
  |  Branch (1537:2): [True: 0, False: 45.3k]
  ------------------
 1538|    194|	case EXIF_TAG_SHARPNESS:
  ------------------
  |  Branch (1538:2): [True: 0, False: 45.3k]
  ------------------
 1539|    194|		e->components = 1;
 1540|    194|		e->format = EXIF_FORMAT_SHORT;
 1541|    194|		e->size = exif_format_get_size (e->format) * e->components;
 1542|    194|		e->data = exif_entry_alloc (e, e->size);
 1543|    194|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1543:7): [True: 0, False: 194]
  ------------------
 1544|    194|		exif_set_short (e->data, o, 0);
 1545|    194|		break;
 1546|       |
 1547|       |	/* SHORT, 1 component, default 1 */
 1548|      0|	case EXIF_TAG_ORIENTATION:
  ------------------
  |  Branch (1548:2): [True: 0, False: 45.3k]
  ------------------
 1549|      0|	case EXIF_TAG_PLANAR_CONFIGURATION:
  ------------------
  |  Branch (1549:2): [True: 0, False: 45.3k]
  ------------------
 1550|      0|	case EXIF_TAG_YCBCR_POSITIONING:
  ------------------
  |  Branch (1550:2): [True: 0, False: 45.3k]
  ------------------
 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|  7.60k|	case EXIF_TAG_RESOLUTION_UNIT:
  ------------------
  |  Branch (1560:2): [True: 7.60k, False: 37.7k]
  ------------------
 1561|  7.60k|	case EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT:
  ------------------
  |  Branch (1561:2): [True: 0, False: 45.3k]
  ------------------
 1562|  7.60k|		e->components = 1;
 1563|  7.60k|		e->format = EXIF_FORMAT_SHORT;
 1564|  7.60k|		e->size = exif_format_get_size (e->format) * e->components;
 1565|  7.60k|		e->data = exif_entry_alloc (e, e->size);
 1566|  7.60k|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1566:7): [True: 0, False: 7.60k]
  ------------------
 1567|  7.60k|		exif_set_short (e->data, o, 2);
 1568|  7.60k|		break;
 1569|       |
 1570|       |	/* SHORT, 1 component, default 3 */
 1571|      0|	case EXIF_TAG_SAMPLES_PER_PIXEL:
  ------------------
  |  Branch (1571:2): [True: 0, False: 45.3k]
  ------------------
 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|  7.44k|	case EXIF_TAG_COLOR_SPACE:
  ------------------
  |  Branch (1581:2): [True: 7.44k, False: 37.9k]
  ------------------
 1582|  7.44k|		e->components = 1;
 1583|  7.44k|		e->format = EXIF_FORMAT_SHORT;
 1584|  7.44k|		e->size = exif_format_get_size (e->format) * e->components;
 1585|  7.44k|		e->data = exif_entry_alloc (e, e->size);
 1586|  7.44k|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1586:7): [True: 0, False: 7.44k]
  ------------------
 1587|  7.44k|		exif_set_short (e->data, o, 0xffff);
 1588|  7.44k|		break;
 1589|       |
 1590|       |	/* SHORT, 3 components, default 8 8 8 */
 1591|      0|	case EXIF_TAG_BITS_PER_SAMPLE:
  ------------------
  |  Branch (1591:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1634|      0|	case EXIF_TAG_BRIGHTNESS_VALUE:
  ------------------
  |  Branch (1634:2): [True: 0, False: 45.3k]
  ------------------
 1635|      0|	case EXIF_TAG_SHUTTER_SPEED_VALUE:
  ------------------
  |  Branch (1635:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1645|      0|	case EXIF_TAG_FOCAL_PLANE_X_RESOLUTION:
  ------------------
  |  Branch (1645:2): [True: 0, False: 45.3k]
  ------------------
 1646|      0|	case EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION:
  ------------------
  |  Branch (1646:2): [True: 0, False: 45.3k]
  ------------------
 1647|      0|	case EXIF_TAG_EXPOSURE_INDEX:
  ------------------
  |  Branch (1647:2): [True: 0, False: 45.3k]
  ------------------
 1648|      0|	case EXIF_TAG_FLASH_ENERGY:
  ------------------
  |  Branch (1648:2): [True: 0, False: 45.3k]
  ------------------
 1649|      0|	case EXIF_TAG_FNUMBER:
  ------------------
  |  Branch (1649:2): [True: 0, False: 45.3k]
  ------------------
 1650|      0|	case EXIF_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (1650:2): [True: 0, False: 45.3k]
  ------------------
 1651|      0|	case EXIF_TAG_SUBJECT_DISTANCE:
  ------------------
  |  Branch (1651:2): [True: 0, False: 45.3k]
  ------------------
 1652|      0|	case EXIF_TAG_MAX_APERTURE_VALUE:
  ------------------
  |  Branch (1652:2): [True: 0, False: 45.3k]
  ------------------
 1653|      0|	case EXIF_TAG_APERTURE_VALUE:
  ------------------
  |  Branch (1653:2): [True: 0, False: 45.3k]
  ------------------
 1654|      0|	case EXIF_TAG_COMPRESSED_BITS_PER_PIXEL:
  ------------------
  |  Branch (1654:2): [True: 0, False: 45.3k]
  ------------------
 1655|      0|	case EXIF_TAG_PRIMARY_CHROMATICITIES:
  ------------------
  |  Branch (1655:2): [True: 0, False: 45.3k]
  ------------------
 1656|      0|	case EXIF_TAG_DIGITAL_ZOOM_RATIO:
  ------------------
  |  Branch (1656:2): [True: 0, False: 45.3k]
  ------------------
 1657|      0|	case EXIF_TAG_GAMMA:
  ------------------
  |  Branch (1657:2): [True: 0, False: 45.3k]
  ------------------
 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|  7.59k|	case EXIF_TAG_X_RESOLUTION:
  ------------------
  |  Branch (1666:2): [True: 7.59k, False: 37.7k]
  ------------------
 1667|  15.2k|	case EXIF_TAG_Y_RESOLUTION:
  ------------------
  |  Branch (1667:2): [True: 7.63k, False: 37.7k]
  ------------------
 1668|  15.2k|		e->components = 1;
 1669|  15.2k|		e->format = EXIF_FORMAT_RATIONAL;
 1670|  15.2k|		e->size = exif_format_get_size (e->format) * e->components;
 1671|  15.2k|		e->data = exif_entry_alloc (e, e->size);
 1672|  15.2k|		if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1672:7): [True: 0, False: 15.2k]
  ------------------
 1673|  15.2k|		r.numerator = 72;
 1674|  15.2k|		r.denominator = 1;
 1675|  15.2k|		exif_set_rational (e->data, o, r);
 1676|  15.2k|		break;
 1677|       |
 1678|       |	/* RATIONAL, 2 components, no default */
 1679|      0|	case EXIF_TAG_WHITE_POINT:
  ------------------
  |  Branch (1679:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1725|      0|	case EXIF_TAG_DATE_TIME_ORIGINAL:
  ------------------
  |  Branch (1725:2): [True: 0, False: 45.3k]
  ------------------
 1726|      0|	case EXIF_TAG_DATE_TIME_DIGITIZED:
  ------------------
  |  Branch (1726:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1757|      0|	case EXIF_TAG_SUB_SEC_TIME_ORIGINAL:
  ------------------
  |  Branch (1757:2): [True: 0, False: 45.3k]
  ------------------
 1758|      0|	case EXIF_TAG_SUB_SEC_TIME_DIGITIZED:
  ------------------
  |  Branch (1758:2): [True: 0, False: 45.3k]
  ------------------
 1759|      0|	case EXIF_TAG_OFFSET_TIME:
  ------------------
  |  Branch (1759:2): [True: 0, False: 45.3k]
  ------------------
 1760|      0|	case EXIF_TAG_OFFSET_TIME_ORIGINAL:
  ------------------
  |  Branch (1760:2): [True: 0, False: 45.3k]
  ------------------
 1761|      0|	case EXIF_TAG_OFFSET_TIME_DIGITIZED:
  ------------------
  |  Branch (1761:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1770|      0|	case EXIF_TAG_MAKE:
  ------------------
  |  Branch (1770:2): [True: 0, False: 45.3k]
  ------------------
 1771|      0|	case EXIF_TAG_MODEL:
  ------------------
  |  Branch (1771:2): [True: 0, False: 45.3k]
  ------------------
 1772|      0|	case EXIF_TAG_SOFTWARE:
  ------------------
  |  Branch (1772:2): [True: 0, False: 45.3k]
  ------------------
 1773|      0|	case EXIF_TAG_ARTIST:
  ------------------
  |  Branch (1773:2): [True: 0, False: 45.3k]
  ------------------
 1774|      0|	case EXIF_TAG_CAMERA_OWNER_NAME:
  ------------------
  |  Branch (1774:2): [True: 0, False: 45.3k]
  ------------------
 1775|      0|	case EXIF_TAG_BODY_SERIAL_NUMBER:
  ------------------
  |  Branch (1775:2): [True: 0, False: 45.3k]
  ------------------
 1776|      0|	case EXIF_TAG_LENS_MAKE:
  ------------------
  |  Branch (1776:2): [True: 0, False: 45.3k]
  ------------------
 1777|      0|	case EXIF_TAG_LENS_MODEL:
  ------------------
  |  Branch (1777:2): [True: 0, False: 45.3k]
  ------------------
 1778|      0|	case EXIF_TAG_LENS_SERIAL_NUMBER:
  ------------------
  |  Branch (1778:2): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 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|  7.45k|        case EXIF_TAG_FLASH_PIX_VERSION:
  ------------------
  |  Branch (1818:9): [True: 7.45k, False: 37.9k]
  ------------------
 1819|  7.45k|                e->components = 4;
 1820|  7.45k|                e->format = EXIF_FORMAT_UNDEFINED;
 1821|  7.45k|                e->size = exif_format_get_size (e->format) * e->components;
 1822|  7.45k|                e->data = exif_entry_alloc (e, e->size);
 1823|  7.45k|                if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1823:21): [True: 0, False: 7.45k]
  ------------------
 1824|  7.45k|                memcpy (e->data, "0100", 4);
 1825|  7.45k|                break;
 1826|       |
 1827|       |        /* UNDEFINED, 4 components, default 48 50 49 48 */
 1828|  7.44k|        case EXIF_TAG_EXIF_VERSION:
  ------------------
  |  Branch (1828:9): [True: 7.44k, False: 37.9k]
  ------------------
 1829|  7.44k|                e->components = 4;
 1830|  7.44k|                e->format = EXIF_FORMAT_UNDEFINED;
 1831|  7.44k|                e->size = exif_format_get_size (e->format) * e->components;
 1832|  7.44k|                e->data = exif_entry_alloc (e, e->size);
 1833|  7.44k|                if (!e->data) { clear_entry(e); break; }
  ------------------
  |  Branch (1833:21): [True: 0, False: 7.44k]
  ------------------
 1834|  7.44k|                memcpy (e->data, "0210", 4);
 1835|  7.44k|                break;
 1836|       |
 1837|       |        /* UNDEFINED, 4 components, default 1 2 3 0 */
 1838|      0|        case EXIF_TAG_COMPONENTS_CONFIGURATION:
  ------------------
  |  Branch (1838:9): [True: 0, False: 45.3k]
  ------------------
 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: 45.3k]
  ------------------
 1853|      0|	case EXIF_TAG_USER_COMMENT:
  ------------------
  |  Branch (1853:2): [True: 0, False: 45.3k]
  ------------------
 1854|      0|	default:
  ------------------
  |  Branch (1854:2): [True: 0, False: 45.3k]
  ------------------
 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|  45.3k|	}
 1861|  45.3k|}
exif-entry.c:exif_entry_log:
   56|  86.1k|{
   57|  86.1k|	va_list args;
   58|  86.1k|	ExifLog *l = NULL;
   59|       |
   60|  86.1k|	if (e && e->parent && e->parent->parent)
  ------------------
  |  Branch (60:6): [True: 86.1k, False: 0]
  |  Branch (60:11): [True: 86.1k, False: 0]
  |  Branch (60:24): [True: 86.1k, False: 0]
  ------------------
   61|  86.1k|		l = exif_data_get_log (e->parent->parent);
   62|  86.1k|	va_start (args, format);
   63|  86.1k|	exif_logv (l, code, "ExifEntry", format, args);
   64|       |	va_end (args);
   65|  86.1k|}
exif-entry.c:exif_entry_alloc:
   78|  45.7k|{
   79|  45.7k|	void *d;
   80|  45.7k|	ExifLog *l = NULL;
   81|       |
   82|  45.7k|	if (!e || !e->priv || !i) return NULL;
  ------------------
  |  Branch (82:6): [True: 0, False: 45.7k]
  |  Branch (82:12): [True: 0, False: 45.7k]
  |  Branch (82:24): [True: 0, False: 45.7k]
  ------------------
   83|       |
   84|  45.7k|	d = exif_mem_alloc (e->priv->mem, i);
   85|  45.7k|	if (d) return d;
  ------------------
  |  Branch (85:6): [True: 45.7k, 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|  45.7k|}
exif-entry.c:exif_get_short_convert:
  187|  86.1k|{
  188|  86.1k|	switch (format) {
  189|  1.19k|	case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (189:2): [True: 1.19k, False: 84.9k]
  ------------------
  190|  1.19k|		return (ExifShort) exif_get_long (buf, order);
  191|    483|	case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (191:2): [True: 483, False: 85.6k]
  ------------------
  192|    483|		return (ExifShort) exif_get_slong (buf, order);
  193|      0|	case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (193:2): [True: 0, False: 86.1k]
  ------------------
  194|      0|		return (ExifShort) exif_get_short (buf, order);
  195|  2.47k|	case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (195:2): [True: 2.47k, False: 83.6k]
  ------------------
  196|  2.47k|		return (ExifShort) exif_get_sshort (buf, order);
  197|  56.1k|	case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (197:2): [True: 56.1k, False: 29.9k]
  ------------------
  198|  81.9k|	case EXIF_FORMAT_SBYTE:
  ------------------
  |  Branch (198:2): [True: 25.8k, False: 60.2k]
  ------------------
  199|  81.9k|		return (ExifShort) buf[0];
  200|      0|	default:
  ------------------
  |  Branch (200:2): [True: 0, False: 86.1k]
  ------------------
  201|       |		/* Unsupported type */
  202|      0|		return (ExifShort) 0;
  203|  86.1k|	}
  204|  86.1k|}
exif-entry.c:exif_entry_realloc:
   95|    112|{
   96|    112|	void *d;
   97|    112|	ExifLog *l = NULL;
   98|       |
   99|    112|	if (!e || !e->priv) return NULL;
  ------------------
  |  Branch (99:6): [True: 0, False: 112]
  |  Branch (99:12): [True: 0, False: 112]
  ------------------
  100|       |
  101|    112|	if (!i) { exif_mem_free (e->priv->mem, d_orig); return NULL; }
  ------------------
  |  Branch (101:6): [True: 0, False: 112]
  ------------------
  102|       |
  103|    112|	d = exif_mem_realloc (e->priv->mem, d_orig, i);
  104|    112|	if (d) return d;
  ------------------
  |  Branch (104:6): [True: 112, 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|    112|}
exif-entry.c:match_repeated_char:
  633|    207|{
  634|    207|	int i;
  635|    801|	for (i=n; i; --i, ++data) {
  ------------------
  |  Branch (635:12): [True: 779, False: 22]
  ------------------
  636|    779|		if (*data == 0) {
  ------------------
  |  Branch (636:7): [True: 59, False: 720]
  ------------------
  637|     59|			i = 0;	/* all bytes before NUL matched */
  638|     59|			break;
  639|     59|		}
  640|    720|		if (*data != ch)
  ------------------
  |  Branch (640:7): [True: 126, False: 594]
  ------------------
  641|    126|			break;
  642|    720|	}
  643|    207|	return i;
  644|    207|}
exif-entry.c:exif_entry_format_value:
  454|  35.7k|{
  455|  35.7k|	ExifByte v_byte;
  456|  35.7k|	ExifShort v_short;
  457|  35.7k|	ExifSShort v_sshort;
  458|  35.7k|	ExifLong v_long;
  459|  35.7k|	ExifRational v_rat;
  460|  35.7k|	ExifSRational v_srat;
  461|  35.7k|	ExifSLong v_slong;
  462|  35.7k|	unsigned int i;
  463|  35.7k|	size_t len;
  464|  35.7k|	const ExifByteOrder o = exif_data_get_byte_order (e->parent->parent);
  465|       |
  466|  35.7k|	if (!e->size || !maxlen)
  ------------------
  |  Branch (466:6): [True: 0, False: 35.7k]
  |  Branch (466:18): [True: 0, False: 35.7k]
  ------------------
  467|      0|		return;
  468|  35.7k|	switch (e->format) {
  469|  1.60k|	case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (469:2): [True: 1.60k, False: 34.1k]
  ------------------
  470|  1.60k|		snprintf (val, maxlen, _("%i bytes undefined data"), e->size);
  ------------------
  |  |   31|  1.60k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  471|  1.60k|		break;
  472|  3.33k|	case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (472:2): [True: 3.33k, False: 32.4k]
  ------------------
  473|  4.98k|	case EXIF_FORMAT_SBYTE:
  ------------------
  |  Branch (473:2): [True: 1.65k, False: 34.1k]
  ------------------
  474|  4.98k|		v_byte = e->data[0];
  475|  4.98k|		snprintf (val, maxlen, "0x%02x", v_byte);
  476|  4.98k|		len = strlen (val);
  477|   264k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (477:15): [True: 260k, False: 4.88k]
  ------------------
  478|   260k|			v_byte = e->data[i];
  479|   260k|			snprintf (val+len, maxlen-len, ", 0x%02x", v_byte);
  480|   260k|			len += strlen (val+len);
  481|   260k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (481:8): [True: 106, False: 259k]
  ------------------
  482|   260k|		}
  483|  4.98k|		break;
  484|  3.12k|	case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (484:2): [True: 3.12k, False: 32.6k]
  ------------------
  485|  3.12k|		v_short = exif_get_short (e->data, o);
  486|  3.12k|		snprintf (val, maxlen, "%u", v_short);
  487|  3.12k|		len = strlen (val);
  488|   263k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (488:15): [True: 260k, False: 3.02k]
  ------------------
  489|   260k|			v_short = exif_get_short (e->data +
  490|   260k|				exif_format_get_size (e->format) * i, o);
  491|   260k|			snprintf (val+len, maxlen-len, ", %u", v_short);
  492|   260k|			len += strlen (val+len);
  493|   260k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (493:8): [True: 96, False: 260k]
  ------------------
  494|   260k|		}
  495|  3.12k|		break;
  496|    799|	case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (496:2): [True: 799, False: 34.9k]
  ------------------
  497|    799|		v_sshort = exif_get_sshort (e->data, o);
  498|    799|		snprintf (val, maxlen, "%i", v_sshort);
  499|    799|		len = strlen (val);
  500|   150k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (500:15): [True: 149k, False: 728]
  ------------------
  501|   149k|			v_sshort = exif_get_short (e->data +
  502|   149k|				exif_format_get_size (e->format) *
  503|   149k|				i, o);
  504|   149k|			snprintf (val+len, maxlen-len, ", %i", v_sshort);
  505|   149k|			len += strlen (val+len);
  506|   149k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (506:8): [True: 71, False: 149k]
  ------------------
  507|   149k|		}
  508|    799|		break;
  509|  1.40k|	case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (509:2): [True: 1.40k, False: 34.3k]
  ------------------
  510|  1.40k|		v_long = exif_get_long (e->data, o);
  511|  1.40k|		snprintf (val, maxlen, "%lu", (unsigned long) v_long);
  512|  1.40k|		len = strlen (val);
  513|  72.0k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (513:15): [True: 70.7k, False: 1.36k]
  ------------------
  514|  70.7k|			v_long = exif_get_long (e->data +
  515|  70.7k|				exif_format_get_size (e->format) *
  516|  70.7k|				i, o);
  517|  70.7k|			snprintf (val+len, maxlen-len, ", %lu", (unsigned long) v_long);
  518|  70.7k|			len += strlen (val+len);
  519|  70.7k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (519:8): [True: 37, False: 70.6k]
  ------------------
  520|  70.7k|		}
  521|  1.40k|		break;
  522|    891|	case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (522:2): [True: 891, False: 34.9k]
  ------------------
  523|    891|		v_slong = exif_get_slong (e->data, o);
  524|    891|		snprintf (val, maxlen, "%li", (long) v_slong);
  525|    891|		len = strlen (val);
  526|  51.8k|		for (i = 1; i < e->components; i++) {
  ------------------
  |  Branch (526:15): [True: 51.0k, False: 849]
  ------------------
  527|  51.0k|			v_slong = exif_get_slong (e->data +
  528|  51.0k|				exif_format_get_size (e->format) * i, o);
  529|  51.0k|			snprintf (val+len, maxlen-len, ", %li", (long) v_slong);
  530|  51.0k|			len += strlen (val+len);
  531|  51.0k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (531:8): [True: 42, False: 50.9k]
  ------------------
  532|  51.0k|		}
  533|    891|		break;
  534|  5.40k|	case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (534:2): [True: 5.40k, False: 30.3k]
  ------------------
  535|  5.40k|		strncpy (val, (char *) e->data, MIN (maxlen-1, e->size));
  ------------------
  |  |  182|  5.40k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 195, False: 5.21k]
  |  |  ------------------
  ------------------
  536|  5.40k|		val[MIN (maxlen-1, e->size)] = 0;
  ------------------
  |  |  182|  5.40k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 195, False: 5.21k]
  |  |  ------------------
  ------------------
  537|  5.40k|		break;
  538|  16.5k|	case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (538:2): [True: 16.5k, False: 19.2k]
  ------------------
  539|  16.5k|		len = 0;
  540|   103k|		for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (540:15): [True: 86.9k, False: 16.5k]
  ------------------
  541|  86.9k|			if (i > 0) {
  ------------------
  |  Branch (541:8): [True: 70.3k, False: 16.5k]
  ------------------
  542|  70.3k|				snprintf (val+len, maxlen-len, ", ");
  543|  70.3k|				len += strlen (val+len);
  544|  70.3k|			}
  545|  86.9k|			v_rat = exif_get_rational (
  546|  86.9k|				e->data + 8 * i, o);
  547|  86.9k|			if (v_rat.denominator) {
  ------------------
  |  Branch (547:8): [True: 79.6k, False: 7.27k]
  ------------------
  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|  79.6k|				int decimals = (int)(log10(v_rat.denominator)-0.08+1.0);
  555|  79.6k|				snprintf (val+len, maxlen-len, "%2.*f",
  556|  79.6k|					  decimals,
  557|  79.6k|					  (double) v_rat.numerator /
  558|  79.6k|					  (double) v_rat.denominator);
  559|  79.6k|			} else
  560|  7.27k|				snprintf (val+len, maxlen-len, "%lu/%lu",
  561|  7.27k|				  (unsigned long) v_rat.numerator,
  562|  7.27k|				  (unsigned long) v_rat.denominator);
  563|  86.9k|			len += strlen (val+len);
  564|  86.9k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (564:8): [True: 46, False: 86.9k]
  ------------------
  565|  86.9k|		}
  566|  16.5k|		break;
  567|    528|	case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (567:2): [True: 528, False: 35.2k]
  ------------------
  568|    528|		len = 0;
  569|  58.7k|		for (i = 0; i < e->components; i++) {
  ------------------
  |  Branch (569:15): [True: 58.2k, False: 474]
  ------------------
  570|  58.2k|			if (i > 0) {
  ------------------
  |  Branch (570:8): [True: 57.7k, False: 528]
  ------------------
  571|  57.7k|				snprintf (val+len, maxlen-len, ", ");
  572|  57.7k|				len += strlen (val+len);
  573|  57.7k|			}
  574|  58.2k|			v_srat = exif_get_srational (
  575|  58.2k|				e->data + 8 * i, o);
  576|  58.2k|			if (v_srat.denominator && v_srat.denominator > INT32_MIN) {
  ------------------
  |  Branch (576:8): [True: 53.6k, False: 4.60k]
  |  Branch (576:30): [True: 53.3k, False: 329]
  ------------------
  577|  53.3k|				int decimals = (int)(log10(abs(v_srat.denominator))-0.08+1.0);
  578|  53.3k|				snprintf (val+len, maxlen-len, "%2.*f",
  579|  53.3k|					  decimals,
  580|  53.3k|					  (double) v_srat.numerator /
  581|  53.3k|					  (double) v_srat.denominator);
  582|  53.3k|			} else
  583|  4.93k|				snprintf (val+len, maxlen-len, "%li/%li",
  584|  4.93k|				  (long) v_srat.numerator,
  585|  4.93k|				  (long) v_srat.denominator);
  586|  58.2k|			len += strlen (val+len);
  587|  58.2k|			if (len >= maxlen-1) break;
  ------------------
  |  Branch (587:8): [True: 54, False: 58.1k]
  ------------------
  588|  58.2k|		}
  589|    528|		break;
  590|     18|	case EXIF_FORMAT_DOUBLE:
  ------------------
  |  Branch (590:2): [True: 18, False: 35.7k]
  ------------------
  591|    488|	case EXIF_FORMAT_FLOAT:
  ------------------
  |  Branch (591:2): [True: 470, False: 35.3k]
  ------------------
  592|    488|	default:
  ------------------
  |  Branch (592:2): [True: 0, False: 35.7k]
  ------------------
  593|       |		snprintf (val, maxlen, _("%i bytes unsupported data type"),
  ------------------
  |  |   31|    488|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  594|    488|			  e->size);
  595|    488|		break;
  596|  35.7k|	}
  597|  35.7k|}

exif_format_get_name:
   56|  46.8k|{
   57|  46.8k|	unsigned int i;
   58|       |
   59|  46.8k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   287k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 274k, False: 12.2k]
  ------------------
   62|   274k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 34.6k, False: 240k]
  ------------------
   63|  34.6k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  34.6k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  12.2k|	return NULL;
   65|  46.8k|}
exif_format_get_size:
   69|  1.77M|{
   70|  1.77M|	unsigned int i;
   71|       |
   72|  12.0M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 11.4M, False: 520k]
  ------------------
   73|  11.4M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.25M, False: 10.2M]
  ------------------
   74|  1.25M|			return ExifFormatTable[i].size;
   75|   520k|	return 0;
   76|  1.77M|}

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

exif_loader_write:
  171|  9.77k|{
  172|  9.77k|	unsigned int i;
  173|       |
  174|  71.8k|begin:
  175|  71.8k|	if (!eld || (len && !buf)) 
  ------------------
  |  Branch (175:6): [True: 0, False: 71.8k]
  |  Branch (175:15): [True: 71.6k, False: 203]
  |  Branch (175:22): [True: 0, False: 71.6k]
  ------------------
  176|      0|		return 0;
  177|       |
  178|  71.8k|	switch (eld->state) {
  179|    192|	case EL_EXIF_FOUND:
  ------------------
  |  Branch (179:2): [True: 192, False: 71.6k]
  ------------------
  180|    192|		return exif_loader_copy (eld, buf, len);
  181|  1.05k|	case EL_SKIP_BYTES:
  ------------------
  |  Branch (181:2): [True: 1.05k, False: 70.8k]
  ------------------
  182|  1.05k|		if (eld->size > len) { 
  ------------------
  |  Branch (182:7): [True: 167, False: 883]
  ------------------
  183|    167|			eld->size -= len; 
  184|    167|			return 1; 
  185|    167|		}
  186|    883|		len -= eld->size;
  187|    883|		buf += eld->size;
  188|    883|		eld->size = 0;
  189|    883|		eld->b_len = 0;
  190|    883|		switch (eld->data_format) {
  191|     58|		case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (191:3): [True: 58, False: 825]
  ------------------
  192|     58|			eld->state = EL_READ_SIZE_BYTE_24;
  193|     58|			break;
  194|    825|		default:
  ------------------
  |  Branch (194:3): [True: 825, False: 58]
  ------------------
  195|    825|			eld->state = EL_READ;
  196|    825|			break;
  197|    883|		}
  198|    883|		break;
  199|       |
  200|  69.8k|	case EL_READ:
  ------------------
  |  Branch (200:2): [True: 69.8k, False: 2.01k]
  ------------------
  201|  70.6k|	default:
  ------------------
  |  Branch (201:2): [True: 776, False: 71.1k]
  ------------------
  202|  70.6k|		break;
  203|  71.8k|	}
  204|       |
  205|  71.5k|	if (!len)
  ------------------
  |  Branch (205:6): [True: 48, False: 71.4k]
  ------------------
  206|     48|		return 1;
  207|  71.4k|	exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
  208|  71.4k|		  "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|  71.4k|	i = MIN (len, sizeof (eld->b) - eld->b_len);
  ------------------
  |  |  182|  71.4k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 30, False: 71.4k]
  |  |  ------------------
  ------------------
  215|  71.4k|	if (i) {
  ------------------
  |  Branch (215:6): [True: 71.4k, False: 0]
  ------------------
  216|  71.4k|		memcpy (&eld->b[eld->b_len], buf, i);
  217|  71.4k|		eld->b_len += i;
  218|  71.4k|		if (eld->b_len < sizeof (eld->b)) 
  ------------------
  |  Branch (218:7): [True: 30, False: 71.4k]
  ------------------
  219|     30|			return 1;
  220|  71.4k|		buf += i;
  221|  71.4k|		len -= i;
  222|  71.4k|	}
  223|       |
  224|  71.4k|	switch (eld->data_format) {
  225|  9.99k|	case EL_DATA_FORMAT_UNKNOWN:
  ------------------
  |  Branch (225:2): [True: 9.99k, False: 61.4k]
  ------------------
  226|       |
  227|       |		/* Check the small buffer against known formats. */
  228|  9.99k|		if (!memcmp (eld->b, "FUJIFILM", 8)) {
  ------------------
  |  Branch (228:7): [True: 59, False: 9.93k]
  ------------------
  229|       |
  230|       |			/* Skip to byte 84. There is another offset there. */
  231|     59|			eld->data_format = EL_DATA_FORMAT_FUJI_RAW;
  232|     59|			eld->size = 84;
  233|     59|			eld->state = EL_SKIP_BYTES;
  234|     59|			eld->size = 84;
  235|       |
  236|  9.93k|		} else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) {
  ------------------
  |  Branch (236:14): [True: 9.06k, False: 865]
  ------------------
  237|       |
  238|       |			/* Read the size (2 bytes). */
  239|  9.06k|			eld->data_format = EL_DATA_FORMAT_EXIF;
  240|  9.06k|			eld->state = EL_READ_SIZE_BYTE_08;
  241|  9.06k|		}
  242|  71.4k|	default:
  ------------------
  |  Branch (242:2): [True: 61.4k, False: 9.99k]
  ------------------
  243|  71.4k|		break;
  244|  71.4k|	}
  245|       |
  246|   841k|	for (i = 0; i < sizeof (eld->b); i++) {
  ------------------
  |  Branch (246:14): [True: 779k, False: 62.1k]
  ------------------
  247|   779k|		switch (eld->state) {
  248|  9.25k|		case EL_EXIF_FOUND:
  ------------------
  |  Branch (248:3): [True: 9.25k, False: 770k]
  ------------------
  249|  9.25k|			if (!exif_loader_copy (eld, eld->b + i,
  ------------------
  |  Branch (249:8): [True: 9, False: 9.24k]
  ------------------
  250|  9.25k|					sizeof (eld->b) - i)) 
  251|      9|				return 0;
  252|  9.24k|			return exif_loader_copy (eld, buf, len);
  253|  8.79k|		case EL_SKIP_BYTES:
  ------------------
  |  Branch (253:3): [True: 8.79k, False: 770k]
  ------------------
  254|  8.79k|			switch (eld->size) {
  255|  5.62k|                            case 0:
  ------------------
  |  Branch (255:29): [True: 5.62k, False: 3.17k]
  ------------------
  256|  5.62k|			        eld->state = EL_READ;
  257|  5.62k|				i--;   /* reprocess this byte */
  258|  5.62k|				break;
  259|  1.06k|                            case 1:
  ------------------
  |  Branch (259:29): [True: 1.06k, False: 7.73k]
  ------------------
  260|  1.06k|                                eld->size = 0;
  261|  1.06k|			        eld->state = EL_READ;
  262|  1.06k|				break;
  263|  2.10k|                            default:
  ------------------
  |  Branch (263:29): [True: 2.10k, False: 6.69k]
  ------------------
  264|  2.10k|                                eld->size--;
  265|  2.10k|				break;
  266|  8.79k|			}
  267|  8.79k|			break;
  268|       |
  269|  8.79k|		case EL_READ_SIZE_BYTE_24:
  ------------------
  |  Branch (269:3): [True: 57, False: 779k]
  ------------------
  270|     57|			eld->size |= (unsigned int)eld->b[i] << 24;
  271|     57|			eld->state = EL_READ_SIZE_BYTE_16;
  272|     57|			break;
  273|     57|		case EL_READ_SIZE_BYTE_16:
  ------------------
  |  Branch (273:3): [True: 57, False: 779k]
  ------------------
  274|     57|			eld->size |= (unsigned int)eld->b[i] << 16;
  275|     57|			eld->state = EL_READ_SIZE_BYTE_08;
  276|     57|			break;
  277|  17.1k|		case EL_READ_SIZE_BYTE_08:
  ------------------
  |  Branch (277:3): [True: 17.1k, False: 762k]
  ------------------
  278|  17.1k|			eld->size |= (unsigned int)eld->b[i] << 8;
  279|  17.1k|			eld->state = EL_READ_SIZE_BYTE_00;
  280|  17.1k|			break;
  281|  17.1k|		case EL_READ_SIZE_BYTE_00:
  ------------------
  |  Branch (281:3): [True: 17.1k, False: 762k]
  ------------------
  282|  17.1k|			eld->size |= eld->b[i] << 0;
  283|  17.1k|			switch (eld->data_format) {
  284|  7.62k|			case EL_DATA_FORMAT_JPEG:
  ------------------
  |  Branch (284:4): [True: 7.62k, False: 9.50k]
  ------------------
  285|  7.62k|				eld->state = EL_SKIP_BYTES;
  286|  7.62k|				if (eld->size < 2) {
  ------------------
  |  Branch (286:9): [True: 2.85k, False: 4.77k]
  ------------------
  287|       |				    /* Actually it's malformed... */
  288|  2.85k|				    eld->size = 0;
  289|  2.85k|				} else
  290|  4.77k|				    eld->size -= 2;
  291|  7.62k|				break;
  292|     57|			case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (292:4): [True: 57, False: 17.0k]
  ------------------
  293|     57|				eld->data_format = EL_DATA_FORMAT_EXIF;
  294|     57|				eld->state = EL_SKIP_BYTES;
  295|     57|				if (eld->size < 86) {
  ------------------
  |  Branch (295:9): [True: 5, False: 52]
  ------------------
  296|       |				    /* Actually it's malformed... */
  297|      5|				    eld->size = 0;
  298|      5|				} else
  299|     52|				    eld->size -= 86;	/* and put this in an else */
  300|     57|				break;
  301|  9.44k|			case EL_DATA_FORMAT_EXIF:
  ------------------
  |  Branch (301:4): [True: 9.44k, False: 7.68k]
  ------------------
  302|  9.44k|				eld->state = EL_EXIF_FOUND;
  303|  9.44k|				break;
  304|      0|			default:
  ------------------
  |  Branch (304:4): [True: 0, False: 17.1k]
  ------------------
  305|      0|				break;
  306|  17.1k|			}
  307|  17.1k|			break;
  308|       |
  309|   727k|		default:
  ------------------
  |  Branch (309:3): [True: 727k, False: 52.4k]
  ------------------
  310|   727k|			switch (eld->b[i]) {
  311|  1.58k|			case JPEG_MARKER_APP1:
  ------------------
  |  |   46|  1.58k|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (311:4): [True: 1.58k, False: 725k]
  ------------------
  312|  1.58k|			  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.17k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 487, False: 1.09k]
  |  |  |  Branch (182:29): [True: 3, False: 1.58k]
  |  |  |  Branch (182:42): [True: 3, False: 1.09k]
  |  |  ------------------
  ------------------
  |  Branch (312:10): [True: 379, False: 1.20k]
  ------------------
  313|    379|					eld->data_format = EL_DATA_FORMAT_EXIF;
  314|  1.20k|				} else {
  315|  1.20k|					eld->data_format = EL_DATA_FORMAT_JPEG; /* Probably JFIF - keep searching for APP1 EXIF*/
  316|  1.20k|				}
  317|  1.58k|				eld->size = 0;
  318|  1.58k|				eld->state = EL_READ_SIZE_BYTE_08;
  319|  1.58k|				break;
  320|    434|			case JPEG_MARKER_DCT:
  ------------------
  |  |   36|    434|#define JPEG_MARKER_DCT  0xc0
  ------------------
  |  Branch (320:4): [True: 434, False: 726k]
  ------------------
  321|    666|			case JPEG_MARKER_DHT:
  ------------------
  |  |   38|    666|#define JPEG_MARKER_DHT  0xc4
  ------------------
  |  Branch (321:4): [True: 232, False: 726k]
  ------------------
  322|    867|			case JPEG_MARKER_DQT:
  ------------------
  |  |   42|    867|#define JPEG_MARKER_DQT  0xdb
  ------------------
  |  Branch (322:4): [True: 201, False: 726k]
  ------------------
  323|  2.82k|			case JPEG_MARKER_APP0:
  ------------------
  |  |   44|  2.82k|#define JPEG_MARKER_APP0 0xe0
  ------------------
  |  Branch (323:4): [True: 1.96k, False: 725k]
  ------------------
  324|  3.25k|			case JPEG_MARKER_APP2:
  ------------------
  |  |   48|  3.25k|#define JPEG_MARKER_APP2 0xe2
  ------------------
  |  Branch (324:4): [True: 425, False: 726k]
  ------------------
  325|  4.00k|			case JPEG_MARKER_APP3:
  ------------------
  |  |   50|  4.00k|#define JPEG_MARKER_APP3 0xe3
  ------------------
  |  Branch (325:4): [True: 748, False: 726k]
  ------------------
  326|  4.39k|			case JPEG_MARKER_APP4:
  ------------------
  |  |   52|  4.39k|#define JPEG_MARKER_APP4 0xe4
  ------------------
  |  Branch (326:4): [True: 393, False: 726k]
  ------------------
  327|  4.61k|			case JPEG_MARKER_APP5:
  ------------------
  |  |   54|  4.61k|#define JPEG_MARKER_APP5 0xe5
  ------------------
  |  Branch (327:4): [True: 222, False: 726k]
  ------------------
  328|  5.14k|			case JPEG_MARKER_APP10:
  ------------------
  |  |   56|  5.14k|#define JPEG_MARKER_APP10 0xea
  ------------------
  |  Branch (328:4): [True: 526, False: 726k]
  ------------------
  329|  5.52k|			case JPEG_MARKER_APP11:
  ------------------
  |  |   58|  5.52k|#define JPEG_MARKER_APP11 0xeb
  ------------------
  |  Branch (329:4): [True: 377, False: 726k]
  ------------------
  330|  5.78k|			case JPEG_MARKER_APP13:
  ------------------
  |  |   60|  5.78k|#define JPEG_MARKER_APP13 0xed
  ------------------
  |  Branch (330:4): [True: 263, False: 726k]
  ------------------
  331|  6.18k|			case JPEG_MARKER_APP14:
  ------------------
  |  |   62|  6.18k|#define JPEG_MARKER_APP14 0xee
  ------------------
  |  Branch (331:4): [True: 401, False: 726k]
  ------------------
  332|  6.43k|			case JPEG_MARKER_COM:
  ------------------
  |  |   64|  6.43k|#define JPEG_MARKER_COM 0xfe
  ------------------
  |  Branch (332:4): [True: 248, False: 726k]
  ------------------
  333|  6.43k|				eld->data_format = EL_DATA_FORMAT_JPEG;
  334|  6.43k|				eld->size = 0;
  335|  6.43k|				eld->state = EL_READ_SIZE_BYTE_08;
  336|  6.43k|				break;
  337|   717k|			case 0xff:
  ------------------
  |  Branch (337:4): [True: 717k, False: 9.12k]
  ------------------
  338|   719k|			case JPEG_MARKER_SOI:
  ------------------
  |  |   40|   719k|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (338:4): [True: 1.02k, False: 726k]
  ------------------
  339|   719k|				break;
  340|     84|			default:
  ------------------
  |  Branch (340:4): [True: 84, False: 727k]
  ------------------
  341|     84|				exif_log (eld->log,
  342|     84|					EXIF_LOG_CODE_CORRUPT_DATA,
  343|     84|					"ExifLoader", _("The data supplied "
  ------------------
  |  |   31|     84|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  344|     84|						"does not seem to contain "
  345|     84|						"EXIF data. JPEG Marker type 0x%02x"), eld->b[i]);
  346|     84|				exif_loader_reset (eld);
  347|     84|				return 0;
  348|   727k|			}
  349|   779k|		}
  350|   779k|	}
  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|  62.1k|	eld->b_len = 0;
  357|  62.1k|	goto begin;
  358|  71.4k|}
exif_loader_new:
  362|  9.77k|{
  363|  9.77k|	ExifMem *mem = exif_mem_new_default ();
  364|  9.77k|	ExifLoader *l = exif_loader_new_mem (mem);
  365|       |
  366|  9.77k|	exif_mem_unref (mem);
  367|       |
  368|  9.77k|	return l;
  369|  9.77k|}
exif_loader_new_mem:
  373|  9.77k|{
  374|  9.77k|	ExifLoader *loader;
  375|       |
  376|  9.77k|	if (!mem) 
  ------------------
  |  Branch (376:6): [True: 0, False: 9.77k]
  ------------------
  377|      0|		return NULL;
  378|       |	
  379|  9.77k|	loader = exif_mem_alloc (mem, sizeof (ExifLoader));
  380|  9.77k|	if (!loader) 
  ------------------
  |  Branch (380:6): [True: 0, False: 9.77k]
  ------------------
  381|      0|		return NULL;
  382|  9.77k|	loader->ref_count = 1;
  383|       |
  384|  9.77k|	loader->mem = mem;
  385|  9.77k|	exif_mem_ref (mem);
  386|       |
  387|  9.77k|	return loader;
  388|  9.77k|}
exif_loader_unref:
  414|  9.77k|{
  415|  9.77k|	if (!loader) 
  ------------------
  |  Branch (415:6): [True: 0, False: 9.77k]
  ------------------
  416|      0|		return;
  417|  9.77k|	if (!--loader->ref_count)
  ------------------
  |  Branch (417:6): [True: 9.77k, False: 0]
  ------------------
  418|  9.77k|		exif_loader_free (loader);
  419|  9.77k|}
exif_loader_reset:
  423|  9.86k|{
  424|  9.86k|	if (!loader) 
  ------------------
  |  Branch (424:6): [True: 0, False: 9.86k]
  ------------------
  425|      0|		return;
  426|  9.86k|	exif_mem_free (loader->mem, loader->buf); loader->buf = NULL;
  427|  9.86k|	loader->size = 0;
  428|  9.86k|	loader->bytes_read = 0;
  429|  9.86k|	loader->state = 0;
  430|  9.86k|	loader->b_len = 0;
  431|  9.86k|	loader->data_format = EL_DATA_FORMAT_UNKNOWN;
  432|  9.86k|}
exif_loader_get_data:
  436|  9.77k|{
  437|  9.77k|	ExifData *ed;
  438|       |
  439|  9.77k|	if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) ||
  ------------------
  |  Branch (439:6): [True: 0, False: 9.77k]
  |  Branch (439:17): [True: 98, False: 9.67k]
  ------------------
  440|  9.67k|	    !loader->bytes_read)
  ------------------
  |  Branch (440:6): [True: 249, False: 9.42k]
  ------------------
  441|    347|		return NULL;
  442|       |
  443|  9.42k|	ed = exif_data_new_mem (loader->mem);
  444|  9.42k|	exif_data_log (ed, loader->log);
  445|  9.42k|	exif_data_load_data (ed, loader->buf, loader->bytes_read);
  446|       |
  447|  9.42k|	return ed;
  448|  9.77k|}
exif-loader.c:exif_loader_copy:
  151|  18.6k|{
  152|  18.6k|	if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) 
  ------------------
  |  Branch (152:6): [True: 0, False: 18.6k]
  |  Branch (152:15): [True: 18.6k, False: 36]
  |  Branch (152:22): [True: 0, False: 18.6k]
  |  Branch (152:31): [True: 2, False: 18.6k]
  ------------------
  153|      2|		return 0;
  154|       |
  155|       |	/* If needed, allocate the buffer. */
  156|  18.6k|	if (!eld->buf) 
  ------------------
  |  Branch (156:6): [True: 9.44k, False: 9.24k]
  ------------------
  157|  9.44k|		eld->buf = exif_loader_alloc (eld, eld->size);
  158|  18.6k|	if (!eld->buf) 
  ------------------
  |  Branch (158:6): [True: 0, False: 18.6k]
  ------------------
  159|      0|		return 0;
  160|       |
  161|       |	/* Copy memory */
  162|  18.6k|	len = MIN (len, eld->size - eld->bytes_read);
  ------------------
  |  |  182|  18.6k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 18.6k, False: 84]
  |  |  ------------------
  ------------------
  163|  18.6k|	memcpy (eld->buf + eld->bytes_read, buf, len);
  164|  18.6k|	eld->bytes_read += len;
  165|       |
  166|  18.6k|	return (eld->bytes_read >= eld->size) ? 0 : 1;
  ------------------
  |  Branch (166:9): [True: 84, False: 18.6k]
  ------------------
  167|  18.6k|}
exif-loader.c:exif_loader_alloc:
  109|  9.44k|{
  110|  9.44k|	void *d;
  111|       |
  112|  9.44k|	if (!l || !i) 
  ------------------
  |  Branch (112:6): [True: 0, False: 9.44k]
  |  Branch (112:12): [True: 0, False: 9.44k]
  ------------------
  113|      0|		return NULL;
  114|       |
  115|  9.44k|	d = exif_mem_alloc (l->mem, i);
  116|  9.44k|	if (d) 
  ------------------
  |  Branch (116:6): [True: 9.44k, False: 0]
  ------------------
  117|  9.44k|		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|  9.44k|}
exif-loader.c:exif_loader_free:
  399|  9.77k|{
  400|  9.77k|	ExifMem *mem;
  401|       |
  402|  9.77k|	if (!loader) 
  ------------------
  |  Branch (402:6): [True: 0, False: 9.77k]
  ------------------
  403|      0|		return;
  404|       |
  405|  9.77k|	mem = loader->mem;
  406|  9.77k|	exif_loader_reset (loader);
  407|  9.77k|	exif_log_unref (loader->log);
  408|  9.77k|	exif_mem_free (mem, loader);
  409|  9.77k|	exif_mem_unref (mem);
  410|  9.77k|}

exif_log_ref:
  100|  15.8k|{
  101|  15.8k|	if (!log) return;
  ------------------
  |  Branch (101:6): [True: 15.8k, False: 0]
  ------------------
  102|      0|	log->ref_count++;
  103|      0|}
exif_log_unref:
  107|  79.1k|{
  108|  79.1k|	if (!log) return;
  ------------------
  |  Branch (108:6): [True: 79.1k, 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|   186M|{
  140|   186M|	va_list args;
  141|       |
  142|   186M|	va_start (args, format);
  143|   186M|	exif_logv (log, code, domain, format, args);
  144|       |	va_end (args);
  145|   186M|}
exif_logv:
  150|   186M|{
  151|   186M|	if (!log) return;
  ------------------
  |  Branch (151:6): [True: 186M, 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|  55.1k|{
   59|  55.1k|	ExifMem *mem;
   60|       |
   61|  55.1k|	if (!alloc_func && !realloc_func) 
  ------------------
  |  Branch (61:6): [True: 0, False: 55.1k]
  |  Branch (61:21): [True: 0, False: 0]
  ------------------
   62|      0|		return NULL;
   63|  55.1k|	mem = alloc_func ? alloc_func (sizeof (ExifMem)) :
  ------------------
  |  Branch (63:8): [True: 55.1k, False: 0]
  ------------------
   64|  55.1k|		           realloc_func (NULL, sizeof (ExifMem));
   65|  55.1k|	if (!mem) return NULL;
  ------------------
  |  Branch (65:6): [True: 0, False: 55.1k]
  ------------------
   66|  55.1k|	mem->ref_count = 1;
   67|       |
   68|  55.1k|	mem->alloc_func   = alloc_func;
   69|  55.1k|	mem->realloc_func = realloc_func;
   70|  55.1k|	mem->free_func    = free_func;
   71|       |
   72|  55.1k|	return mem;
   73|  55.1k|}
exif_mem_ref:
   77|   454k|{
   78|   454k|	if (!mem) return;
  ------------------
  |  Branch (78:6): [True: 0, False: 454k]
  ------------------
   79|   454k|	mem->ref_count++;
   80|   454k|}
exif_mem_unref:
   84|   509k|{
   85|   509k|	if (!mem) return;
  ------------------
  |  Branch (85:6): [True: 0, False: 509k]
  ------------------
   86|   509k|	if (!--mem->ref_count)
  ------------------
  |  Branch (86:6): [True: 55.1k, False: 454k]
  ------------------
   87|  55.1k|		exif_mem_free (mem, mem);
   88|   509k|}
exif_mem_free:
   92|  1.16M|{
   93|  1.16M|	if (!mem) return;
  ------------------
  |  Branch (93:6): [True: 0, False: 1.16M]
  ------------------
   94|  1.16M|	if (mem->free_func) {
  ------------------
  |  Branch (94:6): [True: 1.16M, False: 0]
  ------------------
   95|  1.16M|		mem->free_func (d);
   96|  1.16M|		return;
   97|  1.16M|	}
   98|  1.16M|}
exif_mem_alloc:
  102|  1.06M|{
  103|  1.06M|	if (!mem) return NULL;
  ------------------
  |  Branch (103:6): [True: 0, False: 1.06M]
  ------------------
  104|  1.06M|	if (mem->alloc_func || mem->realloc_func)
  ------------------
  |  Branch (104:6): [True: 1.06M, False: 0]
  |  Branch (104:25): [True: 0, False: 0]
  ------------------
  105|  1.06M|		return mem->alloc_func ? mem->alloc_func (ds) :
  ------------------
  |  Branch (105:10): [True: 1.06M, False: 0]
  ------------------
  106|  1.06M|					 mem->realloc_func (NULL, ds);
  107|      0|	return NULL;
  108|  1.06M|}
exif_mem_realloc:
  112|  73.1k|{
  113|  73.1k|	return (mem && mem->realloc_func) ? mem->realloc_func (d, ds) : NULL;
  ------------------
  |  Branch (113:10): [True: 73.1k, False: 0]
  |  Branch (113:17): [True: 73.1k, False: 0]
  ------------------
  114|  73.1k|}
exif_mem_new_default:
  118|  55.1k|{
  119|  55.1k|	return exif_mem_new (exif_mem_alloc_func, exif_mem_realloc_func,
  120|  55.1k|			     exif_mem_free_func);
  121|  55.1k|}
exif-mem.c:exif_mem_alloc_func:
   37|  1.11M|{
   38|  1.11M|	return calloc ((size_t) ds, 1);
   39|  1.11M|}
exif-mem.c:exif_mem_realloc_func:
   44|  73.1k|{
   45|  73.1k|	return realloc (d, (size_t) ds);
   46|  73.1k|}
exif-mem.c:exif_mem_free_func:
   51|  1.16M|{
   52|  1.16M|	free (d);
   53|  1.16M|}

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

exif_tag_table_count:
  978|   409M|{
  979|   409M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   409M|}
exif_tag_table_get_tag:
  985|  5.13M|{
  986|  5.13M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.13M, False: 0]
  ------------------
  987|  5.13M|}
exif_tag_get_name_in_ifd:
 1043|   399M|{
 1044|   399M|	unsigned int i;
 1045|   399M|	int first;
 1046|       |
 1047|   399M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 399M]
  ------------------
 1048|      0|		return NULL;
 1049|   399M|	first = exif_tag_table_first(tag);
 1050|   399M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 37.2M, False: 362M]
  ------------------
 1051|  37.2M|		return NULL;
 1052|       |
 1053|   724M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 724M, False: 1.06k]
  ------------------
 1054|   724M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 362M, False: 361M]
  ------------------
 1055|   362M|		   if (RECORDED)
  ------------------
  |  | 1035|   362M|#define RECORDED \
  |  | 1036|   362M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 725k, False: 361M]
  |  |  ------------------
  |  | 1037|   362M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 361M]
  |  |  ------------------
  |  | 1038|   362M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.95k, False: 361M]
  |  |  ------------------
  |  | 1039|   362M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 15.4k, False: 361M]
  |  |  ------------------
  ------------------
 1056|   742k|			   break;
 1057|   362M|		} else
 1058|   361M|			return NULL; /* Recorded tag not found in the table */
 1059|   724M|	}
 1060|   743k|	return ExifTagTable[i].name;
 1061|   362M|}
exif_tag_get_name:
 1152|  72.1M|{
 1153|  72.1M|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|  72.1M|}
exif_tag_get_support_level_in_ifd:
 1261|  5.15M|{
 1262|  5.15M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.15M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.15M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.15M, False: 0]
  ------------------
 1266|  5.15M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.15M|}
exif-tag.c:exif_tag_table_first:
 1016|   404M|{
 1017|   404M|	int i;
 1018|   404M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   404M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   404M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 37.2M, False: 367M]
  ------------------
 1021|  37.2M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|   367M|	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|   367M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 366M, False: 1.51M]
  |  Branch (1029:20): [True: 409k, False: 366M]
  ------------------
 1030|   409k|		--i;
 1031|   409k|	}
 1032|   367M|	return i;
 1033|   404M|}
exif-tag.c:match_tag:
 1003|  2.86G|{
 1004|  2.86G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.86G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  72.1M|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|  72.1M|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|  72.1M|		EXIF_IFD_EXIF,
 1134|  72.1M|		EXIF_IFD_0,
 1135|  72.1M|		EXIF_IFD_1,
 1136|  72.1M|		EXIF_IFD_INTEROPERABILITY,
 1137|  72.1M|		EXIF_IFD_GPS
 1138|  72.1M|	};
 1139|  72.1M|	int i;
 1140|   432M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 360M, False: 71.8M]
  ------------------
 1141|   360M|		const char *result = func(tag, ifds[i]);
 1142|   360M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 359k, False: 360M]
  ------------------
 1143|   359k|			return result;
 1144|   359k|		}
 1145|   360M|	}
 1146|  71.8M|	return (const char *) NULL;
 1147|  72.1M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.15M|{
 1228|  5.15M|	unsigned int i;
 1229|  5.15M|	int first = exif_tag_table_first(tag);
 1230|  5.15M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.15M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  8.76M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 8.75M, False: 15.2k]
  ------------------
 1234|  8.75M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.24M, False: 3.51M]
  ------------------
 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.24M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.24M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.70M, False: 3.54M]
  ------------------
 1242|  1.70M|				unsigned int dt;
 1243|  8.42M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 6.79M, False: 1.62M]
  ------------------
 1244|  6.79M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 77.6k, False: 6.71M]
  ------------------
 1245|  77.6k|						break;
 1246|  6.79M|				}
 1247|  1.70M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.62M, False: 77.6k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.62M|					return supp;
 1250|  1.70M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.24M|		} else {
 1253|  3.51M|			break; /* We've reached the end of the matching tags */
 1254|  3.51M|		}
 1255|  8.75M|	}
 1256|  3.52M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.15M|}

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

exif_mnote_data_fuji_identify:
  348|  2.10k|{
  349|  2.10k|	(void) ed;  /* unused */
  350|  2.10k|	return ((e->size >= 12) && !memcmp (e->data, "FUJIFILM", 8));
  ------------------
  |  Branch (350:10): [True: 1.80k, False: 308]
  |  Branch (350:29): [True: 977, False: 824]
  ------------------
  351|  2.10k|}
exif_mnote_data_fuji_new:
  355|    977|{
  356|    977|	ExifMnoteData *d;
  357|       |
  358|    977|	if (!mem) return NULL;
  ------------------
  |  Branch (358:6): [True: 0, False: 977]
  ------------------
  359|       |
  360|    977|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataFuji));
  361|    977|	if (!d) return NULL;
  ------------------
  |  Branch (361:6): [True: 0, False: 977]
  ------------------
  362|       |
  363|    977|	exif_mnote_data_construct (d, mem);
  364|       |
  365|       |	/* Set up function pointers */
  366|    977|	d->methods.free            = exif_mnote_data_fuji_free;
  367|    977|	d->methods.set_byte_order  = exif_mnote_data_fuji_set_byte_order;
  368|    977|	d->methods.set_offset      = exif_mnote_data_fuji_set_offset;
  369|    977|	d->methods.load            = exif_mnote_data_fuji_load;
  370|    977|	d->methods.save            = exif_mnote_data_fuji_save;
  371|    977|	d->methods.count           = exif_mnote_data_fuji_count;
  372|    977|	d->methods.get_id          = exif_mnote_data_fuji_get_id;
  373|    977|	d->methods.get_name        = exif_mnote_data_fuji_get_name;
  374|    977|	d->methods.get_title       = exif_mnote_data_fuji_get_title;
  375|    977|	d->methods.get_description = exif_mnote_data_fuji_get_description;
  376|    977|	d->methods.get_value       = exif_mnote_data_fuji_get_value;
  377|       |
  378|    977|	return d;
  379|    977|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_free:
   61|    977|{
   62|    977|	if (!n) return;
  ------------------
  |  Branch (62:6): [True: 0, False: 977]
  ------------------
   63|       |
   64|    977|	exif_mnote_data_fuji_clear ((ExifMnoteDataFuji *) n);
   65|    977|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_clear:
   41|  1.86k|{
   42|  1.86k|	ExifMnoteData *d = (ExifMnoteData *) n;
   43|  1.86k|	unsigned int i;
   44|       |
   45|  1.86k|	if (!n) return;
  ------------------
  |  Branch (45:6): [True: 0, False: 1.86k]
  ------------------
   46|       |
   47|  1.86k|	if (n->entries) {
  ------------------
  |  Branch (47:6): [True: 890, False: 977]
  ------------------
   48|  25.1k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (48:15): [True: 24.2k, False: 890]
  ------------------
   49|  24.2k|			if (n->entries[i].data) {
  ------------------
  |  Branch (49:8): [True: 5.37k, False: 18.9k]
  ------------------
   50|  5.37k|				exif_mem_free (d->mem, n->entries[i].data);
   51|  5.37k|				n->entries[i].data = NULL;
   52|  5.37k|			}
   53|    890|		exif_mem_free (d->mem, n->entries);
   54|       |		n->entries = NULL;
   55|    890|		n->count = 0;
   56|    890|	}
   57|  1.86k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_set_byte_order:
  322|    977|{
  323|    977|	ExifByteOrder o_orig;
  324|    977|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  325|    977|	unsigned int i;
  326|       |
  327|    977|	if (!n) return;
  ------------------
  |  Branch (327:6): [True: 0, False: 977]
  ------------------
  328|       |
  329|    977|	o_orig = n->order;
  330|    977|	n->order = o;
  331|    977|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (331:14): [True: 0, False: 977]
  ------------------
  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|    977|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_set_offset:
  342|    977|{
  343|    977|	if (n) ((ExifMnoteDataFuji *) n)->offset = o;
  ------------------
  |  Branch (343:6): [True: 977, False: 0]
  ------------------
  344|    977|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_load:
  160|    977|{
  161|    977|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji*) en;
  162|    977|	ExifLong c;
  163|    977|	size_t i, tcount, o, datao;
  164|       |
  165|    977|	if (!n) return;
  ------------------
  |  Branch (165:6): [True: 0, False: 977]
  ------------------
  166|       |
  167|    977|	if (!buf || !buf_size) {
  ------------------
  |  Branch (167:6): [True: 0, False: 977]
  |  Branch (167:14): [True: 0, False: 977]
  ------------------
  168|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  169|      0|			  "ExifMnoteDataFuji", "Short MakerNote");
  170|      0|		return;
  171|      0|	}
  172|    977|	if (CHECKOVERFLOW(n->offset, buf_size, 6+8+4)) {
  ------------------
  |  |   33|    977|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 977]
  |  |  |  Branch (33:81): [True: 0, False: 977]
  |  |  |  Branch (33:112): [True: 2, False: 975]
  |  |  ------------------
  ------------------
  173|      2|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  174|      2|			  "ExifMnoteDataFuji", "Short MakerNote");
  175|      2|		return;
  176|      2|	}
  177|    975|	datao = 6 + n->offset;
  178|       |
  179|    975|	n->order = EXIF_BYTE_ORDER_INTEL;
  180|       |
  181|    975|	datao += exif_get_long (buf + datao + 8, EXIF_BYTE_ORDER_INTEL);
  182|    975|	if (CHECKOVERFLOW(datao, buf_size, 2)) {
  ------------------
  |  |   33|    975|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 62, False: 913]
  |  |  |  Branch (33:81): [True: 0, False: 913]
  |  |  |  Branch (33:112): [True: 2, False: 911]
  |  |  ------------------
  ------------------
  183|     64|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  184|     64|			  "ExifMnoteDataFuji", "Short MakerNote");
  185|     64|		return;
  186|     64|	}
  187|       |
  188|       |	/* Read the number of tags */
  189|    911|	c = exif_get_short (buf + datao, EXIF_BYTE_ORDER_INTEL);
  190|    911|	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|    911|	if (c > 150) {
  ------------------
  |  Branch (195:6): [True: 21, False: 890]
  ------------------
  196|     21|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataFuji", "Too much tags (%d) in Fuji MakerNote", c);
  197|     21|		return;
  198|     21|	}
  199|       |
  200|       |	/* Remove any old entries */
  201|    890|	exif_mnote_data_fuji_clear (n);
  202|       |
  203|       |	/* Reserve enough space for all the possible MakerNote tags */
  204|    890|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteFujiEntry) * c);
  205|    890|	if (!n->entries) {
  ------------------
  |  Branch (205:6): [True: 0, False: 890]
  ------------------
  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|    890|	tcount = 0;
  212|  27.4k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (212:25): [True: 27.3k, False: 117]
  ------------------
  213|  27.3k|		size_t s;
  214|       |
  215|  27.3k|		memset(&n->entries[tcount], 0, sizeof(MnoteFujiEntry));
  216|  27.3k|		if (CHECKOVERFLOW(o, buf_size, 12)) {
  ------------------
  |  |   33|  27.3k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 191, False: 27.1k]
  |  |  |  Branch (33:81): [True: 0, False: 27.1k]
  |  |  |  Branch (33:112): [True: 582, False: 26.5k]
  |  |  ------------------
  ------------------
  217|    773|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  218|    773|				  "ExifMnoteDataFuji", "Short MakerNote");
  219|    773|			break;
  220|    773|		}
  221|       |
  222|  26.5k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  223|  26.5k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  224|  26.5k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  225|  26.5k|		n->entries[tcount].order      = n->order;
  226|       |
  227|  26.5k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataFuji",
  228|  26.5k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  229|  26.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|  26.5k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (233:8): [True: 9.26k, False: 17.3k]
  ------------------
  234|  9.26k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (234:4): [True: 1.63k, False: 7.62k]
  ------------------
  235|  26.5k|		) {
  236|  1.63k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  237|  1.63k|					  "ExifMnoteDataFuji", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  238|  1.63k|			continue;
  239|  1.63k|		}
  240|       |		/*
  241|       |		 * Size? If bigger than 4 bytes, the actual data is not
  242|       |		 * in the entry but somewhere else (offset).
  243|       |		 */
  244|  24.9k|		s = exif_format_get_size (n->entries[tcount].format) * n->entries[tcount].components;
  245|  24.9k|		n->entries[tcount].size = s;
  246|  24.9k|		if (s) {
  ------------------
  |  Branch (246:7): [True: 6.03k, False: 18.9k]
  ------------------
  247|  6.03k|			size_t dataofs = o + 8;
  248|  6.03k|			if (s > 4)
  ------------------
  |  Branch (248:8): [True: 3.34k, False: 2.69k]
  ------------------
  249|       |				/* The data in this case is merely a pointer */
  250|  3.34k|				dataofs = exif_get_long (buf + dataofs, n->order) + 6 + n->offset;
  251|       |
  252|  6.03k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  6.03k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 405, False: 5.63k]
  |  |  |  Branch (33:81): [True: 0, False: 5.63k]
  |  |  |  Branch (33:112): [True: 254, False: 5.37k]
  |  |  ------------------
  ------------------
  253|    659|				exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  254|    659|						  "ExifMnoteDataFuji", "Tag data past end of "
  255|    659|					  "buffer (%u >= %u)", (unsigned)(dataofs + s), buf_size);
  256|    659|				continue;
  257|    659|			}
  258|       |
  259|  5.37k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  260|  5.37k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (260:8): [True: 0, False: 5.37k]
  ------------------
  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|  5.37k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  265|  5.37k|		}
  266|       |
  267|       |		/* Tag was successfully parsed */
  268|  24.2k|		++tcount;
  269|  24.2k|	}
  270|       |	/* Store the count of successfully parsed tags */
  271|    890|	n->count = tcount;
  272|    890|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_count:
  276|    977|{
  277|    977|	return n ? ((ExifMnoteDataFuji *) n)->count : 0;
  ------------------
  |  Branch (277:9): [True: 977, False: 0]
  ------------------
  278|    977|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_name:
  292|  10.5k|{
  293|  10.5k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  294|       |
  295|  10.5k|	if (!n) return NULL;
  ------------------
  |  Branch (295:6): [True: 0, False: 10.5k]
  ------------------
  296|  10.5k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (296:6): [True: 0, False: 10.5k]
  ------------------
  297|  10.5k|	return mnote_fuji_tag_get_name (n->entries[i].tag);
  298|  10.5k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_title:
  302|  9.97k|{
  303|  9.97k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  304|       |	
  305|  9.97k|	if (!n) return NULL;
  ------------------
  |  Branch (305:6): [True: 0, False: 9.97k]
  ------------------
  306|  9.97k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (306:6): [True: 0, False: 9.97k]
  ------------------
  307|  9.97k|        return mnote_fuji_tag_get_title (n->entries[i].tag);
  308|  9.97k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_description:
  312|  9.97k|{
  313|  9.97k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  314|       |	
  315|  9.97k|	if (!n) return NULL;
  ------------------
  |  Branch (315:6): [True: 0, False: 9.97k]
  ------------------
  316|  9.97k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (316:6): [True: 0, False: 9.97k]
  ------------------
  317|  9.97k|        return mnote_fuji_tag_get_description (n->entries[i].tag);
  318|  9.97k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_value:
   69|  9.97k|{
   70|  9.97k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
   71|       |
   72|  9.97k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (72:6): [True: 0, False: 9.97k]
  |  Branch (72:12): [True: 0, False: 9.97k]
  ------------------
   73|  9.97k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (73:6): [True: 0, False: 9.97k]
  ------------------
   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.97k|	return mnote_fuji_entry_get_value (&n->entries[i], val, maxlen);
   80|  9.97k|}

mnote_fuji_entry_get_value:
  194|  9.97k|{
  195|  9.97k|	ExifLong  vl;
  196|  9.97k|	ExifSLong vsl;
  197|  9.97k|	ExifShort vs, vs2;
  198|  9.97k|	ExifSShort vss;
  199|  9.97k|	ExifRational vr;
  200|  9.97k|	ExifSRational vsr;
  201|  9.97k|	int i, j;
  202|       |
  203|  9.97k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 9.97k]
  ------------------
  204|  9.97k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 9.97k]
  ------------------
  205|       |
  206|  9.97k|	memset (val, 0, maxlen);
  207|  9.97k|	maxlen--;
  208|       |
  209|  9.97k|	switch (entry->tag) {
  210|  1.38k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.38k, False: 8.58k]
  ------------------
  211|  1.38k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.38k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.38k|{                                                               \
  |  |   35|  1.38k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 894, False: 492]
  |  |  ------------------
  |  |   36|    894|                snprintf (v, maxlen,	                        \
  |  |   37|    894|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    894|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    894|                        "expected '%s'."),                      \
  |  |   39|    894|                        exif_format_get_name (format),          \
  |  |   40|    894|                        exif_format_get_name (target));         \
  |  |   41|    894|                break;                                          \
  |  |   42|    894|        }                                                       \
  |  |   43|  1.38k|}
  ------------------
  212|    492|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    492|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    492|{                                                                       \
  |  |   47|    492|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 213, False: 279]
  |  |  ------------------
  |  |   48|    213|                snprintf (v, maxlen,                                    \
  |  |   49|    213|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    213|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    213|                break;                                                  \
  |  |   52|    213|        }                                                               \
  |  |   53|    492|}
  ------------------
  213|    279|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    279|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 279]
  |  |  ------------------
  ------------------
  214|    279|		break;
  215|    251|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 251, False: 9.72k]
  ------------------
  216|    521|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 270, False: 9.70k]
  ------------------
  217|    778|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 257, False: 9.71k]
  ------------------
  218|  1.12k|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 350, False: 9.62k]
  ------------------
  219|  1.38k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 254, False: 9.71k]
  ------------------
  220|  1.64k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 260, False: 9.71k]
  ------------------
  221|  1.90k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 267, False: 9.70k]
  ------------------
  222|  2.23k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 324, False: 9.64k]
  ------------------
  223|  2.45k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 221, False: 9.75k]
  ------------------
  224|  2.70k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 246, False: 9.72k]
  ------------------
  225|  2.83k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 135, False: 9.83k]
  ------------------
  226|  3.05k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 219, False: 9.75k]
  ------------------
  227|  3.30k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 247, False: 9.72k]
  ------------------
  228|  3.54k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 243, False: 9.72k]
  ------------------
  229|  3.88k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 337, False: 9.63k]
  ------------------
  230|  4.11k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 230, False: 9.74k]
  ------------------
  231|  4.32k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 210, False: 9.76k]
  ------------------
  232|  4.32k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  4.32k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  4.32k|{                                                               \
  |  |   35|  4.32k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 2.22k, False: 2.09k]
  |  |  ------------------
  |  |   36|  2.22k|                snprintf (v, maxlen,	                        \
  |  |   37|  2.22k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.22k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  2.22k|                        "expected '%s'."),                      \
  |  |   39|  2.22k|                        exif_format_get_name (format),          \
  |  |   40|  2.22k|                        exif_format_get_name (target));         \
  |  |   41|  2.22k|                break;                                          \
  |  |   42|  2.22k|        }                                                       \
  |  |   43|  4.32k|}
  ------------------
  233|  2.09k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  2.09k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  2.09k|{                                                                       \
  |  |   47|  2.09k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 382, False: 1.71k]
  |  |  ------------------
  |  |   48|    382|                snprintf (v, maxlen,                                    \
  |  |   49|    382|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    382|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    382|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    382|                break;                                                  \
  |  |   52|    382|        }                                                               \
  |  |   53|  2.09k|}
  ------------------
  234|  1.71k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  12.9k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 12.9k, False: 0]
  |  Branch (237:32): [True: 11.2k, False: 1.71k]
  ------------------
  238|  1.71k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.71k]
  ------------------
  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|  9.10k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 8.31k, False: 794]
  ------------------
  246|  8.31k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 7.39k, False: 917]
  ------------------
  247|  1.71k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 1.10k, False: 611]
  ------------------
  248|  1.10k|			snprintf (val, maxlen,
  249|  1.10k|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|  1.10k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.10k|			break;
  251|  1.10k|		}
  252|    611|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    611|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    611|		break;
  254|    761|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 761, False: 9.21k]
  ------------------
  255|    761|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    761|#define CF(format,target,v,maxlen)                              \
  |  |   34|    761|{                                                               \
  |  |   35|    761|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 233, False: 528]
  |  |  ------------------
  |  |   36|    233|                snprintf (v, maxlen,	                        \
  |  |   37|    233|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    233|                        "expected '%s'."),                      \
  |  |   39|    233|                        exif_format_get_name (format),          \
  |  |   40|    233|                        exif_format_get_name (target));         \
  |  |   41|    233|                break;                                          \
  |  |   42|    233|        }                                                       \
  |  |   43|    761|}
  ------------------
  256|    528|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    528|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    528|{                                                                       \
  |  |   47|    528|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 293, False: 235]
  |  |  ------------------
  |  |   48|    293|                snprintf (v, maxlen,                                    \
  |  |   49|    293|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    293|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    293|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    293|                break;                                                  \
  |  |   52|    293|        }                                                               \
  |  |   53|    528|}
  ------------------
  257|    235|		vs = exif_get_short (entry->data, entry->order);
  258|    235|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    235|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    235|		break;
  261|    323|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 323, False: 9.64k]
  ------------------
  262|  1.35k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 1.03k, False: 8.94k]
  ------------------
  263|  1.35k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.35k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.35k|{                                                               \
  |  |   35|  1.35k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 427, False: 926]
  |  |  ------------------
  |  |   36|    427|                snprintf (v, maxlen,	                        \
  |  |   37|    427|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    427|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    427|                        "expected '%s'."),                      \
  |  |   39|    427|                        exif_format_get_name (format),          \
  |  |   40|    427|                        exif_format_get_name (target));         \
  |  |   41|    427|                break;                                          \
  |  |   42|    427|        }                                                       \
  |  |   43|  1.35k|}
  ------------------
  264|    926|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    926|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    926|{                                                                       \
  |  |   47|    926|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 80, False: 846]
  |  |  ------------------
  |  |   48|     80|                snprintf (v, maxlen,                                    \
  |  |   49|     80|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     80|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     80|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     80|                break;                                                  \
  |  |   52|     80|        }                                                               \
  |  |   53|    926|}
  ------------------
  265|    846|		vr = exif_get_rational (entry->data, entry->order);
  266|    846|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 231, False: 615]
  ------------------
  267|    615|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    615|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    615|			  vr.denominator);
  269|    615|		break;
  270|       |
  271|  2.15k|	default:
  ------------------
  |  Branch (271:2): [True: 2.15k, False: 7.82k]
  ------------------
  272|  2.15k|		switch (entry->format) {
  273|    234|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 234, False: 1.91k]
  ------------------
  274|    234|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    234|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 92, False: 142]
  |  |  ------------------
  ------------------
  275|    234|		  break;
  276|    249|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 249, False: 1.90k]
  ------------------
  277|    249|		  vs = exif_get_short (entry->data, entry->order);
  278|    249|		  snprintf (val, maxlen, "%hu", vs);
  279|    249|		  break;
  280|    110|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 110, False: 2.04k]
  ------------------
  281|    110|		  vss = exif_get_sshort (entry->data, entry->order);
  282|    110|		  snprintf (val, maxlen, "%hi", vss);
  283|    110|		  break;
  284|     74|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 74, False: 2.07k]
  ------------------
  285|     74|		  vl = exif_get_long (entry->data, entry->order);
  286|     74|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|     74|		  break;
  288|    138|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 138, False: 2.01k]
  ------------------
  289|    138|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    138|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    138|		  break;
  292|    608|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 608, False: 1.54k]
  ------------------
  293|    608|		  vr = exif_get_rational (entry->data, entry->order);
  294|    608|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 174, False: 434]
  ------------------
  295|    434|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    434|						    vr.denominator);
  297|    434|		  break;
  298|    411|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 411, False: 1.74k]
  ------------------
  299|    411|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    411|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 93, False: 318]
  ------------------
  301|    318|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    318|			  vsr.denominator);
  303|    318|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.15k]
  ------------------
  305|    327|		default:
  ------------------
  |  Branch (305:3): [True: 327, False: 1.82k]
  ------------------
  306|    327|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    327|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    327| 			  entry->size);
  308|    327|		  break;
  309|  2.15k|		}
  310|  2.15k|		break;
  311|  9.97k|	}
  312|       |
  313|  9.97k|	return (val);
  314|  9.97k|}

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

exif_mnote_data_olympus_identify:
  627|  6.57k|{
  628|  6.57k|	int variant = exif_mnote_data_olympus_identify_variant(e->data, e->size);
  629|       |
  630|  6.57k|	if (variant == nikonV0) {
  ------------------
  |  Branch (630:6): [True: 412, False: 6.15k]
  ------------------
  631|       |		/* This variant needs some extra checking with the Make */
  632|    412|		char value[5];
  633|    412|		ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|    412|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 8, False: 404]
  |  |  ------------------
  |  |  254|    412|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|    412|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 47, False: 357]
  |  |  ------------------
  |  |  256|    404|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|    404|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 357]
  |  |  ------------------
  |  |  258|    357|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|    357|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 357]
  |  |  ------------------
  |  |  260|    357|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    357|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 357]
  |  |  ------------------
  |  |  262|    357|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  634|    412|		variant = unrecognized;
  635|       |
  636|    412|		if (em) {
  ------------------
  |  Branch (636:7): [True: 55, False: 357]
  ------------------
  637|     55|			const char *v = exif_entry_get_value (em, value, sizeof(value));
  638|     55|			if (v && (!strncmp (v, "Nikon", sizeof(value)) || 
  ------------------
  |  Branch (638:8): [True: 55, False: 0]
  |  Branch (638:14): [True: 0, False: 55]
  ------------------
  639|     55|					  !strncmp (v, "NIKON", sizeof(value)) ))
  ------------------
  |  Branch (639:8): [True: 0, False: 55]
  ------------------
  640|       |				/* When saved, this variant will be written out like the
  641|       |				 * alternative nikonV2 form above instead
  642|       |				 */
  643|      0|				variant = nikonV0;
  644|     55|		}
  645|    412|	}
  646|       |
  647|  6.57k|	return variant;
  648|  6.57k|}
exif_mnote_data_olympus_new:
  653|  3.65k|{
  654|  3.65k|	ExifMnoteData *d;
  655|       |
  656|  3.65k|	if (!mem) return NULL;
  ------------------
  |  Branch (656:6): [True: 0, False: 3.65k]
  ------------------
  657|       |	
  658|  3.65k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus));
  659|  3.65k|	if (!d) return NULL;
  ------------------
  |  Branch (659:6): [True: 0, False: 3.65k]
  ------------------
  660|       |
  661|  3.65k|	exif_mnote_data_construct (d, mem);
  662|       |
  663|       |	/* Set up function pointers */
  664|  3.65k|	d->methods.free            = exif_mnote_data_olympus_free;
  665|  3.65k|	d->methods.set_byte_order  = exif_mnote_data_olympus_set_byte_order;
  666|  3.65k|	d->methods.set_offset      = exif_mnote_data_olympus_set_offset;
  667|  3.65k|	d->methods.load            = exif_mnote_data_olympus_load;
  668|  3.65k|	d->methods.save            = exif_mnote_data_olympus_save;
  669|  3.65k|	d->methods.count           = exif_mnote_data_olympus_count;
  670|  3.65k|	d->methods.get_id          = exif_mnote_data_olympus_get_id;
  671|  3.65k|	d->methods.get_name        = exif_mnote_data_olympus_get_name;
  672|  3.65k|	d->methods.get_title       = exif_mnote_data_olympus_get_title;
  673|  3.65k|	d->methods.get_description = exif_mnote_data_olympus_get_description;
  674|  3.65k|	d->methods.get_value       = exif_mnote_data_olympus_get_value;
  675|       |
  676|  3.65k|	return d;
  677|  3.65k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_identify_variant:
  596|  10.2k|{
  597|       |	/* Olympus, Nikon, Sanyo, Epson */
  598|  10.2k|	if (buf_size >= 8) {
  ------------------
  |  Branch (598:6): [True: 9.97k, False: 246]
  ------------------
  599|       |		/* Match the terminating NUL character, too */
  600|  9.97k|		if (!memcmp (buf, "OLYMPUS", 8))
  ------------------
  |  Branch (600:7): [True: 833, False: 9.13k]
  ------------------
  601|    833|			   return olympusV2;
  602|  9.13k|		else if (!memcmp (buf, "OLYMP", 6))
  ------------------
  |  Branch (602:12): [True: 2.35k, False: 6.78k]
  ------------------
  603|  2.35k|			   return olympusV1;
  604|  6.78k|		else if (!memcmp (buf, "SANYO", 6))
  ------------------
  |  Branch (604:12): [True: 2.24k, False: 4.54k]
  ------------------
  605|  2.24k|			   return sanyoV1;
  606|  4.54k|		else if (!memcmp (buf, "EPSON", 6))
  ------------------
  |  Branch (606:12): [True: 1.43k, False: 3.10k]
  ------------------
  607|  1.43k|			   return epsonV1;
  608|  3.10k|		else if (!memcmp (buf, "Nikon", 6)) {
  ------------------
  |  Branch (608:12): [True: 397, False: 2.70k]
  ------------------
  609|    397|			switch (buf[6]) {
  610|    152|				case 1:  return nikonV1;
  ------------------
  |  Branch (610:5): [True: 152, False: 245]
  ------------------
  611|    240|				case 2:  return nikonV2;
  ------------------
  |  Branch (611:5): [True: 240, False: 157]
  ------------------
  612|      5|				default: return 0; /* Unrecognized Nikon variant */
  ------------------
  |  Branch (612:5): [True: 5, False: 392]
  ------------------
  613|    397|			}
  614|    397|		}
  615|  9.97k|	}
  616|       |
  617|       |	/* Another variant of Nikon */
  618|  2.95k|	if ((buf_size >= 2) && (buf[0] == 0x00) && (buf[1] == 0x1b)) {
  ------------------
  |  Branch (618:6): [True: 2.94k, False: 14]
  |  Branch (618:25): [True: 466, False: 2.47k]
  |  Branch (618:45): [True: 430, False: 36]
  ------------------
  619|    430|		return nikonV0;
  620|    430|	}
  621|       |
  622|  2.52k|	return unrecognized;
  623|  2.95k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_free:
   69|  3.65k|{
   70|  3.65k|	if (!n) return;
  ------------------
  |  Branch (70:6): [True: 0, False: 3.65k]
  ------------------
   71|       |
   72|  3.65k|	exif_mnote_data_olympus_clear ((ExifMnoteDataOlympus *) n);
   73|  3.65k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_clear:
   49|  7.10k|{
   50|  7.10k|	ExifMnoteData *d = (ExifMnoteData *) n;
   51|  7.10k|	unsigned int i;
   52|       |
   53|  7.10k|	if (!n) return;
  ------------------
  |  Branch (53:6): [True: 0, False: 7.10k]
  ------------------
   54|       |
   55|  7.10k|	if (n->entries) {
  ------------------
  |  Branch (55:6): [True: 3.45k, False: 3.65k]
  ------------------
   56|   124k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (56:15): [True: 121k, False: 3.45k]
  ------------------
   57|   121k|			if (n->entries[i].data) {
  ------------------
  |  Branch (57:8): [True: 39.9k, False: 81.1k]
  ------------------
   58|  39.9k|				exif_mem_free (d->mem, n->entries[i].data);
   59|  39.9k|				n->entries[i].data = NULL;
   60|  39.9k|			}
   61|  3.45k|		exif_mem_free (d->mem, n->entries);
   62|       |		n->entries = NULL;
   63|  3.45k|		n->count = 0;
   64|  3.45k|	}
   65|  7.10k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_byte_order:
  569|  3.65k|{
  570|  3.65k|	ExifByteOrder o_orig;
  571|  3.65k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  572|  3.65k|	unsigned int i;
  573|       |
  574|  3.65k|	if (!n) return;
  ------------------
  |  Branch (574:6): [True: 0, False: 3.65k]
  ------------------
  575|       |
  576|  3.65k|	o_orig = n->order;
  577|  3.65k|	n->order = o;
  578|  3.65k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (578:14): [True: 0, False: 3.65k]
  ------------------
  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.65k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_offset:
  589|  3.65k|{
  590|  3.65k|	if (n) ((ExifMnoteDataOlympus *) n)->offset = o;
  ------------------
  |  Branch (590:6): [True: 3.65k, False: 0]
  ------------------
  591|  3.65k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_load:
  242|  3.65k|{
  243|  3.65k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en;
  244|  3.65k|	ExifShort c;
  245|  3.65k|	size_t i, tcount, o, o2, datao = 6, base = 0;
  246|       |
  247|  3.65k|	if (!n) return;
  ------------------
  |  Branch (247:6): [True: 0, False: 3.65k]
  ------------------
  248|       |
  249|  3.65k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (249:6): [True: 0, False: 3.65k]
  |  Branch (249:14): [True: 0, False: 3.65k]
  ------------------
  250|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  251|      0|			  "ExifMnoteDataOlympus", "Short MakerNote");
  252|      0|		return;
  253|      0|	}
  254|  3.65k|	o2 = 6 + n->offset; /* Start of interesting data */
  255|  3.65k|	if (CHECKOVERFLOW(o2,buf_size,10)) {
  ------------------
  |  |   40|  3.65k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 3.65k]
  |  |  |  Branch (40:81): [True: 0, False: 3.65k]
  |  |  |  Branch (40:112): [True: 9, False: 3.64k]
  |  |  ------------------
  ------------------
  256|      9|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  257|      9|			  "ExifMnoteDataOlympus", "Short MakerNote");
  258|      9|		return;
  259|      9|	}
  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.64k|	n->version = exif_mnote_data_olympus_identify_variant(buf+o2, buf_size-o2);
  283|  3.64k|	switch (n->version) {
  284|  1.16k|	case olympusV1:
  ------------------
  |  Branch (284:2): [True: 1.16k, False: 2.48k]
  ------------------
  285|  2.28k|	case sanyoV1:
  ------------------
  |  Branch (285:2): [True: 1.11k, False: 2.52k]
  ------------------
  286|  2.98k|	case epsonV1:
  ------------------
  |  Branch (286:2): [True: 706, False: 2.94k]
  ------------------
  287|  2.98k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  288|  2.98k|			"Parsing Olympus/Sanyo/Epson maker note v1...");
  289|       |
  290|       |		/* The number of entries is at position 8. */
  291|  2.98k|		if (buf[o2 + 6] == 1)
  ------------------
  |  Branch (291:7): [True: 164, False: 2.82k]
  ------------------
  292|    164|			n->order = EXIF_BYTE_ORDER_INTEL;
  293|  2.82k|		else if (buf[o2 + 6 + 1] == 1)
  ------------------
  |  Branch (293:12): [True: 21, False: 2.80k]
  ------------------
  294|     21|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  295|  2.98k|		o2 += 8;
  296|  2.98k|		c = exif_get_short (buf + o2, n->order);
  297|  2.98k|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (297:7): [True: 920, False: 2.06k]
  |  Branch (297:24): [True: 728, False: 192]
  ------------------
  298|    728|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (298:8): [True: 693, False: 35]
  ------------------
  299|    693|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  300|    693|			} else {
  301|     35|				n->order = EXIF_BYTE_ORDER_INTEL;
  302|     35|			}
  303|    728|		}
  304|  2.98k|		break;
  305|       |
  306|    416|	case olympusV2:
  ------------------
  |  Branch (306:2): [True: 416, False: 3.23k]
  ------------------
  307|       |		/* Olympus S760, S770 */
  308|    416|		datao = o2;
  309|    416|		o2 += 8;
  310|    416|		if (CHECKOVERFLOW(o2,buf_size,4)) return;
  ------------------
  |  |   40|    416|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 416]
  |  |  |  Branch (40:81): [True: 0, False: 416]
  |  |  |  Branch (40:112): [True: 2, False: 414]
  |  |  ------------------
  ------------------
  311|    414|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  312|    414|			"Parsing Olympus maker note v2 (0x%02x, %02x, %02x, %02x)...",
  313|    414|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  314|       |
  315|    414|		if ((buf[o2] == 'I') && (buf[o2 + 1] == 'I'))
  ------------------
  |  Branch (315:7): [True: 10, False: 404]
  |  Branch (315:27): [True: 2, False: 8]
  ------------------
  316|      2|			n->order = EXIF_BYTE_ORDER_INTEL;
  317|    412|		else if ((buf[o2] == 'M') && (buf[o2 + 1] == 'M'))
  ------------------
  |  Branch (317:12): [True: 9, False: 403]
  |  Branch (317:32): [True: 1, False: 8]
  ------------------
  318|      1|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  319|       |
  320|       |		/* The number of entries is at position 8+4. */
  321|    414|		o2 += 4;
  322|    414|		break;
  323|       |
  324|     74|	case nikonV1:
  ------------------
  |  Branch (324:2): [True: 74, False: 3.57k]
  ------------------
  325|     74|		o2 += 6;
  326|     74|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  327|     74|			"Parsing Nikon maker note v1 (0x%02x, %02x, %02x, "
  328|     74|			"%02x)...",
  329|     74|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  330|       |
  331|       |		/* Skip version number */
  332|     74|		o2 += 1;
  333|       |
  334|       |		/* Skip an unknown byte (00 or 0A). */
  335|     74|		o2 += 1;
  336|       |
  337|     74|		base = MNOTE_NIKON1_TAG_BASE;
  338|       |		/* Fix endianness, if needed */
  339|     74|		c = exif_get_short (buf + o2, n->order);
  340|     74|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (340:7): [True: 14, False: 60]
  |  Branch (340:24): [True: 10, False: 4]
  ------------------
  341|     10|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (341:8): [True: 6, False: 4]
  ------------------
  342|      6|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  343|      6|			} else {
  344|      4|				n->order = EXIF_BYTE_ORDER_INTEL;
  345|      4|			}
  346|     10|		}
  347|     74|		break;
  348|       |
  349|    123|	case nikonV2:
  ------------------
  |  Branch (349:2): [True: 123, False: 3.52k]
  ------------------
  350|    123|		o2 += 6;
  351|    123|		if (CHECKOVERFLOW(o2,buf_size,12)) return;
  ------------------
  |  |   40|    123|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 123]
  |  |  |  Branch (40:81): [True: 0, False: 123]
  |  |  |  Branch (40:112): [True: 2, False: 121]
  |  |  ------------------
  ------------------
  352|    121|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  353|    121|			"Parsing Nikon maker note v2 (0x%02x, %02x, %02x, "
  354|    121|			"%02x, %02x, %02x, %02x, %02x)...",
  355|    121|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3],
  356|    121|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  357|       |
  358|       |		/* Skip version number */
  359|    121|		o2 += 1;
  360|       |
  361|       |		/* Skip an unknown byte (00 or 0A). */
  362|    121|		o2 += 1;
  363|       |
  364|       |		/* Skip 2 unknown bytes (00 00). */
  365|    121|		o2 += 2;
  366|       |
  367|       |		/*
  368|       |		 * Byte order. From here the data offset
  369|       |		 * gets calculated.
  370|       |		 */
  371|    121|		datao = o2;
  372|    121|		if (!strncmp ((char *)&buf[o2], "II", 2))
  ------------------
  |  Branch (372:7): [True: 88, False: 33]
  ------------------
  373|     88|			n->order = EXIF_BYTE_ORDER_INTEL;
  374|     33|		else if (!strncmp ((char *)&buf[o2], "MM", 2))
  ------------------
  |  Branch (374:12): [True: 6, False: 27]
  ------------------
  375|      6|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  376|     27|		else {
  377|     27|			exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  378|     27|				"ExifMnoteDataOlympus", "Unknown "
  379|     27|				"byte order '%c%c'", buf[o2],
  380|     27|				buf[o2 + 1]);
  381|     27|			return;
  382|     27|		}
  383|     94|		o2 += 2;
  384|       |
  385|       |		/* Skip 2 unknown bytes (00 2A). */
  386|     94|		o2 += 2;
  387|       |
  388|       |		/* Go to where the number of entries is. */
  389|     94|		if (CHECKOVERFLOW(o2,buf_size,exif_get_long (buf + o2, n->order))) return;
  ------------------
  |  |   40|     94|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 94]
  |  |  |  Branch (40:81): [True: 64, False: 30]
  |  |  |  Branch (40:112): [True: 13, False: 17]
  |  |  ------------------
  ------------------
  390|     17|		o2 = datao + exif_get_long (buf + o2, n->order);
  391|     17|		break;
  392|       |
  393|     18|	case nikonV0:
  ------------------
  |  Branch (393:2): [True: 18, False: 3.62k]
  ------------------
  394|     18|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  395|     18|			"Parsing Nikon maker note v0 (0x%02x, %02x, %02x, "
  396|     18|			"%02x, %02x, %02x, %02x, %02x)...",
  397|     18|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
  398|     18|			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|     18|		n->order = EXIF_BYTE_ORDER_MOTOROLA;
  401|     18|		break;
  402|       |
  403|     26|	default:
  ------------------
  |  Branch (403:2): [True: 26, False: 3.62k]
  ------------------
  404|     26|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  405|     26|			"Unknown Olympus variant %i.", n->version);
  406|     26|		return;
  407|  3.64k|	}
  408|       |
  409|       |	/* Sanity check the offset */
  410|  3.51k|	if (CHECKOVERFLOW(o2,buf_size,2)) {
  ------------------
  |  |   40|  3.51k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 21, False: 3.49k]
  |  |  |  Branch (40:81): [True: 0, False: 3.49k]
  |  |  |  Branch (40:112): [True: 3, False: 3.48k]
  |  |  ------------------
  ------------------
  411|     24|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  412|     24|			  "ExifMnoteOlympus", "Short MakerNote");
  413|     24|		return;
  414|     24|	}
  415|       |
  416|       |	/* Read the number of tags */
  417|  3.48k|	c = exif_get_short (buf + o2, n->order);
  418|  3.48k|	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.48k|	if (c > 300) {
  ------------------
  |  Branch (422:6): [True: 38, False: 3.45k]
  ------------------
  423|     38|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Too much tags (%d) in Olympus MakerNote", c);
  424|     38|		return;
  425|     38|	}
  426|       |
  427|       |	/* Remove any old entries */
  428|  3.45k|	exif_mnote_data_olympus_clear (n);
  429|       |
  430|       |	/* Reserve enough space for all the possible MakerNote tags */
  431|  3.45k|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c);
  432|  3.45k|	if (!n->entries) {
  ------------------
  |  Branch (432:6): [True: 0, False: 3.45k]
  ------------------
  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.45k|	tcount = 0;
  439|   135k|	for (i = c, o = o2; i; --i, o += 12) {
  ------------------
  |  Branch (439:22): [True: 134k, False: 640]
  ------------------
  440|   134k|		size_t s;
  441|   134k|		memset(&n->entries[tcount], 0, sizeof(MnoteOlympusEntry));
  442|   134k|		if (CHECKOVERFLOW(o, buf_size, 12)) {
  ------------------
  |  |   40|   134k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.41k, False: 133k]
  |  |  |  Branch (40:81): [True: 0, False: 133k]
  |  |  |  Branch (40:112): [True: 1.39k, False: 131k]
  |  |  ------------------
  ------------------
  443|  2.81k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  444|  2.81k|				  "ExifMnoteOlympus", "Short MakerNote");
  445|  2.81k|			break;
  446|  2.81k|		}
  447|       |
  448|   131k|	    n->entries[tcount].tag        = exif_get_short (buf + o, n->order) + base;
  449|   131k|	    n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  450|   131k|	    n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  451|   131k|	    n->entries[tcount].order      = n->order;
  452|       |
  453|   131k|	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  454|   131k|		      "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  455|   131k|		      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|   131k|	    if (exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (465:10): [True: 59.5k, False: 72.1k]
  ------------------
  466|  59.5k|		buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (466:3): [True: 7.72k, False: 51.7k]
  ------------------
  467|   131k|	    ) {
  468|  7.72k|		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|  7.72k|		continue;
  470|  7.72k|	    }
  471|       |	    /*
  472|       |	     * Size? If bigger than 4 bytes, the actual data is not
  473|       |	     * in the entry but somewhere else (offset).
  474|       |	     */
  475|   123k|	    s = exif_format_get_size (n->entries[tcount].format) *
  476|   123k|		   			 n->entries[tcount].components;
  477|   123k|		n->entries[tcount].size = s;
  478|   123k|		if (s) {
  ------------------
  |  Branch (478:7): [True: 42.7k, False: 81.1k]
  ------------------
  479|  42.7k|			size_t dataofs = o + 8;
  480|  42.7k|			if (s > 4) {
  ------------------
  |  Branch (480:8): [True: 23.9k, False: 18.7k]
  ------------------
  481|       |				/* The data in this case is merely a pointer */
  482|  23.9k|				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|  23.9k|			}
  498|  42.7k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   40|  42.7k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 2.20k, False: 40.5k]
  |  |  |  Branch (40:81): [True: 0, False: 40.5k]
  |  |  |  Branch (40:112): [True: 598, False: 39.9k]
  |  |  ------------------
  ------------------
  499|  2.80k|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  500|  2.80k|					  "ExifMnoteOlympus",
  501|  2.80k|					  "Tag data past end of buffer (%u > %u)",
  502|  2.80k|					  (unsigned)(dataofs + s), buf_size);
  503|  2.80k|				continue;
  504|  2.80k|			}
  505|       |
  506|  39.9k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  507|  39.9k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (507:8): [True: 0, False: 39.9k]
  ------------------
  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|  39.9k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  512|  39.9k|		}
  513|       |
  514|       |		/* Tag was successfully parsed */
  515|   121k|		++tcount;
  516|   121k|	}
  517|       |	/* Store the count of successfully parsed tags */
  518|  3.45k|	n->count = tcount;
  519|  3.45k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_count:
  523|  3.65k|{
  524|  3.65k|	return n ? ((ExifMnoteDataOlympus *) n)->count : 0;
  ------------------
  |  Branch (524:9): [True: 3.65k, False: 0]
  ------------------
  525|  3.65k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_name:
  539|  59.2k|{
  540|  59.2k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  541|       |
  542|  59.2k|	if (!n) return NULL;
  ------------------
  |  Branch (542:6): [True: 0, False: 59.2k]
  ------------------
  543|  59.2k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (543:6): [True: 0, False: 59.2k]
  ------------------
  544|  59.2k|	return mnote_olympus_tag_get_name (n->entries[i].tag);
  545|  59.2k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_title:
  549|  57.9k|{
  550|  57.9k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  551|       |	
  552|  57.9k|	if (!n) return NULL;
  ------------------
  |  Branch (552:6): [True: 0, False: 57.9k]
  ------------------
  553|  57.9k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (553:6): [True: 0, False: 57.9k]
  ------------------
  554|  57.9k|        return mnote_olympus_tag_get_title (n->entries[i].tag);
  555|  57.9k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_description:
  559|  57.9k|{
  560|  57.9k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  561|       |	
  562|  57.9k|	if (!n) return NULL;
  ------------------
  |  Branch (562:6): [True: 0, False: 57.9k]
  ------------------
  563|  57.9k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (563:6): [True: 0, False: 57.9k]
  ------------------
  564|  57.9k|        return mnote_olympus_tag_get_description (n->entries[i].tag);
  565|  57.9k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_value:
   77|  57.9k|{
   78|  57.9k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
   79|       |
   80|  57.9k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (80:6): [True: 0, False: 57.9k]
  |  Branch (80:12): [True: 0, False: 57.9k]
  ------------------
   81|  57.9k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (81:6): [True: 0, False: 57.9k]
  ------------------
   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|  57.9k|	return mnote_olympus_entry_get_value (&n->entries[i], val, maxlen);
   88|  57.9k|}

mnote_olympus_entry_get_value:
  276|  57.9k|{
  277|  57.9k|	char         buf[30];
  278|  57.9k|	ExifLong     vl;
  279|  57.9k|	ExifSLong    vsl;
  280|  57.9k|	ExifShort    vs = 0;
  281|  57.9k|	ExifSShort   vss = 0;
  282|  57.9k|	ExifRational vr, vr2;
  283|  57.9k|	ExifSRational vsr;
  284|  57.9k|	int          i, j;
  285|  57.9k|	double       r, b;
  286|       |
  287|  57.9k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 57.9k]
  ------------------
  288|      0|		return (NULL);
  289|  57.9k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 57.9k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  57.9k|	memset (v, 0, maxlen);
  293|  57.9k|	maxlen--;
  294|       |
  295|  57.9k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 19.9k, False: 38.0k]
  |  Branch (295:24): [True: 5.24k, False: 14.6k]
  ------------------
  296|  5.24k|		return (v);
  297|       |
  298|  52.7k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 14.6k, False: 38.0k]
  |  Branch (298:24): [True: 0, False: 14.6k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  52.7k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    681|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 681, False: 52.0k]
  ------------------
  305|    681|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    681|#define CF(format,target,v,maxlen)                              \
  |  |   36|    681|{                                                               \
  |  |   37|    681|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 245, False: 436]
  |  |  ------------------
  |  |   38|    245|                snprintf (v, maxlen,	                        \
  |  |   39|    245|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    245|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    245|                        "expected '%s'."),                      \
  |  |   41|    245|                        exif_format_get_name (format),          \
  |  |   42|    245|                        exif_format_get_name (target));         \
  |  |   43|    245|                break;                                          \
  |  |   44|    245|        }                                                       \
  |  |   45|    681|}
  ------------------
  306|    436|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    436|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    436|{                                                                       \
  |  |   62|    436|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 70, False: 366]
  |  |  ------------------
  |  |   63|     70|                snprintf (v, maxlen,                                    \
  |  |   64|     70|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     70|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     70|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     70|                break;                                                  \
  |  |   67|     70|        }                                                               \
  |  |   68|    436|}
  ------------------
  307|    366|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    366|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 237, False: 129]
  ------------------
  309|    237|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|    237|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 237]
  |  |  ------------------
  ------------------
  310|    237|		} else {
  311|    129|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    129|		}
  313|    366|		break;
  314|    610|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 610, False: 52.1k]
  ------------------
  315|    610|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    610|#define CF(format,target,v,maxlen)                              \
  |  |   36|    610|{                                                               \
  |  |   37|    610|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 328, False: 282]
  |  |  ------------------
  |  |   38|    328|                snprintf (v, maxlen,	                        \
  |  |   39|    328|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    328|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    328|                        "expected '%s'."),                      \
  |  |   41|    328|                        exif_format_get_name (format),          \
  |  |   42|    328|                        exif_format_get_name (target));         \
  |  |   43|    328|                break;                                          \
  |  |   44|    328|        }                                                       \
  |  |   45|    610|}
  ------------------
  316|    282|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    282|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    282|{                                                                       \
  |  |   62|    282|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 196, False: 86]
  |  |  ------------------
  |  |   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|    282|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|     86|                vs = exif_get_short (entry->data + 2, entry->order);
  319|     86|                snprintf (v, maxlen, "ISO %hd", vs);
  320|     86|                break;
  321|    551|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 551, False: 52.1k]
  ------------------
  322|    551|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    551|#define CF(format,target,v,maxlen)                              \
  |  |   36|    551|{                                                               \
  |  |   37|    551|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 258, False: 293]
  |  |  ------------------
  |  |   38|    258|                snprintf (v, maxlen,	                        \
  |  |   39|    258|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    258|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    258|                        "expected '%s'."),                      \
  |  |   41|    258|                        exif_format_get_name (format),          \
  |  |   42|    258|                        exif_format_get_name (target));         \
  |  |   43|    258|                break;                                          \
  |  |   44|    258|        }                                                       \
  |  |   45|    551|}
  ------------------
  323|    293|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    293|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    293|{                                                                       \
  |  |   62|    293|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 88, False: 205]
  |  |  ------------------
  |  |   63|     88|                snprintf (v, maxlen,                                    \
  |  |   64|     88|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     88|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     88|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     88|                break;                                                  \
  |  |   67|     88|        }                                                               \
  |  |   68|    293|}
  ------------------
  324|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  325|    205|                vs = exif_get_short (entry->data + 2, entry->order);
  326|    205|                snprintf (v, maxlen, "ISO2 %hd", vs);
  327|    205|                break;
  328|    268|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 268, False: 52.4k]
  ------------------
  329|    528|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 260, False: 52.4k]
  ------------------
  330|    777|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 249, False: 52.4k]
  ------------------
  331|  1.00k|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 228, False: 52.5k]
  ------------------
  332|  1.39k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 390, False: 52.3k]
  ------------------
  333|  1.63k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 242, False: 52.5k]
  ------------------
  334|  1.89k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 257, False: 52.4k]
  ------------------
  335|  2.00k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 107, False: 52.6k]
  ------------------
  336|  2.24k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 247, False: 52.4k]
  ------------------
  337|  2.50k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 256, False: 52.4k]
  ------------------
  338|  2.71k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 214, False: 52.5k]
  ------------------
  339|  2.83k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 113, False: 52.6k]
  ------------------
  340|  2.91k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 87, False: 52.6k]
  ------------------
  341|  2.91k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  2.91k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.91k|{                                                               \
  |  |   37|  2.91k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.36k, False: 550]
  |  |  ------------------
  |  |   38|  2.36k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.36k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.36k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.36k|                        "expected '%s'."),                      \
  |  |   41|  2.36k|                        exif_format_get_name (format),          \
  |  |   42|  2.36k|                        exif_format_get_name (target));         \
  |  |   43|  2.36k|                break;                                          \
  |  |   44|  2.36k|        }                                                       \
  |  |   45|  2.91k|}
  ------------------
  342|    550|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    550|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 224, False: 326]
  |  |  ------------------
  ------------------
  343|    550|		break;
  344|    255|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 255, False: 52.4k]
  ------------------
  345|    493|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 238, False: 52.5k]
  ------------------
  346|    853|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 360, False: 52.3k]
  ------------------
  347|    853|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    853|#define CF(format,target,v,maxlen)                              \
  |  |   36|    853|{                                                               \
  |  |   37|    853|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 412, False: 441]
  |  |  ------------------
  |  |   38|    412|                snprintf (v, maxlen,	                        \
  |  |   39|    412|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    412|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    412|                        "expected '%s'."),                      \
  |  |   41|    412|                        exif_format_get_name (format),          \
  |  |   42|    412|                        exif_format_get_name (target));         \
  |  |   43|    412|                break;                                          \
  |  |   44|    412|        }                                                       \
  |  |   45|    853|}
  ------------------
  348|    441|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    441|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    441|{                                                                       \
  |  |   62|    441|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 243, False: 198]
  |  |  ------------------
  |  |   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|    441|}
  ------------------
  349|    198|		vl =  exif_get_long (entry->data, entry->order);
  350|    198|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    198|		break;
  352|    713|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 713, False: 52.0k]
  ------------------
  353|  1.20k|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 487, False: 52.2k]
  ------------------
  354|  1.20k|		unsigned char h,m,l;
  355|  1.20k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  1.20k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.20k|{                                                               \
  |  |   37|  1.20k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 372, False: 828]
  |  |  ------------------
  |  |   38|    372|                snprintf (v, maxlen,	                        \
  |  |   39|    372|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    372|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    372|                        "expected '%s'."),                      \
  |  |   41|    372|                        exif_format_get_name (format),          \
  |  |   42|    372|                        exif_format_get_name (target));         \
  |  |   43|    372|                break;                                          \
  |  |   44|    372|        }                                                       \
  |  |   45|  1.20k|}
  ------------------
  356|    828|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    828|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    828|{                                                                       \
  |  |   62|    828|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 331, False: 497]
  |  |  ------------------
  |  |   63|    331|                snprintf (v, maxlen,                                    \
  |  |   64|    331|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    331|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    331|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    331|                break;                                                  \
  |  |   67|    331|        }                                                               \
  |  |   68|    828|}
  ------------------
  357|    497|		vl =  exif_get_long (entry->data, entry->order);
  358|    497|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    497|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 291, False: 206]
  ------------------
  360|    497|		break;
  361|    828|	}
  362|    236|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 236, False: 52.5k]
  ------------------
  363|    692|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 456, False: 52.2k]
  ------------------
  364|    692|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    692|#define CF(format,target,v,maxlen)                              \
  |  |   36|    692|{                                                               \
  |  |   37|    692|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 221, False: 471]
  |  |  ------------------
  |  |   38|    221|                snprintf (v, maxlen,	                        \
  |  |   39|    221|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    221|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    221|                        "expected '%s'."),                      \
  |  |   41|    221|                        exif_format_get_name (format),          \
  |  |   42|    221|                        exif_format_get_name (target));         \
  |  |   43|    221|                break;                                          \
  |  |   44|    221|        }                                                       \
  |  |   45|    692|}
  ------------------
  365|    471|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    471|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    471|{                                                                       \
  |  |   62|    471|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 245, False: 226]
  |  |  ------------------
  |  |   63|    245|                snprintf (v, maxlen,                                    \
  |  |   64|    245|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    245|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    245|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    245|                break;                                                  \
  |  |   67|    245|        }                                                               \
  |  |   68|    471|}
  ------------------
  366|    226|		vl =  exif_get_long (entry->data, entry->order);
  367|    226|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    226|		break;
  369|    447|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 447, False: 52.2k]
  ------------------
  370|    676|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 229, False: 52.5k]
  ------------------
  371|    746|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 70, False: 52.6k]
  ------------------
  372|  1.10k|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 359, False: 52.3k]
  ------------------
  373|  1.32k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 224, False: 52.5k]
  ------------------
  374|  1.32k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.32k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.32k|{                                                               \
  |  |   37|  1.32k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 831, False: 498]
  |  |  ------------------
  |  |   38|    831|                snprintf (v, maxlen,	                        \
  |  |   39|    831|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    831|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    831|                        "expected '%s'."),                      \
  |  |   41|    831|                        exif_format_get_name (format),          \
  |  |   42|    831|                        exif_format_get_name (target));         \
  |  |   43|    831|                break;                                          \
  |  |   44|    831|        }                                                       \
  |  |   45|  1.32k|}
  ------------------
  375|    498|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    498|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    498|{                                                                       \
  |  |   62|    498|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 221, False: 277]
  |  |  ------------------
  |  |   63|    221|                snprintf (v, maxlen,                                    \
  |  |   64|    221|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    221|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    221|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    221|                break;                                                  \
  |  |   67|    221|        }                                                               \
  |  |   68|    498|}
  ------------------
  376|    277|		vs = exif_get_short (entry->data, entry->order);
  377|    277|		snprintf (v, maxlen, "%hd", vs);
  378|    277|		break;
  379|  1.32k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.32k, False: 51.4k]
  ------------------
  380|  1.32k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.32k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.32k|{                                                               \
  |  |   37|  1.32k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 247, False: 1.08k]
  |  |  ------------------
  |  |   38|    247|                snprintf (v, maxlen,	                        \
  |  |   39|    247|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    247|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    247|                        "expected '%s'."),                      \
  |  |   41|    247|                        exif_format_get_name (format),          \
  |  |   42|    247|                        exif_format_get_name (target));         \
  |  |   43|    247|                break;                                          \
  |  |   44|    247|        }                                                       \
  |  |   45|  1.32k|}
  ------------------
  381|  1.08k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.08k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.08k|{                                                                       \
  |  |   62|  1.08k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 253, False: 827]
  |  |  ------------------
  |  |   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|  1.08k|}
  ------------------
  382|    827|		vr = exif_get_rational (entry->data, entry->order);
  383|    827|		r = R2D(vr);
  ------------------
  |  |   82|    827|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 458, False: 369]
  |  |  ------------------
  ------------------
  384|    827|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    827|		b = R2D(vr);
  ------------------
  |  |   82|    827|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 551, False: 276]
  |  |  ------------------
  ------------------
  386|    827|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    827|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    827|		break;
  388|  1.20k|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 1.20k, False: 51.5k]
  ------------------
  389|  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: 396, False: 811]
  |  |  ------------------
  |  |   38|    396|                snprintf (v, maxlen,	                        \
  |  |   39|    396|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    396|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    396|                        "expected '%s'."),                      \
  |  |   41|    396|                        exif_format_get_name (format),          \
  |  |   42|    396|                        exif_format_get_name (target));         \
  |  |   43|    396|                break;                                          \
  |  |   44|    396|        }                                                       \
  |  |   45|  1.20k|}
  ------------------
  390|    811|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    811|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    811|{                                                                       \
  |  |   62|    811|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 207, False: 604]
  |  |  ------------------
  |  |   63|    207|                snprintf (v, maxlen,                                    \
  |  |   64|    207|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    207|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    207|                break;                                                  \
  |  |   67|    207|        }                                                               \
  |  |   68|    811|}
  ------------------
  391|    604|		vr = exif_get_rational (entry->data, entry->order);
  392|    604|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 202, False: 402]
  |  Branch (392:24): [True: 71, False: 331]
  ------------------
  393|    273|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    273|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    331|		} else {
  395|    331|			r = R2D(vr);
  ------------------
  |  |   82|    331|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 331, False: 0]
  |  |  ------------------
  ------------------
  396|    331|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    331|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    331|		}
  398|    604|		break;
  399|  2.11k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 2.11k, False: 50.6k]
  ------------------
  400|  2.11k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  2.11k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.11k|{                                                               \
  |  |   37|  2.11k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 123, False: 1.99k]
  |  |  ------------------
  |  |   38|    123|                snprintf (v, maxlen,	                        \
  |  |   39|    123|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    123|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    123|                        "expected '%s'."),                      \
  |  |   41|    123|                        exif_format_get_name (format),          \
  |  |   42|    123|                        exif_format_get_name (target));         \
  |  |   43|    123|                break;                                          \
  |  |   44|    123|        }                                                       \
  |  |   45|  2.11k|}
  ------------------
  401|  1.99k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.99k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.99k|{                                                                       \
  |  |   62|  1.99k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 426, False: 1.56k]
  |  |  ------------------
  |  |   63|    426|                snprintf (v, maxlen,                                    \
  |  |   64|    426|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    426|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    426|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    426|                break;                                                  \
  |  |   67|    426|        }                                                               \
  |  |   68|  1.99k|}
  ------------------
  402|  1.56k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.56k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.56k|		r = R2D(vr);
  ------------------
  |  |   82|  1.56k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.28k, False: 281]
  |  |  ------------------
  ------------------
  405|  1.56k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.56k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.27k, False: 296]
  |  |  ------------------
  ------------------
  406|  1.56k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.56k|		break;
  408|  1.30k|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 1.30k, False: 51.4k]
  ------------------
  409|  1.30k|		CF2 (entry->format, EXIF_FORMAT_BYTE, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   47|  1.30k|#define CF2(format,target1,target2,v,maxlen)                    \
  |  |   48|  1.30k|{                                                               \
  |  |   49|  1.30k|        if ((format != target1) && (format != target2)) {       \
  |  |  ------------------
  |  |  |  Branch (49:13): [True: 676, False: 632]
  |  |  |  Branch (49:36): [True: 284, False: 392]
  |  |  ------------------
  |  |   50|    284|                snprintf (v, maxlen,	                        \
  |  |   51|    284|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    284|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    284|                        "expected '%s' or '%s'."),              \
  |  |   53|    284|                        exif_format_get_name (format),          \
  |  |   54|    284|                        exif_format_get_name (target1),         \
  |  |   55|    284|                        exif_format_get_name (target2));        \
  |  |   56|    284|                break;                                          \
  |  |   57|    284|        }                                                       \
  |  |   58|  1.30k|}
  ------------------
  410|  1.02k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.02k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.02k|{                                                                       \
  |  |   62|  1.02k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 288, False: 736]
  |  |  ------------------
  |  |   63|    288|                snprintf (v, maxlen,                                    \
  |  |   64|    288|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    288|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    288|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    288|                break;                                                  \
  |  |   67|    288|        }                                                               \
  |  |   68|  1.02k|}
  ------------------
  411|    736|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 272, False: 464]
  ------------------
  412|    272|			vs = exif_get_short (entry->data, entry->order);
  413|    464|		} else {
  414|    464|			vs = entry->data[0];
  415|    464|		}
  416|    736|		snprintf (v, maxlen, "%hd", vs);
  417|    736|		break;
  418|  2.51k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.51k, False: 50.2k]
  ------------------
  419|  2.51k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.51k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.51k|{                                                               \
  |  |   37|  2.51k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 88, False: 2.43k]
  |  |  ------------------
  |  |   38|     88|                snprintf (v, maxlen,	                        \
  |  |   39|     88|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     88|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     88|                        "expected '%s'."),                      \
  |  |   41|     88|                        exif_format_get_name (format),          \
  |  |   42|     88|                        exif_format_get_name (target));         \
  |  |   43|     88|                break;                                          \
  |  |   44|     88|        }                                                       \
  |  |   45|  2.51k|}
  ------------------
  420|  2.43k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.43k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.43k|{                                                                       \
  |  |   62|  2.43k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 242, False: 2.18k]
  |  |  ------------------
  |  |   63|    242|                snprintf (v, maxlen,                                    \
  |  |   64|    242|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    242|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    242|                break;                                                  \
  |  |   67|    242|        }                                                               \
  |  |   68|  2.43k|}
  ------------------
  421|  2.18k|		switch (  *( entry->data+1)  ) {
  422|    216|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 216, False: 1.97k]
  ------------------
  423|     75|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|     75|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 75, False: 2.11k]
  ------------------
  424|    267|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|    267|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 267, False: 1.92k]
  ------------------
  425|    241|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    241|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 241, False: 1.94k]
  ------------------
  426|    258|		  	case  4: strncpy (v, _("AF position: right"), maxlen); break;
  ------------------
  |  |   31|    258|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (426:6): [True: 258, False: 1.93k]
  ------------------
  427|    199|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 199, False: 1.98k]
  ------------------
  428|    118|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    118|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 118, False: 2.07k]
  ------------------
  429|    201|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 201, False: 1.98k]
  ------------------
  430|     66|		  	case  8: strncpy (v, _("AF position: lower-right"), maxlen); break;
  ------------------
  |  |   31|     66|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (430:6): [True: 66, False: 2.12k]
  ------------------
  431|     72|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|     72|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 72, False: 2.11k]
  ------------------
  432|    200|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 200, False: 1.98k]
  ------------------
  433|    275|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    275|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 275, False: 1.91k]
  ------------------
  434|  2.18k|		}     
  435|  2.18k|		break;
  436|  2.18k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.81k, False: 50.9k]
  ------------------
  437|  1.81k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.81k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.81k|{                                                               \
  |  |   37|  1.81k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 283, False: 1.53k]
  |  |  ------------------
  |  |   38|    283|                snprintf (v, maxlen,	                        \
  |  |   39|    283|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    283|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    283|                        "expected '%s'."),                      \
  |  |   41|    283|                        exif_format_get_name (format),          \
  |  |   42|    283|                        exif_format_get_name (target));         \
  |  |   43|    283|                break;                                          \
  |  |   44|    283|        }                                                       \
  |  |   45|  1.81k|}
  ------------------
  438|  1.53k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.53k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.53k|{                                                                       \
  |  |   62|  1.53k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 554, False: 980]
  |  |  ------------------
  |  |   63|    554|                snprintf (v, maxlen,                                    \
  |  |   64|    554|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    554|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    554|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    554|                break;                                                  \
  |  |   67|    554|        }                                                               \
  |  |   68|  1.53k|}
  ------------------
  439|    980|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  13.7k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 13.7k, False: 0]
  |  Branch (441:32): [True: 12.7k, False: 980]
  ------------------
  442|  12.7k|			;
  443|    980|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 980]
  ------------------
  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|    980|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|    980|#define CF(format,target,v,maxlen)                              \
  |  |   36|    980|{                                                               \
  |  |   37|    980|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 980]
  |  |  ------------------
  |  |   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|    980|}
  ------------------
  448|       |		/* find the value */
  449|  2.77k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.50k, False: 275]
  ------------------
  450|  2.50k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.79k, False: 705]
  ------------------
  451|    980|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 286, False: 694]
  ------------------
  452|    286|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    286|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    286|			break;
  454|    286|		}
  455|    694|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    694|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    694|		break;
  457|  1.47k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.47k, False: 51.2k]
  ------------------
  458|  1.47k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 1.15k, False: 318]
  ------------------
  459|  1.15k|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.15k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.15k|{                                                                       \
  |  |   62|  1.15k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 345, False: 808]
  |  |  ------------------
  |  |   63|    345|                snprintf (v, maxlen,                                    \
  |  |   64|    345|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    345|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    345|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    345|                break;                                                  \
  |  |   67|    345|        }                                                               \
  |  |   68|  1.15k|}
  ------------------
  460|    808|			vr = exif_get_rational (entry->data, entry->order);
  461|    808|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 219, False: 589]
  |  Branch (461:25): [True: 248, False: 341]
  ------------------
  462|    467|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    467|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    467|			} else {
  464|    341|				r = R2D(vr);
  ------------------
  |  |   82|    341|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 341, False: 0]
  |  |  ------------------
  ------------------
  465|    341|				snprintf (v, maxlen, "%2.2f", r);
  466|    341|			}
  467|    808|			break;
  468|  1.15k|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    541|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 223, False: 52.5k]
  ------------------
  472|    913|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 372, False: 52.3k]
  ------------------
  473|  1.14k|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 235, False: 52.5k]
  ------------------
  474|  1.42k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 281, False: 52.4k]
  ------------------
  475|  1.69k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 269, False: 52.4k]
  ------------------
  476|  1.95k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 256, False: 52.4k]
  ------------------
  477|  2.19k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 240, False: 52.5k]
  ------------------
  478|  2.40k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 210, False: 52.5k]
  ------------------
  479|  2.67k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 272, False: 52.4k]
  ------------------
  480|  2.91k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 236, False: 52.5k]
  ------------------
  481|  3.20k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 289, False: 52.4k]
  ------------------
  482|  3.44k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 239, False: 52.5k]
  ------------------
  483|  3.71k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 274, False: 52.4k]
  ------------------
  484|  3.92k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 211, False: 52.5k]
  ------------------
  485|  4.30k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 378, False: 52.3k]
  ------------------
  486|  4.52k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 218, False: 52.5k]
  ------------------
  487|  4.78k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 265, False: 52.4k]
  ------------------
  488|  5.12k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 335, False: 52.4k]
  ------------------
  489|  5.36k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 244, False: 52.5k]
  ------------------
  490|  5.57k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 209, False: 52.5k]
  ------------------
  491|  6.02k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 454, False: 52.2k]
  ------------------
  492|  6.25k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 229, False: 52.5k]
  ------------------
  493|  6.66k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 403, False: 52.3k]
  ------------------
  494|  6.86k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 209, False: 52.5k]
  ------------------
  495|  7.11k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 248, False: 52.4k]
  ------------------
  496|  7.34k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 226, False: 52.5k]
  ------------------
  497|  7.56k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 225, False: 52.5k]
  ------------------
  498|  7.56k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  7.56k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  7.56k|{                                                                       \
  |  |   62|  7.56k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.74k, False: 4.82k]
  |  |  ------------------
  |  |   63|  2.74k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.74k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.74k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.74k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.74k|                break;                                                  \
  |  |   67|  2.74k|        }                                                               \
  |  |   68|  7.56k|}
  ------------------
  499|  4.82k|		switch (entry->format) {
  500|    907|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 907, False: 3.92k]
  ------------------
  501|  1.49k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 592, False: 4.23k]
  ------------------
  502|  1.49k|			vs = entry->data[0];
  503|  1.49k|			break;
  504|  2.26k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 2.26k, False: 2.56k]
  ------------------
  505|  2.26k|			vs = exif_get_short(entry->data, entry->order);
  506|  2.26k|			break;
  507|  1.06k|		default:
  ------------------
  |  Branch (507:3): [True: 1.06k, False: 3.76k]
  ------------------
  508|  1.06k|			vs = 0;
  509|  1.06k|			break;
  510|  4.82k|		}
  511|       |		/* search for the tag */
  512|  83.2k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 83.0k, False: 251]
  |  Branch (512:32): [True: 78.4k, False: 4.57k]
  ------------------
  513|  78.4k|			;
  514|  4.82k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 251, False: 4.57k]
  ------------------
  515|    251|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|    251|		  	break;
  517|    251|		}
  518|  4.57k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  4.57k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  4.57k|{                                                               \
  |  |   37|  4.57k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 1.92k, False: 2.65k]
  |  |  ------------------
  |  |   38|  1.92k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.92k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.92k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.92k|                        "expected '%s'."),                      \
  |  |   41|  1.92k|                        exif_format_get_name (format),          \
  |  |   42|  1.92k|                        exif_format_get_name (target));         \
  |  |   43|  1.92k|                break;                                          \
  |  |   44|  1.92k|        }                                                       \
  |  |   45|  4.57k|}
  ------------------
  519|       |		/* find the value */
  520|  9.57k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 8.33k, False: 1.24k]
  ------------------
  521|  8.33k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 6.92k, False: 1.40k]
  ------------------
  522|  2.65k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.30k, False: 1.35k]
  ------------------
  523|  1.30k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.30k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.30k|			break;
  525|  1.30k|		}
  526|  1.35k|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|  1.35k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|  1.35k|		break;
  528|    201|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 201, False: 52.5k]
  ------------------
  529|    293|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 92, False: 52.6k]
  ------------------
  530|    557|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 264, False: 52.4k]
  ------------------
  531|    793|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 236, False: 52.5k]
  ------------------
  532|    870|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 77, False: 52.6k]
  ------------------
  533|  1.14k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 279, False: 52.4k]
  ------------------
  534|  1.24k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 99, False: 52.6k]
  ------------------
  535|  1.45k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 204, False: 52.5k]
  ------------------
  536|  1.90k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 454, False: 52.2k]
  ------------------
  537|  1.90k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.90k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.90k|{                                                               \
  |  |   37|  1.90k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 546, False: 1.36k]
  |  |  ------------------
  |  |   38|    546|                snprintf (v, maxlen,	                        \
  |  |   39|    546|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    546|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    546|                        "expected '%s'."),                      \
  |  |   41|    546|                        exif_format_get_name (format),          \
  |  |   42|    546|                        exif_format_get_name (target));         \
  |  |   43|    546|                break;                                          \
  |  |   44|    546|        }                                                       \
  |  |   45|  1.90k|}
  ------------------
  538|  1.36k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.36k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.36k|{                                                                       \
  |  |   62|  1.36k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 494, False: 866]
  |  |  ------------------
  |  |   63|    494|                snprintf (v, maxlen,                                    \
  |  |   64|    494|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    494|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    494|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    494|                break;                                                  \
  |  |   67|    494|        }                                                               \
  |  |   68|  1.36k|}
  ------------------
  539|    866|		vs = exif_get_short (entry->data, entry->order);
  540|    866|		switch (vs) {
  541|    397|		case 0:
  ------------------
  |  Branch (541:3): [True: 397, False: 469]
  ------------------
  542|    397|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    397|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    397|			break;
  544|    208|		case 1:
  ------------------
  |  Branch (544:3): [True: 208, False: 658]
  ------------------
  545|    208|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|    208|			break;
  547|    261|		default:
  ------------------
  |  Branch (547:3): [True: 261, False: 605]
  ------------------
  548|    261|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    261|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    261|			strncat (v, buf, maxlen - strlen (v));
  550|    261|			break;
  551|    866|		}
  552|    866|		break;
  553|  1.26k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.26k, False: 51.4k]
  ------------------
  554|  1.26k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.26k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.26k|{                                                               \
  |  |   37|  1.26k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 251, False: 1.01k]
  |  |  ------------------
  |  |   38|    251|                snprintf (v, maxlen,	                        \
  |  |   39|    251|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    251|                        "expected '%s'."),                      \
  |  |   41|    251|                        exif_format_get_name (format),          \
  |  |   42|    251|                        exif_format_get_name (target));         \
  |  |   43|    251|                break;                                          \
  |  |   44|    251|        }                                                       \
  |  |   45|  1.26k|}
  ------------------
  555|  1.01k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.01k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.01k|{                                                                       \
  |  |   62|  1.01k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 304, False: 707]
  |  |  ------------------
  |  |   63|    304|                snprintf (v, maxlen,                                    \
  |  |   64|    304|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    304|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    304|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    304|                break;                                                  \
  |  |   67|    304|        }                                                               \
  |  |   68|  1.01k|}
  ------------------
  556|    707|		vs = exif_get_short (entry->data, entry->order);
  557|    707|		switch (vs) {
  558|    139|		case 0:
  ------------------
  |  Branch (558:3): [True: 139, False: 568]
  ------------------
  559|    139|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    139|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    139|			break;
  561|     77|		case 1:
  ------------------
  |  Branch (561:3): [True: 77, False: 630]
  ------------------
  562|     77|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|     77|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|     77|			break;
  564|    194|		case 2:
  ------------------
  |  Branch (564:3): [True: 194, False: 513]
  ------------------
  565|    194|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|    194|			break;
  567|    297|		default:
  ------------------
  |  Branch (567:3): [True: 297, False: 410]
  ------------------
  568|    297|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    297|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    297|			strncat (v, buf, maxlen - strlen (v));
  570|    297|			break;
  571|    707|		}
  572|    707|		break;
  573|  1.71k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.71k, False: 51.0k]
  ------------------
  574|  1.71k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.71k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.71k|{                                                               \
  |  |   37|  1.71k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 110, False: 1.60k]
  |  |  ------------------
  |  |   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.71k|}
  ------------------
  575|  1.60k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.60k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.60k|{                                                                       \
  |  |   62|  1.60k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 298, False: 1.31k]
  |  |  ------------------
  |  |   63|    298|                snprintf (v, maxlen,                                    \
  |  |   64|    298|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    298|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    298|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    298|                break;                                                  \
  |  |   67|    298|        }                                                               \
  |  |   68|  1.60k|}
  ------------------
  576|  1.31k|		{
  577|  1.31k|			double ao,ac;
  578|  1.31k|			unsigned long fs,fl;
  579|  1.31k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.31k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.31k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 1.07k, False: 238]
  |  |  ------------------
  ------------------
  581|  1.31k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.31k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.31k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 763, False: 547]
  |  |  ------------------
  ------------------
  583|  1.31k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.31k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.31k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.11k, False: 195]
  |  |  ------------------
  ------------------
  585|  1.31k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.31k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.31k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.05k, False: 260]
  |  |  ------------------
  ------------------
  587|  1.31k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.31k|		}
  589|  1.31k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.21k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.21k, False: 50.5k]
  ------------------
  593|  2.21k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.21k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.21k|{                                                               \
  |  |   37|  2.21k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 163, False: 2.05k]
  |  |  ------------------
  |  |   38|    163|                snprintf (v, maxlen,	                        \
  |  |   39|    163|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    163|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    163|                        "expected '%s'."),                      \
  |  |   41|    163|                        exif_format_get_name (format),          \
  |  |   42|    163|                        exif_format_get_name (target));         \
  |  |   43|    163|                break;                                          \
  |  |   44|    163|        }                                                       \
  |  |   45|  2.21k|}
  ------------------
  594|  2.05k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  2.05k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.05k|{                                                                       \
  |  |   62|  2.05k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 271, False: 1.78k]
  |  |  ------------------
  |  |   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|  2.05k|}
  ------------------
  595|  1.78k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.78k|		switch (vl) {
  597|    194|		case 0:
  ------------------
  |  Branch (597:3): [True: 194, False: 1.58k]
  ------------------
  598|    194|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    194|			break;
  600|    207|		case 1:
  ------------------
  |  Branch (600:3): [True: 207, False: 1.57k]
  ------------------
  601|    207|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    207|			break;
  603|    381|		case 2:
  ------------------
  |  Branch (603:3): [True: 381, False: 1.40k]
  ------------------
  604|    381|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    381|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    381|			break;
  606|    362|		case 3:
  ------------------
  |  Branch (606:3): [True: 362, False: 1.42k]
  ------------------
  607|    362|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    362|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    362|			break;
  609|    639|		default:
  ------------------
  |  Branch (609:3): [True: 639, False: 1.14k]
  ------------------
  610|    639|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.78k|		}
  612|  1.78k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.78k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.78k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.78k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.78k|		switch (vl) {
  617|    204|		case 1:
  ------------------
  |  Branch (617:3): [True: 204, False: 1.57k]
  ------------------
  618|    204|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    204|			break;
  620|    316|		case 2:
  ------------------
  |  Branch (620:3): [True: 316, False: 1.46k]
  ------------------
  621|    316|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    316|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    316|			break;
  623|    195|		case 3:
  ------------------
  |  Branch (623:3): [True: 195, False: 1.58k]
  ------------------
  624|    195|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    195|			break;
  626|     93|		case 4:
  ------------------
  |  Branch (626:3): [True: 93, False: 1.69k]
  ------------------
  627|     93|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|     93|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|     93|			break;
  629|    975|		default:
  ------------------
  |  Branch (629:3): [True: 975, False: 808]
  ------------------
  630|    975|			snprintf (buf, sizeof (buf), "%li",
  631|    975|				  (long int) vl);
  632|    975|			strncat (v, buf, maxlen - strlen (v));
  633|  1.78k|		}
  634|  1.78k|		break;
  635|  1.78k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.53k, False: 51.2k]
  ------------------
  636|  1.53k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 268, False: 1.26k]
  ------------------
  637|       |			/* Epson uses a single SHORT here */
  638|    268|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    268|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    268|{                                                                       \
  |  |   62|    268|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 195, False: 73]
  |  |  ------------------
  |  |   63|    195|                snprintf (v, maxlen,                                    \
  |  |   64|    195|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    195|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    195|                break;                                                  \
  |  |   67|    195|        }                                                               \
  |  |   68|    268|}
  ------------------
  639|     73|			vs = exif_get_short (entry->data, entry->order);
  640|     73|			sprintf (buf, "%hu", vs);
  641|     73|			strncat (v, buf, maxlen - strlen (v));
  642|  1.26k|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|  1.26k|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.26k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.26k|{                                                                       \
  |  |   62|  1.26k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 281, False: 982]
  |  |  ------------------
  |  |   63|    281|                snprintf (v, maxlen,                                    \
  |  |   64|    281|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    281|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    281|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    281|                break;                                                  \
  |  |   67|    281|        }                                                               \
  |  |   68|  1.26k|}
  ------------------
  645|    982|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    982|#define CF(format,target,v,maxlen)                              \
  |  |   36|    982|{                                                               \
  |  |   37|    982|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 224, False: 758]
  |  |  ------------------
  |  |   38|    224|                snprintf (v, maxlen,	                        \
  |  |   39|    224|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    224|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    224|                        "expected '%s'."),                      \
  |  |   41|    224|                        exif_format_get_name (format),          \
  |  |   42|    224|                        exif_format_get_name (target));         \
  |  |   43|    224|                break;                                          \
  |  |   44|    224|        }                                                       \
  |  |   45|    982|}
  ------------------
  646|  5.30k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 4.54k, False: 758]
  ------------------
  647|  4.54k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  4.54k|				sprintf (buf, "%hd ", vss);
  649|  4.54k|				strncat (v, buf, maxlen - strlen (v));
  650|  4.54k|			}
  651|    758|		}
  652|    831|		break;
  653|  1.26k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.26k, False: 51.4k]
  ------------------
  654|  1.26k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.26k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.26k|{                                                               \
  |  |   37|  1.26k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 204, False: 1.06k]
  |  |  ------------------
  |  |   38|    204|                snprintf (v, maxlen,	                        \
  |  |   39|    204|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    204|                        "expected '%s'."),                      \
  |  |   41|    204|                        exif_format_get_name (format),          \
  |  |   42|    204|                        exif_format_get_name (target));         \
  |  |   43|    204|                break;                                          \
  |  |   44|    204|        }                                                       \
  |  |   45|  1.26k|}
  ------------------
  655|  1.06k|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.06k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.06k|{                                                                       \
  |  |   62|  1.06k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 260, False: 803]
  |  |  ------------------
  |  |   63|    260|                snprintf (v, maxlen,                                    \
  |  |   64|    260|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    260|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    260|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    260|                break;                                                  \
  |  |   67|    260|        }                                                               \
  |  |   68|  1.06k|}
  ------------------
  656|  5.62k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 4.81k, False: 803]
  ------------------
  657|  4.81k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  4.81k|			sprintf (buf, "%hu ", vs);
  659|  4.81k|			strncat (v, buf, maxlen - strlen (v));
  660|  4.81k|		}
  661|    803|		break;
  662|    871|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 871, False: 51.8k]
  ------------------
  663|    871|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    871|#define CF(format,target,v,maxlen)                              \
  |  |   36|    871|{                                                               \
  |  |   37|    871|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 88, False: 783]
  |  |  ------------------
  |  |   38|     88|                snprintf (v, maxlen,	                        \
  |  |   39|     88|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     88|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     88|                        "expected '%s'."),                      \
  |  |   41|     88|                        exif_format_get_name (format),          \
  |  |   42|     88|                        exif_format_get_name (target));         \
  |  |   43|     88|                break;                                          \
  |  |   44|     88|        }                                                       \
  |  |   45|    871|}
  ------------------
  664|    783|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    783|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    783|{                                                                       \
  |  |   72|    783|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 143, False: 640]
  |  |  |  Branch (72:23): [True: 327, False: 313]
  |  |  ------------------
  |  |   73|    470|		snprintf (v, maxlen,                                    \
  |  |   74|    470|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    470|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    470|			"expected %i or %i)."), (int) number,		\
  |  |   76|    470|			(int) t1, (int) t2);  				\
  |  |   77|    470|		break;                                                  \
  |  |   78|    470|	}                                                               \
  |  |   79|    783|}
  ------------------
  665|    313|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    313|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 313]
  |  |  ------------------
  ------------------
  666|    313|		break;
  667|    798|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 798, False: 51.9k]
  ------------------
  668|    798|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    798|#define CF(format,target,v,maxlen)                              \
  |  |   36|    798|{                                                               \
  |  |   37|    798|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 221, False: 577]
  |  |  ------------------
  |  |   38|    221|                snprintf (v, maxlen,	                        \
  |  |   39|    221|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    221|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    221|                        "expected '%s'."),                      \
  |  |   41|    221|                        exif_format_get_name (format),          \
  |  |   42|    221|                        exif_format_get_name (target));         \
  |  |   43|    221|                break;                                          \
  |  |   44|    221|        }                                                       \
  |  |   45|    798|}
  ------------------
  669|    577|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    577|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 292, False: 285]
  |  |  ------------------
  ------------------
  670|    577|		break;
  671|  1.11k|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 1.11k, False: 51.6k]
  ------------------
  672|  1.11k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  1.11k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.11k|{                                                               \
  |  |   37|  1.11k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 236, False: 882]
  |  |  ------------------
  |  |   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|  1.11k|}
  ------------------
  673|    882|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    882|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    882|{                                                                       \
  |  |   72|    882|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 105, False: 777]
  |  |  |  Branch (72:23): [True: 398, False: 379]
  |  |  ------------------
  |  |   73|    503|		snprintf (v, maxlen,                                    \
  |  |   74|    503|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    503|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    503|			"expected %i or %i)."), (int) number,		\
  |  |   76|    503|			(int) t1, (int) t2);  				\
  |  |   77|    503|		break;                                                  \
  |  |   78|    503|	}                                                               \
  |  |   79|    882|}
  ------------------
  674|    379|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    379|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 379]
  |  |  ------------------
  ------------------
  675|    379|		break;
  676|    530|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 530, False: 52.2k]
  ------------------
  677|    530|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    530|#define CF(format,target,v,maxlen)                              \
  |  |   36|    530|{                                                               \
  |  |   37|    530|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 92, False: 438]
  |  |  ------------------
  |  |   38|     92|                snprintf (v, maxlen,	                        \
  |  |   39|     92|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     92|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     92|                        "expected '%s'."),                      \
  |  |   41|     92|                        exif_format_get_name (format),          \
  |  |   42|     92|                        exif_format_get_name (target));         \
  |  |   43|     92|                break;                                          \
  |  |   44|     92|        }                                                       \
  |  |   45|    530|}
  ------------------
  678|    438|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    438|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    438|{                                                                       \
  |  |   62|    438|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 237, False: 201]
  |  |  ------------------
  |  |   63|    237|                snprintf (v, maxlen,                                    \
  |  |   64|    237|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    237|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    237|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    237|                break;                                                  \
  |  |   67|    237|        }                                                               \
  |  |   68|    438|}
  ------------------
  679|    201|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    201|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 201]
  |  |  ------------------
  ------------------
  680|    201|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 52.7k]
  ------------------
  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.71k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.71k, False: 51.0k]
  ------------------
  691|  1.71k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.71k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.71k|{                                                               \
  |  |   37|  1.71k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 95, False: 1.62k]
  |  |  ------------------
  |  |   38|     95|                snprintf (v, maxlen,	                        \
  |  |   39|     95|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     95|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     95|                        "expected '%s'."),                      \
  |  |   41|     95|                        exif_format_get_name (format),          \
  |  |   42|     95|                        exif_format_get_name (target));         \
  |  |   43|     95|                break;                                          \
  |  |   44|     95|        }                                                       \
  |  |   45|  1.71k|}
  ------------------
  692|  1.62k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.62k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.62k|{                                                                       \
  |  |   62|  1.62k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 311, False: 1.30k]
  |  |  ------------------
  |  |   63|    311|                snprintf (v, maxlen,                                    \
  |  |   64|    311|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    311|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    311|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    311|                break;                                                  \
  |  |   67|    311|        }                                                               \
  |  |   68|  1.62k|}
  ------------------
  693|  1.30k|		vr = exif_get_rational (entry->data, entry->order);
  694|  1.30k|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 235, False: 1.07k]
  |  Branch (694:24): [True: 517, False: 557]
  ------------------
  695|    752|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    752|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    752|		}
  697|    557|		else {
  698|    557|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    557|			snprintf (v, maxlen, "%li mm", tmp);
  700|    557|		}
  701|  1.30k|		break;
  702|  2.26k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.26k, False: 50.4k]
  ------------------
  703|  2.26k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.26k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.26k|{                                                               \
  |  |   37|  2.26k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 237, False: 2.02k]
  |  |  ------------------
  |  |   38|    237|                snprintf (v, maxlen,	                        \
  |  |   39|    237|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    237|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    237|                        "expected '%s'."),                      \
  |  |   41|    237|                        exif_format_get_name (format),          \
  |  |   42|    237|                        exif_format_get_name (target));         \
  |  |   43|    237|                break;                                          \
  |  |   44|    237|        }                                                       \
  |  |   45|  2.26k|}
  ------------------
  704|  2.02k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  2.02k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.02k|{                                                                       \
  |  |   62|  2.02k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 213, False: 1.81k]
  |  |  ------------------
  |  |   63|    213|                snprintf (v, maxlen,                                    \
  |  |   64|    213|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    213|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    213|                break;                                                  \
  |  |   67|    213|        }                                                               \
  |  |   68|  2.02k|}
  ------------------
  705|  1.81k|		vs = exif_get_short (entry->data, entry->order);
  706|  1.81k|		switch (vs) {
  707|    225|		case 1:
  ------------------
  |  Branch (707:3): [True: 225, False: 1.58k]
  ------------------
  708|    225|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    225|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    225|			break;
  710|  1.09k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.09k, False: 716]
  ------------------
  711|  1.09k|			{
  712|  1.09k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.09k|				unsigned long colorTemp = 0;
  714|  1.09k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 999, False: 97]
  ------------------
  715|    205|				case 2:
  ------------------
  |  Branch (715:5): [True: 205, False: 891]
  ------------------
  716|    205|					colorTemp = 3000;
  717|    205|					break;
  718|     10|				case 3:
  ------------------
  |  Branch (718:5): [True: 10, False: 1.08k]
  ------------------
  719|     10|					colorTemp = 3700;
  720|     10|					break;
  721|    256|				case 4:
  ------------------
  |  Branch (721:5): [True: 256, False: 840]
  ------------------
  722|    256|					colorTemp = 4000;
  723|    256|					break;
  724|     66|				case 5:
  ------------------
  |  Branch (724:5): [True: 66, False: 1.03k]
  ------------------
  725|     66|					colorTemp = 4500;
  726|     66|					break;
  727|    196|				case 6:
  ------------------
  |  Branch (727:5): [True: 196, False: 900]
  ------------------
  728|    196|					colorTemp = 5500;
  729|    196|					break;
  730|     69|				case 7:
  ------------------
  |  Branch (730:5): [True: 69, False: 1.02k]
  ------------------
  731|     69|					colorTemp = 6500;
  732|     69|					break;
  733|    197|				case 9:
  ------------------
  |  Branch (733:5): [True: 197, False: 899]
  ------------------
  734|    197|					colorTemp = 7500;
  735|    197|					break;
  736|  1.09k|				}
  737|  1.09k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 999, False: 97]
  ------------------
  738|    999|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|    999|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|    999|				}
  740|     97|				else {
  741|     97|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|     97|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|     97|				}
  743|       |
  744|  1.09k|			}
  745|      0|			break;
  746|    246|		case 3:
  ------------------
  |  Branch (746:3): [True: 246, False: 1.56k]
  ------------------
  747|    246|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    246|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    246|			break;
  749|    245|		default:
  ------------------
  |  Branch (749:3): [True: 245, False: 1.56k]
  ------------------
  750|    245|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    245|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    245|			break;
  752|  1.81k|		}
  753|  1.81k|		break;
  754|  1.81k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 213, False: 52.5k]
  ------------------
  755|    692|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 479, False: 52.2k]
  ------------------
  756|    692|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    692|#define CF(format,target,v,maxlen)                              \
  |  |   36|    692|{                                                               \
  |  |   37|    692|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 247, False: 445]
  |  |  ------------------
  |  |   38|    247|                snprintf (v, maxlen,	                        \
  |  |   39|    247|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    247|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    247|                        "expected '%s'."),                      \
  |  |   41|    247|                        exif_format_get_name (format),          \
  |  |   42|    247|                        exif_format_get_name (target));         \
  |  |   43|    247|                break;                                          \
  |  |   44|    247|        }                                                       \
  |  |   45|    692|}
  ------------------
  757|    445|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    445|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    445|{                                                                       \
  |  |   62|    445|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 250, False: 195]
  |  |  ------------------
  |  |   63|    250|                snprintf (v, maxlen,                                    \
  |  |   64|    250|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    250|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    250|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    250|                break;                                                  \
  |  |   67|    250|        }                                                               \
  |  |   68|    445|}
  ------------------
  758|    195|		vs = exif_get_short (entry->data, entry->order);
  759|    195|		snprintf (v, maxlen, "%hu ", vs);
  760|    195|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    195|		sprintf (buf, "%hu", vs);
  762|    195|		strncat (v, buf, maxlen - strlen (v));
  763|    195|		break;
  764|     88|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 88, False: 52.6k]
  ------------------
  765|    716|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 628, False: 52.1k]
  ------------------
  766|    716|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    716|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    716|{                                                                       \
  |  |   62|    716|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 111, False: 605]
  |  |  ------------------
  |  |   63|    111|                snprintf (v, maxlen,                                    \
  |  |   64|    111|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    111|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    111|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    111|                break;                                                  \
  |  |   67|    111|        }                                                               \
  |  |   68|    716|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|  1.43k|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 825, False: 51.9k]
  ------------------
  770|  1.43k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.43k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.43k|{                                                               \
  |  |   37|  1.43k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 224, False: 1.20k]
  |  |  ------------------
  |  |   38|    224|                snprintf (v, maxlen,	                        \
  |  |   39|    224|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    224|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    224|                        "expected '%s'."),                      \
  |  |   41|    224|                        exif_format_get_name (format),          \
  |  |   42|    224|                        exif_format_get_name (target));         \
  |  |   43|    224|                break;                                          \
  |  |   44|    224|        }                                                       \
  |  |   45|  1.43k|}
  ------------------
  771|  1.20k|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 604, False: 602]
  ------------------
  772|    604|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    604|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    604|{                                                                       \
  |  |   62|    604|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 385, False: 219]
  |  |  ------------------
  |  |   63|    385|                snprintf (v, maxlen,                                    \
  |  |   64|    385|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    385|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    385|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    385|                break;                                                  \
  |  |   67|    385|        }                                                               \
  |  |   68|    604|}
  ------------------
  773|  5.20k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 4.37k, False: 821]
  ------------------
  774|  4.37k|			vs = exif_get_short (entry->data+2*i, entry->order);
  775|  4.37k|			sprintf (buf, "%hu ", vs);
  776|  4.37k|			strncat (v, buf, maxlen - strlen (v));
  777|  4.37k|		}
  778|    821|		break;
  779|    248|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 248, False: 52.4k]
  ------------------
  780|    635|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 387, False: 52.3k]
  ------------------
  781|    839|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 204, False: 52.5k]
  ------------------
  782|  1.32k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 484, False: 52.2k]
  ------------------
  783|  1.32k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.32k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.32k|{                                                               \
  |  |   37|  1.32k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 558, False: 765]
  |  |  ------------------
  |  |   38|    558|                snprintf (v, maxlen,	                        \
  |  |   39|    558|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    558|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    558|                        "expected '%s'."),                      \
  |  |   41|    558|                        exif_format_get_name (format),          \
  |  |   42|    558|                        exif_format_get_name (target));         \
  |  |   43|    558|                break;                                          \
  |  |   44|    558|        }                                                       \
  |  |   45|  1.32k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.91k|	default:
  ------------------
  |  Branch (786:2): [True: 4.14k, False: 48.5k]
  ------------------
  787|  4.91k|		switch (entry->format) {
  788|    636|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 636, False: 4.27k]
  ------------------
  789|    636|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    636|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 369, False: 267]
  |  |  ------------------
  ------------------
  790|    636|			break;
  791|    493|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 493, False: 4.41k]
  ------------------
  792|    493|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    493|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    493|{                                                                       \
  |  |   62|    493|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 262, False: 231]
  |  |  ------------------
  |  |   63|    262|                snprintf (v, maxlen,                                    \
  |  |   64|    262|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    262|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    262|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    262|                break;                                                  \
  |  |   67|    262|        }                                                               \
  |  |   68|    493|}
  ------------------
  793|    231|			vs = exif_get_short (entry->data, entry->order);
  794|    231|			snprintf (v, maxlen, "%hu", vs);
  795|    231|			break;
  796|    468|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 468, False: 4.44k]
  ------------------
  797|    468|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    468|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    468|{                                                                       \
  |  |   62|    468|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 221, False: 247]
  |  |  ------------------
  |  |   63|    221|                snprintf (v, maxlen,                                    \
  |  |   64|    221|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    221|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    221|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    221|                break;                                                  \
  |  |   67|    221|        }                                                               \
  |  |   68|    468|}
  ------------------
  798|    247|			vss = exif_get_sshort (entry->data, entry->order);
  799|    247|			snprintf (v, maxlen, "%hi", vss);
  800|    247|			break;
  801|    355|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 355, False: 4.55k]
  ------------------
  802|    355|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    355|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    355|{                                                                       \
  |  |   62|    355|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 122, False: 233]
  |  |  ------------------
  |  |   63|    122|                snprintf (v, maxlen,                                    \
  |  |   64|    122|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    122|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    122|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    122|                break;                                                  \
  |  |   67|    122|        }                                                               \
  |  |   68|    355|}
  ------------------
  803|    233|			vl = exif_get_long (entry->data, entry->order);
  804|    233|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    233|			break;
  806|    160|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 160, False: 4.75k]
  ------------------
  807|    160|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    160|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    160|{                                                                       \
  |  |   62|    160|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 92, False: 68]
  |  |  ------------------
  |  |   63|     92|                snprintf (v, maxlen,                                    \
  |  |   64|     92|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     92|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     92|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     92|                break;                                                  \
  |  |   67|     92|        }                                                               \
  |  |   68|    160|}
  ------------------
  808|     68|			vsl = exif_get_slong (entry->data, entry->order);
  809|     68|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|     68|			break;
  811|  1.05k|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 1.05k, False: 3.85k]
  ------------------
  812|  1.05k|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.05k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.05k|{                                                                       \
  |  |   62|  1.05k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 355, False: 700]
  |  |  ------------------
  |  |   63|    355|                snprintf (v, maxlen,                                    \
  |  |   64|    355|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    355|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    355|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    355|                break;                                                  \
  |  |   67|    355|        }                                                               \
  |  |   68|  1.05k|}
  ------------------
  813|    700|			vr = exif_get_rational (entry->data, entry->order);
  814|    700|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 283, False: 417]
  ------------------
  815|    283|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    283|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    417|			} else {
  817|    417|				r = R2D(vr);
  ------------------
  |  |   82|    417|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 417, False: 0]
  |  |  ------------------
  ------------------
  818|    417|				snprintf (v, maxlen, "%2.3f", r);
  819|    417|			}
  820|    700|			break;
  821|  1.00k|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 1.00k, False: 3.90k]
  ------------------
  822|  1.00k|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.00k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.00k|{                                                                       \
  |  |   62|  1.00k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 379, False: 625]
  |  |  ------------------
  |  |   63|    379|                snprintf (v, maxlen,                                    \
  |  |   64|    379|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    379|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    379|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    379|                break;                                                  \
  |  |   67|    379|        }                                                               \
  |  |   68|  1.00k|}
  ------------------
  823|    625|			vsr = exif_get_srational (entry->data, entry->order);
  824|    625|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 210, False: 415]
  ------------------
  825|    210|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  826|    415|			} else {
  827|    415|				r = R2D(vsr);
  ------------------
  |  |   82|    415|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 415, False: 0]
  |  |  ------------------
  ------------------
  828|    415|				snprintf (v, maxlen, "%2.3f", r);
  829|    415|			}
  830|    625|			break;
  831|    109|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 109, False: 4.80k]
  ------------------
  832|    740|		default:
  ------------------
  |  Branch (832:3): [True: 631, False: 4.28k]
  ------------------
  833|    740|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    740|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    740|				  entry->size);
  835|  50.0k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 49.3k, False: 740]
  ------------------
  836|  49.3k|				sprintf (buf, "%02x", entry->data[i]);
  837|  49.3k|				strncat (v, buf, maxlen - strlen (v));
  838|  49.3k|			}
  839|    740|			break;
  840|  4.91k|		}
  841|  4.91k|		break;
  842|  52.7k|	}
  843|       |
  844|  52.7k|	return (v);
  845|  52.7k|}

mnote_olympus_tag_get_name:
  232|   190k|{
  233|   190k|	unsigned int i;
  234|       |
  235|  21.2M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (235:14): [True: 21.2M, False: 38.0k]
  ------------------
  236|  21.2M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (236:7): [True: 152k, False: 21.0M]
  ------------------
  237|  38.0k|	return NULL;
  238|   190k|}
mnote_olympus_tag_get_title:
  242|  57.9k|{
  243|  57.9k|	unsigned int i;
  244|       |
  245|  57.9k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  246|  4.94M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (246:14): [True: 4.94M, False: 0]
  ------------------
  247|  4.94M|		if (table[i].tag == t) {
  ------------------
  |  Branch (247:7): [True: 57.9k, False: 4.89M]
  ------------------
  248|  57.9k|			if (!table[i].title)
  ------------------
  |  Branch (248:8): [True: 0, False: 57.9k]
  ------------------
  249|      0|				return NULL;
  250|  57.9k|			return _(table[i].title);
  ------------------
  |  |   31|  57.9k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  251|  57.9k|		}
  252|      0|	return NULL;
  253|  57.9k|}
mnote_olympus_tag_get_description:
  257|  57.9k|{
  258|  57.9k|	unsigned int i;
  259|       |
  260|  4.94M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (260:14): [True: 4.94M, False: 0]
  ------------------
  261|  4.94M|		if (table[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 57.9k, False: 4.89M]
  ------------------
  262|  57.9k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (262:8): [True: 87, False: 57.9k]
  |  Branch (262:33): [True: 56.9k, False: 932]
  ------------------
  263|  57.0k|				return "";
  264|    932|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  265|    932|			return _(table[i].description);
  ------------------
  |  |   31|    932|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  57.9k|		}
  267|      0|	return NULL;
  268|  57.9k|}

exif_mnote_data_pentax_identify:
  429|  1.13k|{
  430|  1.13k|	(void) ed;  /* unused */
  431|  1.13k|	if ((e->size >= 8) && !memcmp (e->data, "AOC", 4)) {
  ------------------
  |  Branch (431:6): [True: 895, False: 237]
  |  Branch (431:24): [True: 516, False: 379]
  ------------------
  432|    516|		if (((e->data[4] == 'I') && (e->data[5] == 'I')) ||
  ------------------
  |  Branch (432:8): [True: 225, False: 291]
  |  Branch (432:31): [True: 8, False: 217]
  ------------------
  433|    508|		    ((e->data[4] == 'M') && (e->data[5] == 'M')))
  ------------------
  |  Branch (433:8): [True: 19, False: 489]
  |  Branch (433:31): [True: 3, False: 16]
  ------------------
  434|     11|			return pentaxV3;
  435|    505|		else
  436|       |			/* Uses Casio v2 tags */
  437|    505|			return pentaxV2;
  438|    516|	}
  439|       |
  440|    616|	if ((e->size >= 8) && !memcmp (e->data, "QVC", 4))
  ------------------
  |  Branch (440:6): [True: 379, False: 237]
  |  Branch (440:24): [True: 26, False: 353]
  ------------------
  441|     26|		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|    590|	if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b))
  ------------------
  |  Branch (445:6): [True: 576, False: 14]
  |  Branch (445:24): [True: 440, False: 136]
  |  Branch (445:48): [True: 410, False: 30]
  ------------------
  446|    410|		return pentaxV1;
  447|       |
  448|    180|	return 0;
  449|    590|}
exif_mnote_data_pentax_new:
  453|    952|{
  454|    952|	ExifMnoteData *d;
  455|       |
  456|    952|	if (!mem) return NULL;
  ------------------
  |  Branch (456:6): [True: 0, False: 952]
  ------------------
  457|       |
  458|    952|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataPentax));
  459|    952|	if (!d) return NULL;
  ------------------
  |  Branch (459:6): [True: 0, False: 952]
  ------------------
  460|       |
  461|    952|	exif_mnote_data_construct (d, mem);
  462|       |
  463|       |	/* Set up function pointers */
  464|    952|	d->methods.free            = exif_mnote_data_pentax_free;
  465|    952|	d->methods.set_byte_order  = exif_mnote_data_pentax_set_byte_order;
  466|    952|	d->methods.set_offset      = exif_mnote_data_pentax_set_offset;
  467|    952|	d->methods.load            = exif_mnote_data_pentax_load;
  468|    952|	d->methods.save            = exif_mnote_data_pentax_save;
  469|    952|	d->methods.count           = exif_mnote_data_pentax_count;
  470|    952|	d->methods.get_id          = exif_mnote_data_pentax_get_id;
  471|    952|	d->methods.get_name        = exif_mnote_data_pentax_get_name;
  472|    952|	d->methods.get_title       = exif_mnote_data_pentax_get_title;
  473|    952|	d->methods.get_description = exif_mnote_data_pentax_get_description;
  474|    952|	d->methods.get_value       = exif_mnote_data_pentax_get_value;
  475|       |
  476|    952|	return d;
  477|    952|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_free:
   57|    952|{
   58|    952|	if (!n) return;
  ------------------
  |  Branch (58:6): [True: 0, False: 952]
  ------------------
   59|       |
   60|    952|	exif_mnote_data_pentax_clear ((ExifMnoteDataPentax *) n);
   61|    952|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_clear:
   37|  1.80k|{
   38|  1.80k|	ExifMnoteData *d = (ExifMnoteData *) n;
   39|  1.80k|	unsigned int i;
   40|       |
   41|  1.80k|	if (!n) return;
  ------------------
  |  Branch (41:6): [True: 0, False: 1.80k]
  ------------------
   42|       |
   43|  1.80k|	if (n->entries) {
  ------------------
  |  Branch (43:6): [True: 854, False: 952]
  ------------------
   44|  19.2k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (44:15): [True: 18.3k, False: 854]
  ------------------
   45|  18.3k|			if (n->entries[i].data) {
  ------------------
  |  Branch (45:8): [True: 7.17k, False: 11.2k]
  ------------------
   46|  7.17k|				exif_mem_free (d->mem, n->entries[i].data);
   47|  7.17k|				n->entries[i].data = NULL;
   48|  7.17k|			}
   49|    854|		exif_mem_free (d->mem, n->entries);
   50|       |		n->entries = NULL;
   51|    854|		n->count = 0;
   52|    854|	}
   53|  1.80k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_byte_order:
  409|    952|{
  410|    952|	ExifByteOrder o_orig;
  411|    952|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
  412|    952|	unsigned int i;
  413|       |
  414|    952|	if (!n) return;
  ------------------
  |  Branch (414:6): [True: 0, False: 952]
  ------------------
  415|       |
  416|    952|	o_orig = n->order;
  417|    952|	n->order = o;
  418|    952|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (418:14): [True: 0, False: 952]
  ------------------
  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|    952|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_offset:
  403|    952|{
  404|    952|	if (d) ((ExifMnoteDataPentax *) d)->offset = o;
  ------------------
  |  Branch (404:6): [True: 952, False: 0]
  ------------------
  405|    952|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_load:
  220|    952|{
  221|    952|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) en;
  222|    952|	size_t i, tcount, o, datao, base = 0;
  223|    952|	ExifShort c;
  224|       |
  225|    952|	if (!n) return;
  ------------------
  |  Branch (225:6): [True: 0, False: 952]
  ------------------
  226|       |
  227|    952|	if (!buf || !buf_size) {
  ------------------
  |  Branch (227:6): [True: 0, False: 952]
  |  Branch (227:14): [True: 0, False: 952]
  ------------------
  228|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  229|      0|			  "ExifMnoteDataPentax", "Short MakerNote");
  230|      0|		return;
  231|      0|	}
  232|    952|	datao = 6 + n->offset;
  233|    952|	if (CHECKOVERFLOW(datao, buf_size, 8)) {
  ------------------
  |  |   33|    952|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 952]
  |  |  |  Branch (33:81): [True: 0, False: 952]
  |  |  |  Branch (33:112): [True: 8, False: 944]
  |  |  ------------------
  ------------------
  234|      8|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  235|      8|			  "ExifMnoteDataPentax", "Short MakerNote");
  236|      8|		return;
  237|      8|	}
  238|       |
  239|       |	/* Detect variant of Pentax/Casio MakerNote found */
  240|    944|	if (!memcmp(buf + datao, "AOC", 4)) {
  ------------------
  |  Branch (240:6): [True: 498, False: 446]
  ------------------
  241|    498|		if ((buf[datao + 4] == 'I') && (buf[datao + 5] == 'I')) {
  ------------------
  |  Branch (241:7): [True: 218, False: 280]
  |  Branch (241:34): [True: 8, False: 210]
  ------------------
  242|      8|			n->version = pentaxV3;
  243|      8|			n->order = EXIF_BYTE_ORDER_INTEL;
  244|    490|		} else if ((buf[datao + 4] == 'M') && (buf[datao + 5] == 'M')) {
  ------------------
  |  Branch (244:14): [True: 19, False: 471]
  |  Branch (244:41): [True: 3, False: 16]
  ------------------
  245|      3|			n->version = pentaxV3;
  246|      3|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  247|    487|		} else {
  248|       |			/* Uses Casio v2 tags */
  249|    487|			n->version = pentaxV2;
  250|    487|		}
  251|    498|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  252|    498|			"Parsing Pentax maker note v%d...", (int)n->version);
  253|    498|		datao += 4 + 2;
  254|    498|		base = MNOTE_PENTAX2_TAG_BASE;
  255|    498|	} else if (!memcmp(buf + datao, "QVC", 4)) {
  ------------------
  |  Branch (255:13): [True: 23, False: 423]
  ------------------
  256|     23|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  257|     23|			"Parsing Casio maker note v2...");
  258|     23|		n->version = casioV2;
  259|     23|		base = MNOTE_CASIO2_TAG_BASE;
  260|     23|		datao += 4 + 2;
  261|    423|	} else {
  262|       |		/* probably assert(!memcmp(buf + datao, "\x00\x1b", 2)) */
  263|    423|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  264|    423|			"Parsing Pentax maker note v1...");
  265|    423|		n->version = pentaxV1;
  266|    423|	}
  267|       |
  268|       |	/* Read the number of tags */
  269|    944|	c = exif_get_short (buf + datao, n->order);
  270|    944|	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|    944|	if (c > 200) {
  ------------------
  |  Branch (274:6): [True: 90, False: 854]
  ------------------
  275|     90|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataPentax", "Too much tags (%d) in Pentax MakerNote", c);
  276|     90|		return;
  277|     90|	}
  278|       |
  279|       |
  280|       |	/* Remove any old entries */
  281|    854|	exif_mnote_data_pentax_clear (n);
  282|       |
  283|       |	/* Reserve enough space for all the possible MakerNote tags */
  284|    854|	n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c);
  285|    854|	if (!n->entries) {
  ------------------
  |  Branch (285:6): [True: 0, False: 854]
  ------------------
  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|    854|	tcount = 0;
  292|  19.9k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (292:25): [True: 19.9k, False: 34]
  ------------------
  293|  19.9k|		size_t s;
  294|       |
  295|  19.9k|		memset(&n->entries[tcount], 0, sizeof(MnotePentaxEntry));
  296|  19.9k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   33|  19.9k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 251, False: 19.7k]
  |  |  |  Branch (33:81): [True: 0, False: 19.7k]
  |  |  |  Branch (33:112): [True: 363, False: 19.3k]
  |  |  ------------------
  ------------------
  297|    614|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  298|    614|				  "ExifMnoteDataPentax", "Short MakerNote");
  299|    614|			break;
  300|    614|		}
  301|       |
  302|  19.3k|		n->entries[tcount].tag        = exif_get_short (buf + o + 0, n->order) + base;
  303|  19.3k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  304|  19.3k|		n->entries[tcount].components = exif_get_long  (buf + o + 4, n->order);
  305|  19.3k|		n->entries[tcount].order      = n->order;
  306|       |
  307|  19.3k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnotePentax",
  308|  19.3k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  309|  19.3k|			  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.3k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (313:8): [True: 10.2k, False: 9.12k]
  ------------------
  314|  10.2k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (314:4): [True: 206, False: 10.0k]
  ------------------
  315|  19.3k|		) {
  316|    206|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  317|    206|				  "ExifMnoteDataPentax", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  318|    206|			break;
  319|    206|		}
  320|       |		/*
  321|       |		 * Size? If bigger than 4 bytes, the actual data is not
  322|       |		 * in the entry but somewhere else (offset).
  323|       |		 */
  324|  19.1k|		s = exif_format_get_size (n->entries[tcount].format) *
  325|  19.1k|                                      n->entries[tcount].components;
  326|  19.1k|		n->entries[tcount].size = s;
  327|  19.1k|		if (s) {
  ------------------
  |  Branch (327:7): [True: 7.92k, False: 11.2k]
  ------------------
  328|  7.92k|			size_t dataofs = o + 8;
  329|  7.92k|			if (s > 4)
  ------------------
  |  Branch (329:8): [True: 2.79k, False: 5.12k]
  ------------------
  330|       |				/* The data in this case is merely a pointer */
  331|  2.79k|			   	dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  332|       |
  333|  7.92k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  7.92k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 595, False: 7.32k]
  |  |  |  Branch (33:81): [True: 0, False: 7.32k]
  |  |  |  Branch (33:112): [True: 154, False: 7.17k]
  |  |  ------------------
  ------------------
  334|    749|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  335|    749|						  "ExifMnoteDataPentax", "Tag data past end "
  336|    749|					  "of buffer (%u > %u)", (unsigned)(dataofs + s), buf_size);
  337|    749|				continue;
  338|    749|			}
  339|       |
  340|  7.17k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  341|  7.17k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (341:8): [True: 0, False: 7.17k]
  ------------------
  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.17k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  346|  7.17k|		}
  347|       |
  348|       |		/* Tag was successfully parsed */
  349|  18.3k|		++tcount;
  350|  18.3k|	}
  351|       |	/* Store the count of successfully parsed tags */
  352|    854|	n->count = tcount;
  353|    854|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_count:
  357|    952|{
  358|    952|	return n ? ((ExifMnoteDataPentax *) n)->count : 0;
  ------------------
  |  Branch (358:9): [True: 952, False: 0]
  ------------------
  359|    952|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_name:
  373|  13.2k|{
  374|  13.2k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  375|       |
  376|  13.2k|	if (!note) return NULL;
  ------------------
  |  Branch (376:6): [True: 0, False: 13.2k]
  ------------------
  377|  13.2k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (377:6): [True: 0, False: 13.2k]
  ------------------
  378|  13.2k|	return mnote_pentax_tag_get_name (note->entries[n].tag);
  379|  13.2k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_title:
  383|  12.9k|{
  384|  12.9k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  385|       |
  386|  12.9k|	if (!note) return NULL;
  ------------------
  |  Branch (386:6): [True: 0, False: 12.9k]
  ------------------
  387|  12.9k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (387:6): [True: 0, False: 12.9k]
  ------------------
  388|  12.9k|	return mnote_pentax_tag_get_title (note->entries[n].tag);
  389|  12.9k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_description:
  393|  12.9k|{
  394|  12.9k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  395|       |	
  396|  12.9k|	if (!note) return NULL;
  ------------------
  |  Branch (396:6): [True: 0, False: 12.9k]
  ------------------
  397|  12.9k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (397:6): [True: 0, False: 12.9k]
  ------------------
  398|  12.9k|	return mnote_pentax_tag_get_description (note->entries[n].tag);
  399|  12.9k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_value:
   65|  12.9k|{
   66|  12.9k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
   67|       |
   68|  12.9k|	if (!n) return NULL;
  ------------------
  |  Branch (68:6): [True: 0, False: 12.9k]
  ------------------
   69|  12.9k|	if (n->count <= i) return NULL;
  ------------------
  |  Branch (69:6): [True: 0, False: 12.9k]
  ------------------
   70|  12.9k|	return mnote_pentax_entry_get_value (&n->entries[i], val, maxlen);
   71|  12.9k|}

mnote_pentax_entry_get_value:
  312|  12.9k|{
  313|  12.9k|	ExifLong vl;
  314|  12.9k|	ExifSLong vsl;
  315|  12.9k|	ExifShort vs, vs2;
  316|  12.9k|	ExifSShort vss;
  317|  12.9k|	int i = 0, j = 0;
  318|       |
  319|  12.9k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 12.9k]
  ------------------
  320|  12.9k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 12.9k]
  ------------------
  321|       |
  322|  12.9k|	memset (val, 0, maxlen);
  323|  12.9k|	maxlen--;
  324|       |
  325|  12.9k|	switch (entry->tag) {
  326|    602|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 602, False: 12.3k]
  ------------------
  327|    844|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 242, False: 12.7k]
  ------------------
  328|  1.12k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 282, False: 12.6k]
  ------------------
  329|  1.54k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 420, False: 12.5k]
  ------------------
  330|  1.80k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 260, False: 12.6k]
  ------------------
  331|  2.03k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 231, False: 12.7k]
  ------------------
  332|  2.43k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 398, False: 12.5k]
  ------------------
  333|  2.63k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 204, False: 12.7k]
  ------------------
  334|  2.89k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 259, False: 12.6k]
  ------------------
  335|  3.21k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 319, False: 12.6k]
  ------------------
  336|  3.55k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 339, False: 12.6k]
  ------------------
  337|  3.93k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 376, False: 12.5k]
  ------------------
  338|  4.14k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 216, False: 12.7k]
  ------------------
  339|  4.40k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 259, False: 12.6k]
  ------------------
  340|  4.67k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 269, False: 12.6k]
  ------------------
  341|  5.07k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 403, False: 12.5k]
  ------------------
  342|  5.37k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 291, False: 12.6k]
  ------------------
  343|  5.85k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 488, False: 12.4k]
  ------------------
  344|  6.47k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 617, False: 12.3k]
  ------------------
  345|  6.58k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 105, False: 12.8k]
  ------------------
  346|  6.58k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  6.58k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  6.58k|{                                                               \
  |  |   39|  6.58k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 3.33k, False: 3.24k]
  |  |  ------------------
  |  |   40|  3.33k|		snprintf (v, maxlen,	                        \
  |  |   41|  3.33k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  3.33k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  3.33k|			"expected '%s'."),                      \
  |  |   43|  3.33k|			exif_format_get_name (format),          \
  |  |   44|  3.33k|			exif_format_get_name (target));         \
  |  |   45|  3.33k|		break;                                          \
  |  |   46|  3.33k|	}                                                       \
  |  |   47|  6.58k|}
  ------------------
  347|  3.24k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.24k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.24k|{                                                                       \
  |  |   61|  3.24k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.20k, False: 2.04k]
  |  |  |  Branch (61:24): [True: 344, False: 856]
  |  |  ------------------
  |  |   62|    344|		snprintf (v, maxlen,                                    \
  |  |   63|    344|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    344|			"expected %i or %i)."), (int) number,		\
  |  |   65|    344|			(int) t1, (int) t2);  				\
  |  |   66|    344|		break;                                                  \
  |  |   67|    344|	}                                                               \
  |  |   68|  3.24k|}
  ------------------
  348|  2.90k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 2.04k, False: 856]
  ------------------
  349|  2.04k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  24.3k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 24.3k, False: 0]
  |  Branch (352:33): [True: 22.3k, False: 2.04k]
  ------------------
  353|  2.04k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 2.04k]
  ------------------
  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|  11.8k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 10.8k, False: 1.01k]
  ------------------
  361|  10.8k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 9.79k, False: 1.02k]
  ------------------
  362|  2.04k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.34k, False: 707]
  ------------------
  363|  1.34k|				snprintf (val, maxlen,
  364|  1.34k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.34k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.34k|				break;
  366|  1.34k|			}
  367|    707|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    707|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|    856|		} else {
  369|       |			/* Two-component values */
  370|    856|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|    856|#define CF(format,target,v,maxlen)                              \
  |  |   38|    856|{                                                               \
  |  |   39|    856|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 856]
  |  |  ------------------
  |  |   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|    856|}
  ------------------
  371|    856|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|    856|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    856|{                                                                       \
  |  |   61|    856|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 856, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 856]
  |  |  ------------------
  |  |   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|    856|}
  ------------------
  372|    856|			vs = exif_get_short (entry->data, entry->order);
  373|    856|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  1.76k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.42k, False: 344]
  |  Branch (376:34): [True: 912, False: 512]
  ------------------
  377|    856|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 344, False: 512]
  ------------------
  378|    344|				snprintf (val, maxlen,
  379|    344|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    344|			  	break;
  381|    344|			}
  382|       |
  383|       |			/* find the value */
  384|  2.03k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 2.03k, False: 0]
  |  Branch (384:45): [True: 0, False: 2.03k]
  ------------------
  385|  2.03k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.74k, False: 293]
  |  Branch (385:46): [True: 1.52k, False: 219]
  ------------------
  386|    512|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 304, False: 208]
  |  Branch (386:44): [True: 0, False: 208]
  ------------------
  387|    304|				snprintf (val, maxlen,
  388|    304|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    304|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    304|				break;
  390|    304|			}
  391|    208|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    208|		}
  393|    915|		break;
  394|       |
  395|    915|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 631, False: 12.3k]
  ------------------
  396|    631|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    631|#define CF(format,target,v,maxlen)                              \
  |  |   38|    631|{                                                               \
  |  |   39|    631|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 118, False: 513]
  |  |  ------------------
  |  |   40|    118|		snprintf (v, maxlen,	                        \
  |  |   41|    118|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    118|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    118|			"expected '%s'."),                      \
  |  |   43|    118|			exif_format_get_name (format),          \
  |  |   44|    118|			exif_format_get_name (target));         \
  |  |   45|    118|		break;                                          \
  |  |   46|    118|	}                                                       \
  |  |   47|    631|}
  ------------------
  397|    513|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    513|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    513|{                                                                       \
  |  |   51|    513|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 427, False: 86]
  |  |  ------------------
  |  |   52|    427|		snprintf (v, maxlen,                                    \
  |  |   53|    427|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    427|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    427|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    427|		break;                                                  \
  |  |   56|    427|	}                                                               \
  |  |   57|    513|}
  ------------------
  398|     86|		vl = exif_get_long (entry->data, entry->order);
  399|     86|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|     86|		break;
  401|    709|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 709, False: 12.2k]
  ------------------
  402|    709|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    709|#define CF(format,target,v,maxlen)                              \
  |  |   38|    709|{                                                               \
  |  |   39|    709|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 257, False: 452]
  |  |  ------------------
  |  |   40|    257|		snprintf (v, maxlen,	                        \
  |  |   41|    257|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    257|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    257|			"expected '%s'."),                      \
  |  |   43|    257|			exif_format_get_name (format),          \
  |  |   44|    257|			exif_format_get_name (target));         \
  |  |   45|    257|		break;                                          \
  |  |   46|    257|	}                                                       \
  |  |   47|    709|}
  ------------------
  403|    452|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    452|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    452|{                                                                       \
  |  |   51|    452|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 226, False: 226]
  |  |  ------------------
  |  |   52|    226|		snprintf (v, maxlen,                                    \
  |  |   53|    226|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    226|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    226|		break;                                                  \
  |  |   56|    226|	}                                                               \
  |  |   57|    452|}
  ------------------
  404|    226|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|    226|			entry->size);
  406|    226|		break;
  407|    497|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 497, False: 12.4k]
  ------------------
  408|  1.01k|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 519, False: 12.4k]
  ------------------
  409|  1.01k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|  1.01k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.01k|{                                                               \
  |  |   39|  1.01k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 335, False: 681]
  |  |  ------------------
  |  |   40|    335|		snprintf (v, maxlen,	                        \
  |  |   41|    335|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    335|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    335|			"expected '%s'."),                      \
  |  |   43|    335|			exif_format_get_name (format),          \
  |  |   44|    335|			exif_format_get_name (target));         \
  |  |   45|    335|		break;                                          \
  |  |   46|    335|	}                                                       \
  |  |   47|  1.01k|}
  ------------------
  410|    681|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    681|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    681|{                                                                       \
  |  |   51|    681|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 382, False: 299]
  |  |  ------------------
  |  |   52|    382|		snprintf (v, maxlen,                                    \
  |  |   53|    382|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    382|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    382|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    382|		break;                                                  \
  |  |   56|    382|	}                                                               \
  |  |   57|    681|}
  ------------------
  411|    299|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    299|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 299]
  |  |  ------------------
  ------------------
  412|    299|		break;
  413|    586|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 586, False: 12.3k]
  ------------------
  414|    586|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    586|#define CF(format,target,v,maxlen)                              \
  |  |   38|    586|{                                                               \
  |  |   39|    586|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 286, False: 300]
  |  |  ------------------
  |  |   40|    286|		snprintf (v, maxlen,	                        \
  |  |   41|    286|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    286|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    286|			"expected '%s'."),                      \
  |  |   43|    286|			exif_format_get_name (format),          \
  |  |   44|    286|			exif_format_get_name (target));         \
  |  |   45|    286|		break;                                          \
  |  |   46|    286|	}                                                       \
  |  |   47|    586|}
  ------------------
  415|    300|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    300|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    300|{                                                                       \
  |  |   51|    300|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 232, False: 68]
  |  |  ------------------
  |  |   52|    232|		snprintf (v, maxlen,                                    \
  |  |   53|    232|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    232|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    232|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    232|		break;                                                  \
  |  |   56|    232|	}                                                               \
  |  |   57|    300|}
  ------------------
  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|    666|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 666, False: 12.2k]
  ------------------
  421|    666|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    666|#define CF(format,target,v,maxlen)                              \
  |  |   38|    666|{                                                               \
  |  |   39|    666|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 353, False: 313]
  |  |  ------------------
  |  |   40|    353|		snprintf (v, maxlen,	                        \
  |  |   41|    353|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    353|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    353|			"expected '%s'."),                      \
  |  |   43|    353|			exif_format_get_name (format),          \
  |  |   44|    353|			exif_format_get_name (target));         \
  |  |   45|    353|		break;                                          \
  |  |   46|    353|	}                                                       \
  |  |   47|    666|}
  ------------------
  422|    313|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    313|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    313|{                                                                       \
  |  |   61|    313|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 213, False: 100]
  |  |  |  Branch (61:24): [True: 124, False: 89]
  |  |  ------------------
  |  |   62|    124|		snprintf (v, maxlen,                                    \
  |  |   63|    124|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    124|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    124|			"expected %i or %i)."), (int) number,		\
  |  |   65|    124|			(int) t1, (int) t2);  				\
  |  |   66|    124|		break;                                                  \
  |  |   67|    124|	}                                                               \
  |  |   68|    313|}
  ------------------
  423|    189|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    189|		break;
  425|  2.76k|	default:
  ------------------
  |  Branch (425:2): [True: 2.76k, False: 10.1k]
  ------------------
  426|  2.76k|		switch (entry->format) {
  427|    333|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 333, False: 2.43k]
  ------------------
  428|    333|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    333|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 97, False: 236]
  |  |  ------------------
  ------------------
  429|    333|		  break;
  430|    412|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 412, False: 2.35k]
  ------------------
  431|    412|		  {
  432|    412|			const unsigned char *data = entry->data;
  433|    412|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    412|			sizeleft = entry->size;
  436|   104k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 104k, False: 412]
  ------------------
  437|   104k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 104k]
  ------------------
  438|      0|					break;
  439|   104k|				vs = exif_get_short (data, entry->order);
  440|   104k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|   104k|				len = strlen(val);
  442|   104k|				data += 2;
  443|   104k|				sizeleft -= 2;
  444|   104k|			}
  445|    412|		  }
  446|    412|		  break;
  447|    496|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 496, False: 2.27k]
  ------------------
  448|    496|		  {
  449|    496|			const unsigned char *data = entry->data;
  450|    496|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    496|			sizeleft = entry->size;
  453|  30.4k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 29.9k, False: 496]
  ------------------
  454|  29.9k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 29.9k]
  ------------------
  455|      0|					break;
  456|  29.9k|				vss = exif_get_sshort (data, entry->order);
  457|  29.9k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  29.9k|				len = strlen(val);
  459|  29.9k|				data += 2;
  460|  29.9k|				sizeleft -= 2;
  461|  29.9k|			}
  462|    496|		  }
  463|    496|		  break;
  464|    484|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 484, False: 2.28k]
  ------------------
  465|    484|		  {
  466|    484|			const unsigned char *data = entry->data;
  467|    484|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    484|			sizeleft = entry->size;
  470|  37.4k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 36.9k, False: 484]
  ------------------
  471|  36.9k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 36.9k]
  ------------------
  472|      0|					break;
  473|  36.9k|				vl = exif_get_long (data, entry->order);
  474|  36.9k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  36.9k|				len = strlen(val);
  476|  36.9k|				data += 4;
  477|  36.9k|				sizeleft -= 4;
  478|  36.9k|			}
  479|    484|		  }
  480|    484|		  break;
  481|    519|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 519, False: 2.24k]
  ------------------
  482|    519|		  {
  483|    519|			const unsigned char *data = entry->data;
  484|    519|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    519|			sizeleft = entry->size;
  487|  42.5k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 42.0k, False: 519]
  ------------------
  488|  42.0k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 42.0k]
  ------------------
  489|      0|					break;
  490|  42.0k|				vsl = exif_get_slong (data, entry->order);
  491|  42.0k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  42.0k|				len = strlen(val);
  493|  42.0k|				data += 4;
  494|  42.0k|				sizeleft -= 4;
  495|  42.0k|			}
  496|    519|		  }
  497|    519|		  break;
  498|     10|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 10, False: 2.75k]
  ------------------
  499|    522|		default:
  ------------------
  |  Branch (499:3): [True: 512, False: 2.25k]
  ------------------
  500|    522|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    522|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    522|			  entry->size);
  502|    522|		  break;
  503|  2.76k|		}
  504|  2.76k|		break;
  505|  12.9k|	}
  506|       |
  507|  12.9k|	return val;
  508|  12.9k|}

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

