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

exif_mnote_data_canon_identify:
  400|  3.29k|{
  401|  3.29k|	char value[8];
  402|       |
  403|  3.29k|	ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|  3.29k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 880, False: 2.41k]
  |  |  ------------------
  |  |  254|  3.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  3.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 199, False: 2.21k]
  |  |  ------------------
  |  |  256|  2.41k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  2.41k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 2.21k]
  |  |  ------------------
  |  |  258|  2.21k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  2.21k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 2.21k]
  |  |  ------------------
  |  |  260|  2.21k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  2.21k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 2.21k]
  |  |  ------------------
  |  |  262|  2.21k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  404|  3.29k|	if (!em) 
  ------------------
  |  Branch (404:6): [True: 2.21k, False: 1.07k]
  ------------------
  405|  2.21k|		return 0;
  406|       |
  407|  1.07k|	(void) e;  /* unused */
  408|  1.07k|	return !strcmp (exif_entry_get_value (em, value, sizeof (value)), "Canon");
  409|  3.29k|}
exif_mnote_data_canon_new:
  413|    936|{
  414|    936|	ExifMnoteData *d;
  415|    936|	ExifMnoteDataCanon *dc;
  416|       |
  417|    936|	if (!mem) return NULL;
  ------------------
  |  Branch (417:6): [True: 0, False: 936]
  ------------------
  418|       |
  419|    936|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataCanon));
  420|    936|	if (!d)
  ------------------
  |  Branch (420:6): [True: 0, False: 936]
  ------------------
  421|      0|		return NULL;
  422|       |
  423|    936|	exif_mnote_data_construct (d, mem);
  424|       |
  425|       |	/* Set up function pointers */
  426|    936|	d->methods.free            = exif_mnote_data_canon_free;
  427|    936|	d->methods.set_byte_order  = exif_mnote_data_canon_set_byte_order;
  428|    936|	d->methods.set_offset      = exif_mnote_data_canon_set_offset;
  429|    936|	d->methods.load            = exif_mnote_data_canon_load;
  430|    936|	d->methods.save            = exif_mnote_data_canon_save;
  431|    936|	d->methods.count           = exif_mnote_data_canon_count;
  432|    936|	d->methods.get_id          = exif_mnote_data_canon_get_id;
  433|    936|	d->methods.get_name        = exif_mnote_data_canon_get_name;
  434|    936|	d->methods.get_title       = exif_mnote_data_canon_get_title;
  435|    936|	d->methods.get_description = exif_mnote_data_canon_get_description;
  436|    936|	d->methods.get_value       = exif_mnote_data_canon_get_value;
  437|       |
  438|    936|	dc = (ExifMnoteDataCanon*)d;
  439|    936|	dc->options = o;
  440|    936|	return d;
  441|    936|}
exif-mnote-data-canon.c:exif_mnote_data_canon_free:
   62|    936|{
   63|    936|	if (!n) return;
  ------------------
  |  Branch (63:6): [True: 0, False: 936]
  ------------------
   64|       |
   65|    936|	exif_mnote_data_canon_clear ((ExifMnoteDataCanon *) n);
   66|    936|}
exif-mnote-data-canon.c:exif_mnote_data_canon_clear:
   42|  1.85k|{
   43|  1.85k|	ExifMnoteData *d = (ExifMnoteData *) n;
   44|  1.85k|	unsigned int i;
   45|       |
   46|  1.85k|	if (!n) return;
  ------------------
  |  Branch (46:6): [True: 0, False: 1.85k]
  ------------------
   47|       |
   48|  1.85k|	if (n->entries) {
  ------------------
  |  Branch (48:6): [True: 919, False: 936]
  ------------------
   49|  11.9k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (49:15): [True: 11.0k, False: 919]
  ------------------
   50|  11.0k|			if (n->entries[i].data) {
  ------------------
  |  Branch (50:8): [True: 11.0k, False: 0]
  ------------------
   51|  11.0k|				exif_mem_free (d->mem, n->entries[i].data);
   52|  11.0k|				n->entries[i].data = NULL;
   53|  11.0k|			}
   54|    919|		exif_mem_free (d->mem, n->entries);
   55|       |		n->entries = NULL;
   56|    919|		n->count = 0;
   57|    919|	}
   58|  1.85k|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_byte_order:
  101|    936|{
  102|    936|	ExifByteOrder o_orig;
  103|    936|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) d;
  104|    936|	unsigned int i;
  105|       |
  106|    936|	if (!n) return;
  ------------------
  |  Branch (106:6): [True: 0, False: 936]
  ------------------
  107|       |
  108|    936|	o_orig = n->order;
  109|    936|	n->order = o;
  110|    936|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (110:14): [True: 0, False: 936]
  ------------------
  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|    936|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_offset:
  121|    936|{
  122|    936|	if (n) ((ExifMnoteDataCanon *) n)->offset = o;
  ------------------
  |  Branch (122:6): [True: 936, False: 0]
  ------------------
  123|    936|}
exif-mnote-data-canon.c:exif_mnote_data_canon_load:
  210|    936|{
  211|    936|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
  212|    936|	ExifShort c;
  213|    936|	size_t i, tcount, o, datao;
  214|    936|	long failsafe_size = 0;
  215|       |
  216|    936|	if (!n) return;
  ------------------
  |  Branch (216:6): [True: 0, False: 936]
  ------------------
  217|       |
  218|    936|	if (!buf || !buf_size) {
  ------------------
  |  Branch (218:6): [True: 0, False: 936]
  |  Branch (218:14): [True: 0, False: 936]
  ------------------
  219|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  220|      0|			  "ExifMnoteCanon", "Short MakerNote");
  221|      0|		return;
  222|      0|	}
  223|    936|	if (CHECKOVERFLOW(n->offset, buf_size, 8)) {
  ------------------
  |  |   35|    936|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 0, False: 936]
  |  |  |  Branch (35:81): [True: 0, False: 936]
  |  |  |  Branch (35:112): [True: 0, False: 936]
  |  |  ------------------
  ------------------
  224|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  225|      0|			  "ExifMnoteCanon", "Short MakerNote");
  226|      0|		return;
  227|      0|	}
  228|    936|	datao = 6 + n->offset;
  229|       |
  230|       |	/* Read the number of tags */
  231|    936|	c = exif_get_short (buf + datao, n->order);
  232|    936|	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|    936|	if (c > 250) {
  ------------------
  |  Branch (236:6): [True: 17, False: 919]
  ------------------
  237|     17|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Too much tags (%d) in Canon MakerNote", c);
  238|     17|		return;
  239|     17|	}
  240|       |
  241|       |	/* Remove any old entries */
  242|    919|	exif_mnote_data_canon_clear (n);
  243|       |
  244|       |	/* Reserve enough space for all the possible MakerNote tags */
  245|    919|	n->entries = exif_mem_alloc (ne->mem, sizeof (MnoteCanonEntry) * c);
  246|    919|	if (!n->entries) {
  ------------------
  |  Branch (246:6): [True: 0, False: 919]
  ------------------
  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|    919|	tcount = 0;
  253|  51.7k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (253:25): [True: 51.6k, False: 137]
  ------------------
  254|  51.6k|		size_t s;
  255|       |
  256|  51.6k|		memset(&n->entries[tcount], 0, sizeof(MnoteCanonEntry));
  257|  51.6k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   35|  51.6k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (35:52): [True: 333, False: 51.2k]
  |  |  |  Branch (35:81): [True: 0, False: 51.2k]
  |  |  |  Branch (35:112): [True: 444, False: 50.8k]
  |  |  ------------------
  ------------------
  258|    777|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  259|    777|				"ExifMnoteCanon", "Short MakerNote");
  260|    777|			break;
  261|    777|		}
  262|       |
  263|  50.8k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  264|  50.8k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  265|  50.8k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  266|  50.8k|		n->entries[tcount].order      = n->order;
  267|       |
  268|  50.8k|		exif_log (ne->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteCanon",
  269|  50.8k|			"Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  270|  50.8k|			 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|  50.8k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (274:8): [True: 17.0k, False: 33.7k]
  ------------------
  275|  17.0k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (275:4): [True: 4.20k, False: 12.8k]
  ------------------
  276|  50.8k|		) {
  277|  4.20k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  278|  4.20k|				  "ExifMnoteCanon", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  279|  4.20k|			continue;
  280|  4.20k|		}
  281|       |
  282|       |		/*
  283|       |		 * Size? If bigger than 4 bytes, the actual data is not
  284|       |		 * in the entry but somewhere else (offset).
  285|       |		 */
  286|  46.6k|		s = exif_format_get_size (n->entries[tcount].format) * 
  287|  46.6k|								  n->entries[tcount].components;
  288|  46.6k|		n->entries[tcount].size = s;
  289|  46.6k|		if (!s) {
  ------------------
  |  Branch (289:7): [True: 34.1k, False: 12.4k]
  ------------------
  290|  34.1k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  291|  34.1k|				  "ExifMnoteCanon",
  292|  34.1k|				  "Invalid zero-length tag size");
  293|  34.1k|			continue;
  294|       |
  295|  34.1k|		} 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.31k, False: 3.16k]
  ------------------
  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: 825, False: 11.6k]
  |  |  |  Branch (35:81): [True: 0, False: 11.6k]
  |  |  |  Branch (35:112): [True: 626, False: 11.0k]
  |  |  ------------------
  ------------------
  300|  1.45k|				exif_log (ne->log, EXIF_LOG_CODE_DEBUG,
  301|  1.45k|					"ExifMnoteCanon",
  302|  1.45k|					"Tag data past end of buffer (%u > %u)",
  303|  1.45k|					(unsigned)(dataofs + s), buf_size);
  304|  1.45k|				continue;
  305|  1.45k|			}
  306|       |
  307|  11.0k|			n->entries[tcount].data = exif_mem_alloc (ne->mem, s);
  308|  11.0k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (308:8): [True: 0, False: 11.0k]
  ------------------
  309|      0|				EXIF_LOG_NO_MEMORY(ne->log, "ExifMnoteCanon", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  310|      0|				continue;
  311|      0|			}
  312|  11.0k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  313|  11.0k|		}
  314|       |
  315|       |		/* Track the size of decoded tag data. A malicious file could
  316|       |		 * be crafted to cause extremely large values here without
  317|       |		 * tripping any buffer range checks.  This is especially bad
  318|       |		 * with the libexif representation of Canon MakerNotes because
  319|       |		 * some arrays are turned into individual tags that the
  320|       |		 * application must loop around. */
  321|  11.0k|		failsafe_size += mnote_canon_entry_count_values(&n->entries[tcount]);
  322|       |
  323|  11.0k|		if (failsafe_size > FAILSAFE_SIZE_MAX) {
  ------------------
  |  |   38|  11.0k|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  |  Branch (323:7): [True: 5, False: 11.0k]
  ------------------
  324|       |			/* Abort if the total size of the data in the tags extraordinarily large, */
  325|      5|			exif_mem_free (ne->mem, n->entries[tcount].data);
  326|      5|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  327|      5|					  "ExifMnoteCanon", "Failsafe tag size overflow (%lu > %ld)",
  328|      5|					  failsafe_size, FAILSAFE_SIZE_MAX);
  ------------------
  |  |   38|      5|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  329|      5|			break;
  330|      5|		}
  331|       |
  332|       |		/* Tag was successfully parsed */
  333|  11.0k|		++tcount;
  334|  11.0k|	}
  335|       |	/* Store the count of successfully parsed tags */
  336|    919|	n->count = tcount;
  337|    919|}
exif-mnote-data-canon.c:exif_mnote_data_canon_count:
  341|    936|{
  342|    936|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) n;
  343|    936|	unsigned int i, c;
  344|       |
  345|  11.9k|	for (i = c = 0; dc && (i < dc->count); i++)
  ------------------
  |  Branch (345:18): [True: 11.9k, False: 0]
  |  Branch (345:24): [True: 11.0k, False: 936]
  ------------------
  346|  11.0k|		c += mnote_canon_entry_count_values (&dc->entries[i]);
  347|    936|	return c;
  348|    936|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_tags:
   71|  6.91M|{
   72|  6.91M|	unsigned int from = 0, to;
   73|       |
   74|  6.91M|	if (s) *s = 0;
  ------------------
  |  Branch (74:6): [True: 5.18M, False: 1.72M]
  ------------------
   75|       |
   76|  6.91M|	if (!dc || !m) return;
  ------------------
  |  Branch (76:6): [True: 0, False: 6.91M]
  |  Branch (76:13): [True: 0, False: 6.91M]
  ------------------
   77|   119M|	for (*m = 0; *m < dc->count; (*m)++) {
  ------------------
  |  Branch (77:15): [True: 119M, False: 0]
  ------------------
   78|   119M|		to = from + mnote_canon_entry_count_values (&dc->entries[*m]);
   79|   119M|		if (to > n) {
  ------------------
  |  Branch (79:7): [True: 6.91M, False: 112M]
  ------------------
   80|  6.91M|			if (s) *s = n - from;
  ------------------
  |  Branch (80:8): [True: 5.18M, False: 1.72M]
  ------------------
   81|  6.91M|			break;
   82|  6.91M|		}
   83|   112M|		from = to;
   84|   112M|	}
   85|  6.91M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_name:
  364|  1.72M|{
  365|  1.72M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  366|  1.72M|	unsigned int m, s;
  367|       |
  368|  1.72M|	if (!dc) return NULL;
  ------------------
  |  Branch (368:6): [True: 0, False: 1.72M]
  ------------------
  369|  1.72M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  370|  1.72M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (370:6): [True: 0, False: 1.72M]
  ------------------
  371|  1.72M|	return mnote_canon_tag_get_name_sub (dc->entries[m].tag, s, dc->options);
  372|  1.72M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_title:
  376|  1.72M|{
  377|  1.72M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  378|  1.72M|	unsigned int m, s;
  379|       |
  380|  1.72M|	if (!dc) return NULL;
  ------------------
  |  Branch (380:6): [True: 0, False: 1.72M]
  ------------------
  381|  1.72M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  382|  1.72M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (382:6): [True: 0, False: 1.72M]
  ------------------
  383|  1.72M|	return mnote_canon_tag_get_title_sub (dc->entries[m].tag, s, dc->options);
  384|  1.72M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_description:
  388|  1.72M|{
  389|  1.72M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  390|  1.72M|	unsigned int m;
  391|       |
  392|  1.72M|	if (!dc) return NULL;
  ------------------
  |  Branch (392:6): [True: 0, False: 1.72M]
  ------------------
  393|  1.72M|	exif_mnote_data_canon_get_tags (dc, i, &m, NULL);
  394|  1.72M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (394:6): [True: 0, False: 1.72M]
  ------------------
  395|  1.72M|	return mnote_canon_tag_get_description (dc->entries[m].tag);
  396|  1.72M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_value:
   89|  1.72M|{
   90|  1.72M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
   91|  1.72M|	unsigned int m, s;
   92|       |
   93|  1.72M|	if (!dc) return NULL;
  ------------------
  |  Branch (93:6): [True: 0, False: 1.72M]
  ------------------
   94|  1.72M|	exif_mnote_data_canon_get_tags (dc, n, &m, &s);
   95|  1.72M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (95:6): [True: 0, False: 1.72M]
  ------------------
   96|  1.72M|	return mnote_canon_entry_get_value (&dc->entries[m], s, val, maxlen);
   97|  1.72M|}

mnote_canon_entry_count_values:
  505|   119M|{
  506|   119M|	unsigned int  val;
  507|       |
  508|   119M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 119M]
  ------------------
  509|       |
  510|   119M|	switch (entry->tag) {
  511|   241k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 241k, False: 119M]
  ------------------
  512|   241k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 616, False: 119M]
  ------------------
  513|   241k|		return entry->components;
  514|  2.59M|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 2.59M, False: 116M]
  ------------------
  515|  3.74M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.14M, False: 118M]
  ------------------
  516|   115M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 112M, False: 7.27M]
  ------------------
  517|   116M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 97.3k, False: 119M]
  ------------------
  518|   116M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 188k, False: 115M]
  ------------------
  519|       |
  520|   115M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|   115M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|   115M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 115M, False: 24.6k]
  |  |  ------------------
  ------------------
  523|  3.18M|	default:
  ------------------
  |  Branch (523:2): [True: 3.18M, False: 116M]
  ------------------
  524|  3.18M|		return 1;
  525|   119M|	}
  526|   119M|}
mnote_canon_entry_get_value:
  552|  1.72M|{
  553|  1.72M|	char buf[128];
  554|  1.72M|	ExifLong vl;
  555|  1.72M|	ExifSLong vsl;
  556|  1.72M|	ExifShort vs, n;
  557|  1.72M|	ExifSShort vss;
  558|  1.72M|	unsigned char *data;
  559|  1.72M|	size_t	size;
  560|  1.72M|	double d;
  561|       |
  562|  1.72M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.72M]
  ------------------
  563|      0|		return NULL;
  564|  1.72M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.72M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.72M|	data = entry->data;
  568|  1.72M|	size = entry->size;
  569|       |
  570|  1.72M|	memset (val, 0, maxlen);
  571|  1.72M|	maxlen--;
  572|       |
  573|  1.72M|	switch (entry->tag) {
  574|  3.13k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 3.13k, False: 1.72M]
  ------------------
  575|  3.13k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.13k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.13k|{                                                               \
  |  |   38|  3.13k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.13k]
  |  |  ------------------
  |  |   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.13k|}
  ------------------
  576|       |
  577|  3.13k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 3.13k]
  ------------------
  578|  3.13k|		n = exif_get_short (data, entry->order) / 2;
  579|  3.13k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 3.13k]
  ------------------
  580|       |
  581|  3.13k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.13k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.13k|{                                                                       \
  |  |   50|  3.13k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 403, False: 2.73k]
  |  |  ------------------
  |  |   51|    403|                snprintf (v, maxlen,                                    \
  |  |   52|    403|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    403|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    403|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    403|                break;                                                  \
  |  |   55|    403|        }                                                               \
  |  |   56|  3.13k|}
  ------------------
  582|       |
  583|  2.73k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.73k]
  ------------------
  584|  2.73k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.73k|		switch (t) {
  586|    559|		case 1:
  ------------------
  |  Branch (586:3): [True: 559, False: 2.17k]
  ------------------
  587|    559|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 220, False: 339]
  ------------------
  588|    220|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    220|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    220|				break;
  590|    220|			}
  591|    339|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    339|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    339|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.73k]
  ------------------
  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.73k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.73k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.73k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.73k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.73k]
  ------------------
  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.73k]
  ------------------
  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.73k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.73k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.73k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  2.17k|		default:
  ------------------
  |  Branch (621:3): [True: 2.17k, False: 559]
  ------------------
  622|  2.17k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.73k|		}
  624|  2.73k|		break;
  625|       |
  626|  2.73k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.67k, False: 1.72M]
  ------------------
  627|  1.67k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.67k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.67k|{                                                               \
  |  |   38|  1.67k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 344, False: 1.33k]
  |  |  ------------------
  |  |   39|    344|                snprintf (v, maxlen,                            \
  |  |   40|    344|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    344|                        "expected '%s'."),                      \
  |  |   42|    344|                        exif_format_get_name (format),          \
  |  |   43|    344|                        exif_format_get_name (target));         \
  |  |   44|    344|                break;                                          \
  |  |   45|    344|        }                                                       \
  |  |   46|  1.67k|}
  ------------------
  628|  1.33k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.33k]
  ------------------
  629|  1.33k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.33k|		switch (t) {
  631|    417|		case 1:
  ------------------
  |  Branch (631:3): [True: 417, False: 916]
  ------------------
  632|    417|			snprintf (val, maxlen, "%u", vs);
  633|    417|			break;
  634|    248|		case 2:
  ------------------
  |  Branch (634:3): [True: 248, False: 1.08k]
  ------------------
  635|    494|		case 3:
  ------------------
  |  Branch (635:3): [True: 246, False: 1.08k]
  ------------------
  636|    494|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    494|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    494|			break;
  638|    422|		default:
  ------------------
  |  Branch (638:3): [True: 422, False: 911]
  ------------------
  639|    422|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.33k|		}
  641|  1.33k|		break;
  642|       |
  643|  7.87k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 7.87k, False: 1.72M]
  ------------------
  644|  7.87k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  7.87k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  7.87k|{                                                               \
  |  |   38|  7.87k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 7.87k]
  |  |  ------------------
  |  |   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|  7.87k|}
  ------------------
  645|  7.87k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 7.87k]
  ------------------
  646|  7.87k|		n = exif_get_short (data, entry->order) / 2;
  647|  7.87k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 7.87k]
  ------------------
  648|  7.87k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  7.87k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  7.87k|{                                                                       \
  |  |   50|  7.87k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.64k, False: 6.23k]
  |  |  ------------------
  |  |   51|  1.64k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.64k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.64k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.64k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.64k|                break;                                                  \
  |  |   55|  1.64k|        }                                                               \
  |  |   56|  7.87k|}
  ------------------
  649|  6.23k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 6.23k]
  ------------------
  650|  6.23k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  6.23k|		switch (t) {
  652|    729|		case 0:
  ------------------
  |  Branch (652:3): [True: 729, False: 5.50k]
  ------------------
  653|    729|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    729|			break;
  655|    729|		case 1:
  ------------------
  |  Branch (655:3): [True: 729, False: 5.50k]
  ------------------
  656|    729|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    729|			break;
  658|    729|		case 2:
  ------------------
  |  Branch (658:3): [True: 729, False: 5.50k]
  ------------------
  659|  1.37k|		case 5:
  ------------------
  |  Branch (659:3): [True: 647, False: 5.58k]
  ------------------
  660|  1.37k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 6.23k]
  ------------------
  661|  1.37k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 6.23k]
  ------------------
  662|  1.37k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.37k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.37k|			break;
  664|    729|		case 3:
  ------------------
  |  Branch (664:3): [True: 729, False: 5.50k]
  ------------------
  665|    729|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 6.23k]
  ------------------
  666|    729|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    729|			break;
  668|    729|		case 4:
  ------------------
  |  Branch (668:3): [True: 729, False: 5.50k]
  ------------------
  669|    729|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 6.23k]
  ------------------
  670|    729|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    729|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 326, False: 403]
  ------------------
  672|    326|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    326|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    403|			else
  674|    403|				snprintf (val, maxlen, "%.0f", d);
  675|    729|			break;
  676|    645|		case 8:
  ------------------
  |  Branch (676:3): [True: 645, False: 5.58k]
  ------------------
  677|    645|			snprintf (val, maxlen, "%u", vss);
  678|    645|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 6.23k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 6.23k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 6.23k]
  ------------------
  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.23k]
  ------------------
  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.29k|		default:
  ------------------
  |  Branch (693:3): [True: 1.29k, False: 4.93k]
  ------------------
  694|  1.29k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  6.23k|		}
  696|  6.23k|		break;
  697|       |
  698|  6.23k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.72M]
  ------------------
  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|    173|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 173, False: 1.72M]
  ------------------
  706|    173|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    173|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    173|{                                                                       \
  |  |   50|    173|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 97, False: 76]
  |  |  ------------------
  |  |   51|     97|                snprintf (v, maxlen,                                    \
  |  |   52|     97|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     97|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|     97|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|     97|                break;                                                  \
  |  |   55|     97|        }                                                               \
  |  |   56|    173|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    460|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 384, False: 1.72M]
  ------------------
  710|    460|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    460|#define CF(format,target,v,maxlen)                              \
  |  |   37|    460|{                                                               \
  |  |   38|    460|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 95, False: 365]
  |  |  ------------------
  |  |   39|     95|                snprintf (v, maxlen,                            \
  |  |   40|     95|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     95|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|     95|                        "expected '%s'."),                      \
  |  |   42|     95|                        exif_format_get_name (format),          \
  |  |   43|     95|                        exif_format_get_name (target));         \
  |  |   44|     95|                break;                                          \
  |  |   45|     95|        }                                                       \
  |  |   46|    460|}
  ------------------
  711|    365|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    365|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 75, False: 290]
  |  |  ------------------
  ------------------
  712|    365|		break;
  713|       |
  714|    546|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 546, False: 1.72M]
  ------------------
  715|    546|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    546|#define CF(format,target,v,maxlen)                              \
  |  |   37|    546|{                                                               \
  |  |   38|    546|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 206, False: 340]
  |  |  ------------------
  |  |   39|    206|                snprintf (v, maxlen,                            \
  |  |   40|    206|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    206|                        "expected '%s'."),                      \
  |  |   42|    206|                        exif_format_get_name (format),          \
  |  |   43|    206|                        exif_format_get_name (target));         \
  |  |   44|    206|                break;                                          \
  |  |   45|    206|        }                                                       \
  |  |   46|    546|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    340|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    340|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 67, False: 273]
  |  |  ------------------
  ------------------
  718|    340|		break;
  719|       |
  720|    849|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 849, False: 1.72M]
  ------------------
  721|    849|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    849|#define CF(format,target,v,maxlen)                              \
  |  |   37|    849|{                                                               \
  |  |   38|    849|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 241, False: 608]
  |  |  ------------------
  |  |   39|    241|                snprintf (v, maxlen,                            \
  |  |   40|    241|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    241|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    241|                        "expected '%s'."),                      \
  |  |   42|    241|                        exif_format_get_name (format),          \
  |  |   43|    241|                        exif_format_get_name (target));         \
  |  |   44|    241|                break;                                          \
  |  |   45|    241|        }                                                       \
  |  |   46|    849|}
  ------------------
  722|    608|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    608|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    608|{                                                                       \
  |  |   50|    608|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 407, False: 201]
  |  |  ------------------
  |  |   51|    407|                snprintf (v, maxlen,                                    \
  |  |   52|    407|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    407|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    407|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    407|                break;                                                  \
  |  |   55|    407|        }                                                               \
  |  |   56|    608|}
  ------------------
  723|    201|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 201]
  ------------------
  724|    201|		vl = exif_get_long (data, entry->order);
  725|    201|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    201|				(unsigned long) vl/10000,
  727|    201|				(unsigned long) vl%10000);
  728|    201|		break;
  729|       |
  730|    503|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 503, False: 1.72M]
  ------------------
  731|    503|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    503|#define CF(format,target,v,maxlen)                              \
  |  |   37|    503|{                                                               \
  |  |   38|    503|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 211, False: 292]
  |  |  ------------------
  |  |   39|    211|                snprintf (v, maxlen,                            \
  |  |   40|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    211|                        "expected '%s'."),                      \
  |  |   42|    211|                        exif_format_get_name (format),          \
  |  |   43|    211|                        exif_format_get_name (target));         \
  |  |   44|    211|                break;                                          \
  |  |   45|    211|        }                                                       \
  |  |   46|    503|}
  ------------------
  732|    292|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    292|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    292|{                                                                       \
  |  |   50|    292|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 216, False: 76]
  |  |  ------------------
  |  |   51|    216|                snprintf (v, maxlen,                                    \
  |  |   52|    216|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    216|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    216|                break;                                                  \
  |  |   55|    216|        }                                                               \
  |  |   56|    292|}
  ------------------
  733|     76|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 76]
  ------------------
  734|     76|		vl = exif_get_long (data, entry->order);
  735|     76|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|     76|		break;
  737|       |
  738|  1.70M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.70M, False: 20.7k]
  ------------------
  739|  1.70M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.70M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.70M|{                                                               \
  |  |   38|  1.70M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.70M]
  |  |  ------------------
  |  |   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.70M|}
  ------------------
  740|  1.70M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.70M]
  ------------------
  741|  1.70M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.70M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.70M]
  ------------------
  743|  1.70M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.70M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.70M|{                                                                       \
  |  |   50|  1.70M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.69M, False: 11.9k]
  |  |  ------------------
  |  |   51|  1.69M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.69M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.69M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.69M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.69M|                break;                                                  \
  |  |   55|  1.69M|        }                                                               \
  |  |   56|  1.70M|}
  ------------------
  744|  11.9k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 11.9k]
  ------------------
  745|  11.9k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  11.9k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  11.9k|		strncat (val, buf, maxlen - strlen (val));
  748|  11.9k|		break;
  749|       |
  750|  2.95k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.95k, False: 1.72M]
  ------------------
  751|  2.95k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.95k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.95k|{                                                               \
  |  |   38|  2.95k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.95k]
  |  |  ------------------
  |  |   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.95k|}
  ------------------
  752|  2.95k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.95k]
  ------------------
  753|  2.95k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.95k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.95k]
  ------------------
  755|  2.95k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.95k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.95k|{                                                                       \
  |  |   50|  2.95k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 693, False: 2.26k]
  |  |  ------------------
  |  |   51|    693|                snprintf (v, maxlen,                                    \
  |  |   52|    693|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    693|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    693|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    693|                break;                                                  \
  |  |   55|    693|        }                                                               \
  |  |   56|  2.95k|}
  ------------------
  756|  2.26k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 2.26k]
  ------------------
  757|  2.26k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  2.26k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  2.26k|		break;
  760|       |
  761|  2.68k|	default:
  ------------------
  |  Branch (761:2): [True: 2.68k, False: 1.72M]
  ------------------
  762|  2.68k|		switch (entry->format) {
  763|    481|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 481, False: 2.20k]
  ------------------
  764|    481|		  {
  765|    481|			size_t i, len = strlen(val);
  766|  86.2k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 85.7k, False: 481]
  ------------------
  767|  85.7k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 85.7k]
  ------------------
  768|      0|					break;
  769|  85.7k|				vs = exif_get_short (data, entry->order);
  770|  85.7k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  85.7k|				len = strlen(val);
  772|  85.7k|				data += 2;
  773|  85.7k|				size -= 2;
  774|  85.7k|			}
  775|    481|		  }
  776|    481|		  break;
  777|    253|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 253, False: 2.42k]
  ------------------
  778|    253|		  {
  779|    253|			size_t i, len = strlen(val);
  780|  76.0k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 75.8k, False: 253]
  ------------------
  781|  75.8k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 75.8k]
  ------------------
  782|      0|					break;
  783|  75.8k|				vss = exif_get_sshort (data, entry->order);
  784|  75.8k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  75.8k|				data += 2;
  786|  75.8k|				size -= 2;
  787|  75.8k|			}
  788|    253|		  }
  789|    253|		  break;
  790|    392|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 392, False: 2.29k]
  ------------------
  791|    392|		  {
  792|    392|			size_t i, len = strlen(val);
  793|  22.8k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 22.4k, False: 392]
  ------------------
  794|  22.4k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 22.4k]
  ------------------
  795|      0|					break;
  796|  22.4k|				vl = exif_get_long (data, entry->order);
  797|  22.4k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  22.4k|				data += 4;
  799|  22.4k|				size -= 4;
  800|  22.4k|			}
  801|    392|		  }
  802|    392|		  break;
  803|    354|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 354, False: 2.32k]
  ------------------
  804|    354|		  {
  805|    354|			size_t i, len = strlen(val);
  806|  54.0k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 53.7k, False: 354]
  ------------------
  807|  53.7k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 53.7k]
  ------------------
  808|      0|					break;
  809|  53.7k|				vsl = exif_get_slong (data, entry->order);
  810|  53.7k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  53.7k|				data += 4;
  812|  53.7k|				size -= 4;
  813|  53.7k|			}
  814|    354|		  }
  815|    354|		  break;
  816|    958|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 958, False: 1.72k]
  ------------------
  817|    958|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    958|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 109, False: 849]
  |  |  ------------------
  ------------------
  818|    958|			break;
  819|    244|		default:
  ------------------
  |  Branch (819:3): [True: 244, False: 2.43k]
  ------------------
  820|    244|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    244|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    244|			  entry->size);
  822|    244|		  break;
  823|  2.68k|		}
  824|  2.68k|		break;
  825|  1.72M|	}
  826|  1.72M|	return val;
  827|  1.72M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  6.14k|{
  445|  6.14k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  88.8k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 87.8k, False: 1.04k]
  |  Branch (448:32): [True: 63.6k, False: 24.1k]
  ------------------
  449|  84.0k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 21.1k, False: 3.05k]
  |  Branch (449:31): [True: 20.4k, False: 722]
  ------------------
  450|  84.0k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 20.4k, False: 63.6k]
  |  Branch (450:33): [True: 1.32k, False: 19.0k]
  ------------------
  451|  1.32k|			break;
  452|  1.32k|		}
  453|  84.0k|	}
  454|  6.14k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.47k, False: 3.67k]
  |  Branch (454:32): [True: 1.32k, False: 1.14k]
  |  Branch (454:58): [True: 1.32k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.32k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.32k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.81k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.81k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.81k|	}
  461|  6.14k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    729|{
  535|    729|	return pow (2, x / 2.);
  536|    729|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    729|{
  547|    729|	return 3.125 * pow (2, x);
  548|    729|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    729|{
  541|    729|	return 1.0 / pow (2, x);
  542|    729|}

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

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

exif_data_get_mnote_data:
   93|  11.0k|{
   94|  11.0k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 11.0k, False: 0]
  |  Branch (94:15): [True: 11.0k, False: 0]
  ------------------
   95|  11.0k|}
exif_data_new_mem:
  110|  11.0k|{
  111|  11.0k|	ExifData *data;
  112|  11.0k|	unsigned int i;
  113|       |
  114|  11.0k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 11.0k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  11.0k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  11.0k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 11.0k]
  ------------------
  119|      0|		return (NULL);
  120|  11.0k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  11.0k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 11.0k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  11.0k|	data->priv->ref_count = 1;
  126|       |
  127|  11.0k|	data->priv->mem = mem;
  128|  11.0k|	exif_mem_ref (mem);
  129|       |
  130|  66.4k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 55.3k, False: 11.0k]
  ------------------
  131|  55.3k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  55.3k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 55.3k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  55.3k|		data->ifd[i]->parent = data;
  137|  55.3k|	}
  138|       |
  139|       |	/* Default options */
  140|  11.0k|#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|  11.0k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  11.0k|#endif
  147|  11.0k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  11.0k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  11.0k|	return (data);
  153|  11.0k|}
exif_data_load_data:
  858|  11.0k|{
  859|  11.0k|	unsigned int l;
  860|  11.0k|	ExifLong offset;
  861|  11.0k|	ExifShort n;
  862|  11.0k|	const unsigned char *d = d_orig;
  863|  11.0k|	unsigned int len, fullds;
  864|       |
  865|  11.0k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 11.0k]
  |  Branch (865:15): [True: 0, False: 11.0k]
  |  Branch (865:30): [True: 0, False: 11.0k]
  |  Branch (865:36): [True: 0, False: 11.0k]
  ------------------
  866|      0|		return;
  867|       |
  868|  11.0k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  11.0k|		  "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|  11.0k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 25, False: 11.0k]
  ------------------
  876|     25|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     25|#define LOG_TOO_SMALL \
  |  |  852|     25|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     25|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     25|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     25|		return;
  878|     25|	}
  879|  11.0k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 10.8k, False: 176]
  ------------------
  880|  10.8k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  10.8k|			  "Found EXIF header at start.");
  882|  10.8k|	} else {
  883|    933|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 918, False: 15]
  ------------------
  884|  1.22k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.21k, False: 6]
  |  Branch (884:17): [True: 304, False: 912]
  ------------------
  885|    304|				d++;
  886|    304|				ds--;
  887|    304|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|    918|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|    912|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 912, False: 6]
  |  Branch (890:14): [True: 311, False: 601]
  ------------------
  891|    311|				d++;
  892|    311|				ds--;
  893|    311|				continue;
  894|    311|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    607|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    601|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 601, False: 6]
  |  Branch (897:14): [True: 287, False: 314]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    287|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 256, False: 31]
  |  Branch (904:22): [True: 55, False: 201]
  ------------------
  905|     55|					break;
  906|       |				/* fallthrough */
  907|    287|			}
  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|    552|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 540, False: 12]
  |  Branch (913:19): [True: 483, False: 57]
  |  Branch (913:35): [True: 479, False: 4]
  ------------------
  914|    479|				d++;
  915|    479|				ds--;
  916|    479|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    479|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 33, False: 446]
  ------------------
  918|     33|					return;
  919|    446|				d += l;
  920|    446|				ds -= l;
  921|    446|				continue;
  922|    479|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     73|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     73|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     73|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     73|			return;
  928|    552|		}
  929|     70|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 15, False: 55]
  ------------------
  930|     15|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     15|#define LOG_TOO_SMALL \
  |  |  852|     15|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     15|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     15|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     15|			return;
  932|     15|		}
  933|     55|		d++;
  934|     55|		ds--;
  935|     55|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     55|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 34, False: 21]
  ------------------
  937|     34|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     34|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     34|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     34|			return;
  940|     34|		}
  941|     21|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 2, False: 19]
  ------------------
  942|      2|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  943|      2|				  "ExifData", _("APP Tag too short."));
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  944|      2|			return;
  945|      2|		}
  946|     19|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     19|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     19|			  len);
  949|     19|		d += 2;
  950|     19|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     19|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  10.8k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 5, False: 10.8k]
  ------------------
  958|      5|		LOG_TOO_SMALL;
  ------------------
  |  |  851|      5|#define LOG_TOO_SMALL \
  |  |  852|      5|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|      5|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  959|      5|		return;
  960|      5|	}
  961|  10.8k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 10.8k]
  ------------------
  962|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  963|      0|			  "ExifData", _("EXIF header not found."));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  964|      0|		return;
  965|      0|	}
  966|       |
  967|  10.8k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  10.8k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  10.8k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 41, False: 10.8k]
  ------------------
  972|     41|		return;
  973|       |
  974|       |	/* The JPEG APP1 section can be no longer than 64 KiB (including a
  975|       |	   16-bit length), so cap the data length to protect against overflow
  976|       |	   in future offset calculations */
  977|  10.8k|	fullds = ds;
  978|  10.8k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 9, False: 10.8k]
  ------------------
  979|      9|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  10.8k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 8.19k, False: 2.65k]
  ------------------
  983|  8.19k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.65k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 2.59k, False: 61]
  ------------------
  985|  2.59k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
  986|     61|	else {
  987|     61|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  988|     61|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     61|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  989|     61|		return;
  990|     61|	}
  991|       |
  992|       |	/* Fixed value */
  993|  10.7k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 19, False: 10.7k]
  ------------------
  994|     19|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  10.7k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  10.7k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  10.7k|		  "IFD 0 at %i.", (int) offset);
 1000|       |
 1001|       |	/* ds is restricted to 16 bit above, so offset is restricted too, and offset+8 should not overflow. */
 1002|  10.7k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 56, False: 10.7k]
  |  Branch (1002:21): [True: 10, False: 10.7k]
  ------------------
 1003|     66|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  10.7k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  10.7k|	n = exif_get_short (d + 6 + offset, data->priv->order);
 1010|       |	/* offset < 2<<16, n is 16 bit at most, so this op will not overflow */
 1011|  10.7k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 2.12k, False: 8.58k]
  ------------------
 1012|  2.12k|		return;
 1013|       |
 1014|  8.58k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  8.58k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 8.39k, False: 188]
  ------------------
 1016|  8.39k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  8.39k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  8.39k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.80k, False: 6.59k]
  ------------------
 1021|  1.80k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.80k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  6.59k|		} else {
 1024|  6.59k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  6.59k|		}
 1026|  8.39k|	}
 1027|       |
 1028|       |	/*
 1029|       |	 * If we got an EXIF_TAG_MAKER_NOTE, try to interpret it. Some
 1030|       |	 * cameras use pointers in the maker note tag that point to the
 1031|       |	 * space between IFDs. Here is the only place where we have access
 1032|       |	 * to that data.
 1033|       |	 */
 1034|  8.58k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  8.58k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 8.58k, False: 0]
  ------------------
 1038|  8.58k|		exif_data_fix (data);
 1039|  8.58k|}
exif_data_unref:
 1111|  11.0k|{
 1112|  11.0k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 11.0k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  11.0k|	data->priv->ref_count--;
 1116|  11.0k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 11.0k, False: 0]
  ------------------
 1117|  11.0k|		exif_data_free (data);
 1118|  11.0k|}
exif_data_free:
 1122|  11.0k|{
 1123|  11.0k|	unsigned int i;
 1124|  11.0k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 11.0k, False: 0]
  |  Branch (1124:26): [True: 11.0k, False: 0]
  ------------------
 1125|       |
 1126|  11.0k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 11.0k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  66.4k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 55.3k, False: 11.0k]
  ------------------
 1130|  55.3k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 55.3k, False: 0]
  ------------------
 1131|  55.3k|			exif_content_unref (data->ifd[i]);
 1132|  55.3k|			data->ifd[i] = NULL;
 1133|  55.3k|		}
 1134|  55.3k|	}
 1135|       |
 1136|  11.0k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 189, False: 10.8k]
  ------------------
 1137|    189|		exif_mem_free (mem, data->data);
 1138|    189|		data->data = NULL;
 1139|    189|	}
 1140|       |
 1141|  11.0k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 11.0k, False: 0]
  ------------------
 1142|  11.0k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 11.0k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  11.0k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 7.20k, False: 3.87k]
  ------------------
 1147|  7.20k|			exif_mnote_data_unref (data->priv->md);
 1148|  7.20k|			data->priv->md = NULL;
 1149|  7.20k|		}
 1150|  11.0k|		exif_mem_free (mem, data->priv);
 1151|  11.0k|		exif_mem_free (mem, data);
 1152|  11.0k|	}
 1153|       |
 1154|  11.0k|	exif_mem_unref (mem);
 1155|  11.0k|}
exif_data_get_byte_order:
 1186|   163k|{
 1187|   163k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 163k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   163k|	return (data->priv->order);
 1191|   163k|}
exif_data_foreach_content:
 1196|  19.6k|{
 1197|  19.6k|	unsigned int i;
 1198|       |
 1199|  19.6k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 19.6k]
  |  Branch (1199:15): [True: 0, False: 19.6k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   117k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 98.3k, False: 19.6k]
  ------------------
 1203|  98.3k|		func (data->ifd[i], user_data);
 1204|  19.6k|}
exif_data_log:
 1246|  11.0k|{
 1247|  11.0k|	unsigned int i;
 1248|       |
 1249|  11.0k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 11.0k]
  |  Branch (1249:15): [True: 0, False: 11.0k]
  ------------------
 1250|      0|		return;
 1251|  11.0k|	exif_log_unref (data->priv->log);
 1252|  11.0k|	data->priv->log = log;
 1253|  11.0k|	exif_log_ref (log);
 1254|       |
 1255|  66.4k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 55.3k, False: 11.0k]
  ------------------
 1256|  55.3k|		exif_content_log (data->ifd[i], log);
 1257|  11.0k|}
exif_data_get_log:
 1263|  96.3k|{
 1264|  96.3k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 96.3k]
  |  Branch (1264:15): [True: 0, False: 96.3k]
  ------------------
 1265|      0|		return NULL;
 1266|  96.3k|	return data->priv->log;
 1267|  96.3k|}
exif_data_set_option:
 1309|  22.1k|{
 1310|  22.1k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 22.1k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  22.1k|	d->priv->options |= o;
 1314|  22.1k|}
exif_data_fix:
 1355|  8.58k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  8.58k|}
exif_data_set_data_type:
 1361|  11.0k|{
 1362|  11.0k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 11.0k]
  |  Branch (1362:12): [True: 0, False: 11.0k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  11.0k|	d->priv->data_type = dt;
 1366|  11.0k|}
exif_data_get_data_type:
 1370|  52.4k|{
 1371|  52.4k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1371:10): [True: 52.4k, False: 0]
  |  Branch (1371:15): [True: 52.4k, False: 0]
  ------------------
 1372|  52.4k|}
exif-data.c:exif_data_load_data_content:
  401|  36.0M|{
  402|  36.0M|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  403|  36.0M|	ExifShort n;
  404|  36.0M|	ExifEntry *entry;
  405|  36.0M|	unsigned int i;
  406|  36.0M|	ExifTag tag;
  407|       |
  408|  36.0M|	if (!data || !data->priv) 
  ------------------
  |  Branch (408:6): [True: 0, False: 36.0M]
  |  Branch (408:15): [True: 0, False: 36.0M]
  ------------------
  409|      0|		return;
  410|       |
  411|       |	/* check for valid ExifIfd enum range */
  412|  36.0M|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (412:6): [True: 0, False: 36.0M]
  |  Branch (412:26): [True: 0, False: 36.0M]
  ------------------
  413|      0|	  return;
  414|       |
  415|  36.0M|	if (recursion_cost > 170) {
  ------------------
  |  Branch (415:6): [True: 34.2M, False: 1.72M]
  ------------------
  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.2M|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  428|  34.2M|			  "Deep/expensive recursion detected!");
  429|  34.2M|		return;
  430|  34.2M|	}
  431|       |
  432|       |	/* Read the number of entries */
  433|  1.72M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  1.72M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 3, False: 1.72M]
  |  |  |  Branch (53:81): [True: 0, False: 1.72M]
  |  |  |  Branch (53:112): [True: 609, False: 1.72M]
  |  |  ------------------
  ------------------
  434|    612|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|    612|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|    612|		return;
  437|    612|	}
  438|  1.72M|	n = exif_get_short (d + offset, data->priv->order);
  439|  1.72M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  1.72M|	          "Loading %hu entries...", n);
  441|  1.72M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  1.72M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  1.72M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 317, False: 1.72M]
  |  |  |  Branch (53:81): [True: 1.70M, False: 18.9k]
  |  |  |  Branch (53:112): [True: 1.00k, False: 17.9k]
  |  |  ------------------
  ------------------
  445|  1.70M|		n = (ds - offset) / 12;
  446|  1.70M|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  447|  1.70M|				  "Short data; only loading %hu entries...", n);
  448|  1.70M|	}
  449|       |
  450|   110M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (450:14): [True: 109M, False: 1.72M]
  ------------------
  451|       |
  452|   109M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   109M|		switch (tag) {
  454|   687k|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 687k, False: 108M]
  ------------------
  455|  35.3M|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (455:3): [True: 34.6M, False: 74.4M]
  ------------------
  456|  70.4M|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (456:3): [True: 35.1M, False: 73.9M]
  ------------------
  457|  70.4M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (457:3): [True: 6.06k, False: 109M]
  ------------------
  458|  70.4M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 7.91k, False: 109M]
  ------------------
  459|  70.4M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  70.4M|					   data->priv->order);
  461|  70.4M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 4.76k, False: 70.4M]
  ------------------
  462|  4.76k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  4.76k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  4.76k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 3.08k, False: 1.67k]
  ------------------
  465|  3.08k|					return;
  466|  1.67k|				break;
  467|  4.76k|			}
  468|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  469|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  470|       |			 */
  471|  70.4M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  70.4M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  70.4M|				  exif_tag_get_name(tag), o);
  474|  70.4M|			switch (tag) {
  475|   685k|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 685k, False: 69.7M]
  ------------------
  476|   685k|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|   685k|#define CHECK_REC(i) 					\
  |  |  357|   685k|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 4.83k, False: 680k]
  |  |  ------------------
  |  |  358|  4.83k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  4.83k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  4.83k|		"'%s' detected. Skipping...",		\
  |  |  361|  4.83k|		exif_ifd_get_name (i));			\
  |  |  362|  4.83k|	break;						\
  |  |  363|   680k|}							\
  |  |  364|   680k|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 3.72k, False: 677k]
  |  |  ------------------
  |  |  365|  3.72k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  3.72k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  3.72k|		"'%s' multiple times detected. "	\
  |  |  368|  3.72k|		"Skipping...",				\
  |  |  369|  3.72k|		exif_ifd_get_name (i));			\
  |  |  370|  3.72k|	break;						\
  |  |  371|  3.72k|}
  ------------------
  477|   677k|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|   677k|					recursion_cost + level_cost(n));
  479|   677k|				break;
  480|  34.6M|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (480:4): [True: 34.6M, False: 35.8M]
  ------------------
  481|  34.6M|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  356|  34.6M|#define CHECK_REC(i) 					\
  |  |  357|  34.6M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.0M, False: 17.5M]
  |  |  ------------------
  |  |  358|  17.0M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.0M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.0M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.0M|		exif_ifd_get_name (i));			\
  |  |  362|  17.0M|	break;						\
  |  |  363|  17.5M|}							\
  |  |  364|  17.5M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 942, False: 17.5M]
  |  |  ------------------
  |  |  365|    942|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    942|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    942|		"'%s' multiple times detected. "	\
  |  |  368|    942|		"Skipping...",				\
  |  |  369|    942|		exif_ifd_get_name (i));			\
  |  |  370|    942|	break;						\
  |  |  371|    942|}
  ------------------
  482|  17.5M|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  483|  17.5M|					recursion_cost + level_cost(n));
  484|  17.5M|				break;
  485|  35.1M|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (485:4): [True: 35.1M, False: 35.3M]
  ------------------
  486|  35.1M|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  356|  35.1M|#define CHECK_REC(i) 					\
  |  |  357|  35.1M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.3M, False: 17.7M]
  |  |  ------------------
  |  |  358|  17.3M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.3M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.3M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.3M|		exif_ifd_get_name (i));			\
  |  |  362|  17.3M|	break;						\
  |  |  363|  17.7M|}							\
  |  |  364|  17.7M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 930, False: 17.7M]
  |  |  ------------------
  |  |  365|    930|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    930|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    930|		"'%s' multiple times detected. "	\
  |  |  368|    930|		"Skipping...",				\
  |  |  369|    930|		exif_ifd_get_name (i));			\
  |  |  370|    930|	break;						\
  |  |  371|    930|}
  ------------------
  487|  17.7M|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  488|  17.7M|					recursion_cost + level_cost(n));
  489|  17.7M|				break;
  490|  7.16k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 7.16k, False: 70.4M]
  ------------------
  491|  7.16k|				thumbnail_offset = o;
  492|  7.16k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 6.23k, False: 938]
  |  Branch (492:29): [True: 1.70k, False: 4.52k]
  ------------------
  493|  1.70k|					exif_data_load_data_thumbnail (data, d,
  494|  1.70k|								       ds, thumbnail_offset,
  495|  1.70k|								       thumbnail_length);
  496|  7.16k|				break;
  497|  5.20k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 5.20k, False: 70.4M]
  ------------------
  498|  5.20k|				thumbnail_length = o;
  499|  5.20k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 3.49k, False: 1.71k]
  |  Branch (499:29): [True: 2.83k, False: 660]
  ------------------
  500|  2.83k|					exif_data_load_data_thumbnail (data, d,
  501|  2.83k|								       ds, thumbnail_offset,
  502|  2.83k|								       thumbnail_length);
  503|  5.20k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 70.4M]
  ------------------
  505|      0|				return;
  506|  70.4M|			}
  507|  70.4M|			break;
  508|  70.4M|		default:
  ------------------
  |  Branch (508:3): [True: 38.5M, False: 70.4M]
  ------------------
  509|       |
  510|       |			/*
  511|       |			 * If we don't know the tag, don't fail. It could be that new 
  512|       |			 * versions of the standard have defined additional tags. Note that
  513|       |			 * 0 is a valid tag in the GPS IFD.
  514|       |			 */
  515|  38.5M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.3M, False: 270k]
  ------------------
  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.3M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (521:9): [True: 243k, False: 38.0M]
  ------------------
  522|   243k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   243k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   243k|						  exif_ifd_get_name (ifd));
  525|   243k|					break;
  526|   243k|				}
  527|  38.0M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  528|  38.0M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  529|  38.0M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  530|  38.0M|					  exif_ifd_get_name (ifd));
  531|  38.0M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (531:9): [True: 38.0M, False: 0]
  ------------------
  532|  38.0M|					break;
  533|  38.0M|			}
  534|   270k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   270k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 270k]
  ------------------
  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|   270k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 30.4k, False: 239k]
  ------------------
  541|   270k|						   offset + 12 * i))
  542|  30.4k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   270k|			exif_entry_unref (entry);
  544|   270k|			break;
  545|   109M|		}
  546|   109M|	}
  547|  1.72M|}
exif-data.c:level_cost:
  380|  36.0M|{
  381|  36.0M|    static const double log_1_1 = 0.09531017980432493;
  382|       |
  383|       |	/* Adding 0.1 protects against the case where n==1 */
  384|  36.0M|	return ceil(log(n + 0.1)/log_1_1);
  385|  36.0M|}
exif-data.c:exif_data_load_data_thumbnail:
  334|  4.53k|{
  335|       |	/* Sanity checks */
  336|  4.53k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 4.53k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  4.53k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  4.53k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 4.53k]
  |  |  |  Branch (53:81): [True: 0, False: 4.53k]
  |  |  |  Branch (53:112): [True: 1.77k, False: 2.76k]
  |  |  ------------------
  ------------------
  341|  1.77k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  1.77k|		return;
  343|  1.77k|	}
  344|  2.76k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 2.57k, False: 189]
  ------------------
  345|  2.57k|		exif_mem_free (data->priv->mem, data->data);
  346|  2.76k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 2.76k]
  ------------------
  347|      0|		EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  348|      0|		data->size = 0;
  349|      0|		return;
  350|      0|	}
  351|  2.76k|	data->size = s;
  352|  2.76k|	memcpy (data->data, d + o, s);
  353|  2.76k|}
exif-data.c:exif_data_load_data_entry:
  169|   270k|{
  170|   270k|	unsigned int s, doff;
  171|       |
  172|   270k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   270k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   270k|	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|   270k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   270k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   270k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   270k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   270k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 174k, False: 95.7k]
  |  Branch (186:33): [True: 41.0k, False: 54.7k]
  ------------------
  187|   215k|		return 0;
  188|   215k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  54.7k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 44.1k, False: 10.5k]
  ------------------
  195|  44.1k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  10.5k|	else
  197|  10.5k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  54.7k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 19.8k, False: 34.8k]
  ------------------
  201|  19.8k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  19.8k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  19.8k|		return 0;
  204|  19.8k|	}
  205|       |
  206|  34.8k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 4.38k, False: 30.4k]
  ------------------
  207|  4.38k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  4.38k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  4.38k|		return 0;
  210|  4.38k|	}
  211|       |
  212|  30.4k|	entry->data = exif_data_alloc (data, s);
  213|  30.4k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 30.4k, False: 0]
  ------------------
  214|  30.4k|		entry->size = s;
  215|  30.4k|		memcpy (entry->data, d + doff, s);
  216|  30.4k|	} else {
  217|      0|		EXIF_LOG_NO_MEMORY(data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  218|      0|		return 0;
  219|      0|	}
  220|       |
  221|       |	/* If this is the MakerNote, remember the offset */
  222|  30.4k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.88k, False: 21.5k]
  ------------------
  223|  8.88k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.88k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.88k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 8.00k, False: 874]
  ------------------
  227|  8.00k|			exif_log (data->priv->log,
  228|  8.00k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  8.00k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  8.00k|					       "%02x %02x %02x...).",
  231|  8.00k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  8.00k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  8.00k|					       entry->data[6]);
  234|  8.00k|		}
  235|  8.88k|		data->priv->offset_mnote = doff;
  236|  8.88k|	}
  237|  30.4k|	return 1;
  238|  30.4k|}
exif-data.c:interpret_maker_note:
  802|  8.58k|{
  803|  8.58k|	int mnoteid;
  804|  8.58k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  8.58k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 8.58k]
  |  |  ------------------
  |  |  254|  8.58k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  8.58k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 8.58k]
  |  |  ------------------
  |  |  256|  8.58k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  8.58k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 7.40k, False: 1.18k]
  |  |  ------------------
  |  |  258|  8.58k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  8.58k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 1.18k]
  |  |  ------------------
  |  |  260|  1.18k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  1.18k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 1.18k]
  |  |  ------------------
  |  |  262|  1.18k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  805|  8.58k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 1.18k, False: 7.40k]
  ------------------
  806|  1.18k|		return;
  807|       |	
  808|  7.40k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 4.10k, False: 3.29k]
  ------------------
  809|  4.10k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  4.10k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  4.10k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  4.10k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 936, False: 2.35k]
  ------------------
  814|    936|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    936|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    936|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  817|       |
  818|  2.35k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (818:13): [True: 1.07k, False: 1.27k]
  ------------------
  819|  1.07k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|  1.07k|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|  1.07k|		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.27k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (825:13): [True: 1.08k, False: 198]
  ------------------
  826|  1.08k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|  1.08k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|  1.08k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|  1.08k|	}
  830|       |/* Marcus: disabled until apple makernote can also be saved
  831|       |	else if ((mnoteid = exif_mnote_data_apple_identify (data, e)) != 0) {
  832|       |		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  833|       |			"ExifData", "Apple MakerNote variant type %d", mnoteid);
  834|       |		data->priv->md = exif_mnote_data_apple_new (data->priv->mem);
  835|       |	}
  836|       |*/
  837|       |
  838|       |	/* 
  839|       |	 * If we are able to interpret the maker note, do so.
  840|       |	 */
  841|  7.40k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 7.20k, False: 198]
  ------------------
  842|  7.20k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  7.20k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  7.20k|						data->priv->order);
  845|  7.20k|		exif_mnote_data_set_offset (data->priv->md,
  846|  7.20k|					    data->priv->offset_mnote);
  847|  7.20k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  7.20k|	}
  849|  7.40k|}
exif-data.c:exif_data_alloc:
   77|  33.2k|{
   78|  33.2k|	void *d;
   79|       |
   80|  33.2k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 33.2k]
  |  Branch (80:15): [True: 0, False: 33.2k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  33.2k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  33.2k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 33.2k, False: 0]
  ------------------
   85|  33.2k|		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|  33.2k|}
exif-data.c:fix_func:
 1327|  42.9k|{
 1328|  42.9k|	switch (exif_content_get_ifd (c)) {
 1329|  8.58k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 8.58k, False: 34.3k]
  ------------------
 1330|  8.58k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 167, False: 8.41k]
  ------------------
 1331|    167|			exif_content_fix (c);
 1332|  8.41k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 555, False: 7.86k]
  ------------------
 1333|    555|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    555|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    555|				  "removed.");
 1336|  2.06k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.50k, False: 555]
  ------------------
 1337|  1.50k|				unsigned int cnt = c->count;
 1338|  1.50k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.50k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.50k]
  ------------------
 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.50k|			}
 1346|    555|		}
 1347|  8.58k|		break;
 1348|  34.3k|	default:
  ------------------
  |  Branch (1348:2): [True: 34.3k, False: 8.58k]
  ------------------
 1349|  34.3k|		exif_content_fix (c);
 1350|  42.9k|	}
 1351|  42.9k|}

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

exif_format_get_name:
   56|  44.0k|{
   57|  44.0k|	unsigned int i;
   58|       |
   59|  44.0k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   271k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 260k, False: 11.6k]
  ------------------
   62|   260k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 32.3k, False: 227k]
  ------------------
   63|  32.3k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  32.3k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  11.6k|	return NULL;
   65|  44.0k|}
exif_format_get_size:
   69|  1.52M|{
   70|  1.52M|	unsigned int i;
   71|       |
   72|  10.0M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 9.63M, False: 412k]
  ------------------
   73|  9.63M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.11M, False: 8.52M]
  ------------------
   74|  1.11M|			return ExifFormatTable[i].size;
   75|   412k|	return 0;
   76|  1.52M|}

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

exif_loader_write:
  171|  11.4k|{
  172|  11.4k|	unsigned int i;
  173|       |
  174|  73.2k|begin:
  175|  73.2k|	if (!eld || (len && !buf)) 
  ------------------
  |  Branch (175:6): [True: 0, False: 73.2k]
  |  Branch (175:15): [True: 72.9k, False: 241]
  |  Branch (175:22): [True: 0, False: 72.9k]
  ------------------
  176|      0|		return 0;
  177|       |
  178|  73.2k|	switch (eld->state) {
  179|    205|	case EL_EXIF_FOUND:
  ------------------
  |  Branch (179:2): [True: 205, False: 73.0k]
  ------------------
  180|    205|		return exif_loader_copy (eld, buf, len);
  181|    963|	case EL_SKIP_BYTES:
  ------------------
  |  Branch (181:2): [True: 963, False: 72.2k]
  ------------------
  182|    963|		if (eld->size > len) { 
  ------------------
  |  Branch (182:7): [True: 173, False: 790]
  ------------------
  183|    173|			eld->size -= len; 
  184|    173|			return 1; 
  185|    173|		}
  186|    790|		len -= eld->size;
  187|    790|		buf += eld->size;
  188|    790|		eld->size = 0;
  189|    790|		eld->b_len = 0;
  190|    790|		switch (eld->data_format) {
  191|     61|		case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (191:3): [True: 61, False: 729]
  ------------------
  192|     61|			eld->state = EL_READ_SIZE_BYTE_24;
  193|     61|			break;
  194|    729|		default:
  ------------------
  |  Branch (194:3): [True: 729, False: 61]
  ------------------
  195|    729|			eld->state = EL_READ;
  196|    729|			break;
  197|    790|		}
  198|    790|		break;
  199|       |
  200|  71.6k|	case EL_READ:
  ------------------
  |  Branch (200:2): [True: 71.6k, False: 1.61k]
  ------------------
  201|  72.0k|	default:
  ------------------
  |  Branch (201:2): [True: 446, False: 72.7k]
  ------------------
  202|  72.0k|		break;
  203|  73.2k|	}
  204|       |
  205|  72.8k|	if (!len)
  ------------------
  |  Branch (205:6): [True: 65, False: 72.7k]
  ------------------
  206|     65|		return 1;
  207|  72.7k|	exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
  208|  72.7k|		  "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|  72.7k|	i = MIN (len, sizeof (eld->b) - eld->b_len);
  ------------------
  |  |  182|  72.7k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 20, False: 72.7k]
  |  |  ------------------
  ------------------
  215|  72.7k|	if (i) {
  ------------------
  |  Branch (215:6): [True: 72.7k, False: 0]
  ------------------
  216|  72.7k|		memcpy (&eld->b[eld->b_len], buf, i);
  217|  72.7k|		eld->b_len += i;
  218|  72.7k|		if (eld->b_len < sizeof (eld->b)) 
  ------------------
  |  Branch (218:7): [True: 20, False: 72.7k]
  ------------------
  219|     20|			return 1;
  220|  72.7k|		buf += i;
  221|  72.7k|		len -= i;
  222|  72.7k|	}
  223|       |
  224|  72.7k|	switch (eld->data_format) {
  225|  11.7k|	case EL_DATA_FORMAT_UNKNOWN:
  ------------------
  |  Branch (225:2): [True: 11.7k, False: 60.9k]
  ------------------
  226|       |
  227|       |		/* Check the small buffer against known formats. */
  228|  11.7k|		if (!memcmp (eld->b, "FUJIFILM", 8)) {
  ------------------
  |  Branch (228:7): [True: 62, False: 11.7k]
  ------------------
  229|       |
  230|       |			/* Skip to byte 84. There is another offset there. */
  231|     62|			eld->data_format = EL_DATA_FORMAT_FUJI_RAW;
  232|     62|			eld->size = 84;
  233|     62|			eld->state = EL_SKIP_BYTES;
  234|     62|			eld->size = 84;
  235|       |
  236|  11.7k|		} else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) {
  ------------------
  |  Branch (236:14): [True: 10.7k, False: 929]
  ------------------
  237|       |
  238|       |			/* Read the size (2 bytes). */
  239|  10.7k|			eld->data_format = EL_DATA_FORMAT_EXIF;
  240|  10.7k|			eld->state = EL_READ_SIZE_BYTE_08;
  241|  10.7k|		}
  242|  72.7k|	default:
  ------------------
  |  Branch (242:2): [True: 60.9k, False: 11.7k]
  ------------------
  243|  72.7k|		break;
  244|  72.7k|	}
  245|       |
  246|   840k|	for (i = 0; i < sizeof (eld->b); i++) {
  ------------------
  |  Branch (246:14): [True: 779k, False: 61.7k]
  ------------------
  247|   779k|		switch (eld->state) {
  248|  10.8k|		case EL_EXIF_FOUND:
  ------------------
  |  Branch (248:3): [True: 10.8k, False: 768k]
  ------------------
  249|  10.8k|			if (!exif_loader_copy (eld, eld->b + i,
  ------------------
  |  Branch (249:8): [True: 8, False: 10.8k]
  ------------------
  250|  10.8k|					sizeof (eld->b) - i)) 
  251|      8|				return 0;
  252|  10.8k|			return exif_loader_copy (eld, buf, len);
  253|  7.22k|		case EL_SKIP_BYTES:
  ------------------
  |  Branch (253:3): [True: 7.22k, False: 771k]
  ------------------
  254|  7.22k|			switch (eld->size) {
  255|  4.36k|                            case 0:
  ------------------
  |  Branch (255:29): [True: 4.36k, False: 2.85k]
  ------------------
  256|  4.36k|			        eld->state = EL_READ;
  257|  4.36k|				i--;   /* reprocess this byte */
  258|  4.36k|				break;
  259|  1.02k|                            case 1:
  ------------------
  |  Branch (259:29): [True: 1.02k, False: 6.19k]
  ------------------
  260|  1.02k|                                eld->size = 0;
  261|  1.02k|			        eld->state = EL_READ;
  262|  1.02k|				break;
  263|  1.83k|                            default:
  ------------------
  |  Branch (263:29): [True: 1.83k, False: 5.38k]
  ------------------
  264|  1.83k|                                eld->size--;
  265|  1.83k|				break;
  266|  7.22k|			}
  267|  7.22k|			break;
  268|       |
  269|  7.22k|		case EL_READ_SIZE_BYTE_24:
  ------------------
  |  Branch (269:3): [True: 60, False: 779k]
  ------------------
  270|     60|			eld->size |= (unsigned int)eld->b[i] << 24;
  271|     60|			eld->state = EL_READ_SIZE_BYTE_16;
  272|     60|			break;
  273|     60|		case EL_READ_SIZE_BYTE_16:
  ------------------
  |  Branch (273:3): [True: 60, False: 779k]
  ------------------
  274|     60|			eld->size |= (unsigned int)eld->b[i] << 16;
  275|     60|			eld->state = EL_READ_SIZE_BYTE_08;
  276|     60|			break;
  277|  17.3k|		case EL_READ_SIZE_BYTE_08:
  ------------------
  |  Branch (277:3): [True: 17.3k, False: 761k]
  ------------------
  278|  17.3k|			eld->size |= (unsigned int)eld->b[i] << 8;
  279|  17.3k|			eld->state = EL_READ_SIZE_BYTE_00;
  280|  17.3k|			break;
  281|  17.3k|		case EL_READ_SIZE_BYTE_00:
  ------------------
  |  Branch (281:3): [True: 17.3k, False: 761k]
  ------------------
  282|  17.3k|			eld->size |= eld->b[i] << 0;
  283|  17.3k|			switch (eld->data_format) {
  284|  6.22k|			case EL_DATA_FORMAT_JPEG:
  ------------------
  |  Branch (284:4): [True: 6.22k, False: 11.1k]
  ------------------
  285|  6.22k|				eld->state = EL_SKIP_BYTES;
  286|  6.22k|				if (eld->size < 2) {
  ------------------
  |  Branch (286:9): [True: 3.03k, False: 3.19k]
  ------------------
  287|       |				    /* Actually it's malformed... */
  288|  3.03k|				    eld->size = 0;
  289|  3.03k|				} else
  290|  3.19k|				    eld->size -= 2;
  291|  6.22k|				break;
  292|     60|			case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (292:4): [True: 60, False: 17.3k]
  ------------------
  293|     60|				eld->data_format = EL_DATA_FORMAT_EXIF;
  294|     60|				eld->state = EL_SKIP_BYTES;
  295|     60|				if (eld->size < 86) {
  ------------------
  |  Branch (295:9): [True: 5, False: 55]
  ------------------
  296|       |				    /* Actually it's malformed... */
  297|      5|				    eld->size = 0;
  298|      5|				} else
  299|     55|				    eld->size -= 86;	/* and put this in an else */
  300|     60|				break;
  301|  11.0k|			case EL_DATA_FORMAT_EXIF:
  ------------------
  |  Branch (301:4): [True: 11.0k, False: 6.28k]
  ------------------
  302|  11.0k|				eld->state = EL_EXIF_FOUND;
  303|  11.0k|				break;
  304|      0|			default:
  ------------------
  |  Branch (304:4): [True: 0, False: 17.3k]
  ------------------
  305|      0|				break;
  306|  17.3k|			}
  307|  17.3k|			break;
  308|       |
  309|   726k|		default:
  ------------------
  |  Branch (309:3): [True: 726k, False: 53.0k]
  ------------------
  310|   726k|			switch (eld->b[i]) {
  311|  1.59k|			case JPEG_MARKER_APP1:
  ------------------
  |  |   46|  1.59k|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (311:4): [True: 1.59k, False: 724k]
  ------------------
  312|  1.59k|			  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.18k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 494, False: 1.09k]
  |  |  |  Branch (182:29): [True: 2, False: 1.59k]
  |  |  |  Branch (182:42): [True: 2, False: 1.09k]
  |  |  ------------------
  ------------------
  |  Branch (312:10): [True: 306, False: 1.28k]
  ------------------
  313|    306|					eld->data_format = EL_DATA_FORMAT_EXIF;
  314|  1.28k|				} else {
  315|  1.28k|					eld->data_format = EL_DATA_FORMAT_JPEG; /* Probably JFIF - keep searching for APP1 EXIF*/
  316|  1.28k|				}
  317|  1.59k|				eld->size = 0;
  318|  1.59k|				eld->state = EL_READ_SIZE_BYTE_08;
  319|  1.59k|				break;
  320|    314|			case JPEG_MARKER_DCT:
  ------------------
  |  |   36|    314|#define JPEG_MARKER_DCT  0xc0
  ------------------
  |  Branch (320:4): [True: 314, False: 725k]
  ------------------
  321|    545|			case JPEG_MARKER_DHT:
  ------------------
  |  |   38|    545|#define JPEG_MARKER_DHT  0xc4
  ------------------
  |  Branch (321:4): [True: 231, False: 725k]
  ------------------
  322|    769|			case JPEG_MARKER_DQT:
  ------------------
  |  |   42|    769|#define JPEG_MARKER_DQT  0xdb
  ------------------
  |  Branch (322:4): [True: 224, False: 725k]
  ------------------
  323|  1.73k|			case JPEG_MARKER_APP0:
  ------------------
  |  |   44|  1.73k|#define JPEG_MARKER_APP0 0xe0
  ------------------
  |  Branch (323:4): [True: 969, False: 725k]
  ------------------
  324|  2.07k|			case JPEG_MARKER_APP2:
  ------------------
  |  |   48|  2.07k|#define JPEG_MARKER_APP2 0xe2
  ------------------
  |  Branch (324:4): [True: 332, False: 725k]
  ------------------
  325|  2.81k|			case JPEG_MARKER_APP3:
  ------------------
  |  |   50|  2.81k|#define JPEG_MARKER_APP3 0xe3
  ------------------
  |  Branch (325:4): [True: 749, False: 725k]
  ------------------
  326|  3.19k|			case JPEG_MARKER_APP4:
  ------------------
  |  |   52|  3.19k|#define JPEG_MARKER_APP4 0xe4
  ------------------
  |  Branch (326:4): [True: 376, False: 725k]
  ------------------
  327|  3.40k|			case JPEG_MARKER_APP5:
  ------------------
  |  |   54|  3.40k|#define JPEG_MARKER_APP5 0xe5
  ------------------
  |  Branch (327:4): [True: 213, False: 725k]
  ------------------
  328|  3.85k|			case JPEG_MARKER_APP10:
  ------------------
  |  |   56|  3.85k|#define JPEG_MARKER_APP10 0xea
  ------------------
  |  Branch (328:4): [True: 446, False: 725k]
  ------------------
  329|  4.13k|			case JPEG_MARKER_APP11:
  ------------------
  |  |   58|  4.13k|#define JPEG_MARKER_APP11 0xeb
  ------------------
  |  Branch (329:4): [True: 279, False: 725k]
  ------------------
  330|  4.40k|			case JPEG_MARKER_APP13:
  ------------------
  |  |   60|  4.40k|#define JPEG_MARKER_APP13 0xed
  ------------------
  |  Branch (330:4): [True: 267, False: 725k]
  ------------------
  331|  4.71k|			case JPEG_MARKER_APP14:
  ------------------
  |  |   62|  4.71k|#define JPEG_MARKER_APP14 0xee
  ------------------
  |  Branch (331:4): [True: 319, False: 725k]
  ------------------
  332|  4.95k|			case JPEG_MARKER_COM:
  ------------------
  |  |   64|  4.95k|#define JPEG_MARKER_COM 0xfe
  ------------------
  |  Branch (332:4): [True: 234, False: 725k]
  ------------------
  333|  4.95k|				eld->data_format = EL_DATA_FORMAT_JPEG;
  334|  4.95k|				eld->size = 0;
  335|  4.95k|				eld->state = EL_READ_SIZE_BYTE_08;
  336|  4.95k|				break;
  337|   718k|			case 0xff:
  ------------------
  |  Branch (337:4): [True: 718k, False: 7.41k]
  ------------------
  338|   719k|			case JPEG_MARKER_SOI:
  ------------------
  |  |   40|   719k|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (338:4): [True: 777, False: 725k]
  ------------------
  339|   719k|				break;
  340|     88|			default:
  ------------------
  |  Branch (340:4): [True: 88, False: 726k]
  ------------------
  341|     88|				exif_log (eld->log,
  342|     88|					EXIF_LOG_CODE_CORRUPT_DATA,
  343|     88|					"ExifLoader", _("The data supplied "
  ------------------
  |  |   31|     88|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  344|     88|						"does not seem to contain "
  345|     88|						"EXIF data. JPEG Marker type 0x%02x"), eld->b[i]);
  346|     88|				exif_loader_reset (eld);
  347|     88|				return 0;
  348|   726k|			}
  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|  61.7k|	eld->b_len = 0;
  357|  61.7k|	goto begin;
  358|  72.7k|}
exif_loader_new:
  362|  11.4k|{
  363|  11.4k|	ExifMem *mem = exif_mem_new_default ();
  364|  11.4k|	ExifLoader *l = exif_loader_new_mem (mem);
  365|       |
  366|  11.4k|	exif_mem_unref (mem);
  367|       |
  368|  11.4k|	return l;
  369|  11.4k|}
exif_loader_new_mem:
  373|  11.4k|{
  374|  11.4k|	ExifLoader *loader;
  375|       |
  376|  11.4k|	if (!mem) 
  ------------------
  |  Branch (376:6): [True: 0, False: 11.4k]
  ------------------
  377|      0|		return NULL;
  378|       |	
  379|  11.4k|	loader = exif_mem_alloc (mem, sizeof (ExifLoader));
  380|  11.4k|	if (!loader) 
  ------------------
  |  Branch (380:6): [True: 0, False: 11.4k]
  ------------------
  381|      0|		return NULL;
  382|  11.4k|	loader->ref_count = 1;
  383|       |
  384|  11.4k|	loader->mem = mem;
  385|  11.4k|	exif_mem_ref (mem);
  386|       |
  387|  11.4k|	return loader;
  388|  11.4k|}
exif_loader_unref:
  414|  11.4k|{
  415|  11.4k|	if (!loader) 
  ------------------
  |  Branch (415:6): [True: 0, False: 11.4k]
  ------------------
  416|      0|		return;
  417|  11.4k|	if (!--loader->ref_count)
  ------------------
  |  Branch (417:6): [True: 11.4k, False: 0]
  ------------------
  418|  11.4k|		exif_loader_free (loader);
  419|  11.4k|}
exif_loader_reset:
  423|  11.5k|{
  424|  11.5k|	if (!loader) 
  ------------------
  |  Branch (424:6): [True: 0, False: 11.5k]
  ------------------
  425|      0|		return;
  426|  11.5k|	exif_mem_free (loader->mem, loader->buf); loader->buf = NULL;
  427|  11.5k|	loader->size = 0;
  428|  11.5k|	loader->bytes_read = 0;
  429|  11.5k|	loader->state = 0;
  430|  11.5k|	loader->b_len = 0;
  431|  11.5k|	loader->data_format = EL_DATA_FORMAT_UNKNOWN;
  432|  11.5k|}
exif_loader_get_data:
  436|  11.4k|{
  437|  11.4k|	ExifData *ed;
  438|       |
  439|  11.4k|	if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) ||
  ------------------
  |  Branch (439:6): [True: 0, False: 11.4k]
  |  Branch (439:17): [True: 97, False: 11.3k]
  ------------------
  440|  11.3k|	    !loader->bytes_read)
  ------------------
  |  Branch (440:6): [True: 268, False: 11.0k]
  ------------------
  441|    365|		return NULL;
  442|       |
  443|  11.0k|	ed = exif_data_new_mem (loader->mem);
  444|  11.0k|	exif_data_log (ed, loader->log);
  445|  11.0k|	exif_data_load_data (ed, loader->buf, loader->bytes_read);
  446|       |
  447|  11.0k|	return ed;
  448|  11.4k|}
exif-loader.c:exif_loader_copy:
  151|  21.9k|{
  152|  21.9k|	if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) 
  ------------------
  |  Branch (152:6): [True: 0, False: 21.9k]
  |  Branch (152:15): [True: 21.9k, False: 45]
  |  Branch (152:22): [True: 0, False: 21.9k]
  |  Branch (152:31): [True: 2, False: 21.9k]
  ------------------
  153|      2|		return 0;
  154|       |
  155|       |	/* If needed, allocate the buffer. */
  156|  21.9k|	if (!eld->buf) 
  ------------------
  |  Branch (156:6): [True: 11.0k, False: 10.8k]
  ------------------
  157|  11.0k|		eld->buf = exif_loader_alloc (eld, eld->size);
  158|  21.9k|	if (!eld->buf) 
  ------------------
  |  Branch (158:6): [True: 0, False: 21.9k]
  ------------------
  159|      0|		return 0;
  160|       |
  161|       |	/* Copy memory */
  162|  21.9k|	len = MIN (len, eld->size - eld->bytes_read);
  ------------------
  |  |  182|  21.9k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 21.8k, False: 91]
  |  |  ------------------
  ------------------
  163|  21.9k|	memcpy (eld->buf + eld->bytes_read, buf, len);
  164|  21.9k|	eld->bytes_read += len;
  165|       |
  166|  21.9k|	return (eld->bytes_read >= eld->size) ? 0 : 1;
  ------------------
  |  Branch (166:9): [True: 91, False: 21.8k]
  ------------------
  167|  21.9k|}
exif-loader.c:exif_loader_alloc:
  109|  11.0k|{
  110|  11.0k|	void *d;
  111|       |
  112|  11.0k|	if (!l || !i) 
  ------------------
  |  Branch (112:6): [True: 0, False: 11.0k]
  |  Branch (112:12): [True: 0, False: 11.0k]
  ------------------
  113|      0|		return NULL;
  114|       |
  115|  11.0k|	d = exif_mem_alloc (l->mem, i);
  116|  11.0k|	if (d) 
  ------------------
  |  Branch (116:6): [True: 11.0k, False: 0]
  ------------------
  117|  11.0k|		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|  11.0k|}
exif-loader.c:exif_loader_free:
  399|  11.4k|{
  400|  11.4k|	ExifMem *mem;
  401|       |
  402|  11.4k|	if (!loader) 
  ------------------
  |  Branch (402:6): [True: 0, False: 11.4k]
  ------------------
  403|      0|		return;
  404|       |
  405|  11.4k|	mem = loader->mem;
  406|  11.4k|	exif_loader_reset (loader);
  407|  11.4k|	exif_log_unref (loader->log);
  408|  11.4k|	exif_mem_free (mem, loader);
  409|  11.4k|	exif_mem_unref (mem);
  410|  11.4k|}

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

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

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

exif_tag_table_count:
  978|   403M|{
  979|   403M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   403M|}
exif_tag_table_get_tag:
  985|  5.83M|{
  986|  5.83M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.83M, False: 0]
  ------------------
  987|  5.83M|}
exif_tag_get_name_in_ifd:
 1043|   391M|{
 1044|   391M|	unsigned int i;
 1045|   391M|	int first;
 1046|       |
 1047|   391M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 391M]
  ------------------
 1048|      0|		return NULL;
 1049|   391M|	first = exif_tag_table_first(tag);
 1050|   391M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 36.9M, False: 354M]
  ------------------
 1051|  36.9M|		return NULL;
 1052|       |
 1053|   709M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 709M, False: 1.30k]
  ------------------
 1054|   709M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 355M, False: 354M]
  ------------------
 1055|   355M|		   if (RECORDED)
  ------------------
  |  | 1035|   355M|#define RECORDED \
  |  | 1036|   355M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 599k, False: 354M]
  |  |  ------------------
  |  | 1037|   355M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 354M]
  |  |  ------------------
  |  | 1038|   355M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.66k, False: 354M]
  |  |  ------------------
  |  | 1039|   355M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 12.9k, False: 354M]
  |  |  ------------------
  ------------------
 1056|   613k|			   break;
 1057|   355M|		} else
 1058|   354M|			return NULL; /* Recorded tag not found in the table */
 1059|   709M|	}
 1060|   615k|	return ExifTagTable[i].name;
 1061|   354M|}
exif_tag_get_name:
 1152|  70.7M|{
 1153|  70.7M|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|  70.7M|}
exif_tag_get_support_level_in_ifd:
 1261|  5.84M|{
 1262|  5.84M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.84M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.84M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.84M, False: 0]
  ------------------
 1266|  5.84M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.84M|}
exif-tag.c:exif_tag_table_first:
 1016|   397M|{
 1017|   397M|	int i;
 1018|   397M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   397M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   397M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 36.9M, False: 360M]
  ------------------
 1021|  36.9M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|   360M|	i = entry - ExifTagTable;
 1025|       |
 1026|       |	/* There may be other entries with the same tag number, so search
 1027|       |	 * backwards to find the first
 1028|       |	 */
 1029|   361M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 359M, False: 1.23M]
  |  Branch (1029:20): [True: 374k, False: 359M]
  ------------------
 1030|   374k|		--i;
 1031|   374k|	}
 1032|   360M|	return i;
 1033|   397M|}
exif-tag.c:match_tag:
 1003|  2.81G|{
 1004|  2.81G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.81G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  70.7M|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|  70.7M|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|  70.7M|		EXIF_IFD_EXIF,
 1134|  70.7M|		EXIF_IFD_0,
 1135|  70.7M|		EXIF_IFD_1,
 1136|  70.7M|		EXIF_IFD_INTEROPERABILITY,
 1137|  70.7M|		EXIF_IFD_GPS
 1138|  70.7M|	};
 1139|  70.7M|	int i;
 1140|   423M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 353M, False: 70.4M]
  ------------------
 1141|   353M|		const char *result = func(tag, ifds[i]);
 1142|   353M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 291k, False: 352M]
  ------------------
 1143|   291k|			return result;
 1144|   291k|		}
 1145|   353M|	}
 1146|  70.4M|	return (const char *) NULL;
 1147|  70.7M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.84M|{
 1228|  5.84M|	unsigned int i;
 1229|  5.84M|	int first = exif_tag_table_first(tag);
 1230|  5.84M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.84M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  9.95M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 9.94M, False: 17.3k]
  ------------------
 1234|  9.94M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.95M, False: 3.98M]
  ------------------
 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.95M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.95M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.93M, False: 4.02M]
  ------------------
 1242|  1.93M|				unsigned int dt;
 1243|  9.54M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 7.70M, False: 1.84M]
  ------------------
 1244|  7.70M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 87.6k, False: 7.61M]
  ------------------
 1245|  87.6k|						break;
 1246|  7.70M|				}
 1247|  1.93M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.84M, False: 87.6k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.84M|					return supp;
 1250|  1.93M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.95M|		} else {
 1253|  3.98M|			break; /* We've reached the end of the matching tags */
 1254|  3.98M|		}
 1255|  9.94M|	}
 1256|  4.00M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.84M|}

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

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

mnote_fuji_entry_get_value:
  194|  9.18k|{
  195|  9.18k|	ExifLong  vl;
  196|  9.18k|	ExifSLong vsl;
  197|  9.18k|	ExifShort vs, vs2;
  198|  9.18k|	ExifSShort vss;
  199|  9.18k|	ExifRational vr;
  200|  9.18k|	ExifSRational vsr;
  201|  9.18k|	int i, j;
  202|       |
  203|  9.18k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 9.18k]
  ------------------
  204|  9.18k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 9.18k]
  ------------------
  205|       |
  206|  9.18k|	memset (val, 0, maxlen);
  207|  9.18k|	maxlen--;
  208|       |
  209|  9.18k|	switch (entry->tag) {
  210|  1.05k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.05k, False: 8.13k]
  ------------------
  211|  1.05k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.05k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.05k|{                                                               \
  |  |   35|  1.05k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 624, False: 429]
  |  |  ------------------
  |  |   36|    624|                snprintf (v, maxlen,	                        \
  |  |   37|    624|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    624|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    624|                        "expected '%s'."),                      \
  |  |   39|    624|                        exif_format_get_name (format),          \
  |  |   40|    624|                        exif_format_get_name (target));         \
  |  |   41|    624|                break;                                          \
  |  |   42|    624|        }                                                       \
  |  |   43|  1.05k|}
  ------------------
  212|    429|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    429|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    429|{                                                                       \
  |  |   47|    429|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 227, False: 202]
  |  |  ------------------
  |  |   48|    227|                snprintf (v, maxlen,                                    \
  |  |   49|    227|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    227|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    227|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    227|                break;                                                  \
  |  |   52|    227|        }                                                               \
  |  |   53|    429|}
  ------------------
  213|    202|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    202|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 202]
  |  |  ------------------
  ------------------
  214|    202|		break;
  215|    211|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 211, False: 8.97k]
  ------------------
  216|    497|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 286, False: 8.89k]
  ------------------
  217|    725|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 228, False: 8.95k]
  ------------------
  218|    966|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 241, False: 8.94k]
  ------------------
  219|  1.20k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 242, False: 8.94k]
  ------------------
  220|  1.44k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 241, False: 8.94k]
  ------------------
  221|  1.69k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 244, False: 8.94k]
  ------------------
  222|  1.89k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 204, False: 8.98k]
  ------------------
  223|  2.11k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 221, False: 8.96k]
  ------------------
  224|  2.32k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 207, False: 8.97k]
  ------------------
  225|  2.57k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 247, False: 8.93k]
  ------------------
  226|  2.77k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 201, False: 8.98k]
  ------------------
  227|  3.02k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 251, False: 8.93k]
  ------------------
  228|  3.23k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 210, False: 8.97k]
  ------------------
  229|  3.59k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 359, False: 8.82k]
  ------------------
  230|  3.82k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 229, False: 8.95k]
  ------------------
  231|  4.02k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 202, False: 8.98k]
  ------------------
  232|  4.02k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  4.02k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  4.02k|{                                                               \
  |  |   35|  4.02k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 2.16k, False: 1.86k]
  |  |  ------------------
  |  |   36|  2.16k|                snprintf (v, maxlen,	                        \
  |  |   37|  2.16k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.16k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  2.16k|                        "expected '%s'."),                      \
  |  |   39|  2.16k|                        exif_format_get_name (format),          \
  |  |   40|  2.16k|                        exif_format_get_name (target));         \
  |  |   41|  2.16k|                break;                                          \
  |  |   42|  2.16k|        }                                                       \
  |  |   43|  4.02k|}
  ------------------
  233|  1.86k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  1.86k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  1.86k|{                                                                       \
  |  |   47|  1.86k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 307, False: 1.55k]
  |  |  ------------------
  |  |   48|    307|                snprintf (v, maxlen,                                    \
  |  |   49|    307|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    307|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    307|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    307|                break;                                                  \
  |  |   52|    307|        }                                                               \
  |  |   53|  1.86k|}
  ------------------
  234|  1.55k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  12.1k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 12.1k, False: 0]
  |  Branch (237:32): [True: 10.6k, False: 1.55k]
  ------------------
  238|  1.55k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.55k]
  ------------------
  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|  8.64k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 7.85k, False: 792]
  ------------------
  246|  7.85k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 7.08k, False: 761]
  ------------------
  247|  1.55k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 1.03k, False: 522]
  ------------------
  248|  1.03k|			snprintf (val, maxlen,
  249|  1.03k|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|  1.03k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.03k|			break;
  251|  1.03k|		}
  252|    522|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    522|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    522|		break;
  254|    608|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 608, False: 8.57k]
  ------------------
  255|    608|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    608|#define CF(format,target,v,maxlen)                              \
  |  |   34|    608|{                                                               \
  |  |   35|    608|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 214, False: 394]
  |  |  ------------------
  |  |   36|    214|                snprintf (v, maxlen,	                        \
  |  |   37|    214|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    214|                        "expected '%s'."),                      \
  |  |   39|    214|                        exif_format_get_name (format),          \
  |  |   40|    214|                        exif_format_get_name (target));         \
  |  |   41|    214|                break;                                          \
  |  |   42|    214|        }                                                       \
  |  |   43|    608|}
  ------------------
  256|    394|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    394|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    394|{                                                                       \
  |  |   47|    394|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 197, False: 197]
  |  |  ------------------
  |  |   48|    197|                snprintf (v, maxlen,                                    \
  |  |   49|    197|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    197|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    197|                break;                                                  \
  |  |   52|    197|        }                                                               \
  |  |   53|    394|}
  ------------------
  257|    197|		vs = exif_get_short (entry->data, entry->order);
  258|    197|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    197|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    197|		break;
  261|    324|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 324, False: 8.86k]
  ------------------
  262|  1.04k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 717, False: 8.46k]
  ------------------
  263|  1.04k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.04k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.04k|{                                                               \
  |  |   35|  1.04k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 326, False: 715]
  |  |  ------------------
  |  |   36|    326|                snprintf (v, maxlen,	                        \
  |  |   37|    326|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    326|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    326|                        "expected '%s'."),                      \
  |  |   39|    326|                        exif_format_get_name (format),          \
  |  |   40|    326|                        exif_format_get_name (target));         \
  |  |   41|    326|                break;                                          \
  |  |   42|    326|        }                                                       \
  |  |   43|  1.04k|}
  ------------------
  264|    715|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    715|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    715|{                                                                       \
  |  |   47|    715|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 78, False: 637]
  |  |  ------------------
  |  |   48|     78|                snprintf (v, maxlen,                                    \
  |  |   49|     78|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     78|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     78|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     78|                break;                                                  \
  |  |   52|     78|        }                                                               \
  |  |   53|    715|}
  ------------------
  265|    637|		vr = exif_get_rational (entry->data, entry->order);
  266|    637|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 227, False: 410]
  ------------------
  267|    410|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    410|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    410|			  vr.denominator);
  269|    410|		break;
  270|       |
  271|  2.45k|	default:
  ------------------
  |  Branch (271:2): [True: 2.45k, False: 6.72k]
  ------------------
  272|  2.45k|		switch (entry->format) {
  273|    230|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 230, False: 2.22k]
  ------------------
  274|    230|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    230|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 96, False: 134]
  |  |  ------------------
  ------------------
  275|    230|		  break;
  276|    206|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 206, False: 2.25k]
  ------------------
  277|    206|		  vs = exif_get_short (entry->data, entry->order);
  278|    206|		  snprintf (val, maxlen, "%hu", vs);
  279|    206|		  break;
  280|    204|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 204, False: 2.25k]
  ------------------
  281|    204|		  vss = exif_get_sshort (entry->data, entry->order);
  282|    204|		  snprintf (val, maxlen, "%hi", vss);
  283|    204|		  break;
  284|    202|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 202, False: 2.25k]
  ------------------
  285|    202|		  vl = exif_get_long (entry->data, entry->order);
  286|    202|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    202|		  break;
  288|    240|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 240, False: 2.21k]
  ------------------
  289|    240|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    240|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    240|		  break;
  292|    465|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 465, False: 1.99k]
  ------------------
  293|    465|		  vr = exif_get_rational (entry->data, entry->order);
  294|    465|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 151, False: 314]
  ------------------
  295|    314|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    314|						    vr.denominator);
  297|    314|		  break;
  298|    533|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 533, False: 1.92k]
  ------------------
  299|    533|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    533|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 237, False: 296]
  ------------------
  301|    296|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    296|			  vsr.denominator);
  303|    296|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.45k]
  ------------------
  305|    378|		default:
  ------------------
  |  Branch (305:3): [True: 378, False: 2.08k]
  ------------------
  306|    378|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    378|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    378| 			  entry->size);
  308|    378|		  break;
  309|  2.45k|		}
  310|  2.45k|		break;
  311|  9.18k|	}
  312|       |
  313|  9.18k|	return (val);
  314|  9.18k|}

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

exif_mnote_data_olympus_identify:
  627|  7.40k|{
  628|  7.40k|	int variant = exif_mnote_data_olympus_identify_variant(e->data, e->size);
  629|       |
  630|  7.40k|	if (variant == nikonV0) {
  ------------------
  |  Branch (630:6): [True: 450, False: 6.95k]
  ------------------
  631|       |		/* This variant needs some extra checking with the Make */
  632|    450|		char value[5];
  633|    450|		ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|    450|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 7, False: 443]
  |  |  ------------------
  |  |  254|    450|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|    450|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 58, False: 385]
  |  |  ------------------
  |  |  256|    443|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|    443|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 385]
  |  |  ------------------
  |  |  258|    385|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|    385|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 385]
  |  |  ------------------
  |  |  260|    385|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    385|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 385]
  |  |  ------------------
  |  |  262|    385|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  634|    450|		variant = unrecognized;
  635|       |
  636|    450|		if (em) {
  ------------------
  |  Branch (636:7): [True: 65, False: 385]
  ------------------
  637|     65|			const char *v = exif_entry_get_value (em, value, sizeof(value));
  638|     65|			if (v && (!strncmp (v, "Nikon", sizeof(value)) || 
  ------------------
  |  Branch (638:8): [True: 65, False: 0]
  |  Branch (638:14): [True: 0, False: 65]
  ------------------
  639|     65|					  !strncmp (v, "NIKON", sizeof(value)) ))
  ------------------
  |  Branch (639:8): [True: 0, False: 65]
  ------------------
  640|       |				/* When saved, this variant will be written out like the
  641|       |				 * alternative nikonV2 form above instead
  642|       |				 */
  643|      0|				variant = nikonV0;
  644|     65|		}
  645|    450|	}
  646|       |
  647|  7.40k|	return variant;
  648|  7.40k|}
exif_mnote_data_olympus_new:
  653|  4.10k|{
  654|  4.10k|	ExifMnoteData *d;
  655|       |
  656|  4.10k|	if (!mem) return NULL;
  ------------------
  |  Branch (656:6): [True: 0, False: 4.10k]
  ------------------
  657|       |	
  658|  4.10k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus));
  659|  4.10k|	if (!d) return NULL;
  ------------------
  |  Branch (659:6): [True: 0, False: 4.10k]
  ------------------
  660|       |
  661|  4.10k|	exif_mnote_data_construct (d, mem);
  662|       |
  663|       |	/* Set up function pointers */
  664|  4.10k|	d->methods.free            = exif_mnote_data_olympus_free;
  665|  4.10k|	d->methods.set_byte_order  = exif_mnote_data_olympus_set_byte_order;
  666|  4.10k|	d->methods.set_offset      = exif_mnote_data_olympus_set_offset;
  667|  4.10k|	d->methods.load            = exif_mnote_data_olympus_load;
  668|  4.10k|	d->methods.save            = exif_mnote_data_olympus_save;
  669|  4.10k|	d->methods.count           = exif_mnote_data_olympus_count;
  670|  4.10k|	d->methods.get_id          = exif_mnote_data_olympus_get_id;
  671|  4.10k|	d->methods.get_name        = exif_mnote_data_olympus_get_name;
  672|  4.10k|	d->methods.get_title       = exif_mnote_data_olympus_get_title;
  673|  4.10k|	d->methods.get_description = exif_mnote_data_olympus_get_description;
  674|  4.10k|	d->methods.get_value       = exif_mnote_data_olympus_get_value;
  675|       |
  676|  4.10k|	return d;
  677|  4.10k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_identify_variant:
  596|  11.4k|{
  597|       |	/* Olympus, Nikon, Sanyo, Epson */
  598|  11.4k|	if (buf_size >= 8) {
  ------------------
  |  Branch (598:6): [True: 11.2k, False: 224]
  ------------------
  599|       |		/* Match the terminating NUL character, too */
  600|  11.2k|		if (!memcmp (buf, "OLYMPUS", 8))
  ------------------
  |  Branch (600:7): [True: 1.05k, False: 10.2k]
  ------------------
  601|  1.05k|			   return olympusV2;
  602|  10.2k|		else if (!memcmp (buf, "OLYMP", 6))
  ------------------
  |  Branch (602:12): [True: 2.47k, False: 7.74k]
  ------------------
  603|  2.47k|			   return olympusV1;
  604|  7.74k|		else if (!memcmp (buf, "SANYO", 6))
  ------------------
  |  Branch (604:12): [True: 2.86k, False: 4.87k]
  ------------------
  605|  2.86k|			   return sanyoV1;
  606|  4.87k|		else if (!memcmp (buf, "EPSON", 6))
  ------------------
  |  Branch (606:12): [True: 1.38k, False: 3.49k]
  ------------------
  607|  1.38k|			   return epsonV1;
  608|  3.49k|		else if (!memcmp (buf, "Nikon", 6)) {
  ------------------
  |  Branch (608:12): [True: 376, False: 3.11k]
  ------------------
  609|    376|			switch (buf[6]) {
  610|    142|				case 1:  return nikonV1;
  ------------------
  |  Branch (610:5): [True: 142, False: 234]
  ------------------
  611|    227|				case 2:  return nikonV2;
  ------------------
  |  Branch (611:5): [True: 227, False: 149]
  ------------------
  612|      7|				default: return 0; /* Unrecognized Nikon variant */
  ------------------
  |  Branch (612:5): [True: 7, False: 369]
  ------------------
  613|    376|			}
  614|    376|		}
  615|  11.2k|	}
  616|       |
  617|       |	/* Another variant of Nikon */
  618|  3.33k|	if ((buf_size >= 2) && (buf[0] == 0x00) && (buf[1] == 0x1b)) {
  ------------------
  |  Branch (618:6): [True: 3.32k, False: 13]
  |  Branch (618:25): [True: 502, False: 2.82k]
  |  Branch (618:45): [True: 464, False: 38]
  ------------------
  619|    464|		return nikonV0;
  620|    464|	}
  621|       |
  622|  2.87k|	return unrecognized;
  623|  3.33k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_free:
   69|  4.10k|{
   70|  4.10k|	if (!n) return;
  ------------------
  |  Branch (70:6): [True: 0, False: 4.10k]
  ------------------
   71|       |
   72|  4.10k|	exif_mnote_data_olympus_clear ((ExifMnoteDataOlympus *) n);
   73|  4.10k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_clear:
   49|  7.96k|{
   50|  7.96k|	ExifMnoteData *d = (ExifMnoteData *) n;
   51|  7.96k|	unsigned int i;
   52|       |
   53|  7.96k|	if (!n) return;
  ------------------
  |  Branch (53:6): [True: 0, False: 7.96k]
  ------------------
   54|       |
   55|  7.96k|	if (n->entries) {
  ------------------
  |  Branch (55:6): [True: 3.86k, False: 4.10k]
  ------------------
   56|  97.2k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (56:15): [True: 93.3k, False: 3.86k]
  ------------------
   57|  93.3k|			if (n->entries[i].data) {
  ------------------
  |  Branch (57:8): [True: 37.2k, False: 56.1k]
  ------------------
   58|  37.2k|				exif_mem_free (d->mem, n->entries[i].data);
   59|  37.2k|				n->entries[i].data = NULL;
   60|  37.2k|			}
   61|  3.86k|		exif_mem_free (d->mem, n->entries);
   62|       |		n->entries = NULL;
   63|  3.86k|		n->count = 0;
   64|  3.86k|	}
   65|  7.96k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_byte_order:
  569|  4.10k|{
  570|  4.10k|	ExifByteOrder o_orig;
  571|  4.10k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  572|  4.10k|	unsigned int i;
  573|       |
  574|  4.10k|	if (!n) return;
  ------------------
  |  Branch (574:6): [True: 0, False: 4.10k]
  ------------------
  575|       |
  576|  4.10k|	o_orig = n->order;
  577|  4.10k|	n->order = o;
  578|  4.10k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (578:14): [True: 0, False: 4.10k]
  ------------------
  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|  4.10k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_offset:
  589|  4.10k|{
  590|  4.10k|	if (n) ((ExifMnoteDataOlympus *) n)->offset = o;
  ------------------
  |  Branch (590:6): [True: 4.10k, False: 0]
  ------------------
  591|  4.10k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_load:
  242|  4.10k|{
  243|  4.10k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en;
  244|  4.10k|	ExifShort c;
  245|  4.10k|	size_t i, tcount, o, o2, datao = 6, base = 0;
  246|       |
  247|  4.10k|	if (!n) return;
  ------------------
  |  Branch (247:6): [True: 0, False: 4.10k]
  ------------------
  248|       |
  249|  4.10k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (249:6): [True: 0, False: 4.10k]
  |  Branch (249:14): [True: 0, False: 4.10k]
  ------------------
  250|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  251|      0|			  "ExifMnoteDataOlympus", "Short MakerNote");
  252|      0|		return;
  253|      0|	}
  254|  4.10k|	o2 = 6 + n->offset; /* Start of interesting data */
  255|  4.10k|	if (CHECKOVERFLOW(o2,buf_size,10)) {
  ------------------
  |  |   40|  4.10k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 4.10k]
  |  |  |  Branch (40:81): [True: 0, False: 4.10k]
  |  |  |  Branch (40:112): [True: 10, False: 4.09k]
  |  |  ------------------
  ------------------
  256|     10|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  257|     10|			  "ExifMnoteDataOlympus", "Short MakerNote");
  258|     10|		return;
  259|     10|	}
  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|  4.09k|	n->version = exif_mnote_data_olympus_identify_variant(buf+o2, buf_size-o2);
  283|  4.09k|	switch (n->version) {
  284|  1.22k|	case olympusV1:
  ------------------
  |  Branch (284:2): [True: 1.22k, False: 2.87k]
  ------------------
  285|  2.65k|	case sanyoV1:
  ------------------
  |  Branch (285:2): [True: 1.42k, False: 2.67k]
  ------------------
  286|  3.32k|	case epsonV1:
  ------------------
  |  Branch (286:2): [True: 671, False: 3.42k]
  ------------------
  287|  3.32k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  288|  3.32k|			"Parsing Olympus/Sanyo/Epson maker note v1...");
  289|       |
  290|       |		/* The number of entries is at position 8. */
  291|  3.32k|		if (buf[o2 + 6] == 1)
  ------------------
  |  Branch (291:7): [True: 130, False: 3.19k]
  ------------------
  292|    130|			n->order = EXIF_BYTE_ORDER_INTEL;
  293|  3.19k|		else if (buf[o2 + 6 + 1] == 1)
  ------------------
  |  Branch (293:12): [True: 29, False: 3.16k]
  ------------------
  294|     29|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  295|  3.32k|		o2 += 8;
  296|  3.32k|		c = exif_get_short (buf + o2, n->order);
  297|  3.32k|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (297:7): [True: 929, False: 2.39k]
  |  Branch (297:24): [True: 740, False: 189]
  ------------------
  298|    740|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (298:8): [True: 704, False: 36]
  ------------------
  299|    704|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  300|    704|			} else {
  301|     36|				n->order = EXIF_BYTE_ORDER_INTEL;
  302|     36|			}
  303|    740|		}
  304|  3.32k|		break;
  305|       |
  306|    528|	case olympusV2:
  ------------------
  |  Branch (306:2): [True: 528, False: 3.56k]
  ------------------
  307|       |		/* Olympus S760, S770 */
  308|    528|		datao = o2;
  309|    528|		o2 += 8;
  310|    528|		if (CHECKOVERFLOW(o2,buf_size,4)) return;
  ------------------
  |  |   40|    528|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 528]
  |  |  |  Branch (40:81): [True: 0, False: 528]
  |  |  |  Branch (40:112): [True: 2, False: 526]
  |  |  ------------------
  ------------------
  311|    526|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  312|    526|			"Parsing Olympus maker note v2 (0x%02x, %02x, %02x, %02x)...",
  313|    526|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  314|       |
  315|    526|		if ((buf[o2] == 'I') && (buf[o2 + 1] == 'I'))
  ------------------
  |  Branch (315:7): [True: 17, False: 509]
  |  Branch (315:27): [True: 5, False: 12]
  ------------------
  316|      5|			n->order = EXIF_BYTE_ORDER_INTEL;
  317|    521|		else if ((buf[o2] == 'M') && (buf[o2 + 1] == 'M'))
  ------------------
  |  Branch (317:12): [True: 13, False: 508]
  |  Branch (317:32): [True: 1, False: 12]
  ------------------
  318|      1|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  319|       |
  320|       |		/* The number of entries is at position 8+4. */
  321|    526|		o2 += 4;
  322|    526|		break;
  323|       |
  324|     69|	case nikonV1:
  ------------------
  |  Branch (324:2): [True: 69, False: 4.02k]
  ------------------
  325|     69|		o2 += 6;
  326|     69|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  327|     69|			"Parsing Nikon maker note v1 (0x%02x, %02x, %02x, "
  328|     69|			"%02x)...",
  329|     69|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  330|       |
  331|       |		/* Skip version number */
  332|     69|		o2 += 1;
  333|       |
  334|       |		/* Skip an unknown byte (00 or 0A). */
  335|     69|		o2 += 1;
  336|       |
  337|     69|		base = MNOTE_NIKON1_TAG_BASE;
  338|       |		/* Fix endianness, if needed */
  339|     69|		c = exif_get_short (buf + o2, n->order);
  340|     69|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (340:7): [True: 14, False: 55]
  |  Branch (340:24): [True: 9, False: 5]
  ------------------
  341|      9|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (341:8): [True: 5, False: 4]
  ------------------
  342|      5|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  343|      5|			} else {
  344|      4|				n->order = EXIF_BYTE_ORDER_INTEL;
  345|      4|			}
  346|      9|		}
  347|     69|		break;
  348|       |
  349|    124|	case nikonV2:
  ------------------
  |  Branch (349:2): [True: 124, False: 3.97k]
  ------------------
  350|    124|		o2 += 6;
  351|    124|		if (CHECKOVERFLOW(o2,buf_size,12)) return;
  ------------------
  |  |   40|    124|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 124]
  |  |  |  Branch (40:81): [True: 0, False: 124]
  |  |  |  Branch (40:112): [True: 1, False: 123]
  |  |  ------------------
  ------------------
  352|    123|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  353|    123|			"Parsing Nikon maker note v2 (0x%02x, %02x, %02x, "
  354|    123|			"%02x, %02x, %02x, %02x, %02x)...",
  355|    123|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3],
  356|    123|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  357|       |
  358|       |		/* Skip version number */
  359|    123|		o2 += 1;
  360|       |
  361|       |		/* Skip an unknown byte (00 or 0A). */
  362|    123|		o2 += 1;
  363|       |
  364|       |		/* Skip 2 unknown bytes (00 00). */
  365|    123|		o2 += 2;
  366|       |
  367|       |		/*
  368|       |		 * Byte order. From here the data offset
  369|       |		 * gets calculated.
  370|       |		 */
  371|    123|		datao = o2;
  372|    123|		if (!strncmp ((char *)&buf[o2], "II", 2))
  ------------------
  |  Branch (372:7): [True: 83, False: 40]
  ------------------
  373|     83|			n->order = EXIF_BYTE_ORDER_INTEL;
  374|     40|		else if (!strncmp ((char *)&buf[o2], "MM", 2))
  ------------------
  |  Branch (374:12): [True: 10, False: 30]
  ------------------
  375|     10|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  376|     30|		else {
  377|     30|			exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  378|     30|				"ExifMnoteDataOlympus", "Unknown "
  379|     30|				"byte order '%c%c'", buf[o2],
  380|     30|				buf[o2 + 1]);
  381|     30|			return;
  382|     30|		}
  383|     93|		o2 += 2;
  384|       |
  385|       |		/* Skip 2 unknown bytes (00 2A). */
  386|     93|		o2 += 2;
  387|       |
  388|       |		/* Go to where the number of entries is. */
  389|     93|		if (CHECKOVERFLOW(o2,buf_size,exif_get_long (buf + o2, n->order))) return;
  ------------------
  |  |   40|     93|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 93]
  |  |  |  Branch (40:81): [True: 52, False: 41]
  |  |  |  Branch (40:112): [True: 20, False: 21]
  |  |  ------------------
  ------------------
  390|     21|		o2 = datao + exif_get_long (buf + o2, n->order);
  391|     21|		break;
  392|       |
  393|     14|	case nikonV0:
  ------------------
  |  Branch (393:2): [True: 14, False: 4.08k]
  ------------------
  394|     14|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  395|     14|			"Parsing Nikon maker note v0 (0x%02x, %02x, %02x, "
  396|     14|			"%02x, %02x, %02x, %02x, %02x)...",
  397|     14|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
  398|     14|			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|     14|		n->order = EXIF_BYTE_ORDER_MOTOROLA;
  401|     14|		break;
  402|       |
  403|     39|	default:
  ------------------
  |  Branch (403:2): [True: 39, False: 4.05k]
  ------------------
  404|     39|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  405|     39|			"Unknown Olympus variant %i.", n->version);
  406|     39|		return;
  407|  4.09k|	}
  408|       |
  409|       |	/* Sanity check the offset */
  410|  3.95k|	if (CHECKOVERFLOW(o2,buf_size,2)) {
  ------------------
  |  |   40|  3.95k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 33, False: 3.92k]
  |  |  |  Branch (40:81): [True: 0, False: 3.92k]
  |  |  |  Branch (40:112): [True: 4, False: 3.91k]
  |  |  ------------------
  ------------------
  411|     37|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  412|     37|			  "ExifMnoteOlympus", "Short MakerNote");
  413|     37|		return;
  414|     37|	}
  415|       |
  416|       |	/* Read the number of tags */
  417|  3.91k|	c = exif_get_short (buf + o2, n->order);
  418|  3.91k|	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.91k|	if (c > 300) {
  ------------------
  |  Branch (422:6): [True: 56, False: 3.86k]
  ------------------
  423|     56|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Too much tags (%d) in Olympus MakerNote", c);
  424|     56|		return;
  425|     56|	}
  426|       |
  427|       |	/* Remove any old entries */
  428|  3.86k|	exif_mnote_data_olympus_clear (n);
  429|       |
  430|       |	/* Reserve enough space for all the possible MakerNote tags */
  431|  3.86k|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c);
  432|  3.86k|	if (!n->entries) {
  ------------------
  |  Branch (432:6): [True: 0, False: 3.86k]
  ------------------
  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.86k|	tcount = 0;
  439|   104k|	for (i = c, o = o2; i; --i, o += 12) {
  ------------------
  |  Branch (439:22): [True: 104k, False: 633]
  ------------------
  440|   104k|		size_t s;
  441|   104k|		memset(&n->entries[tcount], 0, sizeof(MnoteOlympusEntry));
  442|   104k|		if (CHECKOVERFLOW(o, buf_size, 12)) {
  ------------------
  |  |   40|   104k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.84k, False: 102k]
  |  |  |  Branch (40:81): [True: 0, False: 102k]
  |  |  |  Branch (40:112): [True: 1.37k, False: 101k]
  |  |  ------------------
  ------------------
  443|  3.22k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  444|  3.22k|				  "ExifMnoteOlympus", "Short MakerNote");
  445|  3.22k|			break;
  446|  3.22k|		}
  447|       |
  448|   101k|	    n->entries[tcount].tag        = exif_get_short (buf + o, n->order) + base;
  449|   101k|	    n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  450|   101k|	    n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  451|   101k|	    n->entries[tcount].order      = n->order;
  452|       |
  453|   101k|	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  454|   101k|		      "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  455|   101k|		      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|   101k|	    if (exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (465:10): [True: 53.8k, False: 47.3k]
  ------------------
  466|  53.8k|		buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (466:3): [True: 5.60k, False: 48.2k]
  ------------------
  467|   101k|	    ) {
  468|  5.60k|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  469|  5.60k|		continue;
  470|  5.60k|	    }
  471|       |	    /*
  472|       |	     * Size? If bigger than 4 bytes, the actual data is not
  473|       |	     * in the entry but somewhere else (offset).
  474|       |	     */
  475|  95.5k|	    s = exif_format_get_size (n->entries[tcount].format) *
  476|  95.5k|		   			 n->entries[tcount].components;
  477|  95.5k|		n->entries[tcount].size = s;
  478|  95.5k|		if (s) {
  ------------------
  |  Branch (478:7): [True: 39.4k, False: 56.1k]
  ------------------
  479|  39.4k|			size_t dataofs = o + 8;
  480|  39.4k|			if (s > 4) {
  ------------------
  |  Branch (480:8): [True: 20.6k, False: 18.7k]
  ------------------
  481|       |				/* The data in this case is merely a pointer */
  482|  20.6k|				dataofs = exif_get_long (buf + dataofs, n->order) + datao;
  483|       |#ifdef EXIF_OVERCOME_SANYO_OFFSET_BUG
  484|       |				/* Some Sanyo models (e.g. VPC-C5, C40) suffer from a bug when
  485|       |				 * writing the offset for the MNOTE_OLYMPUS_TAG_THUMBNAILIMAGE
  486|       |				 * tag in its MakerNote. The offset is actually the absolute
  487|       |				 * position in the file instead of the position within the IFD.
  488|       |				 */
  489|       |			    if (dataofs > (buf_size - s) && n->version == sanyoV1) {
  490|       |					/* fix pointer */
  491|       |					dataofs -= datao + 6;
  492|       |					exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  493|       |						  "ExifMnoteOlympus",
  494|       |						  "Inconsistent thumbnail tag offset; attempting to recover");
  495|       |			    }
  496|       |#endif
  497|  20.6k|			}
  498|  39.4k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   40|  39.4k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.43k, False: 37.9k]
  |  |  |  Branch (40:81): [True: 0, False: 37.9k]
  |  |  |  Branch (40:112): [True: 722, False: 37.2k]
  |  |  ------------------
  ------------------
  499|  2.15k|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  500|  2.15k|					  "ExifMnoteOlympus",
  501|  2.15k|					  "Tag data past end of buffer (%u > %u)",
  502|  2.15k|					  (unsigned)(dataofs + s), buf_size);
  503|  2.15k|				continue;
  504|  2.15k|			}
  505|       |
  506|  37.2k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  507|  37.2k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (507:8): [True: 0, False: 37.2k]
  ------------------
  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|  37.2k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  512|  37.2k|		}
  513|       |
  514|       |		/* Tag was successfully parsed */
  515|  93.3k|		++tcount;
  516|  93.3k|	}
  517|       |	/* Store the count of successfully parsed tags */
  518|  3.86k|	n->count = tcount;
  519|  3.86k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_count:
  523|  4.10k|{
  524|  4.10k|	return n ? ((ExifMnoteDataOlympus *) n)->count : 0;
  ------------------
  |  Branch (524:9): [True: 4.10k, False: 0]
  ------------------
  525|  4.10k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_name:
  539|  55.0k|{
  540|  55.0k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  541|       |
  542|  55.0k|	if (!n) return NULL;
  ------------------
  |  Branch (542:6): [True: 0, False: 55.0k]
  ------------------
  543|  55.0k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (543:6): [True: 0, False: 55.0k]
  ------------------
  544|  55.0k|	return mnote_olympus_tag_get_name (n->entries[i].tag);
  545|  55.0k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_title:
  549|  53.9k|{
  550|  53.9k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  551|       |	
  552|  53.9k|	if (!n) return NULL;
  ------------------
  |  Branch (552:6): [True: 0, False: 53.9k]
  ------------------
  553|  53.9k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (553:6): [True: 0, False: 53.9k]
  ------------------
  554|  53.9k|        return mnote_olympus_tag_get_title (n->entries[i].tag);
  555|  53.9k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_description:
  559|  53.9k|{
  560|  53.9k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  561|       |	
  562|  53.9k|	if (!n) return NULL;
  ------------------
  |  Branch (562:6): [True: 0, False: 53.9k]
  ------------------
  563|  53.9k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (563:6): [True: 0, False: 53.9k]
  ------------------
  564|  53.9k|        return mnote_olympus_tag_get_description (n->entries[i].tag);
  565|  53.9k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_value:
   77|  53.9k|{
   78|  53.9k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
   79|       |
   80|  53.9k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (80:6): [True: 0, False: 53.9k]
  |  Branch (80:12): [True: 0, False: 53.9k]
  ------------------
   81|  53.9k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (81:6): [True: 0, False: 53.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|  53.9k|	return mnote_olympus_entry_get_value (&n->entries[i], val, maxlen);
   88|  53.9k|}

mnote_olympus_entry_get_value:
  276|  53.9k|{
  277|  53.9k|	char         buf[30];
  278|  53.9k|	ExifLong     vl;
  279|  53.9k|	ExifSLong    vsl;
  280|  53.9k|	ExifShort    vs = 0;
  281|  53.9k|	ExifSShort   vss = 0;
  282|  53.9k|	ExifRational vr, vr2;
  283|  53.9k|	ExifSRational vsr;
  284|  53.9k|	int          i, j;
  285|  53.9k|	double       r, b;
  286|       |
  287|  53.9k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 53.9k]
  ------------------
  288|      0|		return (NULL);
  289|  53.9k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 53.9k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  53.9k|	memset (v, 0, maxlen);
  293|  53.9k|	maxlen--;
  294|       |
  295|  53.9k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 17.8k, False: 36.0k]
  |  Branch (295:24): [True: 3.48k, False: 14.3k]
  ------------------
  296|  3.48k|		return (v);
  297|       |
  298|  50.4k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 14.3k, False: 36.0k]
  |  Branch (298:24): [True: 0, False: 14.3k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  50.4k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    936|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 936, False: 49.4k]
  ------------------
  305|    936|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    936|#define CF(format,target,v,maxlen)                              \
  |  |   36|    936|{                                                               \
  |  |   37|    936|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 254, False: 682]
  |  |  ------------------
  |  |   38|    254|                snprintf (v, maxlen,	                        \
  |  |   39|    254|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    254|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    254|                        "expected '%s'."),                      \
  |  |   41|    254|                        exif_format_get_name (format),          \
  |  |   42|    254|                        exif_format_get_name (target));         \
  |  |   43|    254|                break;                                          \
  |  |   44|    254|        }                                                       \
  |  |   45|    936|}
  ------------------
  306|    682|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    682|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    682|{                                                                       \
  |  |   62|    682|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 199, False: 483]
  |  |  ------------------
  |  |   63|    199|                snprintf (v, maxlen,                                    \
  |  |   64|    199|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    199|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    199|                break;                                                  \
  |  |   67|    199|        }                                                               \
  |  |   68|    682|}
  ------------------
  307|    483|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    483|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 256, False: 227]
  ------------------
  309|    256|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|    256|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 256]
  |  |  ------------------
  ------------------
  310|    256|		} else {
  311|    227|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    227|		}
  313|    483|		break;
  314|    721|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 721, False: 49.6k]
  ------------------
  315|    721|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    721|#define CF(format,target,v,maxlen)                              \
  |  |   36|    721|{                                                               \
  |  |   37|    721|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 264, False: 457]
  |  |  ------------------
  |  |   38|    264|                snprintf (v, maxlen,	                        \
  |  |   39|    264|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    264|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    264|                        "expected '%s'."),                      \
  |  |   41|    264|                        exif_format_get_name (format),          \
  |  |   42|    264|                        exif_format_get_name (target));         \
  |  |   43|    264|                break;                                          \
  |  |   44|    264|        }                                                       \
  |  |   45|    721|}
  ------------------
  316|    457|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    457|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    457|{                                                                       \
  |  |   62|    457|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 200, False: 257]
  |  |  ------------------
  |  |   63|    200|                snprintf (v, maxlen,                                    \
  |  |   64|    200|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    200|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    200|                break;                                                  \
  |  |   67|    200|        }                                                               \
  |  |   68|    457|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|    257|                vs = exif_get_short (entry->data + 2, entry->order);
  319|    257|                snprintf (v, maxlen, "ISO %hd", vs);
  320|    257|                break;
  321|    620|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 620, False: 49.7k]
  ------------------
  322|    620|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    620|#define CF(format,target,v,maxlen)                              \
  |  |   36|    620|{                                                               \
  |  |   37|    620|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 216, False: 404]
  |  |  ------------------
  |  |   38|    216|                snprintf (v, maxlen,	                        \
  |  |   39|    216|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    216|                        "expected '%s'."),                      \
  |  |   41|    216|                        exif_format_get_name (format),          \
  |  |   42|    216|                        exif_format_get_name (target));         \
  |  |   43|    216|                break;                                          \
  |  |   44|    216|        }                                                       \
  |  |   45|    620|}
  ------------------
  323|    404|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    404|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    404|{                                                                       \
  |  |   62|    404|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 204, False: 200]
  |  |  ------------------
  |  |   63|    204|                snprintf (v, maxlen,                                    \
  |  |   64|    204|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    204|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    204|                break;                                                  \
  |  |   67|    204|        }                                                               \
  |  |   68|    404|}
  ------------------
  324|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  325|    200|                vs = exif_get_short (entry->data + 2, entry->order);
  326|    200|                snprintf (v, maxlen, "ISO2 %hd", vs);
  327|    200|                break;
  328|    257|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 257, False: 50.1k]
  ------------------
  329|    486|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 229, False: 50.1k]
  ------------------
  330|    721|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 235, False: 50.1k]
  ------------------
  331|  1.07k|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 356, False: 50.0k]
  ------------------
  332|  1.34k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 267, False: 50.1k]
  ------------------
  333|  1.60k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 257, False: 50.1k]
  ------------------
  334|  1.84k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 248, False: 50.1k]
  ------------------
  335|  1.93k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 85, False: 50.3k]
  ------------------
  336|  2.13k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 203, False: 50.2k]
  ------------------
  337|  2.34k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 204, False: 50.2k]
  ------------------
  338|  2.53k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 196, False: 50.2k]
  ------------------
  339|  2.73k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 199, False: 50.2k]
  ------------------
  340|  2.80k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 66, False: 50.3k]
  ------------------
  341|  2.80k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  2.80k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.80k|{                                                               \
  |  |   37|  2.80k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.04k, False: 753]
  |  |  ------------------
  |  |   38|  2.04k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.04k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.04k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.04k|                        "expected '%s'."),                      \
  |  |   41|  2.04k|                        exif_format_get_name (format),          \
  |  |   42|  2.04k|                        exif_format_get_name (target));         \
  |  |   43|  2.04k|                break;                                          \
  |  |   44|  2.04k|        }                                                       \
  |  |   45|  2.80k|}
  ------------------
  342|    753|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    753|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 206, False: 547]
  |  |  ------------------
  ------------------
  343|    753|		break;
  344|    225|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 225, False: 50.1k]
  ------------------
  345|    456|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 231, False: 50.1k]
  ------------------
  346|    803|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 347, False: 50.0k]
  ------------------
  347|    803|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    803|#define CF(format,target,v,maxlen)                              \
  |  |   36|    803|{                                                               \
  |  |   37|    803|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 358, False: 445]
  |  |  ------------------
  |  |   38|    358|                snprintf (v, maxlen,	                        \
  |  |   39|    358|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    358|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    358|                        "expected '%s'."),                      \
  |  |   41|    358|                        exif_format_get_name (format),          \
  |  |   42|    358|                        exif_format_get_name (target));         \
  |  |   43|    358|                break;                                          \
  |  |   44|    358|        }                                                       \
  |  |   45|    803|}
  ------------------
  348|    445|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    445|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    445|{                                                                       \
  |  |   62|    445|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 218, False: 227]
  |  |  ------------------
  |  |   63|    218|                snprintf (v, maxlen,                                    \
  |  |   64|    218|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    218|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    218|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    218|                break;                                                  \
  |  |   67|    218|        }                                                               \
  |  |   68|    445|}
  ------------------
  349|    227|		vl =  exif_get_long (entry->data, entry->order);
  350|    227|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    227|		break;
  352|    805|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 805, False: 49.6k]
  ------------------
  353|  1.26k|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 460, False: 49.9k]
  ------------------
  354|  1.26k|		unsigned char h,m,l;
  355|  1.26k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  1.26k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.26k|{                                                               \
  |  |   37|  1.26k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 368, False: 897]
  |  |  ------------------
  |  |   38|    368|                snprintf (v, maxlen,	                        \
  |  |   39|    368|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    368|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    368|                        "expected '%s'."),                      \
  |  |   41|    368|                        exif_format_get_name (format),          \
  |  |   42|    368|                        exif_format_get_name (target));         \
  |  |   43|    368|                break;                                          \
  |  |   44|    368|        }                                                       \
  |  |   45|  1.26k|}
  ------------------
  356|    897|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    897|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    897|{                                                                       \
  |  |   62|    897|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 336, False: 561]
  |  |  ------------------
  |  |   63|    336|                snprintf (v, maxlen,                                    \
  |  |   64|    336|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    336|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    336|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    336|                break;                                                  \
  |  |   67|    336|        }                                                               \
  |  |   68|    897|}
  ------------------
  357|    561|		vl =  exif_get_long (entry->data, entry->order);
  358|    561|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    561|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 334, False: 227]
  ------------------
  360|    561|		break;
  361|    897|	}
  362|    242|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 242, False: 50.1k]
  ------------------
  363|    802|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 560, False: 49.8k]
  ------------------
  364|    802|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    802|#define CF(format,target,v,maxlen)                              \
  |  |   36|    802|{                                                               \
  |  |   37|    802|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 287, False: 515]
  |  |  ------------------
  |  |   38|    287|                snprintf (v, maxlen,	                        \
  |  |   39|    287|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    287|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    287|                        "expected '%s'."),                      \
  |  |   41|    287|                        exif_format_get_name (format),          \
  |  |   42|    287|                        exif_format_get_name (target));         \
  |  |   43|    287|                break;                                          \
  |  |   44|    287|        }                                                       \
  |  |   45|    802|}
  ------------------
  365|    515|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    515|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    515|{                                                                       \
  |  |   62|    515|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 287, False: 228]
  |  |  ------------------
  |  |   63|    287|                snprintf (v, maxlen,                                    \
  |  |   64|    287|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    287|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    287|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    287|                break;                                                  \
  |  |   67|    287|        }                                                               \
  |  |   68|    515|}
  ------------------
  366|    228|		vl =  exif_get_long (entry->data, entry->order);
  367|    228|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    228|		break;
  369|    456|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 456, False: 49.9k]
  ------------------
  370|    672|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 216, False: 50.2k]
  ------------------
  371|    743|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 71, False: 50.3k]
  ------------------
  372|    951|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 208, False: 50.2k]
  ------------------
  373|  1.16k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 211, False: 50.2k]
  ------------------
  374|  1.16k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.16k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.16k|{                                                               \
  |  |   37|  1.16k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 620, False: 542]
  |  |  ------------------
  |  |   38|    620|                snprintf (v, maxlen,	                        \
  |  |   39|    620|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    620|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    620|                        "expected '%s'."),                      \
  |  |   41|    620|                        exif_format_get_name (format),          \
  |  |   42|    620|                        exif_format_get_name (target));         \
  |  |   43|    620|                break;                                          \
  |  |   44|    620|        }                                                       \
  |  |   45|  1.16k|}
  ------------------
  375|    542|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    542|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    542|{                                                                       \
  |  |   62|    542|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 212, False: 330]
  |  |  ------------------
  |  |   63|    212|                snprintf (v, maxlen,                                    \
  |  |   64|    212|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    212|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    212|                break;                                                  \
  |  |   67|    212|        }                                                               \
  |  |   68|    542|}
  ------------------
  376|    330|		vs = exif_get_short (entry->data, entry->order);
  377|    330|		snprintf (v, maxlen, "%hd", vs);
  378|    330|		break;
  379|  1.24k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.24k, False: 49.1k]
  ------------------
  380|  1.24k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.24k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.24k|{                                                               \
  |  |   37|  1.24k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 205, False: 1.03k]
  |  |  ------------------
  |  |   38|    205|                snprintf (v, maxlen,	                        \
  |  |   39|    205|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    205|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    205|                        "expected '%s'."),                      \
  |  |   41|    205|                        exif_format_get_name (format),          \
  |  |   42|    205|                        exif_format_get_name (target));         \
  |  |   43|    205|                break;                                          \
  |  |   44|    205|        }                                                       \
  |  |   45|  1.24k|}
  ------------------
  381|  1.03k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.03k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.03k|{                                                                       \
  |  |   62|  1.03k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 234, False: 803]
  |  |  ------------------
  |  |   63|    234|                snprintf (v, maxlen,                                    \
  |  |   64|    234|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    234|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    234|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    234|                break;                                                  \
  |  |   67|    234|        }                                                               \
  |  |   68|  1.03k|}
  ------------------
  382|    803|		vr = exif_get_rational (entry->data, entry->order);
  383|    803|		r = R2D(vr);
  ------------------
  |  |   82|    803|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 570, False: 233]
  |  |  ------------------
  ------------------
  384|    803|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    803|		b = R2D(vr);
  ------------------
  |  |   82|    803|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 552, False: 251]
  |  |  ------------------
  ------------------
  386|    803|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    803|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    803|		break;
  388|  1.04k|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 1.04k, False: 49.3k]
  ------------------
  389|  1.04k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.04k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.04k|{                                                               \
  |  |   37|  1.04k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 285, False: 759]
  |  |  ------------------
  |  |   38|    285|                snprintf (v, maxlen,	                        \
  |  |   39|    285|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    285|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    285|                        "expected '%s'."),                      \
  |  |   41|    285|                        exif_format_get_name (format),          \
  |  |   42|    285|                        exif_format_get_name (target));         \
  |  |   43|    285|                break;                                          \
  |  |   44|    285|        }                                                       \
  |  |   45|  1.04k|}
  ------------------
  390|    759|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    759|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    759|{                                                                       \
  |  |   62|    759|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 199, False: 560]
  |  |  ------------------
  |  |   63|    199|                snprintf (v, maxlen,                                    \
  |  |   64|    199|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    199|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    199|                break;                                                  \
  |  |   67|    199|        }                                                               \
  |  |   68|    759|}
  ------------------
  391|    560|		vr = exif_get_rational (entry->data, entry->order);
  392|    560|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 197, False: 363]
  |  Branch (392:24): [True: 71, False: 292]
  ------------------
  393|    268|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    268|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    292|		} else {
  395|    292|			r = R2D(vr);
  ------------------
  |  |   82|    292|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 292, False: 0]
  |  |  ------------------
  ------------------
  396|    292|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    292|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    292|		}
  398|    560|		break;
  399|  1.76k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 1.76k, False: 48.6k]
  ------------------
  400|  1.76k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.76k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.76k|{                                                               \
  |  |   37|  1.76k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 258, False: 1.50k]
  |  |  ------------------
  |  |   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|  1.76k|}
  ------------------
  401|  1.50k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.50k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.50k|{                                                                       \
  |  |   62|  1.50k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 272, False: 1.23k]
  |  |  ------------------
  |  |   63|    272|                snprintf (v, maxlen,                                    \
  |  |   64|    272|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    272|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    272|                break;                                                  \
  |  |   67|    272|        }                                                               \
  |  |   68|  1.50k|}
  ------------------
  402|  1.23k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.23k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.23k|		r = R2D(vr);
  ------------------
  |  |   82|  1.23k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 990, False: 244]
  |  |  ------------------
  ------------------
  405|  1.23k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.23k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 985, False: 249]
  |  |  ------------------
  ------------------
  406|  1.23k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.23k|		break;
  408|  1.07k|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 1.07k, False: 49.3k]
  ------------------
  409|  1.07k|		CF2 (entry->format, EXIF_FORMAT_BYTE, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   47|  1.07k|#define CF2(format,target1,target2,v,maxlen)                    \
  |  |   48|  1.07k|{                                                               \
  |  |   49|  1.07k|        if ((format != target1) && (format != target2)) {       \
  |  |  ------------------
  |  |  |  Branch (49:13): [True: 591, False: 487]
  |  |  |  Branch (49:36): [True: 243, False: 348]
  |  |  ------------------
  |  |   50|    243|                snprintf (v, maxlen,	                        \
  |  |   51|    243|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    243|                        "expected '%s' or '%s'."),              \
  |  |   53|    243|                        exif_format_get_name (format),          \
  |  |   54|    243|                        exif_format_get_name (target1),         \
  |  |   55|    243|                        exif_format_get_name (target2));        \
  |  |   56|    243|                break;                                          \
  |  |   57|    243|        }                                                       \
  |  |   58|  1.07k|}
  ------------------
  410|    835|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    835|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    835|{                                                                       \
  |  |   62|    835|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 241, False: 594]
  |  |  ------------------
  |  |   63|    241|                snprintf (v, maxlen,                                    \
  |  |   64|    241|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    241|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    241|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    241|                break;                                                  \
  |  |   67|    241|        }                                                               \
  |  |   68|    835|}
  ------------------
  411|    594|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 237, False: 357]
  ------------------
  412|    237|			vs = exif_get_short (entry->data, entry->order);
  413|    357|		} else {
  414|    357|			vs = entry->data[0];
  415|    357|		}
  416|    594|		snprintf (v, maxlen, "%hd", vs);
  417|    594|		break;
  418|  2.97k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.97k, False: 47.4k]
  ------------------
  419|  2.97k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.97k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.97k|{                                                               \
  |  |   37|  2.97k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 222, False: 2.75k]
  |  |  ------------------
  |  |   38|    222|                snprintf (v, maxlen,	                        \
  |  |   39|    222|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    222|                        "expected '%s'."),                      \
  |  |   41|    222|                        exif_format_get_name (format),          \
  |  |   42|    222|                        exif_format_get_name (target));         \
  |  |   43|    222|                break;                                          \
  |  |   44|    222|        }                                                       \
  |  |   45|  2.97k|}
  ------------------
  420|  2.75k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.75k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.75k|{                                                                       \
  |  |   62|  2.75k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 287, False: 2.46k]
  |  |  ------------------
  |  |   63|    287|                snprintf (v, maxlen,                                    \
  |  |   64|    287|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    287|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    287|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    287|                break;                                                  \
  |  |   67|    287|        }                                                               \
  |  |   68|  2.75k|}
  ------------------
  421|  2.46k|		switch (  *( entry->data+1)  ) {
  422|    256|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    256|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 256, False: 2.20k]
  ------------------
  423|    196|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 196, False: 2.26k]
  ------------------
  424|    210|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 210, False: 2.25k]
  ------------------
  425|    336|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    336|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 336, False: 2.12k]
  ------------------
  426|    196|		  	case  4: strncpy (v, _("AF position: right"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (426:6): [True: 196, False: 2.26k]
  ------------------
  427|    196|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 196, False: 2.26k]
  ------------------
  428|    146|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    146|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 146, False: 2.31k]
  ------------------
  429|    197|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 197, False: 2.26k]
  ------------------
  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.39k]
  ------------------
  431|    206|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 206, False: 2.25k]
  ------------------
  432|    194|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 194, False: 2.27k]
  ------------------
  433|    266|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    266|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 266, False: 2.19k]
  ------------------
  434|  2.46k|		}     
  435|  2.46k|		break;
  436|  2.46k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.29k, False: 49.1k]
  ------------------
  437|  1.29k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.29k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.29k|{                                                               \
  |  |   37|  1.29k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 222, False: 1.07k]
  |  |  ------------------
  |  |   38|    222|                snprintf (v, maxlen,	                        \
  |  |   39|    222|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    222|                        "expected '%s'."),                      \
  |  |   41|    222|                        exif_format_get_name (format),          \
  |  |   42|    222|                        exif_format_get_name (target));         \
  |  |   43|    222|                break;                                          \
  |  |   44|    222|        }                                                       \
  |  |   45|  1.29k|}
  ------------------
  438|  1.07k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.07k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.07k|{                                                                       \
  |  |   62|  1.07k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 196, False: 876]
  |  |  ------------------
  |  |   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|  1.07k|}
  ------------------
  439|    876|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  12.2k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 12.2k, False: 0]
  |  Branch (441:32): [True: 11.3k, False: 876]
  ------------------
  442|  11.3k|			;
  443|    876|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 876]
  ------------------
  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|    876|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|    876|#define CF(format,target,v,maxlen)                              \
  |  |   36|    876|{                                                               \
  |  |   37|    876|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 876]
  |  |  ------------------
  |  |   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|    876|}
  ------------------
  448|       |		/* find the value */
  449|  2.48k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.23k, False: 251]
  ------------------
  450|  2.23k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.60k, False: 625]
  ------------------
  451|    876|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 255, False: 621]
  ------------------
  452|    255|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    255|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    255|			break;
  454|    255|		}
  455|    621|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    621|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    621|		break;
  457|  1.21k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.21k, False: 49.2k]
  ------------------
  458|  1.21k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 957, False: 262]
  ------------------
  459|    957|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    957|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    957|{                                                                       \
  |  |   62|    957|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 167, False: 790]
  |  |  ------------------
  |  |   63|    167|                snprintf (v, maxlen,                                    \
  |  |   64|    167|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    167|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    167|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    167|                break;                                                  \
  |  |   67|    167|        }                                                               \
  |  |   68|    957|}
  ------------------
  460|    790|			vr = exif_get_rational (entry->data, entry->order);
  461|    790|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 200, False: 590]
  |  Branch (461:25): [True: 232, False: 358]
  ------------------
  462|    432|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    432|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    432|			} else {
  464|    358|				r = R2D(vr);
  ------------------
  |  |   82|    358|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 358, False: 0]
  |  |  ------------------
  ------------------
  465|    358|				snprintf (v, maxlen, "%2.2f", r);
  466|    358|			}
  467|    790|			break;
  468|    957|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    475|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 213, False: 50.2k]
  ------------------
  472|    707|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 232, False: 50.1k]
  ------------------
  473|    923|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 216, False: 50.2k]
  ------------------
  474|  1.22k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 300, False: 50.1k]
  ------------------
  475|  1.46k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 240, False: 50.1k]
  ------------------
  476|  1.66k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 199, False: 50.2k]
  ------------------
  477|  1.89k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 229, False: 50.1k]
  ------------------
  478|  2.08k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 197, False: 50.2k]
  ------------------
  479|  2.31k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 224, False: 50.1k]
  ------------------
  480|  2.53k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 221, False: 50.1k]
  ------------------
  481|  2.80k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 275, False: 50.1k]
  ------------------
  482|  3.01k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 211, False: 50.2k]
  ------------------
  483|  3.22k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 205, False: 50.2k]
  ------------------
  484|  3.42k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 200, False: 50.2k]
  ------------------
  485|  3.79k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 373, False: 50.0k]
  ------------------
  486|  4.00k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 203, False: 50.2k]
  ------------------
  487|  4.24k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 249, False: 50.1k]
  ------------------
  488|  4.63k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 382, False: 50.0k]
  ------------------
  489|  4.99k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 362, False: 50.0k]
  ------------------
  490|  5.19k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 197, False: 50.2k]
  ------------------
  491|  5.64k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 457, False: 49.9k]
  ------------------
  492|  5.84k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 198, False: 50.2k]
  ------------------
  493|  6.21k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 372, False: 50.0k]
  ------------------
  494|  6.44k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 223, False: 50.1k]
  ------------------
  495|  6.64k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 206, False: 50.2k]
  ------------------
  496|  6.84k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 199, False: 50.2k]
  ------------------
  497|  7.06k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 216, False: 50.2k]
  ------------------
  498|  7.06k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  7.06k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  7.06k|{                                                                       \
  |  |   62|  7.06k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.78k, False: 4.27k]
  |  |  ------------------
  |  |   63|  2.78k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.78k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.78k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.78k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.78k|                break;                                                  \
  |  |   67|  2.78k|        }                                                               \
  |  |   68|  7.06k|}
  ------------------
  499|  4.27k|		switch (entry->format) {
  500|    715|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 715, False: 3.56k]
  ------------------
  501|  1.24k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 527, False: 3.75k]
  ------------------
  502|  1.24k|			vs = entry->data[0];
  503|  1.24k|			break;
  504|  2.10k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 2.10k, False: 2.16k]
  ------------------
  505|  2.10k|			vs = exif_get_short(entry->data, entry->order);
  506|  2.10k|			break;
  507|    927|		default:
  ------------------
  |  Branch (507:3): [True: 927, False: 3.35k]
  ------------------
  508|    927|			vs = 0;
  509|    927|			break;
  510|  4.27k|		}
  511|       |		/* search for the tag */
  512|  75.2k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 75.1k, False: 78]
  |  Branch (512:32): [True: 70.9k, False: 4.19k]
  ------------------
  513|  70.9k|			;
  514|  4.27k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 78, False: 4.19k]
  ------------------
  515|     78|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|     78|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|     78|		  	break;
  517|     78|		}
  518|  4.19k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  4.19k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  4.19k|{                                                               \
  |  |   37|  4.19k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 1.82k, False: 2.37k]
  |  |  ------------------
  |  |   38|  1.82k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.82k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.82k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.82k|                        "expected '%s'."),                      \
  |  |   41|  1.82k|                        exif_format_get_name (format),          \
  |  |   42|  1.82k|                        exif_format_get_name (target));         \
  |  |   43|  1.82k|                break;                                          \
  |  |   44|  1.82k|        }                                                       \
  |  |   45|  4.19k|}
  ------------------
  519|       |		/* find the value */
  520|  8.16k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 7.02k, False: 1.14k]
  ------------------
  521|  7.02k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 5.78k, False: 1.23k]
  ------------------
  522|  2.37k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.18k, False: 1.19k]
  ------------------
  523|  1.18k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.18k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.18k|			break;
  525|  1.18k|		}
  526|  1.19k|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|  1.19k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|  1.19k|		break;
  528|    203|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 203, False: 50.2k]
  ------------------
  529|    423|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 220, False: 50.1k]
  ------------------
  530|    731|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 308, False: 50.1k]
  ------------------
  531|  1.08k|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 354, False: 50.0k]
  ------------------
  532|  1.28k|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 203, False: 50.2k]
  ------------------
  533|  1.54k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 253, False: 50.1k]
  ------------------
  534|  1.74k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 207, False: 50.2k]
  ------------------
  535|  1.94k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 201, False: 50.2k]
  ------------------
  536|  2.36k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 413, False: 50.0k]
  ------------------
  537|  2.36k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.36k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.36k|{                                                               \
  |  |   37|  2.36k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 592, False: 1.77k]
  |  |  ------------------
  |  |   38|    592|                snprintf (v, maxlen,	                        \
  |  |   39|    592|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    592|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    592|                        "expected '%s'."),                      \
  |  |   41|    592|                        exif_format_get_name (format),          \
  |  |   42|    592|                        exif_format_get_name (target));         \
  |  |   43|    592|                break;                                          \
  |  |   44|    592|        }                                                       \
  |  |   45|  2.36k|}
  ------------------
  538|  1.77k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.77k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.77k|{                                                                       \
  |  |   62|  1.77k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 622, False: 1.14k]
  |  |  ------------------
  |  |   63|    622|                snprintf (v, maxlen,                                    \
  |  |   64|    622|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    622|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    622|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    622|                break;                                                  \
  |  |   67|    622|        }                                                               \
  |  |   68|  1.77k|}
  ------------------
  539|  1.14k|		vs = exif_get_short (entry->data, entry->order);
  540|  1.14k|		switch (vs) {
  541|    333|		case 0:
  ------------------
  |  Branch (541:3): [True: 333, False: 815]
  ------------------
  542|    333|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    333|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    333|			break;
  544|    329|		case 1:
  ------------------
  |  Branch (544:3): [True: 329, False: 819]
  ------------------
  545|    329|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    329|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|    329|			break;
  547|    486|		default:
  ------------------
  |  Branch (547:3): [True: 486, False: 662]
  ------------------
  548|    486|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    486|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    486|			strncat (v, buf, maxlen - strlen (v));
  550|    486|			break;
  551|  1.14k|		}
  552|  1.14k|		break;
  553|  1.28k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.28k, False: 49.1k]
  ------------------
  554|  1.28k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.28k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.28k|{                                                               \
  |  |   37|  1.28k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 222, False: 1.06k]
  |  |  ------------------
  |  |   38|    222|                snprintf (v, maxlen,	                        \
  |  |   39|    222|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    222|                        "expected '%s'."),                      \
  |  |   41|    222|                        exif_format_get_name (format),          \
  |  |   42|    222|                        exif_format_get_name (target));         \
  |  |   43|    222|                break;                                          \
  |  |   44|    222|        }                                                       \
  |  |   45|  1.28k|}
  ------------------
  555|  1.06k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.06k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.06k|{                                                                       \
  |  |   62|  1.06k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 206, False: 861]
  |  |  ------------------
  |  |   63|    206|                snprintf (v, maxlen,                                    \
  |  |   64|    206|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    206|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    206|                break;                                                  \
  |  |   67|    206|        }                                                               \
  |  |   68|  1.06k|}
  ------------------
  556|    861|		vs = exif_get_short (entry->data, entry->order);
  557|    861|		switch (vs) {
  558|    219|		case 0:
  ------------------
  |  Branch (558:3): [True: 219, False: 642]
  ------------------
  559|    219|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    219|			break;
  561|    201|		case 1:
  ------------------
  |  Branch (561:3): [True: 201, False: 660]
  ------------------
  562|    201|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|    201|			break;
  564|    202|		case 2:
  ------------------
  |  Branch (564:3): [True: 202, False: 659]
  ------------------
  565|    202|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|    202|			break;
  567|    239|		default:
  ------------------
  |  Branch (567:3): [True: 239, False: 622]
  ------------------
  568|    239|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    239|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    239|			strncat (v, buf, maxlen - strlen (v));
  570|    239|			break;
  571|    861|		}
  572|    861|		break;
  573|  1.79k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.79k, False: 48.6k]
  ------------------
  574|  1.79k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.79k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.79k|{                                                               \
  |  |   37|  1.79k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 97, False: 1.69k]
  |  |  ------------------
  |  |   38|     97|                snprintf (v, maxlen,	                        \
  |  |   39|     97|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     97|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     97|                        "expected '%s'."),                      \
  |  |   41|     97|                        exif_format_get_name (format),          \
  |  |   42|     97|                        exif_format_get_name (target));         \
  |  |   43|     97|                break;                                          \
  |  |   44|     97|        }                                                       \
  |  |   45|  1.79k|}
  ------------------
  575|  1.69k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.69k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.69k|{                                                                       \
  |  |   62|  1.69k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 229, False: 1.46k]
  |  |  ------------------
  |  |   63|    229|                snprintf (v, maxlen,                                    \
  |  |   64|    229|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    229|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    229|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    229|                break;                                                  \
  |  |   67|    229|        }                                                               \
  |  |   68|  1.69k|}
  ------------------
  576|  1.46k|		{
  577|  1.46k|			double ao,ac;
  578|  1.46k|			unsigned long fs,fl;
  579|  1.46k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.46k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.46k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 1.22k, False: 243]
  |  |  ------------------
  ------------------
  581|  1.46k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.46k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.46k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 954, False: 510]
  |  |  ------------------
  ------------------
  583|  1.46k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.46k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.46k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.19k, False: 273]
  |  |  ------------------
  ------------------
  585|  1.46k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.46k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.46k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.20k, False: 261]
  |  |  ------------------
  ------------------
  587|  1.46k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.46k|		}
  589|  1.46k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.20k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.20k, False: 48.2k]
  ------------------
  593|  2.20k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.20k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.20k|{                                                               \
  |  |   37|  2.20k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 256, False: 1.95k]
  |  |  ------------------
  |  |   38|    256|                snprintf (v, maxlen,	                        \
  |  |   39|    256|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    256|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    256|                        "expected '%s'."),                      \
  |  |   41|    256|                        exif_format_get_name (format),          \
  |  |   42|    256|                        exif_format_get_name (target));         \
  |  |   43|    256|                break;                                          \
  |  |   44|    256|        }                                                       \
  |  |   45|  2.20k|}
  ------------------
  594|  1.95k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  1.95k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.95k|{                                                                       \
  |  |   62|  1.95k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 237, False: 1.71k]
  |  |  ------------------
  |  |   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|  1.95k|}
  ------------------
  595|  1.71k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.71k|		switch (vl) {
  597|    195|		case 0:
  ------------------
  |  Branch (597:3): [True: 195, False: 1.51k]
  ------------------
  598|    195|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    195|			break;
  600|    236|		case 1:
  ------------------
  |  Branch (600:3): [True: 236, False: 1.47k]
  ------------------
  601|    236|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    236|			break;
  603|    195|		case 2:
  ------------------
  |  Branch (603:3): [True: 195, False: 1.51k]
  ------------------
  604|    195|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    195|			break;
  606|    293|		case 3:
  ------------------
  |  Branch (606:3): [True: 293, False: 1.42k]
  ------------------
  607|    293|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    293|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    293|			break;
  609|    794|		default:
  ------------------
  |  Branch (609:3): [True: 794, False: 919]
  ------------------
  610|    794|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.71k|		}
  612|  1.71k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.71k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.71k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.71k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.71k|		switch (vl) {
  617|    202|		case 1:
  ------------------
  |  Branch (617:3): [True: 202, False: 1.51k]
  ------------------
  618|    202|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    202|			break;
  620|    194|		case 2:
  ------------------
  |  Branch (620:3): [True: 194, False: 1.51k]
  ------------------
  621|    194|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    194|			break;
  623|    212|		case 3:
  ------------------
  |  Branch (623:3): [True: 212, False: 1.50k]
  ------------------
  624|    212|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    212|			break;
  626|    196|		case 4:
  ------------------
  |  Branch (626:3): [True: 196, False: 1.51k]
  ------------------
  627|    196|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|    196|			break;
  629|    909|		default:
  ------------------
  |  Branch (629:3): [True: 909, False: 804]
  ------------------
  630|    909|			snprintf (buf, sizeof (buf), "%li",
  631|    909|				  (long int) vl);
  632|    909|			strncat (v, buf, maxlen - strlen (v));
  633|  1.71k|		}
  634|  1.71k|		break;
  635|  1.71k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.54k, False: 48.8k]
  ------------------
  636|  1.54k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 408, False: 1.14k]
  ------------------
  637|       |			/* Epson uses a single SHORT here */
  638|    408|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    408|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    408|{                                                                       \
  |  |   62|    408|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 201, False: 207]
  |  |  ------------------
  |  |   63|    201|                snprintf (v, maxlen,                                    \
  |  |   64|    201|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    201|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    201|                break;                                                  \
  |  |   67|    201|        }                                                               \
  |  |   68|    408|}
  ------------------
  639|    207|			vs = exif_get_short (entry->data, entry->order);
  640|    207|			sprintf (buf, "%hu", vs);
  641|    207|			strncat (v, buf, maxlen - strlen (v));
  642|  1.14k|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|  1.14k|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.14k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.14k|{                                                                       \
  |  |   62|  1.14k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 234, False: 906]
  |  |  ------------------
  |  |   63|    234|                snprintf (v, maxlen,                                    \
  |  |   64|    234|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    234|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    234|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    234|                break;                                                  \
  |  |   67|    234|        }                                                               \
  |  |   68|  1.14k|}
  ------------------
  645|    906|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    906|#define CF(format,target,v,maxlen)                              \
  |  |   36|    906|{                                                               \
  |  |   37|    906|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 198, False: 708]
  |  |  ------------------
  |  |   38|    198|                snprintf (v, maxlen,	                        \
  |  |   39|    198|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    198|                        "expected '%s'."),                      \
  |  |   41|    198|                        exif_format_get_name (format),          \
  |  |   42|    198|                        exif_format_get_name (target));         \
  |  |   43|    198|                break;                                          \
  |  |   44|    198|        }                                                       \
  |  |   45|    906|}
  ------------------
  646|  4.95k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 4.24k, False: 708]
  ------------------
  647|  4.24k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  4.24k|				sprintf (buf, "%hd ", vss);
  649|  4.24k|				strncat (v, buf, maxlen - strlen (v));
  650|  4.24k|			}
  651|    708|		}
  652|    915|		break;
  653|  1.20k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.20k, False: 49.2k]
  ------------------
  654|  1.20k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.20k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.20k|{                                                               \
  |  |   37|  1.20k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 197, False: 1.01k]
  |  |  ------------------
  |  |   38|    197|                snprintf (v, maxlen,	                        \
  |  |   39|    197|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    197|                        "expected '%s'."),                      \
  |  |   41|    197|                        exif_format_get_name (format),          \
  |  |   42|    197|                        exif_format_get_name (target));         \
  |  |   43|    197|                break;                                          \
  |  |   44|    197|        }                                                       \
  |  |   45|  1.20k|}
  ------------------
  655|  1.01k|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.01k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.01k|{                                                                       \
  |  |   62|  1.01k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 228, False: 784]
  |  |  ------------------
  |  |   63|    228|                snprintf (v, maxlen,                                    \
  |  |   64|    228|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    228|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    228|                break;                                                  \
  |  |   67|    228|        }                                                               \
  |  |   68|  1.01k|}
  ------------------
  656|  5.48k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 4.70k, False: 784]
  ------------------
  657|  4.70k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  4.70k|			sprintf (buf, "%hu ", vs);
  659|  4.70k|			strncat (v, buf, maxlen - strlen (v));
  660|  4.70k|		}
  661|    784|		break;
  662|    815|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 815, False: 49.6k]
  ------------------
  663|    815|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    815|#define CF(format,target,v,maxlen)                              \
  |  |   36|    815|{                                                               \
  |  |   37|    815|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 217, False: 598]
  |  |  ------------------
  |  |   38|    217|                snprintf (v, maxlen,	                        \
  |  |   39|    217|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    217|                        "expected '%s'."),                      \
  |  |   41|    217|                        exif_format_get_name (format),          \
  |  |   42|    217|                        exif_format_get_name (target));         \
  |  |   43|    217|                break;                                          \
  |  |   44|    217|        }                                                       \
  |  |   45|    815|}
  ------------------
  664|    598|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    598|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    598|{                                                                       \
  |  |   72|    598|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 92, False: 506]
  |  |  |  Branch (72:23): [True: 259, False: 247]
  |  |  ------------------
  |  |   73|    351|		snprintf (v, maxlen,                                    \
  |  |   74|    351|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    351|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    351|			"expected %i or %i)."), (int) number,		\
  |  |   76|    351|			(int) t1, (int) t2);  				\
  |  |   77|    351|		break;                                                  \
  |  |   78|    351|	}                                                               \
  |  |   79|    598|}
  ------------------
  665|    247|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    247|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 247]
  |  |  ------------------
  ------------------
  666|    247|		break;
  667|    722|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 722, False: 49.6k]
  ------------------
  668|    722|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    722|#define CF(format,target,v,maxlen)                              \
  |  |   36|    722|{                                                               \
  |  |   37|    722|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 204, False: 518]
  |  |  ------------------
  |  |   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|    722|}
  ------------------
  669|    518|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    518|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 276, False: 242]
  |  |  ------------------
  ------------------
  670|    518|		break;
  671|  1.06k|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 1.06k, False: 49.3k]
  ------------------
  672|  1.06k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  1.06k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.06k|{                                                               \
  |  |   37|  1.06k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 223, False: 837]
  |  |  ------------------
  |  |   38|    223|                snprintf (v, maxlen,	                        \
  |  |   39|    223|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    223|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    223|                        "expected '%s'."),                      \
  |  |   41|    223|                        exif_format_get_name (format),          \
  |  |   42|    223|                        exif_format_get_name (target));         \
  |  |   43|    223|                break;                                          \
  |  |   44|    223|        }                                                       \
  |  |   45|  1.06k|}
  ------------------
  673|    837|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    837|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    837|{                                                                       \
  |  |   72|    837|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 96, False: 741]
  |  |  |  Branch (72:23): [True: 386, False: 355]
  |  |  ------------------
  |  |   73|    482|		snprintf (v, maxlen,                                    \
  |  |   74|    482|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    482|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    482|			"expected %i or %i)."), (int) number,		\
  |  |   76|    482|			(int) t1, (int) t2);  				\
  |  |   77|    482|		break;                                                  \
  |  |   78|    482|	}                                                               \
  |  |   79|    837|}
  ------------------
  674|    355|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    355|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 355]
  |  |  ------------------
  ------------------
  675|    355|		break;
  676|    650|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 650, False: 49.7k]
  ------------------
  677|    650|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    650|#define CF(format,target,v,maxlen)                              \
  |  |   36|    650|{                                                               \
  |  |   37|    650|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 236, False: 414]
  |  |  ------------------
  |  |   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|    650|}
  ------------------
  678|    414|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    414|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    414|{                                                                       \
  |  |   62|    414|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 220, False: 194]
  |  |  ------------------
  |  |   63|    220|                snprintf (v, maxlen,                                    \
  |  |   64|    220|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    220|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    220|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    220|                break;                                                  \
  |  |   67|    220|        }                                                               \
  |  |   68|    414|}
  ------------------
  679|    194|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    194|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 194]
  |  |  ------------------
  ------------------
  680|    194|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 50.4k]
  ------------------
  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.16k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.16k, False: 49.2k]
  ------------------
  691|  1.16k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.16k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.16k|{                                                               \
  |  |   37|  1.16k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 75, False: 1.09k]
  |  |  ------------------
  |  |   38|     75|                snprintf (v, maxlen,	                        \
  |  |   39|     75|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     75|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     75|                        "expected '%s'."),                      \
  |  |   41|     75|                        exif_format_get_name (format),          \
  |  |   42|     75|                        exif_format_get_name (target));         \
  |  |   43|     75|                break;                                          \
  |  |   44|     75|        }                                                       \
  |  |   45|  1.16k|}
  ------------------
  692|  1.09k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.09k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.09k|{                                                                       \
  |  |   62|  1.09k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 273, False: 820]
  |  |  ------------------
  |  |   63|    273|                snprintf (v, maxlen,                                    \
  |  |   64|    273|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    273|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    273|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    273|                break;                                                  \
  |  |   67|    273|        }                                                               \
  |  |   68|  1.09k|}
  ------------------
  693|    820|		vr = exif_get_rational (entry->data, entry->order);
  694|    820|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 204, False: 616]
  |  Branch (694:24): [True: 230, False: 386]
  ------------------
  695|    434|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    434|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    434|		}
  697|    386|		else {
  698|    386|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    386|			snprintf (v, maxlen, "%li mm", tmp);
  700|    386|		}
  701|    820|		break;
  702|  2.07k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.07k, False: 48.3k]
  ------------------
  703|  2.07k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.07k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.07k|{                                                               \
  |  |   37|  2.07k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 220, False: 1.85k]
  |  |  ------------------
  |  |   38|    220|                snprintf (v, maxlen,	                        \
  |  |   39|    220|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    220|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    220|                        "expected '%s'."),                      \
  |  |   41|    220|                        exif_format_get_name (format),          \
  |  |   42|    220|                        exif_format_get_name (target));         \
  |  |   43|    220|                break;                                          \
  |  |   44|    220|        }                                                       \
  |  |   45|  2.07k|}
  ------------------
  704|  1.85k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.85k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.85k|{                                                                       \
  |  |   62|  1.85k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 216, False: 1.63k]
  |  |  ------------------
  |  |   63|    216|                snprintf (v, maxlen,                                    \
  |  |   64|    216|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    216|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    216|                break;                                                  \
  |  |   67|    216|        }                                                               \
  |  |   68|  1.85k|}
  ------------------
  705|  1.63k|		vs = exif_get_short (entry->data, entry->order);
  706|  1.63k|		switch (vs) {
  707|    204|		case 1:
  ------------------
  |  Branch (707:3): [True: 204, False: 1.43k]
  ------------------
  708|    204|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    204|			break;
  710|  1.02k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.02k, False: 610]
  ------------------
  711|  1.02k|			{
  712|  1.02k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.02k|				unsigned long colorTemp = 0;
  714|  1.02k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 951, False: 74]
  ------------------
  715|    194|				case 2:
  ------------------
  |  Branch (715:5): [True: 194, False: 831]
  ------------------
  716|    194|					colorTemp = 3000;
  717|    194|					break;
  718|     18|				case 3:
  ------------------
  |  Branch (718:5): [True: 18, False: 1.00k]
  ------------------
  719|     18|					colorTemp = 3700;
  720|     18|					break;
  721|    218|				case 4:
  ------------------
  |  Branch (721:5): [True: 218, False: 807]
  ------------------
  722|    218|					colorTemp = 4000;
  723|    218|					break;
  724|     66|				case 5:
  ------------------
  |  Branch (724:5): [True: 66, False: 959]
  ------------------
  725|     66|					colorTemp = 4500;
  726|     66|					break;
  727|    195|				case 6:
  ------------------
  |  Branch (727:5): [True: 195, False: 830]
  ------------------
  728|    195|					colorTemp = 5500;
  729|    195|					break;
  730|     66|				case 7:
  ------------------
  |  Branch (730:5): [True: 66, False: 959]
  ------------------
  731|     66|					colorTemp = 6500;
  732|     66|					break;
  733|    194|				case 9:
  ------------------
  |  Branch (733:5): [True: 194, False: 831]
  ------------------
  734|    194|					colorTemp = 7500;
  735|    194|					break;
  736|  1.02k|				}
  737|  1.02k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 951, False: 74]
  ------------------
  738|    951|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|    951|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|    951|				}
  740|     74|				else {
  741|     74|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|     74|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|     74|				}
  743|       |
  744|  1.02k|			}
  745|      0|			break;
  746|    194|		case 3:
  ------------------
  |  Branch (746:3): [True: 194, False: 1.44k]
  ------------------
  747|    194|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    194|			break;
  749|    212|		default:
  ------------------
  |  Branch (749:3): [True: 212, False: 1.42k]
  ------------------
  750|    212|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    212|			break;
  752|  1.63k|		}
  753|  1.63k|		break;
  754|  1.63k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 224, False: 50.1k]
  ------------------
  755|    702|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 478, False: 49.9k]
  ------------------
  756|    702|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    702|#define CF(format,target,v,maxlen)                              \
  |  |   36|    702|{                                                               \
  |  |   37|    702|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 261, False: 441]
  |  |  ------------------
  |  |   38|    261|                snprintf (v, maxlen,	                        \
  |  |   39|    261|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    261|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    261|                        "expected '%s'."),                      \
  |  |   41|    261|                        exif_format_get_name (format),          \
  |  |   42|    261|                        exif_format_get_name (target));         \
  |  |   43|    261|                break;                                          \
  |  |   44|    261|        }                                                       \
  |  |   45|    702|}
  ------------------
  757|    441|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    441|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    441|{                                                                       \
  |  |   62|    441|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 247, False: 194]
  |  |  ------------------
  |  |   63|    247|                snprintf (v, maxlen,                                    \
  |  |   64|    247|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    247|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    247|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    247|                break;                                                  \
  |  |   67|    247|        }                                                               \
  |  |   68|    441|}
  ------------------
  758|    194|		vs = exif_get_short (entry->data, entry->order);
  759|    194|		snprintf (v, maxlen, "%hu ", vs);
  760|    194|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    194|		sprintf (buf, "%hu", vs);
  762|    194|		strncat (v, buf, maxlen - strlen (v));
  763|    194|		break;
  764|     76|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 76, False: 50.3k]
  ------------------
  765|    563|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 487, False: 49.9k]
  ------------------
  766|    563|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    563|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    563|{                                                                       \
  |  |   62|    563|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 85, False: 478]
  |  |  ------------------
  |  |   63|     85|                snprintf (v, maxlen,                                    \
  |  |   64|     85|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     85|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     85|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     85|                break;                                                  \
  |  |   67|     85|        }                                                               \
  |  |   68|    563|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|  1.12k|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 648, False: 49.7k]
  ------------------
  770|  1.12k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.12k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.12k|{                                                               \
  |  |   37|  1.12k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 222, False: 904]
  |  |  ------------------
  |  |   38|    222|                snprintf (v, maxlen,	                        \
  |  |   39|    222|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    222|                        "expected '%s'."),                      \
  |  |   41|    222|                        exif_format_get_name (format),          \
  |  |   42|    222|                        exif_format_get_name (target));         \
  |  |   43|    222|                break;                                          \
  |  |   44|    222|        }                                                       \
  |  |   45|  1.12k|}
  ------------------
  771|    904|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 429, False: 475]
  ------------------
  772|    429|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    429|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    429|{                                                                       \
  |  |   62|    429|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 230, False: 199]
  |  |  ------------------
  |  |   63|    230|                snprintf (v, maxlen,                                    \
  |  |   64|    230|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    230|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    230|                break;                                                  \
  |  |   67|    230|        }                                                               \
  |  |   68|    429|}
  ------------------
  773|  4.36k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 3.69k, False: 674]
  ------------------
  774|  3.69k|			vs = exif_get_short (entry->data+2*i, entry->order);
  775|  3.69k|			sprintf (buf, "%hu ", vs);
  776|  3.69k|			strncat (v, buf, maxlen - strlen (v));
  777|  3.69k|		}
  778|    674|		break;
  779|     68|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 68, False: 50.3k]
  ------------------
  780|    439|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 371, False: 50.0k]
  ------------------
  781|    633|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 194, False: 50.2k]
  ------------------
  782|  1.15k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 524, False: 49.8k]
  ------------------
  783|  1.15k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.15k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.15k|{                                                               \
  |  |   37|  1.15k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 371, False: 786]
  |  |  ------------------
  |  |   38|    371|                snprintf (v, maxlen,	                        \
  |  |   39|    371|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    371|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    371|                        "expected '%s'."),                      \
  |  |   41|    371|                        exif_format_get_name (format),          \
  |  |   42|    371|                        exif_format_get_name (target));         \
  |  |   43|    371|                break;                                          \
  |  |   44|    371|        }                                                       \
  |  |   45|  1.15k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.72k|	default:
  ------------------
  |  Branch (786:2): [True: 3.93k, False: 46.4k]
  ------------------
  787|  4.72k|		switch (entry->format) {
  788|    580|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 580, False: 4.14k]
  ------------------
  789|    580|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    580|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 296, False: 284]
  |  |  ------------------
  ------------------
  790|    580|			break;
  791|    437|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 437, False: 4.28k]
  ------------------
  792|    437|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    437|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    437|{                                                                       \
  |  |   62|    437|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 225, False: 212]
  |  |  ------------------
  |  |   63|    225|                snprintf (v, maxlen,                                    \
  |  |   64|    225|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    225|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    225|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    225|                break;                                                  \
  |  |   67|    225|        }                                                               \
  |  |   68|    437|}
  ------------------
  793|    212|			vs = exif_get_short (entry->data, entry->order);
  794|    212|			snprintf (v, maxlen, "%hu", vs);
  795|    212|			break;
  796|    423|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 423, False: 4.29k]
  ------------------
  797|    423|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    423|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    423|{                                                                       \
  |  |   62|    423|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 222, False: 201]
  |  |  ------------------
  |  |   63|    222|                snprintf (v, maxlen,                                    \
  |  |   64|    222|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    222|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    222|                break;                                                  \
  |  |   67|    222|        }                                                               \
  |  |   68|    423|}
  ------------------
  798|    201|			vss = exif_get_sshort (entry->data, entry->order);
  799|    201|			snprintf (v, maxlen, "%hi", vss);
  800|    201|			break;
  801|    430|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 430, False: 4.29k]
  ------------------
  802|    430|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    430|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    430|{                                                                       \
  |  |   62|    430|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 230, False: 200]
  |  |  ------------------
  |  |   63|    230|                snprintf (v, maxlen,                                    \
  |  |   64|    230|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    230|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    230|                break;                                                  \
  |  |   67|    230|        }                                                               \
  |  |   68|    430|}
  ------------------
  803|    200|			vl = exif_get_long (entry->data, entry->order);
  804|    200|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    200|			break;
  806|    428|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 428, False: 4.29k]
  ------------------
  807|    428|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    428|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    428|{                                                                       \
  |  |   62|    428|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 232, False: 196]
  |  |  ------------------
  |  |   63|    232|                snprintf (v, maxlen,                                    \
  |  |   64|    232|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    232|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    232|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    232|                break;                                                  \
  |  |   67|    232|        }                                                               \
  |  |   68|    428|}
  ------------------
  808|    196|			vsl = exif_get_slong (entry->data, entry->order);
  809|    196|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|    196|			break;
  811|    985|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 985, False: 3.73k]
  ------------------
  812|    985|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    985|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    985|{                                                                       \
  |  |   62|    985|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 303, False: 682]
  |  |  ------------------
  |  |   63|    303|                snprintf (v, maxlen,                                    \
  |  |   64|    303|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    303|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    303|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    303|                break;                                                  \
  |  |   67|    303|        }                                                               \
  |  |   68|    985|}
  ------------------
  813|    682|			vr = exif_get_rational (entry->data, entry->order);
  814|    682|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 304, False: 378]
  ------------------
  815|    304|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    304|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    378|			} else {
  817|    378|				r = R2D(vr);
  ------------------
  |  |   82|    378|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 378, False: 0]
  |  |  ------------------
  ------------------
  818|    378|				snprintf (v, maxlen, "%2.3f", r);
  819|    378|			}
  820|    682|			break;
  821|    788|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 788, False: 3.93k]
  ------------------
  822|    788|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    788|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    788|{                                                                       \
  |  |   62|    788|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 257, False: 531]
  |  |  ------------------
  |  |   63|    257|                snprintf (v, maxlen,                                    \
  |  |   64|    257|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    257|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    257|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    257|                break;                                                  \
  |  |   67|    257|        }                                                               \
  |  |   68|    788|}
  ------------------
  823|    531|			vsr = exif_get_srational (entry->data, entry->order);
  824|    531|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 217, False: 314]
  ------------------
  825|    217|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  826|    314|			} else {
  827|    314|				r = R2D(vsr);
  ------------------
  |  |   82|    314|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 314, False: 0]
  |  |  ------------------
  ------------------
  828|    314|				snprintf (v, maxlen, "%2.3f", r);
  829|    314|			}
  830|    531|			break;
  831|    220|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 220, False: 4.50k]
  ------------------
  832|    649|		default:
  ------------------
  |  Branch (832:3): [True: 429, False: 4.29k]
  ------------------
  833|    649|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    649|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    649|				  entry->size);
  835|  2.46k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 1.81k, False: 649]
  ------------------
  836|  1.81k|				sprintf (buf, "%02x", entry->data[i]);
  837|  1.81k|				strncat (v, buf, maxlen - strlen (v));
  838|  1.81k|			}
  839|    649|			break;
  840|  4.72k|		}
  841|  4.72k|		break;
  842|  50.4k|	}
  843|       |
  844|  50.4k|	return (v);
  845|  50.4k|}

mnote_olympus_tag_get_name:
  232|   156k|{
  233|   156k|	unsigned int i;
  234|       |
  235|  16.5M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (235:14): [True: 16.4M, False: 24.0k]
  ------------------
  236|  16.4M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (236:7): [True: 132k, False: 16.3M]
  ------------------
  237|  24.0k|	return NULL;
  238|   156k|}
mnote_olympus_tag_get_title:
  242|  53.9k|{
  243|  53.9k|	unsigned int i;
  244|       |
  245|  53.9k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  246|  4.60M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (246:14): [True: 4.60M, False: 0]
  ------------------
  247|  4.60M|		if (table[i].tag == t) {
  ------------------
  |  Branch (247:7): [True: 53.9k, False: 4.55M]
  ------------------
  248|  53.9k|			if (!table[i].title)
  ------------------
  |  Branch (248:8): [True: 0, False: 53.9k]
  ------------------
  249|      0|				return NULL;
  250|  53.9k|			return _(table[i].title);
  ------------------
  |  |   31|  53.9k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  251|  53.9k|		}
  252|      0|	return NULL;
  253|  53.9k|}
mnote_olympus_tag_get_description:
  257|  53.9k|{
  258|  53.9k|	unsigned int i;
  259|       |
  260|  4.60M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (260:14): [True: 4.60M, False: 0]
  ------------------
  261|  4.60M|		if (table[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 53.9k, False: 4.55M]
  ------------------
  262|  53.9k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (262:8): [True: 205, False: 53.6k]
  |  Branch (262:33): [True: 52.7k, False: 993]
  ------------------
  263|  52.9k|				return "";
  264|    993|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  265|    993|			return _(table[i].description);
  ------------------
  |  |   31|    993|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  53.9k|		}
  267|      0|	return NULL;
  268|  53.9k|}

exif_mnote_data_pentax_identify:
  429|  1.27k|{
  430|  1.27k|	(void) ed;  /* unused */
  431|  1.27k|	if ((e->size >= 8) && !memcmp (e->data, "AOC", 4)) {
  ------------------
  |  Branch (431:6): [True: 1.06k, False: 210]
  |  Branch (431:24): [True: 563, False: 505]
  ------------------
  432|    563|		if (((e->data[4] == 'I') && (e->data[5] == 'I')) ||
  ------------------
  |  Branch (432:8): [True: 205, False: 358]
  |  Branch (432:31): [True: 5, False: 200]
  ------------------
  433|    558|		    ((e->data[4] == 'M') && (e->data[5] == 'M')))
  ------------------
  |  Branch (433:8): [True: 18, False: 540]
  |  Branch (433:31): [True: 5, False: 13]
  ------------------
  434|     10|			return pentaxV3;
  435|    553|		else
  436|       |			/* Uses Casio v2 tags */
  437|    553|			return pentaxV2;
  438|    563|	}
  439|       |
  440|    715|	if ((e->size >= 8) && !memcmp (e->data, "QVC", 4))
  ------------------
  |  Branch (440:6): [True: 505, False: 210]
  |  Branch (440:24): [True: 69, False: 436]
  ------------------
  441|     69|		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|    646|	if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b))
  ------------------
  |  Branch (445:6): [True: 633, False: 13]
  |  Branch (445:24): [True: 479, False: 154]
  |  Branch (445:48): [True: 448, False: 31]
  ------------------
  446|    448|		return pentaxV1;
  447|       |
  448|    198|	return 0;
  449|    646|}
exif_mnote_data_pentax_new:
  453|  1.08k|{
  454|  1.08k|	ExifMnoteData *d;
  455|       |
  456|  1.08k|	if (!mem) return NULL;
  ------------------
  |  Branch (456:6): [True: 0, False: 1.08k]
  ------------------
  457|       |
  458|  1.08k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataPentax));
  459|  1.08k|	if (!d) return NULL;
  ------------------
  |  Branch (459:6): [True: 0, False: 1.08k]
  ------------------
  460|       |
  461|  1.08k|	exif_mnote_data_construct (d, mem);
  462|       |
  463|       |	/* Set up function pointers */
  464|  1.08k|	d->methods.free            = exif_mnote_data_pentax_free;
  465|  1.08k|	d->methods.set_byte_order  = exif_mnote_data_pentax_set_byte_order;
  466|  1.08k|	d->methods.set_offset      = exif_mnote_data_pentax_set_offset;
  467|  1.08k|	d->methods.load            = exif_mnote_data_pentax_load;
  468|  1.08k|	d->methods.save            = exif_mnote_data_pentax_save;
  469|  1.08k|	d->methods.count           = exif_mnote_data_pentax_count;
  470|  1.08k|	d->methods.get_id          = exif_mnote_data_pentax_get_id;
  471|  1.08k|	d->methods.get_name        = exif_mnote_data_pentax_get_name;
  472|  1.08k|	d->methods.get_title       = exif_mnote_data_pentax_get_title;
  473|  1.08k|	d->methods.get_description = exif_mnote_data_pentax_get_description;
  474|  1.08k|	d->methods.get_value       = exif_mnote_data_pentax_get_value;
  475|       |
  476|  1.08k|	return d;
  477|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_free:
   57|  1.08k|{
   58|  1.08k|	if (!n) return;
  ------------------
  |  Branch (58:6): [True: 0, False: 1.08k]
  ------------------
   59|       |
   60|  1.08k|	exif_mnote_data_pentax_clear ((ExifMnoteDataPentax *) n);
   61|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_clear:
   37|  2.03k|{
   38|  2.03k|	ExifMnoteData *d = (ExifMnoteData *) n;
   39|  2.03k|	unsigned int i;
   40|       |
   41|  2.03k|	if (!n) return;
  ------------------
  |  Branch (41:6): [True: 0, False: 2.03k]
  ------------------
   42|       |
   43|  2.03k|	if (n->entries) {
  ------------------
  |  Branch (43:6): [True: 959, False: 1.08k]
  ------------------
   44|  19.4k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (44:15): [True: 18.5k, False: 959]
  ------------------
   45|  18.5k|			if (n->entries[i].data) {
  ------------------
  |  Branch (45:8): [True: 6.97k, False: 11.5k]
  ------------------
   46|  6.97k|				exif_mem_free (d->mem, n->entries[i].data);
   47|  6.97k|				n->entries[i].data = NULL;
   48|  6.97k|			}
   49|    959|		exif_mem_free (d->mem, n->entries);
   50|       |		n->entries = NULL;
   51|    959|		n->count = 0;
   52|    959|	}
   53|  2.03k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_byte_order:
  409|  1.08k|{
  410|  1.08k|	ExifByteOrder o_orig;
  411|  1.08k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
  412|  1.08k|	unsigned int i;
  413|       |
  414|  1.08k|	if (!n) return;
  ------------------
  |  Branch (414:6): [True: 0, False: 1.08k]
  ------------------
  415|       |
  416|  1.08k|	o_orig = n->order;
  417|  1.08k|	n->order = o;
  418|  1.08k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (418:14): [True: 0, False: 1.08k]
  ------------------
  419|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (419:7): [True: 0, False: 0]
  |  Branch (419:35): [True: 0, False: 0]
  ------------------
  420|      0|			continue;
  421|      0|		n->entries[i].order = o;
  422|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  423|      0|				n->entries[i].components, o_orig, o);
  424|      0|	}
  425|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_offset:
  403|  1.08k|{
  404|  1.08k|	if (d) ((ExifMnoteDataPentax *) d)->offset = o;
  ------------------
  |  Branch (404:6): [True: 1.08k, False: 0]
  ------------------
  405|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_load:
  220|  1.08k|{
  221|  1.08k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) en;
  222|  1.08k|	size_t i, tcount, o, datao, base = 0;
  223|  1.08k|	ExifShort c;
  224|       |
  225|  1.08k|	if (!n) return;
  ------------------
  |  Branch (225:6): [True: 0, False: 1.08k]
  ------------------
  226|       |
  227|  1.08k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (227:6): [True: 0, False: 1.08k]
  |  Branch (227:14): [True: 0, False: 1.08k]
  ------------------
  228|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  229|      0|			  "ExifMnoteDataPentax", "Short MakerNote");
  230|      0|		return;
  231|      0|	}
  232|  1.08k|	datao = 6 + n->offset;
  233|  1.08k|	if (CHECKOVERFLOW(datao, buf_size, 8)) {
  ------------------
  |  |   33|  1.08k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 1.08k]
  |  |  |  Branch (33:81): [True: 0, False: 1.08k]
  |  |  |  Branch (33:112): [True: 7, False: 1.07k]
  |  |  ------------------
  ------------------
  234|      7|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  235|      7|			  "ExifMnoteDataPentax", "Short MakerNote");
  236|      7|		return;
  237|      7|	}
  238|       |
  239|       |	/* Detect variant of Pentax/Casio MakerNote found */
  240|  1.07k|	if (!memcmp(buf + datao, "AOC", 4)) {
  ------------------
  |  Branch (240:6): [True: 537, False: 536]
  ------------------
  241|    537|		if ((buf[datao + 4] == 'I') && (buf[datao + 5] == 'I')) {
  ------------------
  |  Branch (241:7): [True: 192, False: 345]
  |  Branch (241:34): [True: 5, False: 187]
  ------------------
  242|      5|			n->version = pentaxV3;
  243|      5|			n->order = EXIF_BYTE_ORDER_INTEL;
  244|    532|		} else if ((buf[datao + 4] == 'M') && (buf[datao + 5] == 'M')) {
  ------------------
  |  Branch (244:14): [True: 18, False: 514]
  |  Branch (244:41): [True: 5, False: 13]
  ------------------
  245|      5|			n->version = pentaxV3;
  246|      5|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  247|    527|		} else {
  248|       |			/* Uses Casio v2 tags */
  249|    527|			n->version = pentaxV2;
  250|    527|		}
  251|    537|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  252|    537|			"Parsing Pentax maker note v%d...", (int)n->version);
  253|    537|		datao += 4 + 2;
  254|    537|		base = MNOTE_PENTAX2_TAG_BASE;
  255|    537|	} else if (!memcmp(buf + datao, "QVC", 4)) {
  ------------------
  |  Branch (255:13): [True: 62, False: 474]
  ------------------
  256|     62|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  257|     62|			"Parsing Casio maker note v2...");
  258|     62|		n->version = casioV2;
  259|     62|		base = MNOTE_CASIO2_TAG_BASE;
  260|     62|		datao += 4 + 2;
  261|    474|	} else {
  262|       |		/* probably assert(!memcmp(buf + datao, "\x00\x1b", 2)) */
  263|    474|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  264|    474|			"Parsing Pentax maker note v1...");
  265|    474|		n->version = pentaxV1;
  266|    474|	}
  267|       |
  268|       |	/* Read the number of tags */
  269|  1.07k|	c = exif_get_short (buf + datao, n->order);
  270|  1.07k|	datao += 2;
  271|       |
  272|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 102 named tags currently.
  273|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  274|  1.07k|	if (c > 200) {
  ------------------
  |  Branch (274:6): [True: 114, False: 959]
  ------------------
  275|    114|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataPentax", "Too much tags (%d) in Pentax MakerNote", c);
  276|    114|		return;
  277|    114|	}
  278|       |
  279|       |
  280|       |	/* Remove any old entries */
  281|    959|	exif_mnote_data_pentax_clear (n);
  282|       |
  283|       |	/* Reserve enough space for all the possible MakerNote tags */
  284|    959|	n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c);
  285|    959|	if (!n->entries) {
  ------------------
  |  Branch (285:6): [True: 0, False: 959]
  ------------------
  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|    959|	tcount = 0;
  292|  20.1k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (292:25): [True: 20.1k, False: 20]
  ------------------
  293|  20.1k|		size_t s;
  294|       |
  295|  20.1k|		memset(&n->entries[tcount], 0, sizeof(MnotePentaxEntry));
  296|  20.1k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   33|  20.1k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 336, False: 19.8k]
  |  |  |  Branch (33:81): [True: 0, False: 19.8k]
  |  |  |  Branch (33:112): [True: 399, False: 19.4k]
  |  |  ------------------
  ------------------
  297|    735|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  298|    735|				  "ExifMnoteDataPentax", "Short MakerNote");
  299|    735|			break;
  300|    735|		}
  301|       |
  302|  19.4k|		n->entries[tcount].tag        = exif_get_short (buf + o + 0, n->order) + base;
  303|  19.4k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  304|  19.4k|		n->entries[tcount].components = exif_get_long  (buf + o + 4, n->order);
  305|  19.4k|		n->entries[tcount].order      = n->order;
  306|       |
  307|  19.4k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnotePentax",
  308|  19.4k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  309|  19.4k|			  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.4k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (313:8): [True: 9.82k, False: 9.61k]
  ------------------
  314|  9.82k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (314:4): [True: 204, False: 9.62k]
  ------------------
  315|  19.4k|		) {
  316|    204|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  317|    204|				  "ExifMnoteDataPentax", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  318|    204|			break;
  319|    204|		}
  320|       |		/*
  321|       |		 * Size? If bigger than 4 bytes, the actual data is not
  322|       |		 * in the entry but somewhere else (offset).
  323|       |		 */
  324|  19.2k|		s = exif_format_get_size (n->entries[tcount].format) *
  325|  19.2k|                                      n->entries[tcount].components;
  326|  19.2k|		n->entries[tcount].size = s;
  327|  19.2k|		if (s) {
  ------------------
  |  Branch (327:7): [True: 7.68k, False: 11.5k]
  ------------------
  328|  7.68k|			size_t dataofs = o + 8;
  329|  7.68k|			if (s > 4)
  ------------------
  |  Branch (329:8): [True: 2.78k, False: 4.89k]
  ------------------
  330|       |				/* The data in this case is merely a pointer */
  331|  2.78k|			   	dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  332|       |
  333|  7.68k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  7.68k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 549, False: 7.13k]
  |  |  |  Branch (33:81): [True: 0, False: 7.13k]
  |  |  |  Branch (33:112): [True: 165, False: 6.97k]
  |  |  ------------------
  ------------------
  334|    714|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  335|    714|						  "ExifMnoteDataPentax", "Tag data past end "
  336|    714|					  "of buffer (%u > %u)", (unsigned)(dataofs + s), buf_size);
  337|    714|				continue;
  338|    714|			}
  339|       |
  340|  6.97k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  341|  6.97k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (341:8): [True: 0, False: 6.97k]
  ------------------
  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|  6.97k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  346|  6.97k|		}
  347|       |
  348|       |		/* Tag was successfully parsed */
  349|  18.5k|		++tcount;
  350|  18.5k|	}
  351|       |	/* Store the count of successfully parsed tags */
  352|    959|	n->count = tcount;
  353|    959|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_count:
  357|  1.08k|{
  358|  1.08k|	return n ? ((ExifMnoteDataPentax *) n)->count : 0;
  ------------------
  |  Branch (358:9): [True: 1.08k, False: 0]
  ------------------
  359|  1.08k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_name:
  373|  13.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|    457|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 457, False: 12.4k]
  ------------------
  327|    725|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 268, False: 12.6k]
  ------------------
  328|  1.00k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 277, False: 12.6k]
  ------------------
  329|  1.24k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 247, False: 12.7k]
  ------------------
  330|  1.47k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 223, False: 12.7k]
  ------------------
  331|  1.70k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 235, False: 12.7k]
  ------------------
  332|  2.08k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 381, False: 12.5k]
  ------------------
  333|  2.28k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 200, False: 12.7k]
  ------------------
  334|  2.50k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 216, False: 12.7k]
  ------------------
  335|  2.76k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 258, False: 12.6k]
  ------------------
  336|  3.06k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 303, False: 12.6k]
  ------------------
  337|  3.43k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 372, False: 12.5k]
  ------------------
  338|  3.65k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 222, False: 12.7k]
  ------------------
  339|  3.90k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 245, False: 12.7k]
  ------------------
  340|  4.15k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 254, False: 12.7k]
  ------------------
  341|  4.44k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 290, False: 12.6k]
  ------------------
  342|  4.89k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 442, False: 12.5k]
  ------------------
  343|  5.53k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 647, False: 12.3k]
  ------------------
  344|  6.15k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 618, False: 12.3k]
  ------------------
  345|  6.42k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 265, False: 12.6k]
  ------------------
  346|  6.42k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  6.42k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  6.42k|{                                                               \
  |  |   39|  6.42k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 3.23k, False: 3.18k]
  |  |  ------------------
  |  |   40|  3.23k|		snprintf (v, maxlen,	                        \
  |  |   41|  3.23k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  3.23k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  3.23k|			"expected '%s'."),                      \
  |  |   43|  3.23k|			exif_format_get_name (format),          \
  |  |   44|  3.23k|			exif_format_get_name (target));         \
  |  |   45|  3.23k|		break;                                          \
  |  |   46|  3.23k|	}                                                       \
  |  |   47|  6.42k|}
  ------------------
  347|  3.18k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.18k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.18k|{                                                                       \
  |  |   61|  3.18k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.11k, False: 2.06k]
  |  |  |  Branch (61:24): [True: 252, False: 860]
  |  |  ------------------
  |  |   62|    252|		snprintf (v, maxlen,                                    \
  |  |   63|    252|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    252|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    252|			"expected %i or %i)."), (int) number,		\
  |  |   65|    252|			(int) t1, (int) t2);  				\
  |  |   66|    252|		break;                                                  \
  |  |   67|    252|	}                                                               \
  |  |   68|  3.18k|}
  ------------------
  348|  2.92k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 2.06k, False: 860]
  ------------------
  349|  2.06k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  26.8k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 26.8k, False: 0]
  |  Branch (352:33): [True: 24.7k, False: 2.06k]
  ------------------
  353|  2.06k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 2.06k]
  ------------------
  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|  12.7k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 11.7k, False: 1.00k]
  ------------------
  361|  11.7k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 10.6k, False: 1.06k]
  ------------------
  362|  2.06k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.33k, False: 737]
  ------------------
  363|  1.33k|				snprintf (val, maxlen,
  364|  1.33k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.33k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.33k|				break;
  366|  1.33k|			}
  367|    737|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    737|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|    860|		} else {
  369|       |			/* Two-component values */
  370|    860|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|    860|#define CF(format,target,v,maxlen)                              \
  |  |   38|    860|{                                                               \
  |  |   39|    860|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 860]
  |  |  ------------------
  |  |   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|    860|}
  ------------------
  371|    860|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|    860|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    860|{                                                                       \
  |  |   61|    860|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 860, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 860]
  |  |  ------------------
  |  |   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|    860|}
  ------------------
  372|    860|			vs = exif_get_short (entry->data, entry->order);
  373|    860|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  1.80k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.44k, False: 358]
  |  Branch (376:34): [True: 944, False: 502]
  ------------------
  377|    860|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 358, False: 502]
  ------------------
  378|    358|				snprintf (val, maxlen,
  379|    358|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    358|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    358|			  	break;
  381|    358|			}
  382|       |
  383|       |			/* find the value */
  384|  1.95k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 1.95k, False: 0]
  |  Branch (384:45): [True: 0, False: 1.95k]
  ------------------
  385|  1.95k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.67k, False: 280]
  |  Branch (385:46): [True: 1.45k, False: 222]
  ------------------
  386|    502|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 291, False: 211]
  |  Branch (386:44): [True: 0, False: 211]
  ------------------
  387|    291|				snprintf (val, maxlen,
  388|    291|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    291|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    291|				break;
  390|    291|			}
  391|    211|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    211|		}
  393|    948|		break;
  394|       |
  395|    948|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 647, False: 12.3k]
  ------------------
  396|    647|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    647|#define CF(format,target,v,maxlen)                              \
  |  |   38|    647|{                                                               \
  |  |   39|    647|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 229, False: 418]
  |  |  ------------------
  |  |   40|    229|		snprintf (v, maxlen,	                        \
  |  |   41|    229|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    229|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    229|			"expected '%s'."),                      \
  |  |   43|    229|			exif_format_get_name (format),          \
  |  |   44|    229|			exif_format_get_name (target));         \
  |  |   45|    229|		break;                                          \
  |  |   46|    229|	}                                                       \
  |  |   47|    647|}
  ------------------
  397|    418|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    418|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    418|{                                                                       \
  |  |   51|    418|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 219, False: 199]
  |  |  ------------------
  |  |   52|    219|		snprintf (v, maxlen,                                    \
  |  |   53|    219|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    219|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    219|		break;                                                  \
  |  |   56|    219|	}                                                               \
  |  |   57|    418|}
  ------------------
  398|    199|		vl = exif_get_long (entry->data, entry->order);
  399|    199|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|    199|		break;
  401|    674|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 674, False: 12.2k]
  ------------------
  402|    674|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    674|#define CF(format,target,v,maxlen)                              \
  |  |   38|    674|{                                                               \
  |  |   39|    674|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 244, False: 430]
  |  |  ------------------
  |  |   40|    244|		snprintf (v, maxlen,	                        \
  |  |   41|    244|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    244|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    244|			"expected '%s'."),                      \
  |  |   43|    244|			exif_format_get_name (format),          \
  |  |   44|    244|			exif_format_get_name (target));         \
  |  |   45|    244|		break;                                          \
  |  |   46|    244|	}                                                       \
  |  |   47|    674|}
  ------------------
  403|    430|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    430|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    430|{                                                                       \
  |  |   51|    430|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 204, False: 226]
  |  |  ------------------
  |  |   52|    204|		snprintf (v, maxlen,                                    \
  |  |   53|    204|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    204|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    204|		break;                                                  \
  |  |   56|    204|	}                                                               \
  |  |   57|    430|}
  ------------------
  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|    504|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 504, False: 12.4k]
  ------------------
  408|  1.00k|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 496, False: 12.4k]
  ------------------
  409|  1.00k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|  1.00k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.00k|{                                                               \
  |  |   39|  1.00k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 350, False: 650]
  |  |  ------------------
  |  |   40|    350|		snprintf (v, maxlen,	                        \
  |  |   41|    350|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    350|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    350|			"expected '%s'."),                      \
  |  |   43|    350|			exif_format_get_name (format),          \
  |  |   44|    350|			exif_format_get_name (target));         \
  |  |   45|    350|		break;                                          \
  |  |   46|    350|	}                                                       \
  |  |   47|  1.00k|}
  ------------------
  410|    650|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    650|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    650|{                                                                       \
  |  |   51|    650|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 367, False: 283]
  |  |  ------------------
  |  |   52|    367|		snprintf (v, maxlen,                                    \
  |  |   53|    367|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    367|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    367|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    367|		break;                                                  \
  |  |   56|    367|	}                                                               \
  |  |   57|    650|}
  ------------------
  411|    283|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    283|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 283]
  |  |  ------------------
  ------------------
  412|    283|		break;
  413|    362|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 362, False: 12.5k]
  ------------------
  414|    362|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    362|#define CF(format,target,v,maxlen)                              \
  |  |   38|    362|{                                                               \
  |  |   39|    362|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 223, False: 139]
  |  |  ------------------
  |  |   40|    223|		snprintf (v, maxlen,	                        \
  |  |   41|    223|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    223|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    223|			"expected '%s'."),                      \
  |  |   43|    223|			exif_format_get_name (format),          \
  |  |   44|    223|			exif_format_get_name (target));         \
  |  |   45|    223|		break;                                          \
  |  |   46|    223|	}                                                       \
  |  |   47|    362|}
  ------------------
  415|    139|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    139|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    139|{                                                                       \
  |  |   51|    139|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 73, False: 66]
  |  |  ------------------
  |  |   52|     73|		snprintf (v, maxlen,                                    \
  |  |   53|     73|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     73|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|     73|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|     73|		break;                                                  \
  |  |   56|     73|	}                                                               \
  |  |   57|    139|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|     66|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|     66|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|     66|		break;
  420|    804|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 804, False: 12.1k]
  ------------------
  421|    804|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    804|#define CF(format,target,v,maxlen)                              \
  |  |   38|    804|{                                                               \
  |  |   39|    804|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 393, False: 411]
  |  |  ------------------
  |  |   40|    393|		snprintf (v, maxlen,	                        \
  |  |   41|    393|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    393|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    393|			"expected '%s'."),                      \
  |  |   43|    393|			exif_format_get_name (format),          \
  |  |   44|    393|			exif_format_get_name (target));         \
  |  |   45|    393|		break;                                          \
  |  |   46|    393|	}                                                       \
  |  |   47|    804|}
  ------------------
  422|    411|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    411|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    411|{                                                                       \
  |  |   61|    411|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 326, False: 85]
  |  |  |  Branch (61:24): [True: 256, False: 70]
  |  |  ------------------
  |  |   62|    256|		snprintf (v, maxlen,                                    \
  |  |   63|    256|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    256|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    256|			"expected %i or %i)."), (int) number,		\
  |  |   65|    256|			(int) t1, (int) t2);  				\
  |  |   66|    256|		break;                                                  \
  |  |   67|    256|	}                                                               \
  |  |   68|    411|}
  ------------------
  423|    155|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    155|		break;
  425|  3.04k|	default:
  ------------------
  |  Branch (425:2): [True: 3.04k, False: 9.90k]
  ------------------
  426|  3.04k|		switch (entry->format) {
  427|    499|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 499, False: 2.55k]
  ------------------
  428|    499|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    499|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 230, False: 269]
  |  |  ------------------
  ------------------
  429|    499|		  break;
  430|    521|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 521, False: 2.52k]
  ------------------
  431|    521|		  {
  432|    521|			const unsigned char *data = entry->data;
  433|    521|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    521|			sizeleft = entry->size;
  436|  85.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 84.8k, False: 521]
  ------------------
  437|  84.8k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 84.8k]
  ------------------
  438|      0|					break;
  439|  84.8k|				vs = exif_get_short (data, entry->order);
  440|  84.8k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|  84.8k|				len = strlen(val);
  442|  84.8k|				data += 2;
  443|  84.8k|				sizeleft -= 2;
  444|  84.8k|			}
  445|    521|		  }
  446|    521|		  break;
  447|    488|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 488, False: 2.56k]
  ------------------
  448|    488|		  {
  449|    488|			const unsigned char *data = entry->data;
  450|    488|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    488|			sizeleft = entry->size;
  453|  37.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 36.8k, False: 488]
  ------------------
  454|  36.8k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 36.8k]
  ------------------
  455|      0|					break;
  456|  36.8k|				vss = exif_get_sshort (data, entry->order);
  457|  36.8k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  36.8k|				len = strlen(val);
  459|  36.8k|				data += 2;
  460|  36.8k|				sizeleft -= 2;
  461|  36.8k|			}
  462|    488|		  }
  463|    488|		  break;
  464|    461|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 461, False: 2.58k]
  ------------------
  465|    461|		  {
  466|    461|			const unsigned char *data = entry->data;
  467|    461|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    461|			sizeleft = entry->size;
  470|  23.1k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 22.7k, False: 461]
  ------------------
  471|  22.7k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 22.7k]
  ------------------
  472|      0|					break;
  473|  22.7k|				vl = exif_get_long (data, entry->order);
  474|  22.7k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  22.7k|				len = strlen(val);
  476|  22.7k|				data += 4;
  477|  22.7k|				sizeleft -= 4;
  478|  22.7k|			}
  479|    461|		  }
  480|    461|		  break;
  481|    515|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 515, False: 2.53k]
  ------------------
  482|    515|		  {
  483|    515|			const unsigned char *data = entry->data;
  484|    515|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    515|			sizeleft = entry->size;
  487|  42.1k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 41.6k, False: 515]
  ------------------
  488|  41.6k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 41.6k]
  ------------------
  489|      0|					break;
  490|  41.6k|				vsl = exif_get_slong (data, entry->order);
  491|  41.6k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  41.6k|				len = strlen(val);
  493|  41.6k|				data += 4;
  494|  41.6k|				sizeleft -= 4;
  495|  41.6k|			}
  496|    515|		  }
  497|    515|		  break;
  498|      8|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 8, False: 3.04k]
  ------------------
  499|    565|		default:
  ------------------
  |  Branch (499:3): [True: 557, False: 2.49k]
  ------------------
  500|    565|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    565|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    565|			  entry->size);
  502|    565|		  break;
  503|  3.04k|		}
  504|  3.04k|		break;
  505|  12.9k|	}
  506|       |
  507|  12.9k|	return val;
  508|  12.9k|}

mnote_pentax_tag_get_name:
  145|  32.7k|{
  146|  32.7k|	unsigned int i;
  147|       |
  148|  1.48M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (148:14): [True: 1.47M, False: 5.03k]
  ------------------
  149|  1.47M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (149:7): [True: 27.6k, False: 1.44M]
  ------------------
  150|  5.03k|	return NULL;
  151|  32.7k|}
mnote_pentax_tag_get_title:
  155|  12.9k|{
  156|  12.9k|	unsigned int i;
  157|       |
  158|  12.9k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  159|   436k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (159:14): [True: 436k, False: 0]
  ------------------
  160|   436k|		if (table[i].tag == t) {
  ------------------
  |  Branch (160:7): [True: 12.9k, False: 423k]
  ------------------
  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|   436k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (173:14): [True: 436k, False: 0]
  ------------------
  174|   436k|		if (table[i].tag == t) {
  ------------------
  |  Branch (174:7): [True: 12.9k, False: 423k]
  ------------------
  175|  12.9k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (175:8): [True: 647, False: 12.3k]
  |  Branch (175:33): [True: 12.1k, False: 180]
  ------------------
  176|  12.7k|				return "";
  177|    180|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  178|    180|			return _(table[i].description);
  ------------------
  |  |   31|    180|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  179|  12.9k|		}
  180|      0|	return NULL;
  181|  12.9k|}

