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

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

mnote_canon_entry_count_values:
  505|   172M|{
  506|   172M|	unsigned int  val;
  507|       |
  508|   172M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 172M]
  ------------------
  509|       |
  510|   172M|	switch (entry->tag) {
  511|   192k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 192k, False: 171M]
  ------------------
  512|   193k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 469, False: 172M]
  ------------------
  513|   193k|		return entry->components;
  514|  2.19M|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 2.19M, False: 169M]
  ------------------
  515|  3.21M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.02M, False: 171M]
  ------------------
  516|   164M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 161M, False: 10.9M]
  ------------------
  517|   164M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 61.0k, False: 172M]
  ------------------
  518|   164M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 77.4k, False: 164M]
  ------------------
  519|       |
  520|   164M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|   164M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|   164M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 133M, False: 30.3M]
  |  |  ------------------
  ------------------
  523|  7.50M|	default:
  ------------------
  |  Branch (523:2): [True: 7.50M, False: 164M]
  ------------------
  524|  7.50M|		return 1;
  525|   172M|	}
  526|   172M|}
mnote_canon_entry_get_value:
  552|  1.59M|{
  553|  1.59M|	char buf[128];
  554|  1.59M|	ExifLong vl;
  555|  1.59M|	ExifSLong vsl;
  556|  1.59M|	ExifShort vs, n;
  557|  1.59M|	ExifSShort vss;
  558|  1.59M|	unsigned char *data;
  559|  1.59M|	size_t	size;
  560|  1.59M|	double d;
  561|       |
  562|  1.59M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.59M]
  ------------------
  563|      0|		return NULL;
  564|  1.59M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.59M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.59M|	data = entry->data;
  568|  1.59M|	size = entry->size;
  569|       |
  570|  1.59M|	memset (val, 0, maxlen);
  571|  1.59M|	maxlen--;
  572|       |
  573|  1.59M|	switch (entry->tag) {
  574|  3.01k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 3.01k, False: 1.58M]
  ------------------
  575|  3.01k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.01k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.01k|{                                                               \
  |  |   38|  3.01k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.01k]
  |  |  ------------------
  |  |   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.01k|}
  ------------------
  576|       |
  577|  3.01k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 3.01k]
  ------------------
  578|  3.01k|		n = exif_get_short (data, entry->order) / 2;
  579|  3.01k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 3.01k]
  ------------------
  580|       |
  581|  3.01k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.01k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.01k|{                                                                       \
  |  |   50|  3.01k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 371, False: 2.64k]
  |  |  ------------------
  |  |   51|    371|                snprintf (v, maxlen,                                    \
  |  |   52|    371|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    371|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    371|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    371|                break;                                                  \
  |  |   55|    371|        }                                                               \
  |  |   56|  3.01k|}
  ------------------
  582|       |
  583|  2.64k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.64k]
  ------------------
  584|  2.64k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.64k|		switch (t) {
  586|    536|		case 1:
  ------------------
  |  Branch (586:3): [True: 536, False: 2.11k]
  ------------------
  587|    536|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 208, False: 328]
  ------------------
  588|    208|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    208|				break;
  590|    208|			}
  591|    328|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    328|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    328|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.64k]
  ------------------
  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.64k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.64k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.64k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.64k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.64k]
  ------------------
  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.64k]
  ------------------
  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.64k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.64k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.64k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  2.11k|		default:
  ------------------
  |  Branch (621:3): [True: 2.11k, False: 536]
  ------------------
  622|  2.11k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.64k|		}
  624|  2.64k|		break;
  625|       |
  626|  2.64k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.64k, False: 1.58M]
  ------------------
  627|  1.64k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.64k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.64k|{                                                               \
  |  |   38|  1.64k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 343, False: 1.29k]
  |  |  ------------------
  |  |   39|    343|                snprintf (v, maxlen,                            \
  |  |   40|    343|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    343|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    343|                        "expected '%s'."),                      \
  |  |   42|    343|                        exif_format_get_name (format),          \
  |  |   43|    343|                        exif_format_get_name (target));         \
  |  |   44|    343|                break;                                          \
  |  |   45|    343|        }                                                       \
  |  |   46|  1.64k|}
  ------------------
  628|  1.29k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.29k]
  ------------------
  629|  1.29k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.29k|		switch (t) {
  631|    325|		case 1:
  ------------------
  |  Branch (631:3): [True: 325, False: 973]
  ------------------
  632|    325|			snprintf (val, maxlen, "%u", vs);
  633|    325|			break;
  634|    314|		case 2:
  ------------------
  |  Branch (634:3): [True: 314, False: 984]
  ------------------
  635|    625|		case 3:
  ------------------
  |  Branch (635:3): [True: 311, False: 987]
  ------------------
  636|    625|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    625|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    625|			break;
  638|    348|		default:
  ------------------
  |  Branch (638:3): [True: 348, False: 950]
  ------------------
  639|    348|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.29k|		}
  641|  1.29k|		break;
  642|       |
  643|  6.55k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 6.55k, False: 1.58M]
  ------------------
  644|  6.55k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  6.55k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  6.55k|{                                                               \
  |  |   38|  6.55k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 6.55k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  6.55k|}
  ------------------
  645|  6.55k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 6.55k]
  ------------------
  646|  6.55k|		n = exif_get_short (data, entry->order) / 2;
  647|  6.55k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 6.55k]
  ------------------
  648|  6.55k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  6.55k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  6.55k|{                                                                       \
  |  |   50|  6.55k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.14k, False: 5.41k]
  |  |  ------------------
  |  |   51|  1.14k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.14k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.14k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.14k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.14k|                break;                                                  \
  |  |   55|  1.14k|        }                                                               \
  |  |   56|  6.55k|}
  ------------------
  649|  5.41k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 5.41k]
  ------------------
  650|  5.41k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  5.41k|		switch (t) {
  652|    653|		case 0:
  ------------------
  |  Branch (652:3): [True: 653, False: 4.75k]
  ------------------
  653|    653|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    653|			break;
  655|    653|		case 1:
  ------------------
  |  Branch (655:3): [True: 653, False: 4.75k]
  ------------------
  656|    653|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    653|			break;
  658|    653|		case 2:
  ------------------
  |  Branch (658:3): [True: 653, False: 4.75k]
  ------------------
  659|  1.18k|		case 5:
  ------------------
  |  Branch (659:3): [True: 536, False: 4.87k]
  ------------------
  660|  1.18k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 5.41k]
  ------------------
  661|  1.18k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 5.41k]
  ------------------
  662|  1.18k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.18k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.18k|			break;
  664|    652|		case 3:
  ------------------
  |  Branch (664:3): [True: 652, False: 4.76k]
  ------------------
  665|    652|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 5.41k]
  ------------------
  666|    652|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    652|			break;
  668|    652|		case 4:
  ------------------
  |  Branch (668:3): [True: 652, False: 4.76k]
  ------------------
  669|    652|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 5.41k]
  ------------------
  670|    652|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    652|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 277, False: 375]
  ------------------
  672|    277|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    277|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    375|			else
  674|    375|				snprintf (val, maxlen, "%.0f", d);
  675|    652|			break;
  676|    534|		case 8:
  ------------------
  |  Branch (676:3): [True: 534, False: 4.87k]
  ------------------
  677|    534|			snprintf (val, maxlen, "%u", vss);
  678|    534|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 5.41k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 5.41k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 5.41k]
  ------------------
  684|      0|			snprintf (val, maxlen, _("%u mm"), vss);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  685|      0|			break;
  686|      0|		case 28:
  ------------------
  |  Branch (686:3): [True: 0, False: 5.41k]
  ------------------
  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.07k|		default:
  ------------------
  |  Branch (693:3): [True: 1.07k, False: 4.33k]
  ------------------
  694|  1.07k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  5.41k|		}
  696|  5.41k|		break;
  697|       |
  698|  5.41k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.59M]
  ------------------
  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|    296|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 296, False: 1.59M]
  ------------------
  706|    296|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    296|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    296|{                                                                       \
  |  |   50|    296|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 97, False: 199]
  |  |  ------------------
  |  |   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|    296|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    738|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 539, False: 1.59M]
  ------------------
  710|    738|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    738|#define CF(format,target,v,maxlen)                              \
  |  |   37|    738|{                                                               \
  |  |   38|    738|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 373, False: 365]
  |  |  ------------------
  |  |   39|    373|                snprintf (v, maxlen,                            \
  |  |   40|    373|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    373|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    373|                        "expected '%s'."),                      \
  |  |   42|    373|                        exif_format_get_name (format),          \
  |  |   43|    373|                        exif_format_get_name (target));         \
  |  |   44|    373|                break;                                          \
  |  |   45|    373|        }                                                       \
  |  |   46|    738|}
  ------------------
  711|    365|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    365|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 96, False: 269]
  |  |  ------------------
  ------------------
  712|    365|		break;
  713|       |
  714|    684|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 684, False: 1.59M]
  ------------------
  715|    684|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    684|#define CF(format,target,v,maxlen)                              \
  |  |   37|    684|{                                                               \
  |  |   38|    684|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 231, False: 453]
  |  |  ------------------
  |  |   39|    231|                snprintf (v, maxlen,                            \
  |  |   40|    231|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    231|                        "expected '%s'."),                      \
  |  |   42|    231|                        exif_format_get_name (format),          \
  |  |   43|    231|                        exif_format_get_name (target));         \
  |  |   44|    231|                break;                                          \
  |  |   45|    231|        }                                                       \
  |  |   46|    684|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    453|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    453|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 63, False: 390]
  |  |  ------------------
  ------------------
  718|    453|		break;
  719|       |
  720|    728|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 728, False: 1.59M]
  ------------------
  721|    728|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    728|#define CF(format,target,v,maxlen)                              \
  |  |   37|    728|{                                                               \
  |  |   38|    728|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 150, False: 578]
  |  |  ------------------
  |  |   39|    150|                snprintf (v, maxlen,                            \
  |  |   40|    150|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    150|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    150|                        "expected '%s'."),                      \
  |  |   42|    150|                        exif_format_get_name (format),          \
  |  |   43|    150|                        exif_format_get_name (target));         \
  |  |   44|    150|                break;                                          \
  |  |   45|    150|        }                                                       \
  |  |   46|    728|}
  ------------------
  722|    578|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    578|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    578|{                                                                       \
  |  |   50|    578|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 355, False: 223]
  |  |  ------------------
  |  |   51|    355|                snprintf (v, maxlen,                                    \
  |  |   52|    355|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    355|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    355|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    355|                break;                                                  \
  |  |   55|    355|        }                                                               \
  |  |   56|    578|}
  ------------------
  723|    223|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 223]
  ------------------
  724|    223|		vl = exif_get_long (data, entry->order);
  725|    223|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    223|				(unsigned long) vl/10000,
  727|    223|				(unsigned long) vl%10000);
  728|    223|		break;
  729|       |
  730|    631|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 631, False: 1.59M]
  ------------------
  731|    631|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    631|#define CF(format,target,v,maxlen)                              \
  |  |   37|    631|{                                                               \
  |  |   38|    631|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 314, False: 317]
  |  |  ------------------
  |  |   39|    314|                snprintf (v, maxlen,                            \
  |  |   40|    314|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    314|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    314|                        "expected '%s'."),                      \
  |  |   42|    314|                        exif_format_get_name (format),          \
  |  |   43|    314|                        exif_format_get_name (target));         \
  |  |   44|    314|                break;                                          \
  |  |   45|    314|        }                                                       \
  |  |   46|    631|}
  ------------------
  732|    317|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    317|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    317|{                                                                       \
  |  |   50|    317|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 213, False: 104]
  |  |  ------------------
  |  |   51|    213|                snprintf (v, maxlen,                                    \
  |  |   52|    213|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    213|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    213|                break;                                                  \
  |  |   55|    213|        }                                                               \
  |  |   56|    317|}
  ------------------
  733|    104|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 104]
  ------------------
  734|    104|		vl = exif_get_long (data, entry->order);
  735|    104|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|    104|		break;
  737|       |
  738|  1.57M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.57M, False: 18.6k]
  ------------------
  739|  1.57M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.57M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.57M|{                                                               \
  |  |   38|  1.57M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.57M]
  |  |  ------------------
  |  |   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.57M|}
  ------------------
  740|  1.57M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.57M]
  ------------------
  741|  1.57M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.57M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.57M]
  ------------------
  743|  1.57M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.57M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.57M|{                                                                       \
  |  |   50|  1.57M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.55M, False: 14.5k]
  |  |  ------------------
  |  |   51|  1.55M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.55M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.55M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.55M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.55M|                break;                                                  \
  |  |   55|  1.55M|        }                                                               \
  |  |   56|  1.57M|}
  ------------------
  744|  14.5k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 14.5k]
  ------------------
  745|  14.5k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  14.5k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  14.5k|		strncat (val, buf, maxlen - strlen (val));
  748|  14.5k|		break;
  749|       |
  750|  2.38k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.38k, False: 1.58M]
  ------------------
  751|  2.38k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.38k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.38k|{                                                               \
  |  |   38|  2.38k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.38k]
  |  |  ------------------
  |  |   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.38k|}
  ------------------
  752|  2.38k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.38k]
  ------------------
  753|  2.38k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.38k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.38k]
  ------------------
  755|  2.38k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.38k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.38k|{                                                                       \
  |  |   50|  2.38k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 610, False: 1.77k]
  |  |  ------------------
  |  |   51|    610|                snprintf (v, maxlen,                                    \
  |  |   52|    610|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    610|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    610|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    610|                break;                                                  \
  |  |   55|    610|        }                                                               \
  |  |   56|  2.38k|}
  ------------------
  756|  1.77k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 1.77k]
  ------------------
  757|  1.77k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  1.77k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  1.77k|		break;
  760|       |
  761|  2.17k|	default:
  ------------------
  |  Branch (761:2): [True: 2.17k, False: 1.58M]
  ------------------
  762|  2.17k|		switch (entry->format) {
  763|    338|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 338, False: 1.83k]
  ------------------
  764|    338|		  {
  765|    338|			size_t i, len = strlen(val);
  766|  60.2k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 59.9k, False: 338]
  ------------------
  767|  59.9k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 59.9k]
  ------------------
  768|      0|					break;
  769|  59.9k|				vs = exif_get_short (data, entry->order);
  770|  59.9k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  59.9k|				len = strlen(val);
  772|  59.9k|				data += 2;
  773|  59.9k|				size -= 2;
  774|  59.9k|			}
  775|    338|		  }
  776|    338|		  break;
  777|    250|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 250, False: 1.92k]
  ------------------
  778|    250|		  {
  779|    250|			size_t i, len = strlen(val);
  780|  24.8k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 24.5k, False: 250]
  ------------------
  781|  24.5k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 24.5k]
  ------------------
  782|      0|					break;
  783|  24.5k|				vss = exif_get_sshort (data, entry->order);
  784|  24.5k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  24.5k|				data += 2;
  786|  24.5k|				size -= 2;
  787|  24.5k|			}
  788|    250|		  }
  789|    250|		  break;
  790|    337|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 337, False: 1.83k]
  ------------------
  791|    337|		  {
  792|    337|			size_t i, len = strlen(val);
  793|  40.2k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 39.9k, False: 337]
  ------------------
  794|  39.9k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 39.9k]
  ------------------
  795|      0|					break;
  796|  39.9k|				vl = exif_get_long (data, entry->order);
  797|  39.9k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  39.9k|				data += 4;
  799|  39.9k|				size -= 4;
  800|  39.9k|			}
  801|    337|		  }
  802|    337|		  break;
  803|    276|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 276, False: 1.89k]
  ------------------
  804|    276|		  {
  805|    276|			size_t i, len = strlen(val);
  806|  28.0k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 27.7k, False: 276]
  ------------------
  807|  27.7k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 27.7k]
  ------------------
  808|      0|					break;
  809|  27.7k|				vsl = exif_get_slong (data, entry->order);
  810|  27.7k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  27.7k|				data += 4;
  812|  27.7k|				size -= 4;
  813|  27.7k|			}
  814|    276|		  }
  815|    276|		  break;
  816|    733|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 733, False: 1.43k]
  ------------------
  817|    733|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    733|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 79, False: 654]
  |  |  ------------------
  ------------------
  818|    733|			break;
  819|    238|		default:
  ------------------
  |  Branch (819:3): [True: 238, False: 1.93k]
  ------------------
  820|    238|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    238|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    238|			  entry->size);
  822|    238|		  break;
  823|  2.17k|		}
  824|  2.17k|		break;
  825|  1.59M|	}
  826|  1.59M|	return val;
  827|  1.59M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  5.31k|{
  445|  5.31k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  73.7k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 72.9k, False: 855]
  |  Branch (448:32): [True: 53.2k, False: 19.7k]
  ------------------
  449|  69.7k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 17.3k, False: 2.40k]
  |  Branch (449:31): [True: 16.5k, False: 798]
  ------------------
  450|  69.7k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 16.5k, False: 53.2k]
  |  Branch (450:33): [True: 1.26k, False: 15.2k]
  ------------------
  451|  1.26k|			break;
  452|  1.26k|		}
  453|  69.7k|	}
  454|  5.31k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.40k, False: 2.91k]
  |  Branch (454:32): [True: 1.26k, False: 1.14k]
  |  Branch (454:58): [True: 1.26k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.26k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.26k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.05k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.05k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.05k|	}
  461|  5.31k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    652|{
  535|    652|	return pow (2, x / 2.);
  536|    652|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    653|{
  547|    653|	return 3.125 * pow (2, x);
  548|    653|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    652|{
  541|    652|	return 1.0 / pow (2, x);
  542|    652|}

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

exif_content_new_mem:
   57|  51.0k|{
   58|  51.0k|	ExifContent *content;
   59|       |
   60|  51.0k|	if (!mem) return NULL;
  ------------------
  |  Branch (60:6): [True: 0, False: 51.0k]
  ------------------
   61|       |
   62|  51.0k|	content = exif_mem_alloc (mem, (ExifLong) sizeof (ExifContent));
   63|  51.0k|	if (!content)
  ------------------
  |  Branch (63:6): [True: 0, False: 51.0k]
  ------------------
   64|      0|		return NULL;
   65|  51.0k|	content->priv = exif_mem_alloc (mem,
   66|  51.0k|				(ExifLong) sizeof (ExifContentPrivate));
   67|  51.0k|	if (!content->priv) {
  ------------------
  |  Branch (67:6): [True: 0, False: 51.0k]
  ------------------
   68|      0|		exif_mem_free (mem, content);
   69|      0|		return NULL;
   70|      0|	}
   71|       |
   72|  51.0k|	content->priv->ref_count = 1;
   73|       |
   74|  51.0k|	content->priv->mem = mem;
   75|  51.0k|	exif_mem_ref (mem);
   76|       |
   77|  51.0k|	return content;
   78|  51.0k|}
exif_content_unref:
   91|  51.0k|{
   92|  51.0k|	if (!content)
  ------------------
  |  Branch (92:6): [True: 0, False: 51.0k]
  ------------------
   93|      0|		return;
   94|       |
   95|  51.0k|	content->priv->ref_count--;
   96|  51.0k|	if (!content->priv->ref_count)
  ------------------
  |  Branch (96:6): [True: 51.0k, False: 0]
  ------------------
   97|  51.0k|		exif_content_free (content);
   98|  51.0k|}
exif_content_free:
  102|  51.0k|{
  103|  51.0k|	ExifMem *mem = (content && content->priv) ? content->priv->mem : NULL;
  ------------------
  |  Branch (103:18): [True: 51.0k, False: 0]
  |  Branch (103:29): [True: 51.0k, False: 0]
  ------------------
  104|  51.0k|	unsigned int i;
  105|       |
  106|  51.0k|	if (!content) return;
  ------------------
  |  Branch (106:6): [True: 0, False: 51.0k]
  ------------------
  107|       |
  108|   119k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (108:14): [True: 68.1k, False: 51.0k]
  ------------------
  109|  68.1k|		exif_entry_unref (content->entries[i]);
  110|  51.0k|	exif_mem_free (mem, content->entries);
  111|       |
  112|  51.0k|	if (content->priv) {
  ------------------
  |  Branch (112:6): [True: 51.0k, False: 0]
  ------------------
  113|  51.0k|		exif_log_unref (content->priv->log);
  114|  51.0k|	}
  115|       |
  116|  51.0k|	exif_mem_free (mem, content->priv);
  117|  51.0k|	exif_mem_free (mem, content);
  118|  51.0k|	exif_mem_unref (mem);
  119|  51.0k|}
exif_content_add_entry:
  142|  77.1k|{
  143|  77.1k|	ExifEntry **entries;
  144|  77.1k|	if (!c || !c->priv || !entry || entry->parent) return;
  ------------------
  |  Branch (144:6): [True: 0, False: 77.1k]
  |  Branch (144:12): [True: 0, False: 77.1k]
  |  Branch (144:24): [True: 0, False: 77.1k]
  |  Branch (144:34): [True: 0, False: 77.1k]
  ------------------
  145|       |
  146|       |	/* One tag can only be added once to an IFD. */
  147|  77.1k|	if (exif_content_get_entry (c, entry->tag)) {
  ------------------
  |  Branch (147:6): [True: 7.74k, False: 69.3k]
  ------------------
  148|  7.74k|		exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "ExifContent",
  149|  7.74k|			"An attempt has been made to add "
  150|  7.74k|			"the tag '%s' twice to an IFD. This is against "
  151|  7.74k|			"specification.", exif_tag_get_name (entry->tag));
  152|  7.74k|		return;
  153|  7.74k|	}
  154|       |
  155|  69.3k|	entries = exif_mem_realloc (c->priv->mem,
  156|  69.3k|		c->entries, sizeof (ExifEntry*) * (c->count + 1));
  157|  69.3k|	if (!entries) return;
  ------------------
  |  Branch (157:6): [True: 0, False: 69.3k]
  ------------------
  158|  69.3k|	entry->parent = c;
  159|  69.3k|	entries[c->count++] = entry;
  160|  69.3k|	c->entries = entries;
  161|  69.3k|	exif_entry_ref (entry);
  162|  69.3k|}
exif_content_remove_entry:
  166|  1.27k|{
  167|  1.27k|	unsigned int i;
  168|  1.27k|	ExifEntry **t, *temp;
  169|       |
  170|  1.27k|	if (!c || !c->priv || !e || (e->parent != c)) return;
  ------------------
  |  Branch (170:6): [True: 0, False: 1.27k]
  |  Branch (170:12): [True: 0, False: 1.27k]
  |  Branch (170:24): [True: 0, False: 1.27k]
  |  Branch (170:30): [True: 0, False: 1.27k]
  ------------------
  171|       |
  172|       |	/* Search the entry */
  173|  6.27k|	for (i = 0; i < c->count; i++)
  ------------------
  |  Branch (173:14): [True: 6.27k, False: 0]
  ------------------
  174|  6.27k|			if (c->entries[i] == e)
  ------------------
  |  Branch (174:8): [True: 1.27k, False: 4.99k]
  ------------------
  175|  1.27k|					break;
  176|       |
  177|  1.27k|	if (i == c->count)
  ------------------
  |  Branch (177:6): [True: 0, False: 1.27k]
  ------------------
  178|      0|			return;
  179|       |
  180|       |	/* Remove the entry */
  181|  1.27k|	temp = c->entries[c->count-1];
  182|  1.27k|	if (c->count > 1) {
  ------------------
  |  Branch (182:6): [True: 822, False: 457]
  ------------------
  183|    822|		t = exif_mem_realloc (c->priv->mem, c->entries,
  184|    822|					sizeof(ExifEntry*) * (c->count - 1));
  185|    822|		if (!t) {
  ------------------
  |  Branch (185:7): [True: 0, False: 822]
  ------------------
  186|      0|			return;
  187|      0|		}
  188|    822|		c->entries = t;
  189|    822|		c->count--;
  190|    822|		if (i != c->count) { /* we deallocated the last slot already */ 
  ------------------
  |  Branch (190:7): [True: 0, False: 822]
  ------------------
  191|      0|			memmove (&t[i], &t[i + 1], sizeof (ExifEntry*) * (c->count - i - 1));
  192|      0|			t[c->count-1] = temp;
  193|      0|		} 
  194|    822|	} else {
  195|    457|		exif_mem_free (c->priv->mem, c->entries);
  196|    457|		c->entries = NULL;
  197|    457|		c->count = 0;
  198|    457|	}
  199|  1.27k|	e->parent = NULL;
  200|  1.27k|	exif_entry_unref (e);
  201|  1.27k|}
exif_content_get_entry:
  205|   172k|{
  206|   172k|	unsigned int i;
  207|       |
  208|   172k|	if (!content)
  ------------------
  |  Branch (208:6): [True: 0, False: 172k]
  ------------------
  209|      0|		return (NULL);
  210|       |
  211|   444k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (211:14): [True: 295k, False: 148k]
  ------------------
  212|   295k|		if (content->entries[i]->tag == tag)
  ------------------
  |  Branch (212:7): [True: 24.1k, False: 271k]
  ------------------
  213|  24.1k|			return (content->entries[i]);
  214|   148k|	return (NULL);
  215|   172k|}
exif_content_foreach_entry:
  220|   114k|{
  221|   114k|	unsigned int i;
  222|       |
  223|   114k|	if (!content || !func)
  ------------------
  |  Branch (223:6): [True: 0, False: 114k]
  |  Branch (223:18): [True: 0, False: 114k]
  ------------------
  224|      0|		return;
  225|       |
  226|   217k|	for (i = 0; i < content->count; i++)
  ------------------
  |  Branch (226:14): [True: 102k, False: 114k]
  ------------------
  227|   102k|		func (content->entries[i], data);
  228|   114k|}
exif_content_log:
  232|  51.0k|{
  233|  51.0k|	if (!content || !content->priv || !log || content->priv->log == log)
  ------------------
  |  Branch (233:6): [True: 0, False: 51.0k]
  |  Branch (233:18): [True: 0, False: 51.0k]
  |  Branch (233:36): [True: 51.0k, False: 0]
  |  Branch (233:44): [True: 0, False: 0]
  ------------------
  234|  51.0k|		return;
  235|       |
  236|      0|	if (content->priv->log) exif_log_unref (content->priv->log);
  ------------------
  |  Branch (236:6): [True: 0, False: 0]
  ------------------
  237|      0|	content->priv->log = log;
  238|      0|	exif_log_ref (log);
  239|      0|}
exif_content_get_ifd:
  243|   137k|{
  244|   137k|	if (!c || !c->parent) return EXIF_IFD_COUNT;
  ------------------
  |  Branch (244:6): [True: 0, False: 137k]
  |  Branch (244:12): [True: 0, False: 137k]
  ------------------
  245|       |
  246|   137k|	return 
  247|   137k|		((c)->parent->ifd[EXIF_IFD_EXIF] == (c)) ? EXIF_IFD_EXIF :
  ------------------
  |  Branch (247:3): [True: 50.5k, False: 86.6k]
  ------------------
  248|   137k|		((c)->parent->ifd[EXIF_IFD_0] == (c)) ? EXIF_IFD_0 :
  ------------------
  |  Branch (248:3): [True: 41.7k, False: 44.8k]
  ------------------
  249|  86.6k|		((c)->parent->ifd[EXIF_IFD_1] == (c)) ? EXIF_IFD_1 :
  ------------------
  |  Branch (249:3): [True: 9.86k, False: 34.9k]
  ------------------
  250|  44.8k|		((c)->parent->ifd[EXIF_IFD_GPS] == (c)) ? EXIF_IFD_GPS :
  ------------------
  |  Branch (250:3): [True: 17.9k, False: 17.0k]
  ------------------
  251|  34.9k|		((c)->parent->ifd[EXIF_IFD_INTEROPERABILITY] == (c)) ? EXIF_IFD_INTEROPERABILITY :
  ------------------
  |  Branch (251:3): [True: 17.0k, False: 0]
  ------------------
  252|  17.0k|		EXIF_IFD_COUNT;
  253|   137k|}
exif_content_fix:
  287|  31.8k|{
  288|  31.8k|	ExifIfd ifd = exif_content_get_ifd (c);
  289|  31.8k|	ExifDataType dt;
  290|  31.8k|	ExifEntry *e;
  291|  31.8k|	unsigned int i, num;
  292|       |
  293|  31.8k|	if (!c)
  ------------------
  |  Branch (293:6): [True: 0, False: 31.8k]
  ------------------
  294|      0|		return;
  295|       |
  296|  31.8k|	dt = exif_data_get_data_type (c->parent);
  297|       |
  298|       |	/*
  299|       |	 * First of all, fix all existing entries.
  300|       |	 */
  301|  31.8k|	exif_content_foreach_entry (c, fix_func, NULL);
  302|       |
  303|       |	/*
  304|       |	 * Go through each tag and if it's not recorded, remove it. If one
  305|       |	 * is removed, exif_content_foreach_entry() will skip the next entry,
  306|       |	 * so if this happens do the loop again from the beginning to ensure
  307|       |	 * they're all checked. This could be avoided if we stop relying on
  308|       |	 * exif_content_foreach_entry but loop intelligently here.
  309|       |	 */
  310|  31.8k|	do {
  311|  31.8k|		num = c->count;
  312|  31.8k|		exif_content_foreach_entry (c, remove_not_recorded, NULL);
  313|  31.8k|	} while (num != c->count);
  ------------------
  |  Branch (313:11): [True: 0, False: 31.8k]
  ------------------
  314|       |
  315|       |	/*
  316|       |	 * Then check for non-existing mandatory tags and create them if needed
  317|       |	 */
  318|  31.8k|	num = exif_tag_table_count();
  319|  5.40M|	for (i = 0; i < num; ++i) {
  ------------------
  |  Branch (319:14): [True: 5.37M, False: 31.8k]
  ------------------
  320|  5.37M|		const ExifTag t = exif_tag_table_get_tag (i);
  321|  5.37M|		if (exif_tag_get_support_level_in_ifd (t, ifd, dt) ==
  ------------------
  |  Branch (321:7): [True: 48.1k, False: 5.32M]
  ------------------
  322|  5.37M|			EXIF_SUPPORT_LEVEL_MANDATORY) {
  323|  48.1k|			if (exif_content_get_entry (c, t))
  ------------------
  |  Branch (323:8): [True: 293, False: 47.8k]
  ------------------
  324|       |				/* This tag already exists */
  325|    293|				continue;
  326|  47.8k|			exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "exif-content",
  327|  47.8k|					"Tag '%s' is mandatory in IFD '%s' and has therefore been added.",
  328|  47.8k|					exif_tag_get_name_in_ifd (t, ifd), exif_ifd_get_name (ifd));
  329|  47.8k|			e = exif_entry_new ();
  330|  47.8k|			exif_content_add_entry (c, e);
  331|  47.8k|			exif_entry_initialize (e, t);
  332|  47.8k|			exif_entry_unref (e);
  333|  47.8k|		}
  334|  5.37M|	}
  335|  31.8k|}
exif-content.c:fix_func:
  257|  17.1k|{
  258|  17.1k|	exif_entry_fix (e);
  259|  17.1k|}
exif-content.c:remove_not_recorded:
  269|  17.1k|{
  270|  17.1k|	ExifIfd ifd = exif_entry_get_ifd(e) ;
  ------------------
  |  |  182|  17.1k|#define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
  |  |  ------------------
  |  |  |  Branch (182:32): [True: 17.1k, False: 0]
  |  |  ------------------
  ------------------
  271|  17.1k|	ExifContent *c = e->parent;
  272|  17.1k|	ExifDataType dt = exif_data_get_data_type (c->parent);
  273|  17.1k|	ExifTag t = e->tag;
  274|       |
  275|  17.1k|	if (exif_tag_get_support_level_in_ifd (t, ifd, dt) ==
  ------------------
  |  Branch (275:6): [True: 0, False: 17.1k]
  ------------------
  276|  17.1k|			 EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  277|      0|		exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "exif-content",
  278|      0|				"Tag 0x%04x is not recorded in IFD '%s' and has therefore been "
  279|      0|				"removed.", t, exif_ifd_get_name (ifd));
  280|      0|		exif_content_remove_entry (c, e);
  281|      0|	}
  282|       |
  283|  17.1k|}

exif_data_get_mnote_data:
   93|  10.2k|{
   94|  10.2k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 10.2k, False: 0]
  |  Branch (94:15): [True: 10.2k, False: 0]
  ------------------
   95|  10.2k|}
exif_data_new_mem:
  110|  10.2k|{
  111|  10.2k|	ExifData *data;
  112|  10.2k|	unsigned int i;
  113|       |
  114|  10.2k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 10.2k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  10.2k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  10.2k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 10.2k]
  ------------------
  119|      0|		return (NULL);
  120|  10.2k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  10.2k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 10.2k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  10.2k|	data->priv->ref_count = 1;
  126|       |
  127|  10.2k|	data->priv->mem = mem;
  128|  10.2k|	exif_mem_ref (mem);
  129|       |
  130|  61.2k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 51.0k, False: 10.2k]
  ------------------
  131|  51.0k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  51.0k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 51.0k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  51.0k|		data->ifd[i]->parent = data;
  137|  51.0k|	}
  138|       |
  139|       |	/* Default options */
  140|  10.2k|#ifndef NO_VERBOSE_TAG_STRINGS
  141|       |	/*
  142|       |	 * When the tag list is compiled away, setting this option prevents
  143|       |	 * any tags from being loaded
  144|       |	 */
  145|  10.2k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  10.2k|#endif
  147|  10.2k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  10.2k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  10.2k|	return (data);
  153|  10.2k|}
exif_data_load_data:
  858|  10.2k|{
  859|  10.2k|	unsigned int l;
  860|  10.2k|	ExifLong offset;
  861|  10.2k|	ExifShort n;
  862|  10.2k|	const unsigned char *d = d_orig;
  863|  10.2k|	unsigned int len, fullds;
  864|       |
  865|  10.2k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 10.2k]
  |  Branch (865:15): [True: 0, False: 10.2k]
  |  Branch (865:30): [True: 0, False: 10.2k]
  |  Branch (865:36): [True: 0, False: 10.2k]
  ------------------
  866|      0|		return;
  867|       |
  868|  10.2k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  10.2k|		  "Parsing %i byte(s) EXIF data...\n", ds);
  870|       |
  871|       |	/*
  872|       |	 * It can be that the data starts with the EXIF header. If it does
  873|       |	 * not, search the EXIF marker.
  874|       |	 */
  875|  10.2k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 24, False: 10.1k]
  ------------------
  876|     24|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     24|#define LOG_TOO_SMALL \
  |  |  852|     24|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     24|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     24|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     24|		return;
  878|     24|	}
  879|  10.1k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 10.0k, False: 171]
  ------------------
  880|  10.0k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  10.0k|			  "Found EXIF header at start.");
  882|  10.0k|	} else {
  883|    962|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 946, False: 16]
  ------------------
  884|  1.48k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.47k, False: 6]
  |  Branch (884:17): [True: 534, False: 940]
  ------------------
  885|    534|				d++;
  886|    534|				ds--;
  887|    534|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|    946|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|    940|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 940, False: 6]
  |  Branch (890:14): [True: 325, False: 615]
  ------------------
  891|    325|				d++;
  892|    325|				ds--;
  893|    325|				continue;
  894|    325|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    621|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    615|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 615, False: 6]
  |  Branch (897:14): [True: 307, False: 308]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    307|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 275, False: 32]
  |  Branch (904:22): [True: 53, False: 222]
  ------------------
  905|     53|					break;
  906|       |				/* fallthrough */
  907|    307|			}
  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|    568|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 560, False: 8]
  |  Branch (913:19): [True: 507, False: 53]
  |  Branch (913:35): [True: 502, False: 5]
  ------------------
  914|    502|				d++;
  915|    502|				ds--;
  916|    502|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    502|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 36, False: 466]
  ------------------
  918|     36|					return;
  919|    466|				d += l;
  920|    466|				ds -= l;
  921|    466|				continue;
  922|    502|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     66|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     66|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     66|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     66|			return;
  928|    568|		}
  929|     69|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 16, False: 53]
  ------------------
  930|     16|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     16|#define LOG_TOO_SMALL \
  |  |  852|     16|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     16|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     16|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     16|			return;
  932|     16|		}
  933|     53|		d++;
  934|     53|		ds--;
  935|     53|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     53|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 31, False: 22]
  ------------------
  937|     31|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     31|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     31|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     31|			return;
  940|     31|		}
  941|     22|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 2, False: 20]
  ------------------
  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|     20|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     20|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     20|			  len);
  949|     20|		d += 2;
  950|     20|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     20|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  10.0k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 5, False: 10.0k]
  ------------------
  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.0k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 10.0k]
  ------------------
  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.0k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  10.0k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  10.0k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 44, False: 9.98k]
  ------------------
  972|     44|		return;
  973|       |
  974|       |	/* The JPEG APP1 section can be no longer than 64 KiB (including a
  975|       |	   16-bit length), so cap the data length to protect against overflow
  976|       |	   in future offset calculations */
  977|  9.98k|	fullds = ds;
  978|  9.98k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 6, False: 9.97k]
  ------------------
  979|      6|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  9.98k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 7.76k, False: 2.21k]
  ------------------
  983|  7.76k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.21k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 2.15k, False: 64]
  ------------------
  985|  2.15k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
  986|     64|	else {
  987|     64|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  988|     64|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     64|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  989|     64|		return;
  990|     64|	}
  991|       |
  992|       |	/* Fixed value */
  993|  9.91k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 21, False: 9.89k]
  ------------------
  994|     21|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  9.89k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  9.89k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  9.89k|		  "IFD 0 at %i.", (int) offset);
 1000|       |
 1001|       |	/* ds is restricted to 16 bit above, so offset is restricted too, and offset+8 should not overflow. */
 1002|  9.89k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 60, False: 9.83k]
  |  Branch (1002:21): [True: 8, False: 9.83k]
  ------------------
 1003|     68|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  9.83k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  9.83k|	n = exif_get_short (d + 6 + offset, data->priv->order);
 1010|       |	/* offset < 2<<16, n is 16 bit at most, so this op will not overflow */
 1011|  9.83k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 1.92k, False: 7.90k]
  ------------------
 1012|  1.92k|		return;
 1013|       |
 1014|  7.90k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  7.90k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 7.75k, False: 147]
  ------------------
 1016|  7.75k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  7.75k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  7.75k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.62k, False: 6.13k]
  ------------------
 1021|  1.62k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.62k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  6.13k|		} else {
 1024|  6.13k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  6.13k|		}
 1026|  7.75k|	}
 1027|       |
 1028|       |	/*
 1029|       |	 * If we got an EXIF_TAG_MAKER_NOTE, try to interpret it. Some
 1030|       |	 * cameras use pointers in the maker note tag that point to the
 1031|       |	 * space between IFDs. Here is the only place where we have access
 1032|       |	 * to that data.
 1033|       |	 */
 1034|  7.90k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  7.90k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 7.90k, False: 0]
  ------------------
 1038|  7.90k|		exif_data_fix (data);
 1039|  7.90k|}
exif_data_unref:
 1111|  10.2k|{
 1112|  10.2k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 10.2k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  10.2k|	data->priv->ref_count--;
 1116|  10.2k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 10.2k, False: 0]
  ------------------
 1117|  10.2k|		exif_data_free (data);
 1118|  10.2k|}
exif_data_free:
 1122|  10.2k|{
 1123|  10.2k|	unsigned int i;
 1124|  10.2k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 10.2k, False: 0]
  |  Branch (1124:26): [True: 10.2k, False: 0]
  ------------------
 1125|       |
 1126|  10.2k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 10.2k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  61.2k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 51.0k, False: 10.2k]
  ------------------
 1130|  51.0k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 51.0k, False: 0]
  ------------------
 1131|  51.0k|			exif_content_unref (data->ifd[i]);
 1132|  51.0k|			data->ifd[i] = NULL;
 1133|  51.0k|		}
 1134|  51.0k|	}
 1135|       |
 1136|  10.2k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 206, False: 10.0k]
  ------------------
 1137|    206|		exif_mem_free (mem, data->data);
 1138|    206|		data->data = NULL;
 1139|    206|	}
 1140|       |
 1141|  10.2k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 10.2k, False: 0]
  ------------------
 1142|  10.2k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 10.2k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  10.2k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 6.71k, False: 3.49k]
  ------------------
 1147|  6.71k|			exif_mnote_data_unref (data->priv->md);
 1148|  6.71k|			data->priv->md = NULL;
 1149|  6.71k|		}
 1150|  10.2k|		exif_mem_free (mem, data->priv);
 1151|  10.2k|		exif_mem_free (mem, data);
 1152|  10.2k|	}
 1153|       |
 1154|  10.2k|	exif_mem_unref (mem);
 1155|  10.2k|}
exif_data_get_byte_order:
 1186|   151k|{
 1187|   151k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 151k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   151k|	return (data->priv->order);
 1191|   151k|}
exif_data_foreach_content:
 1196|  18.1k|{
 1197|  18.1k|	unsigned int i;
 1198|       |
 1199|  18.1k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 18.1k]
  |  Branch (1199:15): [True: 0, False: 18.1k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   108k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 90.5k, False: 18.1k]
  ------------------
 1203|  90.5k|		func (data->ifd[i], user_data);
 1204|  18.1k|}
exif_data_log:
 1246|  10.2k|{
 1247|  10.2k|	unsigned int i;
 1248|       |
 1249|  10.2k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 10.2k]
  |  Branch (1249:15): [True: 0, False: 10.2k]
  ------------------
 1250|      0|		return;
 1251|  10.2k|	exif_log_unref (data->priv->log);
 1252|  10.2k|	data->priv->log = log;
 1253|  10.2k|	exif_log_ref (log);
 1254|       |
 1255|  61.2k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 51.0k, False: 10.2k]
  ------------------
 1256|  51.0k|		exif_content_log (data->ifd[i], log);
 1257|  10.2k|}
exif_data_get_log:
 1263|  66.4k|{
 1264|  66.4k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 66.4k]
  |  Branch (1264:15): [True: 0, False: 66.4k]
  ------------------
 1265|      0|		return NULL;
 1266|  66.4k|	return data->priv->log;
 1267|  66.4k|}
exif_data_set_option:
 1309|  20.4k|{
 1310|  20.4k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 20.4k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  20.4k|	d->priv->options |= o;
 1314|  20.4k|}
exif_data_fix:
 1355|  7.90k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  7.90k|}
exif_data_set_data_type:
 1361|  10.2k|{
 1362|  10.2k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 10.2k]
  |  Branch (1362:12): [True: 0, False: 10.2k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  10.2k|	d->priv->data_type = dt;
 1366|  10.2k|}
exif_data_get_data_type:
 1370|  48.9k|{
 1371|  48.9k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1371:10): [True: 48.9k, False: 0]
  |  Branch (1371:15): [True: 48.9k, False: 0]
  ------------------
 1372|  48.9k|}
exif-data.c:exif_data_load_data_content:
  401|  37.2M|{
  402|  37.2M|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  403|  37.2M|	ExifShort n;
  404|  37.2M|	ExifEntry *entry;
  405|  37.2M|	unsigned int i;
  406|  37.2M|	ExifTag tag;
  407|       |
  408|  37.2M|	if (!data || !data->priv) 
  ------------------
  |  Branch (408:6): [True: 0, False: 37.2M]
  |  Branch (408:15): [True: 0, False: 37.2M]
  ------------------
  409|      0|		return;
  410|       |
  411|       |	/* check for valid ExifIfd enum range */
  412|  37.2M|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (412:6): [True: 0, False: 37.2M]
  |  Branch (412:26): [True: 0, False: 37.2M]
  ------------------
  413|      0|	  return;
  414|       |
  415|  37.2M|	if (recursion_cost > 170) {
  ------------------
  |  Branch (415:6): [True: 34.6M, False: 2.60M]
  ------------------
  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.6M|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  428|  34.6M|			  "Deep/expensive recursion detected!");
  429|  34.6M|		return;
  430|  34.6M|	}
  431|       |
  432|       |	/* Read the number of entries */
  433|  2.60M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  2.60M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 2, False: 2.60M]
  |  |  |  Branch (53:81): [True: 0, False: 2.60M]
  |  |  |  Branch (53:112): [True: 194, False: 2.60M]
  |  |  ------------------
  ------------------
  434|    196|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|    196|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|    196|		return;
  437|    196|	}
  438|  2.60M|	n = exif_get_short (d + offset, data->priv->order);
  439|  2.60M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  2.60M|	          "Loading %hu entries...", n);
  441|  2.60M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  2.60M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  2.60M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 336, False: 2.60M]
  |  |  |  Branch (53:81): [True: 2.59M, False: 16.3k]
  |  |  |  Branch (53:112): [True: 400, False: 15.9k]
  |  |  ------------------
  ------------------
  445|  2.59M|		n = (ds - offset) / 12;
  446|  2.59M|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  447|  2.59M|				  "Short data; only loading %hu entries...", n);
  448|  2.59M|	}
  449|       |
  450|   112M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (450:14): [True: 110M, False: 2.60M]
  ------------------
  451|       |
  452|   110M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   110M|		switch (tag) {
  454|  1.18M|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 1.18M, False: 108M]
  ------------------
  455|  36.2M|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (455:3): [True: 35.0M, False: 74.9M]
  ------------------
  456|  71.6M|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (456:3): [True: 35.4M, False: 74.5M]
  ------------------
  457|  71.6M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (457:3): [True: 6.33k, False: 110M]
  ------------------
  458|  71.6M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 6.47k, False: 110M]
  ------------------
  459|  71.6M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  71.6M|					   data->priv->order);
  461|  71.6M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 3.88k, False: 71.6M]
  ------------------
  462|  3.88k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  3.88k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  3.88k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 2.13k, False: 1.75k]
  ------------------
  465|  2.13k|					return;
  466|  1.75k|				break;
  467|  3.88k|			}
  468|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  469|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  470|       |			 */
  471|  71.6M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  71.6M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  71.6M|				  exif_tag_get_name(tag), o);
  474|  71.6M|			switch (tag) {
  475|  1.18M|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 1.18M, False: 70.4M]
  ------------------
  476|  1.18M|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|  1.18M|#define CHECK_REC(i) 					\
  |  |  357|  1.18M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 3.16k, False: 1.18M]
  |  |  ------------------
  |  |  358|  3.16k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  3.16k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  3.16k|		"'%s' detected. Skipping...",		\
  |  |  361|  3.16k|		exif_ifd_get_name (i));			\
  |  |  362|  3.16k|	break;						\
  |  |  363|  1.18M|}							\
  |  |  364|  1.18M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 3.52k, False: 1.18M]
  |  |  ------------------
  |  |  365|  3.52k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  3.52k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  3.52k|		"'%s' multiple times detected. "	\
  |  |  368|  3.52k|		"Skipping...",				\
  |  |  369|  3.52k|		exif_ifd_get_name (i));			\
  |  |  370|  3.52k|	break;						\
  |  |  371|  3.52k|}
  ------------------
  477|  1.18M|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|  1.18M|					recursion_cost + level_cost(n));
  479|  1.18M|				break;
  480|  35.0M|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (480:4): [True: 35.0M, False: 36.6M]
  ------------------
  481|  35.0M|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  356|  35.0M|#define CHECK_REC(i) 					\
  |  |  357|  35.0M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.0M, False: 17.9M]
  |  |  ------------------
  |  |  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.9M|}							\
  |  |  364|  17.9M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 850, False: 17.9M]
  |  |  ------------------
  |  |  365|    850|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    850|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    850|		"'%s' multiple times detected. "	\
  |  |  368|    850|		"Skipping...",				\
  |  |  369|    850|		exif_ifd_get_name (i));			\
  |  |  370|    850|	break;						\
  |  |  371|    850|}
  ------------------
  482|  17.9M|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  483|  17.9M|					recursion_cost + level_cost(n));
  484|  17.9M|				break;
  485|  35.4M|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (485:4): [True: 35.4M, False: 36.2M]
  ------------------
  486|  35.4M|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  356|  35.4M|#define CHECK_REC(i) 					\
  |  |  357|  35.4M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.3M, False: 18.0M]
  |  |  ------------------
  |  |  358|  17.3M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.3M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.3M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.3M|		exif_ifd_get_name (i));			\
  |  |  362|  17.3M|	break;						\
  |  |  363|  18.0M|}							\
  |  |  364|  18.0M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 966, False: 18.0M]
  |  |  ------------------
  |  |  365|    966|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    966|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    966|		"'%s' multiple times detected. "	\
  |  |  368|    966|		"Skipping...",				\
  |  |  369|    966|		exif_ifd_get_name (i));			\
  |  |  370|    966|	break;						\
  |  |  371|    966|}
  ------------------
  487|  18.0M|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  488|  18.0M|					recursion_cost + level_cost(n));
  489|  18.0M|				break;
  490|  5.90k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 5.90k, False: 71.6M]
  ------------------
  491|  5.90k|				thumbnail_offset = o;
  492|  5.90k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 5.21k, False: 692]
  |  Branch (492:29): [True: 1.82k, False: 3.39k]
  ------------------
  493|  1.82k|					exif_data_load_data_thumbnail (data, d,
  494|  1.82k|								       ds, thumbnail_offset,
  495|  1.82k|								       thumbnail_length);
  496|  5.90k|				break;
  497|  5.25k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 5.25k, False: 71.6M]
  ------------------
  498|  5.25k|				thumbnail_length = o;
  499|  5.25k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 2.88k, False: 2.37k]
  |  Branch (499:29): [True: 2.13k, False: 746]
  ------------------
  500|  2.13k|					exif_data_load_data_thumbnail (data, d,
  501|  2.13k|								       ds, thumbnail_offset,
  502|  2.13k|								       thumbnail_length);
  503|  5.25k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 71.6M]
  ------------------
  505|      0|				return;
  506|  71.6M|			}
  507|  71.6M|			break;
  508|  71.6M|		default:
  ------------------
  |  Branch (508:3): [True: 38.3M, False: 71.6M]
  ------------------
  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.3M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.1M, False: 234k]
  ------------------
  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.1M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (521:9): [True: 216k, False: 37.9M]
  ------------------
  522|   216k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   216k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   216k|						  exif_ifd_get_name (ifd));
  525|   216k|					break;
  526|   216k|				}
  527|  37.9M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  528|  37.9M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  529|  37.9M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  530|  37.9M|					  exif_ifd_get_name (ifd));
  531|  37.9M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (531:9): [True: 37.9M, False: 0]
  ------------------
  532|  37.9M|					break;
  533|  37.9M|			}
  534|   234k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   234k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 234k]
  ------------------
  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|   234k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 29.2k, False: 205k]
  ------------------
  541|   234k|						   offset + 12 * i))
  542|  29.2k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   234k|			exif_entry_unref (entry);
  544|   234k|			break;
  545|   110M|		}
  546|   110M|	}
  547|  2.60M|}
exif-data.c:level_cost:
  380|  37.2M|{
  381|  37.2M|    static const double log_1_1 = 0.09531017980432493;
  382|       |
  383|       |	/* Adding 0.1 protects against the case where n==1 */
  384|  37.2M|	return ceil(log(n + 0.1)/log_1_1);
  385|  37.2M|}
exif-data.c:exif_data_load_data_thumbnail:
  334|  3.96k|{
  335|       |	/* Sanity checks */
  336|  3.96k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 3.96k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  3.96k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  3.96k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 3.96k]
  |  |  |  Branch (53:81): [True: 0, False: 3.96k]
  |  |  |  Branch (53:112): [True: 1.37k, False: 2.58k]
  |  |  ------------------
  ------------------
  341|  1.37k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  1.37k|		return;
  343|  1.37k|	}
  344|  2.58k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 2.37k, False: 206]
  ------------------
  345|  2.37k|		exif_mem_free (data->priv->mem, data->data);
  346|  2.58k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 2.58k]
  ------------------
  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.58k|	data->size = s;
  352|  2.58k|	memcpy (data->data, d + o, s);
  353|  2.58k|}
exif-data.c:exif_data_load_data_entry:
  169|   234k|{
  170|   234k|	unsigned int s, doff;
  171|       |
  172|   234k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   234k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   234k|	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|   234k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   234k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   234k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   234k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   234k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 149k, False: 85.3k]
  |  Branch (186:33): [True: 33.9k, False: 51.3k]
  ------------------
  187|   183k|		return 0;
  188|   183k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  51.3k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 40.3k, False: 11.0k]
  ------------------
  195|  40.3k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  11.0k|	else
  197|  11.0k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  51.3k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 18.3k, False: 33.0k]
  ------------------
  201|  18.3k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  18.3k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  18.3k|		return 0;
  204|  18.3k|	}
  205|       |
  206|  33.0k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 3.78k, False: 29.2k]
  ------------------
  207|  3.78k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  3.78k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  3.78k|		return 0;
  210|  3.78k|	}
  211|       |
  212|  29.2k|	entry->data = exif_data_alloc (data, s);
  213|  29.2k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 29.2k, False: 0]
  ------------------
  214|  29.2k|		entry->size = s;
  215|  29.2k|		memcpy (entry->data, d + doff, s);
  216|  29.2k|	} 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|  29.2k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.23k, False: 21.0k]
  ------------------
  223|  8.23k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.23k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.23k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 7.44k, False: 785]
  ------------------
  227|  7.44k|			exif_log (data->priv->log,
  228|  7.44k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  7.44k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  7.44k|					       "%02x %02x %02x...).",
  231|  7.44k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  7.44k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  7.44k|					       entry->data[6]);
  234|  7.44k|		}
  235|  8.23k|		data->priv->offset_mnote = doff;
  236|  8.23k|	}
  237|  29.2k|	return 1;
  238|  29.2k|}
exif-data.c:interpret_maker_note:
  802|  7.90k|{
  803|  7.90k|	int mnoteid;
  804|  7.90k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  7.90k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |  254|  7.90k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  7.90k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |  256|  7.90k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  7.90k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 6.92k, False: 980]
  |  |  ------------------
  |  |  258|  7.90k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  7.90k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 980]
  |  |  ------------------
  |  |  260|    980|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    980|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 980]
  |  |  ------------------
  |  |  262|    980|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  805|  7.90k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 980, False: 6.92k]
  ------------------
  806|    980|		return;
  807|       |	
  808|  6.92k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 3.85k, False: 3.07k]
  ------------------
  809|  3.85k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  3.85k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  3.85k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  3.85k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 845, False: 2.22k]
  ------------------
  814|    845|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    845|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    845|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  817|       |
  818|  2.22k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (818:13): [True: 970, False: 1.25k]
  ------------------
  819|    970|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|    970|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|    970|		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.25k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (825:13): [True: 1.04k, False: 213]
  ------------------
  826|  1.04k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|  1.04k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|  1.04k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|  1.04k|	}
  830|       |/* Marcus: disabled until apple makernote can also be saved
  831|       |	else if ((mnoteid = exif_mnote_data_apple_identify (data, e)) != 0) {
  832|       |		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  833|       |			"ExifData", "Apple MakerNote variant type %d", mnoteid);
  834|       |		data->priv->md = exif_mnote_data_apple_new (data->priv->mem);
  835|       |	}
  836|       |*/
  837|       |
  838|       |	/* 
  839|       |	 * If we are able to interpret the maker note, do so.
  840|       |	 */
  841|  6.92k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 6.71k, False: 213]
  ------------------
  842|  6.71k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  6.71k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  6.71k|						data->priv->order);
  845|  6.71k|		exif_mnote_data_set_offset (data->priv->md,
  846|  6.71k|					    data->priv->offset_mnote);
  847|  6.71k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  6.71k|	}
  849|  6.92k|}
exif-data.c:exif_data_alloc:
   77|  31.8k|{
   78|  31.8k|	void *d;
   79|       |
   80|  31.8k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 31.8k]
  |  Branch (80:15): [True: 0, False: 31.8k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  31.8k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  31.8k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 31.8k, False: 0]
  ------------------
   85|  31.8k|		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|  31.8k|}
exif-data.c:fix_func:
 1327|  39.5k|{
 1328|  39.5k|	switch (exif_content_get_ifd (c)) {
 1329|  7.90k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 7.90k, False: 31.6k]
  ------------------
 1330|  7.90k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 180, False: 7.72k]
  ------------------
 1331|    180|			exif_content_fix (c);
 1332|  7.72k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 457, False: 7.26k]
  ------------------
 1333|    457|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    457|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    457|				  "removed.");
 1336|  1.73k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.27k, False: 457]
  ------------------
 1337|  1.27k|				unsigned int cnt = c->count;
 1338|  1.27k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.27k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.27k]
  ------------------
 1340|       |					/* safety net */
 1341|      0|					exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1342|      0|					"failed to remove last entry from entries.");
 1343|      0|					c->count--;
 1344|      0|				}
 1345|  1.27k|			}
 1346|    457|		}
 1347|  7.90k|		break;
 1348|  31.6k|	default:
  ------------------
  |  Branch (1348:2): [True: 31.6k, False: 7.90k]
  ------------------
 1349|  31.6k|		exif_content_fix (c);
 1350|  39.5k|	}
 1351|  39.5k|}

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

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: 259k, False: 12.0k]
  ------------------
   62|   259k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 31.9k, False: 227k]
  ------------------
   63|  31.9k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  31.9k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  12.0k|	return NULL;
   65|  44.0k|}
exif_format_get_size:
   69|  1.47M|{
   70|  1.47M|	unsigned int i;
   71|       |
   72|  9.52M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 9.14M, False: 374k]
  ------------------
   73|  9.14M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.09M, False: 8.04M]
  ------------------
   74|  1.09M|			return ExifFormatTable[i].size;
   75|   374k|	return 0;
   76|  1.47M|}

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

exif_loader_write:
  170|  10.5k|{
  171|  10.5k|	unsigned int i;
  172|       |
  173|   106k|begin:
  174|   106k|	if (!eld || (len && !buf)) 
  ------------------
  |  Branch (174:6): [True: 0, False: 106k]
  |  Branch (174:15): [True: 106k, False: 241]
  |  Branch (174:22): [True: 0, False: 106k]
  ------------------
  175|      0|		return 0;
  176|       |
  177|   106k|	switch (eld->state) {
  178|    202|	case EL_EXIF_FOUND:
  ------------------
  |  Branch (178:2): [True: 202, False: 106k]
  ------------------
  179|    202|		return exif_loader_copy (eld, buf, len);
  180|  1.09k|	case EL_SKIP_BYTES:
  ------------------
  |  Branch (180:2): [True: 1.09k, False: 105k]
  ------------------
  181|  1.09k|		if (eld->size > len) { 
  ------------------
  |  Branch (181:7): [True: 183, False: 910]
  ------------------
  182|    183|			eld->size -= len; 
  183|    183|			return 1; 
  184|    183|		}
  185|    910|		len -= eld->size;
  186|    910|		buf += eld->size;
  187|    910|		eld->size = 0;
  188|    910|		eld->b_len = 0;
  189|    910|		switch (eld->data_format) {
  190|     58|		case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (190:3): [True: 58, False: 852]
  ------------------
  191|     58|			eld->state = EL_READ_SIZE_BYTE_24;
  192|     58|			break;
  193|    852|		default:
  ------------------
  |  Branch (193:3): [True: 852, False: 58]
  ------------------
  194|    852|			eld->state = EL_READ;
  195|    852|			break;
  196|    910|		}
  197|    910|		break;
  198|       |
  199|   105k|	case EL_READ:
  ------------------
  |  Branch (199:2): [True: 105k, False: 1.54k]
  ------------------
  200|   105k|	default:
  ------------------
  |  Branch (200:2): [True: 248, False: 106k]
  ------------------
  201|   105k|		break;
  202|   106k|	}
  203|       |
  204|   106k|	if (!len)
  ------------------
  |  Branch (204:6): [True: 55, False: 106k]
  ------------------
  205|     55|		return 1;
  206|   106k|	exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
  207|   106k|		  "Scanning %i byte(s) of data...", len);
  208|       |
  209|       |	/*
  210|       |	 * First fill the small buffer. Only continue if the buffer
  211|       |	 * is filled. Note that EXIF data contains at least 12 bytes.
  212|       |	 */
  213|   106k|	i = MIN (len, sizeof (eld->b) - eld->b_len);
  ------------------
  |  |  182|   106k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 21, False: 106k]
  |  |  ------------------
  ------------------
  214|   106k|	if (i) {
  ------------------
  |  Branch (214:6): [True: 106k, False: 0]
  ------------------
  215|   106k|		memcpy (&eld->b[eld->b_len], buf, i);
  216|   106k|		eld->b_len += i;
  217|   106k|		if (eld->b_len < sizeof (eld->b)) 
  ------------------
  |  Branch (217:7): [True: 21, False: 106k]
  ------------------
  218|     21|			return 1;
  219|   106k|		buf += i;
  220|   106k|		len -= i;
  221|   106k|	}
  222|       |
  223|   106k|	switch (eld->data_format) {
  224|  10.8k|	case EL_DATA_FORMAT_UNKNOWN:
  ------------------
  |  Branch (224:2): [True: 10.8k, False: 95.5k]
  ------------------
  225|       |
  226|       |		/* Check the small buffer against known formats. */
  227|  10.8k|		if (!memcmp (eld->b, "FUJIFILM", 8)) {
  ------------------
  |  Branch (227:7): [True: 59, False: 10.7k]
  ------------------
  228|       |
  229|       |			/* Skip to byte 84. There is another offset there. */
  230|     59|			eld->data_format = EL_DATA_FORMAT_FUJI_RAW;
  231|     59|			eld->size = 84;
  232|     59|			eld->state = EL_SKIP_BYTES;
  233|     59|			eld->size = 84;
  234|       |
  235|  10.7k|		} else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) {
  ------------------
  |  Branch (235:14): [True: 9.90k, False: 835]
  ------------------
  236|       |
  237|       |			/* Read the size (2 bytes). */
  238|  9.90k|			eld->data_format = EL_DATA_FORMAT_EXIF;
  239|  9.90k|			eld->state = EL_READ_SIZE_BYTE_08;
  240|  9.90k|		}
  241|   106k|	default:
  ------------------
  |  Branch (241:2): [True: 95.5k, False: 10.8k]
  ------------------
  242|   106k|		break;
  243|   106k|	}
  244|       |
  245|  1.28M|	for (i = 0; i < sizeof (eld->b); i++) {
  ------------------
  |  Branch (245:14): [True: 1.18M, False: 96.2k]
  ------------------
  246|  1.18M|		switch (eld->state) {
  247|  10.0k|		case EL_EXIF_FOUND:
  ------------------
  |  Branch (247:3): [True: 10.0k, False: 1.17M]
  ------------------
  248|  10.0k|			if (!exif_loader_copy (eld, eld->b + i,
  ------------------
  |  Branch (248:8): [True: 9, False: 10.0k]
  ------------------
  249|  10.0k|					sizeof (eld->b) - i)) 
  250|      9|				return 0;
  251|  10.0k|			return exif_loader_copy (eld, buf, len);
  252|  6.55k|		case EL_SKIP_BYTES:
  ------------------
  |  Branch (252:3): [True: 6.55k, False: 1.18M]
  ------------------
  253|  6.55k|			switch (eld->size) {
  254|  3.82k|                            case 0:
  ------------------
  |  Branch (254:29): [True: 3.82k, False: 2.73k]
  ------------------
  255|  3.82k|			        eld->state = EL_READ;
  256|  3.82k|				i--;   /* reprocess this byte */
  257|  3.82k|				break;
  258|    777|                            case 1:
  ------------------
  |  Branch (258:29): [True: 777, False: 5.78k]
  ------------------
  259|    777|                                eld->size = 0;
  260|    777|			        eld->state = EL_READ;
  261|    777|				break;
  262|  1.95k|                            default:
  ------------------
  |  Branch (262:29): [True: 1.95k, False: 4.60k]
  ------------------
  263|  1.95k|                                eld->size--;
  264|  1.95k|				break;
  265|  6.55k|			}
  266|  6.55k|			break;
  267|       |
  268|  6.55k|		case EL_READ_SIZE_BYTE_24:
  ------------------
  |  Branch (268:3): [True: 57, False: 1.18M]
  ------------------
  269|     57|			eld->size |= (unsigned int)eld->b[i] << 24;
  270|     57|			eld->state = EL_READ_SIZE_BYTE_16;
  271|     57|			break;
  272|     57|		case EL_READ_SIZE_BYTE_16:
  ------------------
  |  Branch (272:3): [True: 57, False: 1.18M]
  ------------------
  273|     57|			eld->size |= (unsigned int)eld->b[i] << 16;
  274|     57|			eld->state = EL_READ_SIZE_BYTE_08;
  275|     57|			break;
  276|  15.8k|		case EL_READ_SIZE_BYTE_08:
  ------------------
  |  Branch (276:3): [True: 15.8k, False: 1.17M]
  ------------------
  277|  15.8k|			eld->size |= (unsigned int)eld->b[i] << 8;
  278|  15.8k|			eld->state = EL_READ_SIZE_BYTE_00;
  279|  15.8k|			break;
  280|  15.8k|		case EL_READ_SIZE_BYTE_00:
  ------------------
  |  Branch (280:3): [True: 15.8k, False: 1.17M]
  ------------------
  281|  15.8k|			eld->size |= eld->b[i] << 0;
  282|  15.8k|			switch (eld->data_format) {
  283|  5.58k|			case EL_DATA_FORMAT_JPEG:
  ------------------
  |  Branch (283:4): [True: 5.58k, False: 10.2k]
  ------------------
  284|  5.58k|				eld->state = EL_SKIP_BYTES;
  285|  5.58k|				if (eld->size < 2) {
  ------------------
  |  Branch (285:9): [True: 2.83k, False: 2.74k]
  ------------------
  286|       |				    /* Actually it's malformed... */
  287|  2.83k|				    eld->size = 0;
  288|  2.83k|				} else
  289|  2.74k|				    eld->size -= 2;
  290|  5.58k|				break;
  291|     57|			case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (291:4): [True: 57, False: 15.8k]
  ------------------
  292|     57|				eld->data_format = EL_DATA_FORMAT_EXIF;
  293|     57|				eld->state = EL_SKIP_BYTES;
  294|     57|				if (eld->size < 86) {
  ------------------
  |  Branch (294:9): [True: 6, False: 51]
  ------------------
  295|       |				    /* Actually it's malformed... */
  296|      6|				    eld->size = 0;
  297|      6|				} else
  298|     51|				    eld->size -= 86;	/* and put this in an else */
  299|     57|				break;
  300|  10.2k|			case EL_DATA_FORMAT_EXIF:
  ------------------
  |  Branch (300:4): [True: 10.2k, False: 5.63k]
  ------------------
  301|  10.2k|				eld->state = EL_EXIF_FOUND;
  302|  10.2k|				break;
  303|      0|			default:
  ------------------
  |  Branch (303:4): [True: 0, False: 15.8k]
  ------------------
  304|      0|				break;
  305|  15.8k|			}
  306|  15.8k|			break;
  307|       |
  308|  1.14M|		default:
  ------------------
  |  Branch (308:3): [True: 1.14M, False: 48.4k]
  ------------------
  309|  1.14M|			switch (eld->b[i]) {
  310|  1.37k|			case JPEG_MARKER_APP1:
  ------------------
  |  |   45|  1.37k|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (310:4): [True: 1.37k, False: 1.14M]
  ------------------
  311|  1.37k|			  if (!memcmp (eld->b + i + 3, ExifHeader, MIN((ssize_t)(sizeof(ExifHeader)), MAX(0, ((ssize_t)(sizeof(eld->b))) - ((ssize_t)i) - 3)))) {
  ------------------
  |  |  182|  2.74k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 435, False: 939]
  |  |  |  Branch (182:29): [True: 3, False: 1.37k]
  |  |  |  Branch (182:42): [True: 3, False: 936]
  |  |  ------------------
  ------------------
  |  Branch (311:10): [True: 322, False: 1.05k]
  ------------------
  312|    322|					eld->data_format = EL_DATA_FORMAT_EXIF;
  313|  1.05k|				} else {
  314|  1.05k|					eld->data_format = EL_DATA_FORMAT_JPEG; /* Probably JFIF - keep searching for APP1 EXIF*/
  315|  1.05k|				}
  316|  1.37k|				eld->size = 0;
  317|  1.37k|				eld->state = EL_READ_SIZE_BYTE_08;
  318|  1.37k|				break;
  319|    577|			case JPEG_MARKER_DCT:
  ------------------
  |  |   35|    577|#define JPEG_MARKER_DCT  0xc0
  ------------------
  |  Branch (319:4): [True: 577, False: 1.14M]
  ------------------
  320|    782|			case JPEG_MARKER_DHT:
  ------------------
  |  |   37|    782|#define JPEG_MARKER_DHT  0xc4
  ------------------
  |  Branch (320:4): [True: 205, False: 1.14M]
  ------------------
  321|  1.07k|			case JPEG_MARKER_DQT:
  ------------------
  |  |   41|  1.07k|#define JPEG_MARKER_DQT  0xdb
  ------------------
  |  Branch (321:4): [True: 288, False: 1.14M]
  ------------------
  322|  2.06k|			case JPEG_MARKER_APP0:
  ------------------
  |  |   43|  2.06k|#define JPEG_MARKER_APP0 0xe0
  ------------------
  |  Branch (322:4): [True: 994, False: 1.14M]
  ------------------
  323|  2.42k|			case JPEG_MARKER_APP2:
  ------------------
  |  |   47|  2.42k|#define JPEG_MARKER_APP2 0xe2
  ------------------
  |  Branch (323:4): [True: 365, False: 1.14M]
  ------------------
  324|  2.65k|			case JPEG_MARKER_APP3:
  ------------------
  |  |   49|  2.65k|#define JPEG_MARKER_APP3 0xe3
  ------------------
  |  Branch (324:4): [True: 227, False: 1.14M]
  ------------------
  325|  2.95k|			case JPEG_MARKER_APP4:
  ------------------
  |  |   51|  2.95k|#define JPEG_MARKER_APP4 0xe4
  ------------------
  |  Branch (325:4): [True: 299, False: 1.14M]
  ------------------
  326|  3.20k|			case JPEG_MARKER_APP5:
  ------------------
  |  |   53|  3.20k|#define JPEG_MARKER_APP5 0xe5
  ------------------
  |  Branch (326:4): [True: 247, False: 1.14M]
  ------------------
  327|  3.57k|			case JPEG_MARKER_APP10:
  ------------------
  |  |   55|  3.57k|#define JPEG_MARKER_APP10 0xea
  ------------------
  |  Branch (327:4): [True: 375, False: 1.14M]
  ------------------
  328|  3.83k|			case JPEG_MARKER_APP11:
  ------------------
  |  |   57|  3.83k|#define JPEG_MARKER_APP11 0xeb
  ------------------
  |  Branch (328:4): [True: 262, False: 1.14M]
  ------------------
  329|  4.04k|			case JPEG_MARKER_APP13:
  ------------------
  |  |   59|  4.04k|#define JPEG_MARKER_APP13 0xed
  ------------------
  |  Branch (329:4): [True: 201, False: 1.14M]
  ------------------
  330|  4.32k|			case JPEG_MARKER_APP14:
  ------------------
  |  |   61|  4.32k|#define JPEG_MARKER_APP14 0xee
  ------------------
  |  Branch (330:4): [True: 286, False: 1.14M]
  ------------------
  331|  4.53k|			case JPEG_MARKER_COM:
  ------------------
  |  |   63|  4.53k|#define JPEG_MARKER_COM 0xfe
  ------------------
  |  Branch (331:4): [True: 211, False: 1.14M]
  ------------------
  332|  4.53k|				eld->data_format = EL_DATA_FORMAT_JPEG;
  333|  4.53k|				eld->size = 0;
  334|  4.53k|				eld->state = EL_READ_SIZE_BYTE_08;
  335|  4.53k|				break;
  336|  1.13M|			case 0xff:
  ------------------
  |  Branch (336:4): [True: 1.13M, False: 6.80k]
  ------------------
  337|  1.13M|			case JPEG_MARKER_SOI:
  ------------------
  |  |   39|  1.13M|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (337:4): [True: 812, False: 1.14M]
  ------------------
  338|  1.13M|				break;
  339|     81|			default:
  ------------------
  |  Branch (339:4): [True: 81, False: 1.14M]
  ------------------
  340|     81|				exif_log (eld->log,
  341|     81|					EXIF_LOG_CODE_CORRUPT_DATA,
  342|     81|					"ExifLoader", _("The data supplied "
  ------------------
  |  |   31|     81|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  343|     81|						"does not seem to contain "
  344|     81|						"EXIF data. JPEG Marker type 0x%02x"), eld->b[i]);
  345|     81|				exif_loader_reset (eld);
  346|     81|				return 0;
  347|  1.14M|			}
  348|  1.18M|		}
  349|  1.18M|	}
  350|       |
  351|       |	/*
  352|       |	 * If we reach this point, the buffer has not been big enough
  353|       |	 * to read all data we need. Fill it with new data.
  354|       |	 */
  355|  96.2k|	eld->b_len = 0;
  356|  96.2k|	goto begin;
  357|   106k|}
exif_loader_new:
  361|  10.5k|{
  362|  10.5k|	ExifMem *mem = exif_mem_new_default ();
  363|  10.5k|	ExifLoader *l = exif_loader_new_mem (mem);
  364|       |
  365|  10.5k|	exif_mem_unref (mem);
  366|       |
  367|  10.5k|	return l;
  368|  10.5k|}
exif_loader_new_mem:
  372|  10.5k|{
  373|  10.5k|	ExifLoader *loader;
  374|       |
  375|  10.5k|	if (!mem) 
  ------------------
  |  Branch (375:6): [True: 0, False: 10.5k]
  ------------------
  376|      0|		return NULL;
  377|       |	
  378|  10.5k|	loader = exif_mem_alloc (mem, sizeof (ExifLoader));
  379|  10.5k|	if (!loader) 
  ------------------
  |  Branch (379:6): [True: 0, False: 10.5k]
  ------------------
  380|      0|		return NULL;
  381|  10.5k|	loader->ref_count = 1;
  382|       |
  383|  10.5k|	loader->mem = mem;
  384|  10.5k|	exif_mem_ref (mem);
  385|       |
  386|  10.5k|	return loader;
  387|  10.5k|}
exif_loader_unref:
  413|  10.5k|{
  414|  10.5k|	if (!loader) 
  ------------------
  |  Branch (414:6): [True: 0, False: 10.5k]
  ------------------
  415|      0|		return;
  416|  10.5k|	if (!--loader->ref_count)
  ------------------
  |  Branch (416:6): [True: 10.5k, False: 0]
  ------------------
  417|  10.5k|		exif_loader_free (loader);
  418|  10.5k|}
exif_loader_reset:
  422|  10.6k|{
  423|  10.6k|	if (!loader) 
  ------------------
  |  Branch (423:6): [True: 0, False: 10.6k]
  ------------------
  424|      0|		return;
  425|  10.6k|	exif_mem_free (loader->mem, loader->buf); loader->buf = NULL;
  426|  10.6k|	loader->size = 0;
  427|  10.6k|	loader->bytes_read = 0;
  428|  10.6k|	loader->state = 0;
  429|  10.6k|	loader->b_len = 0;
  430|  10.6k|	loader->data_format = EL_DATA_FORMAT_UNKNOWN;
  431|  10.6k|}
exif_loader_get_data:
  435|  10.5k|{
  436|  10.5k|	ExifData *ed;
  437|       |
  438|  10.5k|	if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) ||
  ------------------
  |  Branch (438:6): [True: 0, False: 10.5k]
  |  Branch (438:17): [True: 90, False: 10.4k]
  ------------------
  439|  10.4k|	    !loader->bytes_read)
  ------------------
  |  Branch (439:6): [True: 270, False: 10.2k]
  ------------------
  440|    360|		return NULL;
  441|       |
  442|  10.2k|	ed = exif_data_new_mem (loader->mem);
  443|  10.2k|	exif_data_log (ed, loader->log);
  444|  10.2k|	exif_data_load_data (ed, loader->buf, loader->bytes_read);
  445|       |
  446|  10.2k|	return ed;
  447|  10.5k|}
exif-loader.c:exif_loader_copy:
  150|  20.2k|{
  151|  20.2k|	if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) 
  ------------------
  |  Branch (151:6): [True: 0, False: 20.2k]
  |  Branch (151:15): [True: 20.1k, False: 45]
  |  Branch (151:22): [True: 0, False: 20.1k]
  |  Branch (151:31): [True: 2, False: 20.2k]
  ------------------
  152|      2|		return 0;
  153|       |
  154|       |	/* If needed, allocate the buffer. */
  155|  20.2k|	if (!eld->buf) 
  ------------------
  |  Branch (155:6): [True: 10.2k, False: 10.0k]
  ------------------
  156|  10.2k|		eld->buf = exif_loader_alloc (eld, eld->size);
  157|  20.2k|	if (!eld->buf) 
  ------------------
  |  Branch (157:6): [True: 0, False: 20.2k]
  ------------------
  158|      0|		return 0;
  159|       |
  160|       |	/* Copy memory */
  161|  20.2k|	len = MIN (len, eld->size - eld->bytes_read);
  ------------------
  |  |  182|  20.2k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 20.1k, False: 82]
  |  |  ------------------
  ------------------
  162|  20.2k|	memcpy (eld->buf + eld->bytes_read, buf, len);
  163|  20.2k|	eld->bytes_read += len;
  164|       |
  165|  20.2k|	return (eld->bytes_read >= eld->size) ? 0 : 1;
  ------------------
  |  Branch (165:9): [True: 82, False: 20.1k]
  ------------------
  166|  20.2k|}
exif-loader.c:exif_loader_alloc:
  108|  10.2k|{
  109|  10.2k|	void *d;
  110|       |
  111|  10.2k|	if (!l || !i) 
  ------------------
  |  Branch (111:6): [True: 0, False: 10.2k]
  |  Branch (111:12): [True: 0, False: 10.2k]
  ------------------
  112|      0|		return NULL;
  113|       |
  114|  10.2k|	d = exif_mem_alloc (l->mem, i);
  115|  10.2k|	if (d) 
  ------------------
  |  Branch (115:6): [True: 10.2k, False: 0]
  ------------------
  116|  10.2k|		return d;
  117|       |
  118|      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))
  ------------------
  119|       |	return NULL;
  120|  10.2k|}
exif-loader.c:exif_loader_free:
  398|  10.5k|{
  399|  10.5k|	ExifMem *mem;
  400|       |
  401|  10.5k|	if (!loader) 
  ------------------
  |  Branch (401:6): [True: 0, False: 10.5k]
  ------------------
  402|      0|		return;
  403|       |
  404|  10.5k|	mem = loader->mem;
  405|  10.5k|	exif_loader_reset (loader);
  406|  10.5k|	exif_log_unref (loader->log);
  407|  10.5k|	exif_mem_free (mem, loader);
  408|  10.5k|	exif_mem_unref (mem);
  409|  10.5k|}

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

exif_mnote_data_construct:
   38|  6.71k|{
   39|  6.71k|	if (!d || !mem) return;
  ------------------
  |  Branch (39:6): [True: 0, False: 6.71k]
  |  Branch (39:12): [True: 0, False: 6.71k]
  ------------------
   40|  6.71k|	if (d->priv) return;
  ------------------
  |  Branch (40:6): [True: 0, False: 6.71k]
  ------------------
   41|  6.71k|	d->priv = exif_mem_alloc (mem, sizeof (ExifMnoteDataPriv));
   42|  6.71k|	if (!d->priv) return;
  ------------------
  |  Branch (42:6): [True: 0, False: 6.71k]
  ------------------
   43|       |
   44|  6.71k|	d->priv->ref_count = 1;
   45|       |
   46|  6.71k|	d->mem = mem;
   47|  6.71k|	exif_mem_ref (mem);
   48|  6.71k|}
exif_mnote_data_ref:
   52|  6.71k|{
   53|  6.71k|	if (d && d->priv) d->priv->ref_count++;
  ------------------
  |  Branch (53:6): [True: 6.71k, False: 0]
  |  Branch (53:11): [True: 6.71k, False: 0]
  ------------------
   54|  6.71k|}
exif_mnote_data_unref:
   74|  13.4k|{
   75|  13.4k|	if (!d || !d->priv) return;
  ------------------
  |  Branch (75:6): [True: 0, False: 13.4k]
  |  Branch (75:12): [True: 0, False: 13.4k]
  ------------------
   76|  13.4k|	if (d->priv->ref_count > 0) d->priv->ref_count--;
  ------------------
  |  Branch (76:6): [True: 13.4k, False: 0]
  ------------------
   77|  13.4k|	if (!d->priv->ref_count)
  ------------------
  |  Branch (77:6): [True: 6.71k, False: 6.71k]
  ------------------
   78|  6.71k|		exif_mnote_data_free (d);
   79|  13.4k|}
exif_mnote_data_load:
   84|  6.71k|{
   85|  6.71k|	if (!d || !d->methods.load) return;
  ------------------
  |  Branch (85:6): [True: 0, False: 6.71k]
  |  Branch (85:12): [True: 0, False: 6.71k]
  ------------------
   86|  6.71k|	d->methods.load (d, buf, buf_size);
   87|  6.71k|}
exif_mnote_data_set_byte_order:
   99|  6.71k|{
  100|  6.71k|	if (!d || !d->methods.set_byte_order) return;
  ------------------
  |  Branch (100:6): [True: 0, False: 6.71k]
  |  Branch (100:12): [True: 0, False: 6.71k]
  ------------------
  101|  6.71k|	d->methods.set_byte_order (d, o);
  102|  6.71k|}
exif_mnote_data_set_offset:
  106|  6.71k|{
  107|  6.71k|	if (!d || !d->methods.set_offset) return;
  ------------------
  |  Branch (107:6): [True: 0, False: 6.71k]
  |  Branch (107:12): [True: 0, False: 6.71k]
  ------------------
  108|  6.71k|	d->methods.set_offset (d, o);
  109|  6.71k|}
exif_mnote_data_count:
  113|  6.71k|{
  114|  6.71k|	if (!d || !d->methods.count) return 0;
  ------------------
  |  Branch (114:6): [True: 0, False: 6.71k]
  |  Branch (114:12): [True: 0, False: 6.71k]
  ------------------
  115|  6.71k|	return d->methods.count (d);
  116|  6.71k|}
exif_mnote_data_get_name:
  127|  1.66M|{
  128|  1.66M|	if (!d || !d->methods.get_name) return NULL;
  ------------------
  |  Branch (128:6): [True: 0, False: 1.66M]
  |  Branch (128:12): [True: 0, False: 1.66M]
  ------------------
  129|  1.66M|	return d->methods.get_name (d, n);
  130|  1.66M|}
exif_mnote_data_get_title:
  134|  1.66M|{
  135|  1.66M|	if (!d || !d->methods.get_title) return NULL;
  ------------------
  |  Branch (135:6): [True: 0, False: 1.66M]
  |  Branch (135:12): [True: 0, False: 1.66M]
  ------------------
  136|  1.66M|	return d->methods.get_title (d, n);
  137|  1.66M|}
exif_mnote_data_get_description:
  141|  1.66M|{
  142|  1.66M|	if (!d || !d->methods.get_description) return NULL;
  ------------------
  |  Branch (142:6): [True: 0, False: 1.66M]
  |  Branch (142:12): [True: 0, False: 1.66M]
  ------------------
  143|  1.66M|	return d->methods.get_description (d, n);
  144|  1.66M|}
exif_mnote_data_get_value:
  148|  1.66M|{
  149|  1.66M|	if (!d || !d->methods.get_value) return NULL;
  ------------------
  |  Branch (149:6): [True: 0, False: 1.66M]
  |  Branch (149:12): [True: 0, False: 1.66M]
  ------------------
  150|  1.66M|	return d->methods.get_value (d, n, val, maxlen);
  151|  1.66M|}
exif_mnote_data_log:
  155|  6.71k|{
  156|  6.71k|	if (!d) return;
  ------------------
  |  Branch (156:6): [True: 0, False: 6.71k]
  ------------------
  157|  6.71k|	exif_log_unref (d->log);
  158|  6.71k|	d->log = log;
  159|  6.71k|	exif_log_ref (log);
  160|  6.71k|}
exif-mnote-data.c:exif_mnote_data_free:
   58|  6.71k|{
   59|  6.71k|	ExifMem *mem = d ? d->mem : NULL;
  ------------------
  |  Branch (59:17): [True: 6.71k, False: 0]
  ------------------
   60|       |
   61|  6.71k|	if (!d) return;
  ------------------
  |  Branch (61:6): [True: 0, False: 6.71k]
  ------------------
   62|  6.71k|	if (d->priv) {
  ------------------
  |  Branch (62:6): [True: 6.71k, False: 0]
  ------------------
   63|  6.71k|		if (d->methods.free) d->methods.free (d);
  ------------------
  |  Branch (63:7): [True: 6.71k, False: 0]
  ------------------
   64|  6.71k|		exif_mem_free (mem, d->priv);
   65|       |		d->priv = NULL;
   66|  6.71k|	}
   67|  6.71k|	exif_log_unref (d->log);
   68|  6.71k|	exif_mem_free (mem, d);
   69|  6.71k|	exif_mem_unref (mem);
   70|  6.71k|}

exif_tag_table_count:
  978|   408M|{
  979|   408M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   408M|}
exif_tag_table_get_tag:
  985|  5.37M|{
  986|  5.37M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.37M, False: 0]
  ------------------
  987|  5.37M|}
exif_tag_get_name_in_ifd:
 1043|   397M|{
 1044|   397M|	unsigned int i;
 1045|   397M|	int first;
 1046|       |
 1047|   397M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 397M]
  ------------------
 1048|      0|		return NULL;
 1049|   397M|	first = exif_tag_table_first(tag);
 1050|   397M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 36.7M, False: 360M]
  ------------------
 1051|  36.7M|		return NULL;
 1052|       |
 1053|   720M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 720M, False: 1.91k]
  ------------------
 1054|   720M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 360M, False: 360M]
  ------------------
 1055|   360M|		   if (RECORDED)
  ------------------
  |  | 1035|   360M|#define RECORDED \
  |  | 1036|   360M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 524k, False: 360M]
  |  |  ------------------
  |  | 1037|   360M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 360M]
  |  |  ------------------
  |  | 1038|   360M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.69k, False: 360M]
  |  |  ------------------
  |  | 1039|   360M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 11.7k, False: 360M]
  |  |  ------------------
  ------------------
 1056|   538k|			   break;
 1057|   360M|		} else
 1058|   360M|			return NULL; /* Recorded tag not found in the table */
 1059|   720M|	}
 1060|   540k|	return ExifTagTable[i].name;
 1061|   360M|}
exif_tag_get_name:
 1152|  71.8M|{
 1153|  71.8M|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|  71.8M|}
exif_tag_get_support_level_in_ifd:
 1261|  5.39M|{
 1262|  5.39M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.39M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.39M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.39M, False: 0]
  ------------------
 1266|  5.39M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.39M|}
exif-tag.c:exif_tag_table_first:
 1016|   402M|{
 1017|   402M|	int i;
 1018|   402M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   402M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   402M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 36.7M, False: 366M]
  ------------------
 1021|  36.7M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|   366M|	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|   366M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 365M, False: 1.05M]
  |  Branch (1029:20): [True: 341k, False: 365M]
  ------------------
 1030|   341k|		--i;
 1031|   341k|	}
 1032|   366M|	return i;
 1033|   402M|}
exif-tag.c:match_tag:
 1003|  2.84G|{
 1004|  2.84G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.84G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  71.8M|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|  71.8M|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|  71.8M|		EXIF_IFD_EXIF,
 1134|  71.8M|		EXIF_IFD_0,
 1135|  71.8M|		EXIF_IFD_1,
 1136|  71.8M|		EXIF_IFD_INTEROPERABILITY,
 1137|  71.8M|		EXIF_IFD_GPS
 1138|  71.8M|	};
 1139|  71.8M|	int i;
 1140|   430M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 359M, False: 71.6M]
  ------------------
 1141|   359M|		const char *result = func(tag, ifds[i]);
 1142|   359M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 254k, False: 358M]
  ------------------
 1143|   254k|			return result;
 1144|   254k|		}
 1145|   359M|	}
 1146|  71.6M|	return (const char *) NULL;
 1147|  71.8M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.39M|{
 1228|  5.39M|	unsigned int i;
 1229|  5.39M|	int first = exif_tag_table_first(tag);
 1230|  5.39M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.39M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  9.17M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 9.16M, False: 15.9k]
  ------------------
 1234|  9.16M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.48M, False: 3.67M]
  ------------------
 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.48M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.48M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.77M, False: 3.70M]
  ------------------
 1242|  1.77M|				unsigned int dt;
 1243|  8.80M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 7.10M, False: 1.69M]
  ------------------
 1244|  7.10M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 81.0k, False: 7.02M]
  ------------------
 1245|  81.0k|						break;
 1246|  7.10M|				}
 1247|  1.77M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.69M, False: 81.0k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.69M|					return supp;
 1250|  1.77M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.48M|		} else {
 1253|  3.67M|			break; /* We've reached the end of the matching tags */
 1254|  3.67M|		}
 1255|  9.16M|	}
 1256|  3.69M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.39M|}

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

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

mnote_fuji_entry_get_value:
  194|  9.05k|{
  195|  9.05k|	ExifLong  vl;
  196|  9.05k|	ExifSLong vsl;
  197|  9.05k|	ExifShort vs, vs2;
  198|  9.05k|	ExifSShort vss;
  199|  9.05k|	ExifRational vr;
  200|  9.05k|	ExifSRational vsr;
  201|  9.05k|	int i, j;
  202|       |
  203|  9.05k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 9.05k]
  ------------------
  204|  9.05k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 9.05k]
  ------------------
  205|       |
  206|  9.05k|	memset (val, 0, maxlen);
  207|  9.05k|	maxlen--;
  208|       |
  209|  9.05k|	switch (entry->tag) {
  210|    982|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 982, False: 8.07k]
  ------------------
  211|    982|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|    982|#define CF(format,target,v,maxlen)                              \
  |  |   34|    982|{                                                               \
  |  |   35|    982|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 691, False: 291]
  |  |  ------------------
  |  |   36|    691|                snprintf (v, maxlen,	                        \
  |  |   37|    691|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    691|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    691|                        "expected '%s'."),                      \
  |  |   39|    691|                        exif_format_get_name (format),          \
  |  |   40|    691|                        exif_format_get_name (target));         \
  |  |   41|    691|                break;                                          \
  |  |   42|    691|        }                                                       \
  |  |   43|    982|}
  ------------------
  212|    291|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    291|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    291|{                                                                       \
  |  |   47|    291|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 213, False: 78]
  |  |  ------------------
  |  |   48|    213|                snprintf (v, maxlen,                                    \
  |  |   49|    213|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    213|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    213|                break;                                                  \
  |  |   52|    213|        }                                                               \
  |  |   53|    291|}
  ------------------
  213|     78|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|     78|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 78]
  |  |  ------------------
  ------------------
  214|     78|		break;
  215|    260|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 260, False: 8.79k]
  ------------------
  216|    544|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 284, False: 8.77k]
  ------------------
  217|    780|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 236, False: 8.82k]
  ------------------
  218|  1.10k|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 322, False: 8.73k]
  ------------------
  219|  1.30k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 203, False: 8.85k]
  ------------------
  220|  1.51k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 210, False: 8.84k]
  ------------------
  221|  1.73k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 223, False: 8.83k]
  ------------------
  222|  1.97k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 234, False: 8.82k]
  ------------------
  223|  2.37k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 399, False: 8.65k]
  ------------------
  224|  2.57k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 199, False: 8.85k]
  ------------------
  225|  2.77k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 200, False: 8.85k]
  ------------------
  226|  2.97k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 208, False: 8.84k]
  ------------------
  227|  3.17k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 198, False: 8.85k]
  ------------------
  228|  3.37k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 200, False: 8.85k]
  ------------------
  229|  3.68k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 311, False: 8.74k]
  ------------------
  230|  3.91k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 224, False: 8.83k]
  ------------------
  231|  4.11k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 201, False: 8.85k]
  ------------------
  232|  4.11k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  4.11k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  4.11k|{                                                               \
  |  |   35|  4.11k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 2.18k, False: 1.92k]
  |  |  ------------------
  |  |   36|  2.18k|                snprintf (v, maxlen,	                        \
  |  |   37|  2.18k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.18k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  2.18k|                        "expected '%s'."),                      \
  |  |   39|  2.18k|                        exif_format_get_name (format),          \
  |  |   40|  2.18k|                        exif_format_get_name (target));         \
  |  |   41|  2.18k|                break;                                          \
  |  |   42|  2.18k|        }                                                       \
  |  |   43|  4.11k|}
  ------------------
  233|  1.92k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  1.92k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  1.92k|{                                                                       \
  |  |   47|  1.92k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 325, False: 1.60k]
  |  |  ------------------
  |  |   48|    325|                snprintf (v, maxlen,                                    \
  |  |   49|    325|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    325|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    325|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    325|                break;                                                  \
  |  |   52|    325|        }                                                               \
  |  |   53|  1.92k|}
  ------------------
  234|  1.60k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  11.5k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 11.5k, False: 0]
  |  Branch (237:32): [True: 9.97k, False: 1.60k]
  ------------------
  238|  1.60k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.60k]
  ------------------
  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|  11.2k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 10.7k, False: 546]
  ------------------
  246|  10.7k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 9.66k, False: 1.05k]
  ------------------
  247|  1.60k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 807, False: 793]
  ------------------
  248|    807|			snprintf (val, maxlen,
  249|    807|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|    807|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|    807|			break;
  251|    807|		}
  252|    793|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    793|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    793|		break;
  254|    498|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 498, False: 8.55k]
  ------------------
  255|    498|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    498|#define CF(format,target,v,maxlen)                              \
  |  |   34|    498|{                                                               \
  |  |   35|    498|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 212, False: 286]
  |  |  ------------------
  |  |   36|    212|                snprintf (v, maxlen,	                        \
  |  |   37|    212|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    212|                        "expected '%s'."),                      \
  |  |   39|    212|                        exif_format_get_name (format),          \
  |  |   40|    212|                        exif_format_get_name (target));         \
  |  |   41|    212|                break;                                          \
  |  |   42|    212|        }                                                       \
  |  |   43|    498|}
  ------------------
  256|    286|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    286|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    286|{                                                                       \
  |  |   47|    286|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 72, False: 214]
  |  |  ------------------
  |  |   48|     72|                snprintf (v, maxlen,                                    \
  |  |   49|     72|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     72|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     72|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     72|                break;                                                  \
  |  |   52|     72|        }                                                               \
  |  |   53|    286|}
  ------------------
  257|    214|		vs = exif_get_short (entry->data, entry->order);
  258|    214|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    214|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    214|		break;
  261|    203|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 203, False: 8.85k]
  ------------------
  262|  1.05k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 849, False: 8.20k]
  ------------------
  263|  1.05k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.05k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.05k|{                                                               \
  |  |   35|  1.05k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 293, False: 759]
  |  |  ------------------
  |  |   36|    293|                snprintf (v, maxlen,	                        \
  |  |   37|    293|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    293|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    293|                        "expected '%s'."),                      \
  |  |   39|    293|                        exif_format_get_name (format),          \
  |  |   40|    293|                        exif_format_get_name (target));         \
  |  |   41|    293|                break;                                          \
  |  |   42|    293|        }                                                       \
  |  |   43|  1.05k|}
  ------------------
  264|    759|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    759|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    759|{                                                                       \
  |  |   47|    759|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 84, False: 675]
  |  |  ------------------
  |  |   48|     84|                snprintf (v, maxlen,                                    \
  |  |   49|     84|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     84|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     84|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     84|                break;                                                  \
  |  |   52|     84|        }                                                               \
  |  |   53|    759|}
  ------------------
  265|    675|		vr = exif_get_rational (entry->data, entry->order);
  266|    675|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 222, False: 453]
  ------------------
  267|    453|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    453|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    453|			  vr.denominator);
  269|    453|		break;
  270|       |
  271|  2.41k|	default:
  ------------------
  |  Branch (271:2): [True: 2.41k, False: 6.64k]
  ------------------
  272|  2.41k|		switch (entry->format) {
  273|    176|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 176, False: 2.23k]
  ------------------
  274|    176|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    176|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 72, False: 104]
  |  |  ------------------
  ------------------
  275|    176|		  break;
  276|    212|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 212, False: 2.20k]
  ------------------
  277|    212|		  vs = exif_get_short (entry->data, entry->order);
  278|    212|		  snprintf (val, maxlen, "%hu", vs);
  279|    212|		  break;
  280|    274|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 274, False: 2.13k]
  ------------------
  281|    274|		  vss = exif_get_sshort (entry->data, entry->order);
  282|    274|		  snprintf (val, maxlen, "%hi", vss);
  283|    274|		  break;
  284|    203|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 203, False: 2.20k]
  ------------------
  285|    203|		  vl = exif_get_long (entry->data, entry->order);
  286|    203|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    203|		  break;
  288|    209|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 209, False: 2.20k]
  ------------------
  289|    209|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    209|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    209|		  break;
  292|    407|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 407, False: 2.00k]
  ------------------
  293|    407|		  vr = exif_get_rational (entry->data, entry->order);
  294|    407|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 106, False: 301]
  ------------------
  295|    301|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    301|						    vr.denominator);
  297|    301|		  break;
  298|    589|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 589, False: 1.82k]
  ------------------
  299|    589|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    589|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 229, False: 360]
  ------------------
  301|    360|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    360|			  vsr.denominator);
  303|    360|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.41k]
  ------------------
  305|    342|		default:
  ------------------
  |  Branch (305:3): [True: 342, False: 2.07k]
  ------------------
  306|    342|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    342|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    342| 			  entry->size);
  308|    342|		  break;
  309|  2.41k|		}
  310|  2.41k|		break;
  311|  9.05k|	}
  312|       |
  313|  9.05k|	return (val);
  314|  9.05k|}

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

exif_mnote_data_olympus_identify:
  627|  6.92k|{
  628|  6.92k|	int variant = exif_mnote_data_olympus_identify_variant(e->data, e->size);
  629|       |
  630|  6.92k|	if (variant == nikonV0) {
  ------------------
  |  Branch (630:6): [True: 452, False: 6.47k]
  ------------------
  631|       |		/* This variant needs some extra checking with the Make */
  632|    452|		char value[5];
  633|    452|		ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|    452|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 12, False: 440]
  |  |  ------------------
  |  |  254|    452|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|    452|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 38, False: 402]
  |  |  ------------------
  |  |  256|    440|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|    440|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 402]
  |  |  ------------------
  |  |  258|    402|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|    402|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 402]
  |  |  ------------------
  |  |  260|    402|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    402|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 402]
  |  |  ------------------
  |  |  262|    402|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  634|    452|		variant = unrecognized;
  635|       |
  636|    452|		if (em) {
  ------------------
  |  Branch (636:7): [True: 50, False: 402]
  ------------------
  637|     50|			const char *v = exif_entry_get_value (em, value, sizeof(value));
  638|     50|			if (v && (!strncmp (v, "Nikon", sizeof(value)) || 
  ------------------
  |  Branch (638:8): [True: 50, False: 0]
  |  Branch (638:14): [True: 0, False: 50]
  ------------------
  639|     50|					  !strncmp (v, "NIKON", sizeof(value)) ))
  ------------------
  |  Branch (639:8): [True: 0, False: 50]
  ------------------
  640|       |				/* When saved, this variant will be written out like the
  641|       |				 * alternative nikonV2 form above instead
  642|       |				 */
  643|      0|				variant = nikonV0;
  644|     50|		}
  645|    452|	}
  646|       |
  647|  6.92k|	return variant;
  648|  6.92k|}
exif_mnote_data_olympus_new:
  653|  3.85k|{
  654|  3.85k|	ExifMnoteData *d;
  655|       |
  656|  3.85k|	if (!mem) return NULL;
  ------------------
  |  Branch (656:6): [True: 0, False: 3.85k]
  ------------------
  657|       |	
  658|  3.85k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus));
  659|  3.85k|	if (!d) return NULL;
  ------------------
  |  Branch (659:6): [True: 0, False: 3.85k]
  ------------------
  660|       |
  661|  3.85k|	exif_mnote_data_construct (d, mem);
  662|       |
  663|       |	/* Set up function pointers */
  664|  3.85k|	d->methods.free            = exif_mnote_data_olympus_free;
  665|  3.85k|	d->methods.set_byte_order  = exif_mnote_data_olympus_set_byte_order;
  666|  3.85k|	d->methods.set_offset      = exif_mnote_data_olympus_set_offset;
  667|  3.85k|	d->methods.load            = exif_mnote_data_olympus_load;
  668|  3.85k|	d->methods.save            = exif_mnote_data_olympus_save;
  669|  3.85k|	d->methods.count           = exif_mnote_data_olympus_count;
  670|  3.85k|	d->methods.get_id          = exif_mnote_data_olympus_get_id;
  671|  3.85k|	d->methods.get_name        = exif_mnote_data_olympus_get_name;
  672|  3.85k|	d->methods.get_title       = exif_mnote_data_olympus_get_title;
  673|  3.85k|	d->methods.get_description = exif_mnote_data_olympus_get_description;
  674|  3.85k|	d->methods.get_value       = exif_mnote_data_olympus_get_value;
  675|       |
  676|  3.85k|	return d;
  677|  3.85k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_identify_variant:
  596|  10.7k|{
  597|       |	/* Olympus, Nikon, Sanyo, Epson */
  598|  10.7k|	if (buf_size >= 8) {
  ------------------
  |  Branch (598:6): [True: 10.5k, False: 227]
  ------------------
  599|       |		/* Match the terminating NUL character, too */
  600|  10.5k|		if (!memcmp (buf, "OLYMPUS", 8))
  ------------------
  |  Branch (600:7): [True: 853, False: 9.69k]
  ------------------
  601|    853|			   return olympusV2;
  602|  9.69k|		else if (!memcmp (buf, "OLYMP", 6))
  ------------------
  |  Branch (602:12): [True: 2.38k, False: 7.31k]
  ------------------
  603|  2.38k|			   return olympusV1;
  604|  7.31k|		else if (!memcmp (buf, "SANYO", 6))
  ------------------
  |  Branch (604:12): [True: 2.59k, False: 4.71k]
  ------------------
  605|  2.59k|			   return sanyoV1;
  606|  4.71k|		else if (!memcmp (buf, "EPSON", 6))
  ------------------
  |  Branch (606:12): [True: 1.42k, False: 3.29k]
  ------------------
  607|  1.42k|			   return epsonV1;
  608|  3.29k|		else if (!memcmp (buf, "Nikon", 6)) {
  ------------------
  |  Branch (608:12): [True: 405, False: 2.88k]
  ------------------
  609|    405|			switch (buf[6]) {
  610|    137|				case 1:  return nikonV1;
  ------------------
  |  Branch (610:5): [True: 137, False: 268]
  ------------------
  611|    261|				case 2:  return nikonV2;
  ------------------
  |  Branch (611:5): [True: 261, False: 144]
  ------------------
  612|      7|				default: return 0; /* Unrecognized Nikon variant */
  ------------------
  |  Branch (612:5): [True: 7, False: 398]
  ------------------
  613|    405|			}
  614|    405|		}
  615|  10.5k|	}
  616|       |
  617|       |	/* Another variant of Nikon */
  618|  3.11k|	if ((buf_size >= 2) && (buf[0] == 0x00) && (buf[1] == 0x1b)) {
  ------------------
  |  Branch (618:6): [True: 3.09k, False: 16]
  |  Branch (618:25): [True: 512, False: 2.58k]
  |  Branch (618:45): [True: 465, False: 47]
  ------------------
  619|    465|		return nikonV0;
  620|    465|	}
  621|       |
  622|  2.64k|	return unrecognized;
  623|  3.11k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_free:
   69|  3.85k|{
   70|  3.85k|	if (!n) return;
  ------------------
  |  Branch (70:6): [True: 0, False: 3.85k]
  ------------------
   71|       |
   72|  3.85k|	exif_mnote_data_olympus_clear ((ExifMnoteDataOlympus *) n);
   73|  3.85k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_clear:
   49|  7.48k|{
   50|  7.48k|	ExifMnoteData *d = (ExifMnoteData *) n;
   51|  7.48k|	unsigned int i;
   52|       |
   53|  7.48k|	if (!n) return;
  ------------------
  |  Branch (53:6): [True: 0, False: 7.48k]
  ------------------
   54|       |
   55|  7.48k|	if (n->entries) {
  ------------------
  |  Branch (55:6): [True: 3.63k, False: 3.85k]
  ------------------
   56|  97.2k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (56:15): [True: 93.6k, False: 3.63k]
  ------------------
   57|  93.6k|			if (n->entries[i].data) {
  ------------------
  |  Branch (57:8): [True: 35.8k, False: 57.7k]
  ------------------
   58|  35.8k|				exif_mem_free (d->mem, n->entries[i].data);
   59|  35.8k|				n->entries[i].data = NULL;
   60|  35.8k|			}
   61|  3.63k|		exif_mem_free (d->mem, n->entries);
   62|       |		n->entries = NULL;
   63|  3.63k|		n->count = 0;
   64|  3.63k|	}
   65|  7.48k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_byte_order:
  569|  3.85k|{
  570|  3.85k|	ExifByteOrder o_orig;
  571|  3.85k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  572|  3.85k|	unsigned int i;
  573|       |
  574|  3.85k|	if (!n) return;
  ------------------
  |  Branch (574:6): [True: 0, False: 3.85k]
  ------------------
  575|       |
  576|  3.85k|	o_orig = n->order;
  577|  3.85k|	n->order = o;
  578|  3.85k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (578:14): [True: 0, False: 3.85k]
  ------------------
  579|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (579:7): [True: 0, False: 0]
  |  Branch (579:35): [True: 0, False: 0]
  ------------------
  580|      0|			continue;
  581|      0|		n->entries[i].order = o;
  582|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  583|      0|				n->entries[i].components, o_orig, o);
  584|      0|	}
  585|  3.85k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_offset:
  589|  3.85k|{
  590|  3.85k|	if (n) ((ExifMnoteDataOlympus *) n)->offset = o;
  ------------------
  |  Branch (590:6): [True: 3.85k, False: 0]
  ------------------
  591|  3.85k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_load:
  242|  3.85k|{
  243|  3.85k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en;
  244|  3.85k|	ExifShort c;
  245|  3.85k|	size_t i, tcount, o, o2, datao = 6, base = 0;
  246|       |
  247|  3.85k|	if (!n) return;
  ------------------
  |  Branch (247:6): [True: 0, False: 3.85k]
  ------------------
  248|       |
  249|  3.85k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (249:6): [True: 0, False: 3.85k]
  |  Branch (249:14): [True: 0, False: 3.85k]
  ------------------
  250|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  251|      0|			  "ExifMnoteDataOlympus", "Short MakerNote");
  252|      0|		return;
  253|      0|	}
  254|  3.85k|	o2 = 6 + n->offset; /* Start of interesting data */
  255|  3.85k|	if (CHECKOVERFLOW(o2,buf_size,10)) {
  ------------------
  |  |   40|  3.85k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 3.85k]
  |  |  |  Branch (40:81): [True: 0, False: 3.85k]
  |  |  |  Branch (40:112): [True: 5, False: 3.84k]
  |  |  ------------------
  ------------------
  256|      5|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  257|      5|			  "ExifMnoteDataOlympus", "Short MakerNote");
  258|      5|		return;
  259|      5|	}
  260|       |
  261|       |	/*
  262|       |	 * Olympus headers start with "OLYMP" and need to have at least
  263|       |	 * a size of 22 bytes (6 for 'OLYMP', 2 other bytes, 2 for the
  264|       |	 * number of entries, and 12 for one entry.
  265|       |	 *
  266|       |	 * Sanyo format is identical and uses identical tags except that
  267|       |	 * header starts with "SANYO".
  268|       |	 *
  269|       |	 * Epson format is identical and uses identical tags except that
  270|       |	 * header starts with "EPSON".
  271|       |	 *
  272|       |	 * Nikon headers start with "Nikon" (6 bytes including '\0'), 
  273|       |	 * version number (1 or 2).
  274|       |	 * 
  275|       |	 * Version 1 continues with 0, 1, 0, number_of_tags,
  276|       |	 * or just with number_of_tags (models D1H, D1X...).
  277|       |	 * 
  278|       |	 * Version 2 continues with an unknown byte (0 or 10),
  279|       |	 * two unknown bytes (0), "MM" or "II", another byte 0 and 
  280|       |	 * lastly 0x2A.
  281|       |	 */
  282|  3.84k|	n->version = exif_mnote_data_olympus_identify_variant(buf+o2, buf_size-o2);
  283|  3.84k|	switch (n->version) {
  284|  1.18k|	case olympusV1:
  ------------------
  |  Branch (284:2): [True: 1.18k, False: 2.66k]
  ------------------
  285|  2.47k|	case sanyoV1:
  ------------------
  |  Branch (285:2): [True: 1.29k, False: 2.55k]
  ------------------
  286|  3.17k|	case epsonV1:
  ------------------
  |  Branch (286:2): [True: 705, False: 3.14k]
  ------------------
  287|  3.17k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  288|  3.17k|			"Parsing Olympus/Sanyo/Epson maker note v1...");
  289|       |
  290|       |		/* The number of entries is at position 8. */
  291|  3.17k|		if (buf[o2 + 6] == 1)
  ------------------
  |  Branch (291:7): [True: 169, False: 3.00k]
  ------------------
  292|    169|			n->order = EXIF_BYTE_ORDER_INTEL;
  293|  3.00k|		else if (buf[o2 + 6 + 1] == 1)
  ------------------
  |  Branch (293:12): [True: 31, False: 2.97k]
  ------------------
  294|     31|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  295|  3.17k|		o2 += 8;
  296|  3.17k|		c = exif_get_short (buf + o2, n->order);
  297|  3.17k|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (297:7): [True: 915, False: 2.26k]
  |  Branch (297:24): [True: 719, False: 196]
  ------------------
  298|    719|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (298:8): [True: 682, False: 37]
  ------------------
  299|    682|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  300|    682|			} else {
  301|     37|				n->order = EXIF_BYTE_ORDER_INTEL;
  302|     37|			}
  303|    719|		}
  304|  3.17k|		break;
  305|       |
  306|    423|	case olympusV2:
  ------------------
  |  Branch (306:2): [True: 423, False: 3.42k]
  ------------------
  307|       |		/* Olympus S760, S770 */
  308|    423|		datao = o2;
  309|    423|		o2 += 8;
  310|    423|		if (CHECKOVERFLOW(o2,buf_size,4)) return;
  ------------------
  |  |   40|    423|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 423]
  |  |  |  Branch (40:81): [True: 0, False: 423]
  |  |  |  Branch (40:112): [True: 2, False: 421]
  |  |  ------------------
  ------------------
  311|    421|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  312|    421|			"Parsing Olympus maker note v2 (0x%02x, %02x, %02x, %02x)...",
  313|    421|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  314|       |
  315|    421|		if ((buf[o2] == 'I') && (buf[o2 + 1] == 'I'))
  ------------------
  |  Branch (315:7): [True: 15, False: 406]
  |  Branch (315:27): [True: 1, False: 14]
  ------------------
  316|      1|			n->order = EXIF_BYTE_ORDER_INTEL;
  317|    420|		else if ((buf[o2] == 'M') && (buf[o2 + 1] == 'M'))
  ------------------
  |  Branch (317:12): [True: 14, False: 406]
  |  Branch (317:32): [True: 1, False: 13]
  ------------------
  318|      1|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  319|       |
  320|       |		/* The number of entries is at position 8+4. */
  321|    421|		o2 += 4;
  322|    421|		break;
  323|       |
  324|     67|	case nikonV1:
  ------------------
  |  Branch (324:2): [True: 67, False: 3.77k]
  ------------------
  325|     67|		o2 += 6;
  326|     67|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  327|     67|			"Parsing Nikon maker note v1 (0x%02x, %02x, %02x, "
  328|     67|			"%02x)...",
  329|     67|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  330|       |
  331|       |		/* Skip version number */
  332|     67|		o2 += 1;
  333|       |
  334|       |		/* Skip an unknown byte (00 or 0A). */
  335|     67|		o2 += 1;
  336|       |
  337|     67|		base = MNOTE_NIKON1_TAG_BASE;
  338|       |		/* Fix endianness, if needed */
  339|     67|		c = exif_get_short (buf + o2, n->order);
  340|     67|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (340:7): [True: 8, False: 59]
  |  Branch (340:24): [True: 7, False: 1]
  ------------------
  341|      7|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (341:8): [True: 3, False: 4]
  ------------------
  342|      3|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  343|      4|			} else {
  344|      4|				n->order = EXIF_BYTE_ORDER_INTEL;
  345|      4|			}
  346|      7|		}
  347|     67|		break;
  348|       |
  349|    131|	case nikonV2:
  ------------------
  |  Branch (349:2): [True: 131, False: 3.71k]
  ------------------
  350|    131|		o2 += 6;
  351|    131|		if (CHECKOVERFLOW(o2,buf_size,12)) return;
  ------------------
  |  |   40|    131|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 131]
  |  |  |  Branch (40:81): [True: 0, False: 131]
  |  |  |  Branch (40:112): [True: 3, False: 128]
  |  |  ------------------
  ------------------
  352|    128|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  353|    128|			"Parsing Nikon maker note v2 (0x%02x, %02x, %02x, "
  354|    128|			"%02x, %02x, %02x, %02x, %02x)...",
  355|    128|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3],
  356|    128|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  357|       |
  358|       |		/* Skip version number */
  359|    128|		o2 += 1;
  360|       |
  361|       |		/* Skip an unknown byte (00 or 0A). */
  362|    128|		o2 += 1;
  363|       |
  364|       |		/* Skip 2 unknown bytes (00 00). */
  365|    128|		o2 += 2;
  366|       |
  367|       |		/*
  368|       |		 * Byte order. From here the data offset
  369|       |		 * gets calculated.
  370|       |		 */
  371|    128|		datao = o2;
  372|    128|		if (!strncmp ((char *)&buf[o2], "II", 2))
  ------------------
  |  Branch (372:7): [True: 66, False: 62]
  ------------------
  373|     66|			n->order = EXIF_BYTE_ORDER_INTEL;
  374|     62|		else if (!strncmp ((char *)&buf[o2], "MM", 2))
  ------------------
  |  Branch (374:12): [True: 25, False: 37]
  ------------------
  375|     25|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  376|     37|		else {
  377|     37|			exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  378|     37|				"ExifMnoteDataOlympus", "Unknown "
  379|     37|				"byte order '%c%c'", buf[o2],
  380|     37|				buf[o2 + 1]);
  381|     37|			return;
  382|     37|		}
  383|     91|		o2 += 2;
  384|       |
  385|       |		/* Skip 2 unknown bytes (00 2A). */
  386|     91|		o2 += 2;
  387|       |
  388|       |		/* Go to where the number of entries is. */
  389|     91|		if (CHECKOVERFLOW(o2,buf_size,exif_get_long (buf + o2, n->order))) return;
  ------------------
  |  |   40|     91|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 91]
  |  |  |  Branch (40:81): [True: 53, False: 38]
  |  |  |  Branch (40:112): [True: 10, False: 28]
  |  |  ------------------
  ------------------
  390|     28|		o2 = datao + exif_get_long (buf + o2, n->order);
  391|     28|		break;
  392|       |
  393|     13|	case nikonV0:
  ------------------
  |  Branch (393:2): [True: 13, False: 3.83k]
  ------------------
  394|     13|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  395|     13|			"Parsing Nikon maker note v0 (0x%02x, %02x, %02x, "
  396|     13|			"%02x, %02x, %02x, %02x, %02x)...",
  397|     13|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
  398|     13|			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|     13|		n->order = EXIF_BYTE_ORDER_MOTOROLA;
  401|     13|		break;
  402|       |
  403|     34|	default:
  ------------------
  |  Branch (403:2): [True: 34, False: 3.81k]
  ------------------
  404|     34|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  405|     34|			"Unknown Olympus variant %i.", n->version);
  406|     34|		return;
  407|  3.84k|	}
  408|       |
  409|       |	/* Sanity check the offset */
  410|  3.70k|	if (CHECKOVERFLOW(o2,buf_size,2)) {
  ------------------
  |  |   40|  3.70k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 34, False: 3.67k]
  |  |  |  Branch (40:81): [True: 0, False: 3.67k]
  |  |  |  Branch (40:112): [True: 4, False: 3.66k]
  |  |  ------------------
  ------------------
  411|     38|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  412|     38|			  "ExifMnoteOlympus", "Short MakerNote");
  413|     38|		return;
  414|     38|	}
  415|       |
  416|       |	/* Read the number of tags */
  417|  3.66k|	c = exif_get_short (buf + o2, n->order);
  418|  3.66k|	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.66k|	if (c > 300) {
  ------------------
  |  Branch (422:6): [True: 37, False: 3.63k]
  ------------------
  423|     37|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Too much tags (%d) in Olympus MakerNote", c);
  424|     37|		return;
  425|     37|	}
  426|       |
  427|       |	/* Remove any old entries */
  428|  3.63k|	exif_mnote_data_olympus_clear (n);
  429|       |
  430|       |	/* Reserve enough space for all the possible MakerNote tags */
  431|  3.63k|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c);
  432|  3.63k|	if (!n->entries) {
  ------------------
  |  Branch (432:6): [True: 0, False: 3.63k]
  ------------------
  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.63k|	tcount = 0;
  439|   105k|	for (i = c, o = o2; i; --i, o += 12) {
  ------------------
  |  Branch (439:22): [True: 104k, False: 534]
  ------------------
  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.65k, False: 102k]
  |  |  |  Branch (40:81): [True: 0, False: 102k]
  |  |  |  Branch (40:112): [True: 1.44k, False: 101k]
  |  |  ------------------
  ------------------
  443|  3.09k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  444|  3.09k|				  "ExifMnoteOlympus", "Short MakerNote");
  445|  3.09k|			break;
  446|  3.09k|		}
  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: 51.9k, False: 49.4k]
  ------------------
  466|  51.9k|		buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (466:3): [True: 5.32k, False: 46.6k]
  ------------------
  467|   101k|	    ) {
  468|  5.32k|		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.32k|		continue;
  470|  5.32k|	    }
  471|       |	    /*
  472|       |	     * Size? If bigger than 4 bytes, the actual data is not
  473|       |	     * in the entry but somewhere else (offset).
  474|       |	     */
  475|  96.0k|	    s = exif_format_get_size (n->entries[tcount].format) *
  476|  96.0k|		   			 n->entries[tcount].components;
  477|  96.0k|		n->entries[tcount].size = s;
  478|  96.0k|		if (s) {
  ------------------
  |  Branch (478:7): [True: 38.3k, False: 57.7k]
  ------------------
  479|  38.3k|			size_t dataofs = o + 8;
  480|  38.3k|			if (s > 4) {
  ------------------
  |  Branch (480:8): [True: 19.1k, False: 19.1k]
  ------------------
  481|       |				/* The data in this case is merely a pointer */
  482|  19.1k|				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|  19.1k|			}
  498|  38.3k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   40|  38.3k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.77k, False: 36.5k]
  |  |  |  Branch (40:81): [True: 0, False: 36.5k]
  |  |  |  Branch (40:112): [True: 692, False: 35.8k]
  |  |  ------------------
  ------------------
  499|  2.46k|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  500|  2.46k|					  "ExifMnoteOlympus",
  501|  2.46k|					  "Tag data past end of buffer (%u > %u)",
  502|  2.46k|					  (unsigned)(dataofs + s), buf_size);
  503|  2.46k|				continue;
  504|  2.46k|			}
  505|       |
  506|  35.8k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  507|  35.8k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (507:8): [True: 0, False: 35.8k]
  ------------------
  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|  35.8k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  512|  35.8k|		}
  513|       |
  514|       |		/* Tag was successfully parsed */
  515|  93.6k|		++tcount;
  516|  93.6k|	}
  517|       |	/* Store the count of successfully parsed tags */
  518|  3.63k|	n->count = tcount;
  519|  3.63k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_count:
  523|  3.85k|{
  524|  3.85k|	return n ? ((ExifMnoteDataOlympus *) n)->count : 0;
  ------------------
  |  Branch (524:9): [True: 3.85k, False: 0]
  ------------------
  525|  3.85k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_name:
  539|  53.3k|{
  540|  53.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  541|       |
  542|  53.3k|	if (!n) return NULL;
  ------------------
  |  Branch (542:6): [True: 0, False: 53.3k]
  ------------------
  543|  53.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (543:6): [True: 0, False: 53.3k]
  ------------------
  544|  53.3k|	return mnote_olympus_tag_get_name (n->entries[i].tag);
  545|  53.3k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_title:
  549|  52.3k|{
  550|  52.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  551|       |	
  552|  52.3k|	if (!n) return NULL;
  ------------------
  |  Branch (552:6): [True: 0, False: 52.3k]
  ------------------
  553|  52.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (553:6): [True: 0, False: 52.3k]
  ------------------
  554|  52.3k|        return mnote_olympus_tag_get_title (n->entries[i].tag);
  555|  52.3k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_description:
  559|  52.3k|{
  560|  52.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  561|       |	
  562|  52.3k|	if (!n) return NULL;
  ------------------
  |  Branch (562:6): [True: 0, False: 52.3k]
  ------------------
  563|  52.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (563:6): [True: 0, False: 52.3k]
  ------------------
  564|  52.3k|        return mnote_olympus_tag_get_description (n->entries[i].tag);
  565|  52.3k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_value:
   77|  52.3k|{
   78|  52.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
   79|       |
   80|  52.3k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (80:6): [True: 0, False: 52.3k]
  |  Branch (80:12): [True: 0, False: 52.3k]
  ------------------
   81|  52.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (81:6): [True: 0, False: 52.3k]
  ------------------
   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|  52.3k|	return mnote_olympus_entry_get_value (&n->entries[i], val, maxlen);
   88|  52.3k|}

mnote_olympus_entry_get_value:
  276|  52.3k|{
  277|  52.3k|	char         buf[30];
  278|  52.3k|	ExifLong     vl;
  279|  52.3k|	ExifSLong    vsl;
  280|  52.3k|	ExifShort    vs = 0;
  281|  52.3k|	ExifSShort   vss = 0;
  282|  52.3k|	ExifRational vr, vr2;
  283|  52.3k|	ExifSRational vsr;
  284|  52.3k|	int          i, j;
  285|  52.3k|	double       r, b;
  286|       |
  287|  52.3k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 52.3k]
  ------------------
  288|      0|		return (NULL);
  289|  52.3k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 52.3k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  52.3k|	memset (v, 0, maxlen);
  293|  52.3k|	maxlen--;
  294|       |
  295|  52.3k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 17.7k, False: 34.5k]
  |  Branch (295:24): [True: 3.43k, False: 14.3k]
  ------------------
  296|  3.43k|		return (v);
  297|       |
  298|  48.8k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 14.3k, False: 34.5k]
  |  Branch (298:24): [True: 0, False: 14.3k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  48.8k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    836|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 836, False: 48.0k]
  ------------------
  305|    836|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    836|#define CF(format,target,v,maxlen)                              \
  |  |   36|    836|{                                                               \
  |  |   37|    836|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 294, False: 542]
  |  |  ------------------
  |  |   38|    294|                snprintf (v, maxlen,	                        \
  |  |   39|    294|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    294|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    294|                        "expected '%s'."),                      \
  |  |   41|    294|                        exif_format_get_name (format),          \
  |  |   42|    294|                        exif_format_get_name (target));         \
  |  |   43|    294|                break;                                          \
  |  |   44|    294|        }                                                       \
  |  |   45|    836|}
  ------------------
  306|    542|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    542|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    542|{                                                                       \
  |  |   62|    542|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 216, False: 326]
  |  |  ------------------
  |  |   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|    542|}
  ------------------
  307|    326|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    326|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 67, False: 259]
  ------------------
  309|     67|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|     67|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 67]
  |  |  ------------------
  ------------------
  310|    259|		} else {
  311|    259|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    259|		}
  313|    326|		break;
  314|    531|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 531, False: 48.3k]
  ------------------
  315|    531|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    531|#define CF(format,target,v,maxlen)                              \
  |  |   36|    531|{                                                               \
  |  |   37|    531|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 260, False: 271]
  |  |  ------------------
  |  |   38|    260|                snprintf (v, maxlen,	                        \
  |  |   39|    260|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    260|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    260|                        "expected '%s'."),                      \
  |  |   41|    260|                        exif_format_get_name (format),          \
  |  |   42|    260|                        exif_format_get_name (target));         \
  |  |   43|    260|                break;                                          \
  |  |   44|    260|        }                                                       \
  |  |   45|    531|}
  ------------------
  316|    271|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    271|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    271|{                                                                       \
  |  |   62|    271|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 201, False: 70]
  |  |  ------------------
  |  |   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|    271|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|     70|                vs = exif_get_short (entry->data + 2, entry->order);
  319|     70|                snprintf (v, maxlen, "ISO %hd", vs);
  320|     70|                break;
  321|    613|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 613, False: 48.2k]
  ------------------
  322|    613|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    613|#define CF(format,target,v,maxlen)                              \
  |  |   36|    613|{                                                               \
  |  |   37|    613|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 212, False: 401]
  |  |  ------------------
  |  |   38|    212|                snprintf (v, maxlen,	                        \
  |  |   39|    212|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    212|                        "expected '%s'."),                      \
  |  |   41|    212|                        exif_format_get_name (format),          \
  |  |   42|    212|                        exif_format_get_name (target));         \
  |  |   43|    212|                break;                                          \
  |  |   44|    212|        }                                                       \
  |  |   45|    613|}
  ------------------
  323|    401|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    401|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    401|{                                                                       \
  |  |   62|    401|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 204, False: 197]
  |  |  ------------------
  |  |   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|    401|}
  ------------------
  324|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  325|    197|                vs = exif_get_short (entry->data + 2, entry->order);
  326|    197|                snprintf (v, maxlen, "ISO2 %hd", vs);
  327|    197|                break;
  328|    226|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 226, False: 48.6k]
  ------------------
  329|    349|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 123, False: 48.7k]
  ------------------
  330|    774|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 425, False: 48.4k]
  ------------------
  331|  1.01k|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 241, False: 48.6k]
  ------------------
  332|  1.30k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 291, False: 48.5k]
  ------------------
  333|  1.60k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 294, False: 48.5k]
  ------------------
  334|  1.95k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 350, False: 48.5k]
  ------------------
  335|  2.21k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 264, False: 48.6k]
  ------------------
  336|  2.42k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 207, False: 48.6k]
  ------------------
  337|  2.62k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 201, False: 48.6k]
  ------------------
  338|  2.84k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 218, False: 48.6k]
  ------------------
  339|  3.03k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 197, False: 48.6k]
  ------------------
  340|  3.10k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 71, False: 48.8k]
  ------------------
  341|  3.10k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  3.10k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  3.10k|{                                                               \
  |  |   37|  3.10k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.44k, False: 666]
  |  |  ------------------
  |  |   38|  2.44k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.44k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.44k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.44k|                        "expected '%s'."),                      \
  |  |   41|  2.44k|                        exif_format_get_name (format),          \
  |  |   42|  2.44k|                        exif_format_get_name (target));         \
  |  |   43|  2.44k|                break;                                          \
  |  |   44|  2.44k|        }                                                       \
  |  |   45|  3.10k|}
  ------------------
  342|    666|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    666|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 228, False: 438]
  |  |  ------------------
  ------------------
  343|    666|		break;
  344|     83|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 83, False: 48.8k]
  ------------------
  345|    334|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 251, False: 48.6k]
  ------------------
  346|    717|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 383, False: 48.5k]
  ------------------
  347|    717|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    717|#define CF(format,target,v,maxlen)                              \
  |  |   36|    717|{                                                               \
  |  |   37|    717|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 232, False: 485]
  |  |  ------------------
  |  |   38|    232|                snprintf (v, maxlen,	                        \
  |  |   39|    232|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    232|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    232|                        "expected '%s'."),                      \
  |  |   41|    232|                        exif_format_get_name (format),          \
  |  |   42|    232|                        exif_format_get_name (target));         \
  |  |   43|    232|                break;                                          \
  |  |   44|    232|        }                                                       \
  |  |   45|    717|}
  ------------------
  348|    485|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    485|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    485|{                                                                       \
  |  |   62|    485|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 255, False: 230]
  |  |  ------------------
  |  |   63|    255|                snprintf (v, maxlen,                                    \
  |  |   64|    255|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    255|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    255|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    255|                break;                                                  \
  |  |   67|    255|        }                                                               \
  |  |   68|    485|}
  ------------------
  349|    230|		vl =  exif_get_long (entry->data, entry->order);
  350|    230|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    230|		break;
  352|    607|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 607, False: 48.2k]
  ------------------
  353|  1.15k|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 546, False: 48.3k]
  ------------------
  354|  1.15k|		unsigned char h,m,l;
  355|  1.15k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  1.15k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.15k|{                                                               \
  |  |   37|  1.15k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 228, False: 925]
  |  |  ------------------
  |  |   38|    228|                snprintf (v, maxlen,	                        \
  |  |   39|    228|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    228|                        "expected '%s'."),                      \
  |  |   41|    228|                        exif_format_get_name (format),          \
  |  |   42|    228|                        exif_format_get_name (target));         \
  |  |   43|    228|                break;                                          \
  |  |   44|    228|        }                                                       \
  |  |   45|  1.15k|}
  ------------------
  356|    925|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    925|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    925|{                                                                       \
  |  |   62|    925|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 335, False: 590]
  |  |  ------------------
  |  |   63|    335|                snprintf (v, maxlen,                                    \
  |  |   64|    335|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    335|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    335|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    335|                break;                                                  \
  |  |   67|    335|        }                                                               \
  |  |   68|    925|}
  ------------------
  357|    590|		vl =  exif_get_long (entry->data, entry->order);
  358|    590|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    590|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 345, False: 245]
  ------------------
  360|    590|		break;
  361|    925|	}
  362|    225|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 225, False: 48.6k]
  ------------------
  363|    780|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 555, False: 48.3k]
  ------------------
  364|    780|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    780|#define CF(format,target,v,maxlen)                              \
  |  |   36|    780|{                                                               \
  |  |   37|    780|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 316, False: 464]
  |  |  ------------------
  |  |   38|    316|                snprintf (v, maxlen,	                        \
  |  |   39|    316|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    316|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    316|                        "expected '%s'."),                      \
  |  |   41|    316|                        exif_format_get_name (format),          \
  |  |   42|    316|                        exif_format_get_name (target));         \
  |  |   43|    316|                break;                                          \
  |  |   44|    316|        }                                                       \
  |  |   45|    780|}
  ------------------
  365|    464|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    464|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    464|{                                                                       \
  |  |   62|    464|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 268, False: 196]
  |  |  ------------------
  |  |   63|    268|                snprintf (v, maxlen,                                    \
  |  |   64|    268|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    268|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    268|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    268|                break;                                                  \
  |  |   67|    268|        }                                                               \
  |  |   68|    464|}
  ------------------
  366|    196|		vl =  exif_get_long (entry->data, entry->order);
  367|    196|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    196|		break;
  369|    750|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 750, False: 48.1k]
  ------------------
  370|    989|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 239, False: 48.6k]
  ------------------
  371|  1.05k|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 68, False: 48.8k]
  ------------------
  372|  1.23k|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 175, False: 48.7k]
  ------------------
  373|  1.43k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 201, False: 48.6k]
  ------------------
  374|  1.43k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.43k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.43k|{                                                               \
  |  |   37|  1.43k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 584, False: 849]
  |  |  ------------------
  |  |   38|    584|                snprintf (v, maxlen,	                        \
  |  |   39|    584|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    584|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    584|                        "expected '%s'."),                      \
  |  |   41|    584|                        exif_format_get_name (format),          \
  |  |   42|    584|                        exif_format_get_name (target));         \
  |  |   43|    584|                break;                                          \
  |  |   44|    584|        }                                                       \
  |  |   45|  1.43k|}
  ------------------
  375|    849|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    849|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    849|{                                                                       \
  |  |   62|    849|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 420, False: 429]
  |  |  ------------------
  |  |   63|    420|                snprintf (v, maxlen,                                    \
  |  |   64|    420|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    420|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    420|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    420|                break;                                                  \
  |  |   67|    420|        }                                                               \
  |  |   68|    849|}
  ------------------
  376|    429|		vs = exif_get_short (entry->data, entry->order);
  377|    429|		snprintf (v, maxlen, "%hd", vs);
  378|    429|		break;
  379|  1.07k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.07k, False: 47.8k]
  ------------------
  380|  1.07k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.07k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.07k|{                                                               \
  |  |   37|  1.07k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 226, False: 849]
  |  |  ------------------
  |  |   38|    226|                snprintf (v, maxlen,	                        \
  |  |   39|    226|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    226|                        "expected '%s'."),                      \
  |  |   41|    226|                        exif_format_get_name (format),          \
  |  |   42|    226|                        exif_format_get_name (target));         \
  |  |   43|    226|                break;                                          \
  |  |   44|    226|        }                                                       \
  |  |   45|  1.07k|}
  ------------------
  381|    849|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    849|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    849|{                                                                       \
  |  |   62|    849|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 235, False: 614]
  |  |  ------------------
  |  |   63|    235|                snprintf (v, maxlen,                                    \
  |  |   64|    235|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    235|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    235|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    235|                break;                                                  \
  |  |   67|    235|        }                                                               \
  |  |   68|    849|}
  ------------------
  382|    614|		vr = exif_get_rational (entry->data, entry->order);
  383|    614|		r = R2D(vr);
  ------------------
  |  |   82|    614|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 375, False: 239]
  |  |  ------------------
  ------------------
  384|    614|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    614|		b = R2D(vr);
  ------------------
  |  |   82|    614|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 398, False: 216]
  |  |  ------------------
  ------------------
  386|    614|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    614|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    614|		break;
  388|    760|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 760, False: 48.1k]
  ------------------
  389|    760|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|    760|#define CF(format,target,v,maxlen)                              \
  |  |   36|    760|{                                                               \
  |  |   37|    760|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 147, False: 613]
  |  |  ------------------
  |  |   38|    147|                snprintf (v, maxlen,	                        \
  |  |   39|    147|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    147|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    147|                        "expected '%s'."),                      \
  |  |   41|    147|                        exif_format_get_name (format),          \
  |  |   42|    147|                        exif_format_get_name (target));         \
  |  |   43|    147|                break;                                          \
  |  |   44|    147|        }                                                       \
  |  |   45|    760|}
  ------------------
  390|    613|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    613|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    613|{                                                                       \
  |  |   62|    613|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 211, False: 402]
  |  |  ------------------
  |  |   63|    211|                snprintf (v, maxlen,                                    \
  |  |   64|    211|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    211|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    211|                break;                                                  \
  |  |   67|    211|        }                                                               \
  |  |   68|    613|}
  ------------------
  391|    402|		vr = exif_get_rational (entry->data, entry->order);
  392|    402|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 187, False: 215]
  |  Branch (392:24): [True: 46, False: 169]
  ------------------
  393|    233|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    233|		} else {
  395|    169|			r = R2D(vr);
  ------------------
  |  |   82|    169|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 169, False: 0]
  |  |  ------------------
  ------------------
  396|    169|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    169|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    169|		}
  398|    402|		break;
  399|  1.71k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 1.71k, False: 47.1k]
  ------------------
  400|  1.71k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.71k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.71k|{                                                               \
  |  |   37|  1.71k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 244, False: 1.47k]
  |  |  ------------------
  |  |   38|    244|                snprintf (v, maxlen,	                        \
  |  |   39|    244|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    244|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    244|                        "expected '%s'."),                      \
  |  |   41|    244|                        exif_format_get_name (format),          \
  |  |   42|    244|                        exif_format_get_name (target));         \
  |  |   43|    244|                break;                                          \
  |  |   44|    244|        }                                                       \
  |  |   45|  1.71k|}
  ------------------
  401|  1.47k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.47k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.47k|{                                                                       \
  |  |   62|  1.47k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 333, False: 1.14k]
  |  |  ------------------
  |  |   63|    333|                snprintf (v, maxlen,                                    \
  |  |   64|    333|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    333|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    333|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    333|                break;                                                  \
  |  |   67|    333|        }                                                               \
  |  |   68|  1.47k|}
  ------------------
  402|  1.14k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.14k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.14k|		r = R2D(vr);
  ------------------
  |  |   82|  1.14k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 897, False: 243]
  |  |  ------------------
  ------------------
  405|  1.14k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.14k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 877, False: 263]
  |  |  ------------------
  ------------------
  406|  1.14k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.14k|		break;
  408|  1.03k|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 1.03k, False: 47.8k]
  ------------------
  409|  1.03k|		CF2 (entry->format, EXIF_FORMAT_BYTE, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   47|  1.03k|#define CF2(format,target1,target2,v,maxlen)                    \
  |  |   48|  1.03k|{                                                               \
  |  |   49|  1.03k|        if ((format != target1) && (format != target2)) {       \
  |  |  ------------------
  |  |  |  Branch (49:13): [True: 581, False: 456]
  |  |  |  Branch (49:36): [True: 277, False: 304]
  |  |  ------------------
  |  |   50|    277|                snprintf (v, maxlen,	                        \
  |  |   51|    277|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    277|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    277|                        "expected '%s' or '%s'."),              \
  |  |   53|    277|                        exif_format_get_name (format),          \
  |  |   54|    277|                        exif_format_get_name (target1),         \
  |  |   55|    277|                        exif_format_get_name (target2));        \
  |  |   56|    277|                break;                                          \
  |  |   57|    277|        }                                                       \
  |  |   58|  1.03k|}
  ------------------
  410|    760|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    760|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    760|{                                                                       \
  |  |   62|    760|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 234, False: 526]
  |  |  ------------------
  |  |   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|    760|}
  ------------------
  411|    526|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 202, False: 324]
  ------------------
  412|    202|			vs = exif_get_short (entry->data, entry->order);
  413|    324|		} else {
  414|    324|			vs = entry->data[0];
  415|    324|		}
  416|    526|		snprintf (v, maxlen, "%hd", vs);
  417|    526|		break;
  418|  2.85k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.85k, False: 46.0k]
  ------------------
  419|  2.85k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.85k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.85k|{                                                               \
  |  |   37|  2.85k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 116, False: 2.74k]
  |  |  ------------------
  |  |   38|    116|                snprintf (v, maxlen,	                        \
  |  |   39|    116|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    116|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    116|                        "expected '%s'."),                      \
  |  |   41|    116|                        exif_format_get_name (format),          \
  |  |   42|    116|                        exif_format_get_name (target));         \
  |  |   43|    116|                break;                                          \
  |  |   44|    116|        }                                                       \
  |  |   45|  2.85k|}
  ------------------
  420|  2.74k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.74k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.74k|{                                                                       \
  |  |   62|  2.74k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 301, False: 2.44k]
  |  |  ------------------
  |  |   63|    301|                snprintf (v, maxlen,                                    \
  |  |   64|    301|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    301|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    301|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    301|                break;                                                  \
  |  |   67|    301|        }                                                               \
  |  |   68|  2.74k|}
  ------------------
  421|  2.44k|		switch (  *( entry->data+1)  ) {
  422|    217|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 217, False: 2.22k]
  ------------------
  423|    208|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 208, False: 2.23k]
  ------------------
  424|    218|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|    218|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 218, False: 2.22k]
  ------------------
  425|    194|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 194, False: 2.24k]
  ------------------
  426|    191|		  	case  4: strncpy (v, _("AF position: right"), maxlen); break;
  ------------------
  |  |   31|    191|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (426:6): [True: 191, False: 2.24k]
  ------------------
  427|    229|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    229|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 229, False: 2.21k]
  ------------------
  428|    164|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    164|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 164, False: 2.27k]
  ------------------
  429|    196|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 196, False: 2.24k]
  ------------------
  430|    194|		  	case  8: strncpy (v, _("AF position: lower-right"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (430:6): [True: 194, False: 2.24k]
  ------------------
  431|    194|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 194, False: 2.24k]
  ------------------
  432|    197|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 197, False: 2.24k]
  ------------------
  433|    238|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    238|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 238, False: 2.20k]
  ------------------
  434|  2.44k|		}     
  435|  2.44k|		break;
  436|  2.44k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.43k, False: 47.4k]
  ------------------
  437|  1.43k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.43k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.43k|{                                                               \
  |  |   37|  1.43k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 205, False: 1.23k]
  |  |  ------------------
  |  |   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.43k|}
  ------------------
  438|  1.23k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.23k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.23k|{                                                                       \
  |  |   62|  1.23k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 198, False: 1.03k]
  |  |  ------------------
  |  |   63|    198|                snprintf (v, maxlen,                                    \
  |  |   64|    198|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    198|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    198|                break;                                                  \
  |  |   67|    198|        }                                                               \
  |  |   68|  1.23k|}
  ------------------
  439|  1.03k|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  14.4k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 14.4k, False: 0]
  |  Branch (441:32): [True: 13.4k, False: 1.03k]
  ------------------
  442|  13.4k|			;
  443|  1.03k|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 1.03k]
  ------------------
  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|  1.03k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  1.03k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.03k|{                                                               \
  |  |   37|  1.03k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |   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|  1.03k|}
  ------------------
  448|       |		/* find the value */
  449|  2.68k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.43k, False: 250]
  ------------------
  450|  2.43k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.64k, False: 784]
  ------------------
  451|  1.03k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 254, False: 780]
  ------------------
  452|    254|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    254|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    254|			break;
  454|    254|		}
  455|    780|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    780|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    780|		break;
  457|  1.48k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.48k, False: 47.4k]
  ------------------
  458|  1.48k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 1.05k, False: 426]
  ------------------
  459|  1.05k|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.05k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.05k|{                                                                       \
  |  |   62|  1.05k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 279, False: 776]
  |  |  ------------------
  |  |   63|    279|                snprintf (v, maxlen,                                    \
  |  |   64|    279|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    279|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    279|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    279|                break;                                                  \
  |  |   67|    279|        }                                                               \
  |  |   68|  1.05k|}
  ------------------
  460|    776|			vr = exif_get_rational (entry->data, entry->order);
  461|    776|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 210, False: 566]
  |  Branch (461:25): [True: 231, False: 335]
  ------------------
  462|    441|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    441|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    441|			} else {
  464|    335|				r = R2D(vr);
  ------------------
  |  |   82|    335|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 335, False: 0]
  |  |  ------------------
  ------------------
  465|    335|				snprintf (v, maxlen, "%2.2f", r);
  466|    335|			}
  467|    776|			break;
  468|  1.05k|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    704|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 278, False: 48.6k]
  ------------------
  472|  1.13k|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 430, False: 48.4k]
  ------------------
  473|  1.34k|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 209, False: 48.6k]
  ------------------
  474|  1.49k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 151, False: 48.7k]
  ------------------
  475|  1.70k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 208, False: 48.6k]
  ------------------
  476|  1.90k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 203, False: 48.6k]
  ------------------
  477|  2.13k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 230, False: 48.6k]
  ------------------
  478|  2.35k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 222, False: 48.6k]
  ------------------
  479|  2.75k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 399, False: 48.4k]
  ------------------
  480|  2.99k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 235, False: 48.6k]
  ------------------
  481|  3.09k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 104, False: 48.7k]
  ------------------
  482|  3.30k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 205, False: 48.6k]
  ------------------
  483|  3.51k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 213, False: 48.6k]
  ------------------
  484|  3.71k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 200, False: 48.6k]
  ------------------
  485|  3.91k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 197, False: 48.6k]
  ------------------
  486|  4.18k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 277, False: 48.6k]
  ------------------
  487|  4.51k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 327, False: 48.5k]
  ------------------
  488|  4.85k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 336, False: 48.5k]
  ------------------
  489|  5.05k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 202, False: 48.6k]
  ------------------
  490|  5.31k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 262, False: 48.6k]
  ------------------
  491|  5.55k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 245, False: 48.6k]
  ------------------
  492|  5.81k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 260, False: 48.6k]
  ------------------
  493|  6.16k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 349, False: 48.5k]
  ------------------
  494|  6.36k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 201, False: 48.6k]
  ------------------
  495|  6.58k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 216, False: 48.6k]
  ------------------
  496|  6.78k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 204, False: 48.6k]
  ------------------
  497|  7.05k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 266, False: 48.6k]
  ------------------
  498|  7.05k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  7.05k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  7.05k|{                                                                       \
  |  |   62|  7.05k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.54k, False: 4.50k]
  |  |  ------------------
  |  |   63|  2.54k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.54k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.54k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.54k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.54k|                break;                                                  \
  |  |   67|  2.54k|        }                                                               \
  |  |   68|  7.05k|}
  ------------------
  499|  4.50k|		switch (entry->format) {
  500|    755|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 755, False: 3.75k]
  ------------------
  501|  1.30k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 547, False: 3.96k]
  ------------------
  502|  1.30k|			vs = entry->data[0];
  503|  1.30k|			break;
  504|  2.05k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 2.05k, False: 2.45k]
  ------------------
  505|  2.05k|			vs = exif_get_short(entry->data, entry->order);
  506|  2.05k|			break;
  507|  1.15k|		default:
  ------------------
  |  Branch (507:3): [True: 1.15k, False: 3.35k]
  ------------------
  508|  1.15k|			vs = 0;
  509|  1.15k|			break;
  510|  4.50k|		}
  511|       |		/* search for the tag */
  512|  75.4k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 75.2k, False: 276]
  |  Branch (512:32): [True: 70.9k, False: 4.23k]
  ------------------
  513|  70.9k|			;
  514|  4.50k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 276, False: 4.23k]
  ------------------
  515|    276|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|    276|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|    276|		  	break;
  517|    276|		}
  518|  4.23k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  4.23k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  4.23k|{                                                               \
  |  |   37|  4.23k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 1.80k, False: 2.42k]
  |  |  ------------------
  |  |   38|  1.80k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.80k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.80k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.80k|                        "expected '%s'."),                      \
  |  |   41|  1.80k|                        exif_format_get_name (format),          \
  |  |   42|  1.80k|                        exif_format_get_name (target));         \
  |  |   43|  1.80k|                break;                                          \
  |  |   44|  1.80k|        }                                                       \
  |  |   45|  4.23k|}
  ------------------
  519|       |		/* find the value */
  520|  11.1k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 9.98k, False: 1.17k]
  ------------------
  521|  9.98k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 8.73k, False: 1.25k]
  ------------------
  522|  2.42k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.22k, False: 1.20k]
  ------------------
  523|  1.22k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.22k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.22k|			break;
  525|  1.22k|		}
  526|  1.20k|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|  1.20k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|  1.20k|		break;
  528|    222|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 222, False: 48.6k]
  ------------------
  529|    432|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 210, False: 48.6k]
  ------------------
  530|    577|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 145, False: 48.7k]
  ------------------
  531|    805|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 228, False: 48.6k]
  ------------------
  532|  1.01k|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 206, False: 48.6k]
  ------------------
  533|  1.25k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 243, False: 48.6k]
  ------------------
  534|  1.56k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 306, False: 48.5k]
  ------------------
  535|  1.80k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 244, False: 48.6k]
  ------------------
  536|  2.16k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 361, False: 48.5k]
  ------------------
  537|  2.16k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.16k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.16k|{                                                               \
  |  |   37|  2.16k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 546, False: 1.61k]
  |  |  ------------------
  |  |   38|    546|                snprintf (v, maxlen,	                        \
  |  |   39|    546|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    546|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    546|                        "expected '%s'."),                      \
  |  |   41|    546|                        exif_format_get_name (format),          \
  |  |   42|    546|                        exif_format_get_name (target));         \
  |  |   43|    546|                break;                                          \
  |  |   44|    546|        }                                                       \
  |  |   45|  2.16k|}
  ------------------
  538|  1.61k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.61k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.61k|{                                                                       \
  |  |   62|  1.61k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 602, False: 1.01k]
  |  |  ------------------
  |  |   63|    602|                snprintf (v, maxlen,                                    \
  |  |   64|    602|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    602|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    602|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    602|                break;                                                  \
  |  |   67|    602|        }                                                               \
  |  |   68|  1.61k|}
  ------------------
  539|  1.01k|		vs = exif_get_short (entry->data, entry->order);
  540|  1.01k|		switch (vs) {
  541|    365|		case 0:
  ------------------
  |  Branch (541:3): [True: 365, False: 652]
  ------------------
  542|    365|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    365|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    365|			break;
  544|    192|		case 1:
  ------------------
  |  Branch (544:3): [True: 192, False: 825]
  ------------------
  545|    192|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    192|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|    192|			break;
  547|    460|		default:
  ------------------
  |  Branch (547:3): [True: 460, False: 557]
  ------------------
  548|    460|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    460|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    460|			strncat (v, buf, maxlen - strlen (v));
  550|    460|			break;
  551|  1.01k|		}
  552|  1.01k|		break;
  553|  1.38k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.38k, False: 47.5k]
  ------------------
  554|  1.38k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.38k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.38k|{                                                               \
  |  |   37|  1.38k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 204, False: 1.18k]
  |  |  ------------------
  |  |   38|    204|                snprintf (v, maxlen,	                        \
  |  |   39|    204|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    204|                        "expected '%s'."),                      \
  |  |   41|    204|                        exif_format_get_name (format),          \
  |  |   42|    204|                        exif_format_get_name (target));         \
  |  |   43|    204|                break;                                          \
  |  |   44|    204|        }                                                       \
  |  |   45|  1.38k|}
  ------------------
  555|  1.18k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.18k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.18k|{                                                                       \
  |  |   62|  1.18k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 216, False: 965]
  |  |  ------------------
  |  |   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.18k|}
  ------------------
  556|    965|		vs = exif_get_short (entry->data, entry->order);
  557|    965|		switch (vs) {
  558|    250|		case 0:
  ------------------
  |  Branch (558:3): [True: 250, False: 715]
  ------------------
  559|    250|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    250|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    250|			break;
  561|    199|		case 1:
  ------------------
  |  Branch (561:3): [True: 199, False: 766]
  ------------------
  562|    199|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|    199|			break;
  564|    198|		case 2:
  ------------------
  |  Branch (564:3): [True: 198, False: 767]
  ------------------
  565|    198|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|    198|			break;
  567|    318|		default:
  ------------------
  |  Branch (567:3): [True: 318, False: 647]
  ------------------
  568|    318|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    318|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    318|			strncat (v, buf, maxlen - strlen (v));
  570|    318|			break;
  571|    965|		}
  572|    965|		break;
  573|  1.83k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.83k, False: 47.0k]
  ------------------
  574|  1.83k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.83k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.83k|{                                                               \
  |  |   37|  1.83k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 322, False: 1.51k]
  |  |  ------------------
  |  |   38|    322|                snprintf (v, maxlen,	                        \
  |  |   39|    322|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    322|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    322|                        "expected '%s'."),                      \
  |  |   41|    322|                        exif_format_get_name (format),          \
  |  |   42|    322|                        exif_format_get_name (target));         \
  |  |   43|    322|                break;                                          \
  |  |   44|    322|        }                                                       \
  |  |   45|  1.83k|}
  ------------------
  575|  1.51k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.51k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.51k|{                                                                       \
  |  |   62|  1.51k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 217, False: 1.29k]
  |  |  ------------------
  |  |   63|    217|                snprintf (v, maxlen,                                    \
  |  |   64|    217|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    217|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    217|                break;                                                  \
  |  |   67|    217|        }                                                               \
  |  |   68|  1.51k|}
  ------------------
  576|  1.29k|		{
  577|  1.29k|			double ao,ac;
  578|  1.29k|			unsigned long fs,fl;
  579|  1.29k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.29k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.29k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 1.03k, False: 267]
  |  |  ------------------
  ------------------
  581|  1.29k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.29k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.29k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 858, False: 441]
  |  |  ------------------
  ------------------
  583|  1.29k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.29k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.29k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.03k, False: 266]
  |  |  ------------------
  ------------------
  585|  1.29k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.29k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.29k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.08k, False: 216]
  |  |  ------------------
  ------------------
  587|  1.29k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.29k|		}
  589|  1.29k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.06k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.06k, False: 46.8k]
  ------------------
  593|  2.06k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.06k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.06k|{                                                               \
  |  |   37|  2.06k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 274, False: 1.79k]
  |  |  ------------------
  |  |   38|    274|                snprintf (v, maxlen,	                        \
  |  |   39|    274|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    274|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    274|                        "expected '%s'."),                      \
  |  |   41|    274|                        exif_format_get_name (format),          \
  |  |   42|    274|                        exif_format_get_name (target));         \
  |  |   43|    274|                break;                                          \
  |  |   44|    274|        }                                                       \
  |  |   45|  2.06k|}
  ------------------
  594|  1.79k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  1.79k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.79k|{                                                                       \
  |  |   62|  1.79k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 224, False: 1.56k]
  |  |  ------------------
  |  |   63|    224|                snprintf (v, maxlen,                                    \
  |  |   64|    224|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    224|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    224|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    224|                break;                                                  \
  |  |   67|    224|        }                                                               \
  |  |   68|  1.79k|}
  ------------------
  595|  1.56k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.56k|		switch (vl) {
  597|    325|		case 0:
  ------------------
  |  Branch (597:3): [True: 325, False: 1.24k]
  ------------------
  598|    325|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    325|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    325|			break;
  600|    194|		case 1:
  ------------------
  |  Branch (600:3): [True: 194, False: 1.37k]
  ------------------
  601|    194|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    194|			break;
  603|    450|		case 2:
  ------------------
  |  Branch (603:3): [True: 450, False: 1.11k]
  ------------------
  604|    450|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    450|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    450|			break;
  606|    343|		case 3:
  ------------------
  |  Branch (606:3): [True: 343, False: 1.22k]
  ------------------
  607|    343|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    343|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    343|			break;
  609|    254|		default:
  ------------------
  |  Branch (609:3): [True: 254, False: 1.31k]
  ------------------
  610|    254|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.56k|		}
  612|  1.56k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.56k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.56k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.56k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.56k|		switch (vl) {
  617|    194|		case 1:
  ------------------
  |  Branch (617:3): [True: 194, False: 1.37k]
  ------------------
  618|    194|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    194|			break;
  620|    194|		case 2:
  ------------------
  |  Branch (620:3): [True: 194, False: 1.37k]
  ------------------
  621|    194|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    194|			break;
  623|    197|		case 3:
  ------------------
  |  Branch (623:3): [True: 197, False: 1.36k]
  ------------------
  624|    197|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    197|			break;
  626|    194|		case 4:
  ------------------
  |  Branch (626:3): [True: 194, False: 1.37k]
  ------------------
  627|    194|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|    194|			break;
  629|    787|		default:
  ------------------
  |  Branch (629:3): [True: 787, False: 779]
  ------------------
  630|    787|			snprintf (buf, sizeof (buf), "%li",
  631|    787|				  (long int) vl);
  632|    787|			strncat (v, buf, maxlen - strlen (v));
  633|  1.56k|		}
  634|  1.56k|		break;
  635|  1.56k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.16k, False: 47.7k]
  ------------------
  636|  1.16k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 397, False: 766]
  ------------------
  637|       |			/* Epson uses a single SHORT here */
  638|    397|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    397|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    397|{                                                                       \
  |  |   62|    397|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 203, False: 194]
  |  |  ------------------
  |  |   63|    203|                snprintf (v, maxlen,                                    \
  |  |   64|    203|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    203|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    203|                break;                                                  \
  |  |   67|    203|        }                                                               \
  |  |   68|    397|}
  ------------------
  639|    194|			vs = exif_get_short (entry->data, entry->order);
  640|    194|			sprintf (buf, "%hu", vs);
  641|    194|			strncat (v, buf, maxlen - strlen (v));
  642|    766|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|    766|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|    766|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    766|{                                                                       \
  |  |   62|    766|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 108, False: 658]
  |  |  ------------------
  |  |   63|    108|                snprintf (v, maxlen,                                    \
  |  |   64|    108|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    108|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    108|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    108|                break;                                                  \
  |  |   67|    108|        }                                                               \
  |  |   68|    766|}
  ------------------
  645|    658|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    658|#define CF(format,target,v,maxlen)                              \
  |  |   36|    658|{                                                               \
  |  |   37|    658|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 69, False: 589]
  |  |  ------------------
  |  |   38|     69|                snprintf (v, maxlen,	                        \
  |  |   39|     69|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     69|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     69|                        "expected '%s'."),                      \
  |  |   41|     69|                        exif_format_get_name (format),          \
  |  |   42|     69|                        exif_format_get_name (target));         \
  |  |   43|     69|                break;                                          \
  |  |   44|     69|        }                                                       \
  |  |   45|    658|}
  ------------------
  646|  4.12k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 3.53k, False: 589]
  ------------------
  647|  3.53k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  3.53k|				sprintf (buf, "%hd ", vss);
  649|  3.53k|				strncat (v, buf, maxlen - strlen (v));
  650|  3.53k|			}
  651|    589|		}
  652|    783|		break;
  653|  1.07k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.07k, False: 47.8k]
  ------------------
  654|  1.07k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.07k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.07k|{                                                               \
  |  |   37|  1.07k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 198, False: 879]
  |  |  ------------------
  |  |   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|  1.07k|}
  ------------------
  655|    879|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|    879|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    879|{                                                                       \
  |  |   62|    879|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 93, False: 786]
  |  |  ------------------
  |  |   63|     93|                snprintf (v, maxlen,                                    \
  |  |   64|     93|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     93|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     93|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     93|                break;                                                  \
  |  |   67|     93|        }                                                               \
  |  |   68|    879|}
  ------------------
  656|  5.50k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 4.71k, False: 786]
  ------------------
  657|  4.71k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  4.71k|			sprintf (buf, "%hu ", vs);
  659|  4.71k|			strncat (v, buf, maxlen - strlen (v));
  660|  4.71k|		}
  661|    786|		break;
  662|    855|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 855, False: 48.0k]
  ------------------
  663|    855|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    855|#define CF(format,target,v,maxlen)                              \
  |  |   36|    855|{                                                               \
  |  |   37|    855|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 204, False: 651]
  |  |  ------------------
  |  |   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|    855|}
  ------------------
  664|    651|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    651|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    651|{                                                                       \
  |  |   72|    651|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 70, False: 581]
  |  |  |  Branch (72:23): [True: 248, False: 333]
  |  |  ------------------
  |  |   73|    318|		snprintf (v, maxlen,                                    \
  |  |   74|    318|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    318|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    318|			"expected %i or %i)."), (int) number,		\
  |  |   76|    318|			(int) t1, (int) t2);  				\
  |  |   77|    318|		break;                                                  \
  |  |   78|    318|	}                                                               \
  |  |   79|    651|}
  ------------------
  665|    333|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    333|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 333]
  |  |  ------------------
  ------------------
  666|    333|		break;
  667|    644|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 644, False: 48.2k]
  ------------------
  668|    644|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    644|#define CF(format,target,v,maxlen)                              \
  |  |   36|    644|{                                                               \
  |  |   37|    644|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 207, False: 437]
  |  |  ------------------
  |  |   38|    207|                snprintf (v, maxlen,	                        \
  |  |   39|    207|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    207|                        "expected '%s'."),                      \
  |  |   41|    207|                        exif_format_get_name (format),          \
  |  |   42|    207|                        exif_format_get_name (target));         \
  |  |   43|    207|                break;                                          \
  |  |   44|    207|        }                                                       \
  |  |   45|    644|}
  ------------------
  669|    437|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    437|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 227, False: 210]
  |  |  ------------------
  ------------------
  670|    437|		break;
  671|    591|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 591, False: 48.2k]
  ------------------
  672|    591|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    591|#define CF(format,target,v,maxlen)                              \
  |  |   36|    591|{                                                               \
  |  |   37|    591|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 260, False: 331]
  |  |  ------------------
  |  |   38|    260|                snprintf (v, maxlen,	                        \
  |  |   39|    260|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    260|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    260|                        "expected '%s'."),                      \
  |  |   41|    260|                        exif_format_get_name (format),          \
  |  |   42|    260|                        exif_format_get_name (target));         \
  |  |   43|    260|                break;                                          \
  |  |   44|    260|        }                                                       \
  |  |   45|    591|}
  ------------------
  673|    331|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    331|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    331|{                                                                       \
  |  |   72|    331|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 140, False: 191]
  |  |  |  Branch (72:23): [True: 111, False: 80]
  |  |  ------------------
  |  |   73|    251|		snprintf (v, maxlen,                                    \
  |  |   74|    251|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    251|			"expected %i or %i)."), (int) number,		\
  |  |   76|    251|			(int) t1, (int) t2);  				\
  |  |   77|    251|		break;                                                  \
  |  |   78|    251|	}                                                               \
  |  |   79|    331|}
  ------------------
  674|     80|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|     80|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 80]
  |  |  ------------------
  ------------------
  675|     80|		break;
  676|    596|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 596, False: 48.2k]
  ------------------
  677|    596|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    596|#define CF(format,target,v,maxlen)                              \
  |  |   36|    596|{                                                               \
  |  |   37|    596|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 217, False: 379]
  |  |  ------------------
  |  |   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|    596|}
  ------------------
  678|    379|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    379|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    379|{                                                                       \
  |  |   62|    379|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 215, False: 164]
  |  |  ------------------
  |  |   63|    215|                snprintf (v, maxlen,                                    \
  |  |   64|    215|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    215|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    215|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    215|                break;                                                  \
  |  |   67|    215|        }                                                               \
  |  |   68|    379|}
  ------------------
  679|    164|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    164|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 164]
  |  |  ------------------
  ------------------
  680|    164|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 48.8k]
  ------------------
  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.01k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.01k, False: 47.8k]
  ------------------
  691|  1.01k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.01k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.01k|{                                                               \
  |  |   37|  1.01k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 54, False: 965]
  |  |  ------------------
  |  |   38|     54|                snprintf (v, maxlen,	                        \
  |  |   39|     54|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     54|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     54|                        "expected '%s'."),                      \
  |  |   41|     54|                        exif_format_get_name (format),          \
  |  |   42|     54|                        exif_format_get_name (target));         \
  |  |   43|     54|                break;                                          \
  |  |   44|     54|        }                                                       \
  |  |   45|  1.01k|}
  ------------------
  692|    965|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    965|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    965|{                                                                       \
  |  |   62|    965|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 232, False: 733]
  |  |  ------------------
  |  |   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|    965|}
  ------------------
  693|    733|		vr = exif_get_rational (entry->data, entry->order);
  694|    733|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 235, False: 498]
  |  Branch (694:24): [True: 106, False: 392]
  ------------------
  695|    341|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    341|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    341|		}
  697|    392|		else {
  698|    392|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    392|			snprintf (v, maxlen, "%li mm", tmp);
  700|    392|		}
  701|    733|		break;
  702|  2.40k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.40k, False: 46.4k]
  ------------------
  703|  2.40k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.40k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.40k|{                                                               \
  |  |   37|  2.40k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 209, False: 2.19k]
  |  |  ------------------
  |  |   38|    209|                snprintf (v, maxlen,	                        \
  |  |   39|    209|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    209|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    209|                        "expected '%s'."),                      \
  |  |   41|    209|                        exif_format_get_name (format),          \
  |  |   42|    209|                        exif_format_get_name (target));         \
  |  |   43|    209|                break;                                          \
  |  |   44|    209|        }                                                       \
  |  |   45|  2.40k|}
  ------------------
  704|  2.19k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  2.19k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.19k|{                                                                       \
  |  |   62|  2.19k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 202, False: 1.99k]
  |  |  ------------------
  |  |   63|    202|                snprintf (v, maxlen,                                    \
  |  |   64|    202|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    202|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    202|                break;                                                  \
  |  |   67|    202|        }                                                               \
  |  |   68|  2.19k|}
  ------------------
  705|  1.99k|		vs = exif_get_short (entry->data, entry->order);
  706|  1.99k|		switch (vs) {
  707|    202|		case 1:
  ------------------
  |  Branch (707:3): [True: 202, False: 1.78k]
  ------------------
  708|    202|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    202|			break;
  710|  1.34k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.34k, False: 645]
  ------------------
  711|  1.34k|			{
  712|  1.34k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.34k|				unsigned long colorTemp = 0;
  714|  1.34k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 1.10k, False: 240]
  ------------------
  715|    197|				case 2:
  ------------------
  |  Branch (715:5): [True: 197, False: 1.14k]
  ------------------
  716|    197|					colorTemp = 3000;
  717|    197|					break;
  718|     34|				case 3:
  ------------------
  |  Branch (718:5): [True: 34, False: 1.31k]
  ------------------
  719|     34|					colorTemp = 3700;
  720|     34|					break;
  721|    216|				case 4:
  ------------------
  |  Branch (721:5): [True: 216, False: 1.13k]
  ------------------
  722|    216|					colorTemp = 4000;
  723|    216|					break;
  724|     66|				case 5:
  ------------------
  |  Branch (724:5): [True: 66, False: 1.28k]
  ------------------
  725|     66|					colorTemp = 4500;
  726|     66|					break;
  727|    200|				case 6:
  ------------------
  |  Branch (727:5): [True: 200, False: 1.14k]
  ------------------
  728|    200|					colorTemp = 5500;
  729|    200|					break;
  730|    196|				case 7:
  ------------------
  |  Branch (730:5): [True: 196, False: 1.15k]
  ------------------
  731|    196|					colorTemp = 6500;
  732|    196|					break;
  733|    197|				case 9:
  ------------------
  |  Branch (733:5): [True: 197, False: 1.14k]
  ------------------
  734|    197|					colorTemp = 7500;
  735|    197|					break;
  736|  1.34k|				}
  737|  1.34k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 1.10k, False: 240]
  ------------------
  738|  1.10k|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|  1.10k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|  1.10k|				}
  740|    240|				else {
  741|    240|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|    240|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|    240|				}
  743|       |
  744|  1.34k|			}
  745|      0|			break;
  746|    198|		case 3:
  ------------------
  |  Branch (746:3): [True: 198, False: 1.79k]
  ------------------
  747|    198|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    198|			break;
  749|    245|		default:
  ------------------
  |  Branch (749:3): [True: 245, False: 1.74k]
  ------------------
  750|    245|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    245|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    245|			break;
  752|  1.99k|		}
  753|  1.99k|		break;
  754|  1.99k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 404, False: 48.4k]
  ------------------
  755|    834|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 430, False: 48.4k]
  ------------------
  756|    834|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    834|#define CF(format,target,v,maxlen)                              \
  |  |   36|    834|{                                                               \
  |  |   37|    834|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 259, False: 575]
  |  |  ------------------
  |  |   38|    259|                snprintf (v, maxlen,	                        \
  |  |   39|    259|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    259|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    259|                        "expected '%s'."),                      \
  |  |   41|    259|                        exif_format_get_name (format),          \
  |  |   42|    259|                        exif_format_get_name (target));         \
  |  |   43|    259|                break;                                          \
  |  |   44|    259|        }                                                       \
  |  |   45|    834|}
  ------------------
  757|    575|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    575|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    575|{                                                                       \
  |  |   62|    575|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 242, False: 333]
  |  |  ------------------
  |  |   63|    242|                snprintf (v, maxlen,                                    \
  |  |   64|    242|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    242|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    242|                break;                                                  \
  |  |   67|    242|        }                                                               \
  |  |   68|    575|}
  ------------------
  758|    333|		vs = exif_get_short (entry->data, entry->order);
  759|    333|		snprintf (v, maxlen, "%hu ", vs);
  760|    333|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    333|		sprintf (buf, "%hu", vs);
  762|    333|		strncat (v, buf, maxlen - strlen (v));
  763|    333|		break;
  764|     72|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 72, False: 48.8k]
  ------------------
  765|    389|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 317, False: 48.5k]
  ------------------
  766|    389|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    389|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    389|{                                                                       \
  |  |   62|    389|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 117, False: 272]
  |  |  ------------------
  |  |   63|    117|                snprintf (v, maxlen,                                    \
  |  |   64|    117|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    117|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    117|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    117|                break;                                                  \
  |  |   67|    117|        }                                                               \
  |  |   68|    389|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|    961|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 689, False: 48.2k]
  ------------------
  770|    961|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    961|#define CF(format,target,v,maxlen)                              \
  |  |   36|    961|{                                                               \
  |  |   37|    961|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 750]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|    961|}
  ------------------
  771|    750|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 486, False: 264]
  ------------------
  772|    486|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    486|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    486|{                                                                       \
  |  |   62|    486|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 214, False: 272]
  |  |  ------------------
  |  |   63|    214|                snprintf (v, maxlen,                                    \
  |  |   64|    214|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    214|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    214|                break;                                                  \
  |  |   67|    214|        }                                                               \
  |  |   68|    486|}
  ------------------
  773|  4.04k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 3.50k, False: 536]
  ------------------
  774|  3.50k|			vs = exif_get_short (entry->data+2*i, entry->order);
  775|  3.50k|			sprintf (buf, "%hu ", vs);
  776|  3.50k|			strncat (v, buf, maxlen - strlen (v));
  777|  3.50k|		}
  778|    536|		break;
  779|    260|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 260, False: 48.6k]
  ------------------
  780|    542|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 282, False: 48.6k]
  ------------------
  781|    773|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 231, False: 48.6k]
  ------------------
  782|  1.28k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 511, False: 48.3k]
  ------------------
  783|  1.28k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.28k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.28k|{                                                               \
  |  |   37|  1.28k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 661, False: 623]
  |  |  ------------------
  |  |   38|    661|                snprintf (v, maxlen,	                        \
  |  |   39|    661|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    661|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    661|                        "expected '%s'."),                      \
  |  |   41|    661|                        exif_format_get_name (format),          \
  |  |   42|    661|                        exif_format_get_name (target));         \
  |  |   43|    661|                break;                                          \
  |  |   44|    661|        }                                                       \
  |  |   45|  1.28k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.35k|	default:
  ------------------
  |  Branch (786:2): [True: 3.73k, False: 45.1k]
  ------------------
  787|  4.35k|		switch (entry->format) {
  788|    446|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 446, False: 3.90k]
  ------------------
  789|    446|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    446|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 219, False: 227]
  |  |  ------------------
  ------------------
  790|    446|			break;
  791|    465|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 465, False: 3.88k]
  ------------------
  792|    465|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    465|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    465|{                                                                       \
  |  |   62|    465|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 257, False: 208]
  |  |  ------------------
  |  |   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|    465|}
  ------------------
  793|    208|			vs = exif_get_short (entry->data, entry->order);
  794|    208|			snprintf (v, maxlen, "%hu", vs);
  795|    208|			break;
  796|    413|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 413, False: 3.94k]
  ------------------
  797|    413|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    413|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    413|{                                                                       \
  |  |   62|    413|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 217, False: 196]
  |  |  ------------------
  |  |   63|    217|                snprintf (v, maxlen,                                    \
  |  |   64|    217|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    217|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    217|                break;                                                  \
  |  |   67|    217|        }                                                               \
  |  |   68|    413|}
  ------------------
  798|    196|			vss = exif_get_sshort (entry->data, entry->order);
  799|    196|			snprintf (v, maxlen, "%hi", vss);
  800|    196|			break;
  801|    415|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 415, False: 3.93k]
  ------------------
  802|    415|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    415|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    415|{                                                                       \
  |  |   62|    415|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 216, False: 199]
  |  |  ------------------
  |  |   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|    415|}
  ------------------
  803|    199|			vl = exif_get_long (entry->data, entry->order);
  804|    199|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    199|			break;
  806|    422|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 422, False: 3.93k]
  ------------------
  807|    422|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    422|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    422|{                                                                       \
  |  |   62|    422|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 226, False: 196]
  |  |  ------------------
  |  |   63|    226|                snprintf (v, maxlen,                                    \
  |  |   64|    226|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    226|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    226|                break;                                                  \
  |  |   67|    226|        }                                                               \
  |  |   68|    422|}
  ------------------
  808|    196|			vsl = exif_get_slong (entry->data, entry->order);
  809|    196|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|    196|			break;
  811|    800|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 800, False: 3.55k]
  ------------------
  812|    800|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    800|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    800|{                                                                       \
  |  |   62|    800|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 161, False: 639]
  |  |  ------------------
  |  |   63|    161|                snprintf (v, maxlen,                                    \
  |  |   64|    161|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    161|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    161|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    161|                break;                                                  \
  |  |   67|    161|        }                                                               \
  |  |   68|    800|}
  ------------------
  813|    639|			vr = exif_get_rational (entry->data, entry->order);
  814|    639|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 311, False: 328]
  ------------------
  815|    311|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    311|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    328|			} else {
  817|    328|				r = R2D(vr);
  ------------------
  |  |   82|    328|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 328, False: 0]
  |  |  ------------------
  ------------------
  818|    328|				snprintf (v, maxlen, "%2.3f", r);
  819|    328|			}
  820|    639|			break;
  821|    856|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 856, False: 3.49k]
  ------------------
  822|    856|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    856|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    856|{                                                                       \
  |  |   62|    856|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 313, False: 543]
  |  |  ------------------
  |  |   63|    313|                snprintf (v, maxlen,                                    \
  |  |   64|    313|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    313|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    313|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    313|                break;                                                  \
  |  |   67|    313|        }                                                               \
  |  |   68|    856|}
  ------------------
  823|    543|			vsr = exif_get_srational (entry->data, entry->order);
  824|    543|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 229, False: 314]
  ------------------
  825|    229|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    229|#  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|    543|			break;
  831|    108|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 108, False: 4.24k]
  ------------------
  832|    536|		default:
  ------------------
  |  Branch (832:3): [True: 428, False: 3.92k]
  ------------------
  833|    536|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    536|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    536|				  entry->size);
  835|  74.6k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 74.1k, False: 536]
  ------------------
  836|  74.1k|				sprintf (buf, "%02x", entry->data[i]);
  837|  74.1k|				strncat (v, buf, maxlen - strlen (v));
  838|  74.1k|			}
  839|    536|			break;
  840|  4.35k|		}
  841|  4.35k|		break;
  842|  48.8k|	}
  843|       |
  844|  48.8k|	return (v);
  845|  48.8k|}

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

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

mnote_pentax_entry_get_value:
  312|  13.0k|{
  313|  13.0k|	ExifLong vl;
  314|  13.0k|	ExifSLong vsl;
  315|  13.0k|	ExifShort vs, vs2;
  316|  13.0k|	ExifSShort vss;
  317|  13.0k|	int i = 0, j = 0;
  318|       |
  319|  13.0k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 13.0k]
  ------------------
  320|  13.0k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 13.0k]
  ------------------
  321|       |
  322|  13.0k|	memset (val, 0, maxlen);
  323|  13.0k|	maxlen--;
  324|       |
  325|  13.0k|	switch (entry->tag) {
  326|    637|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 637, False: 12.4k]
  ------------------
  327|    859|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 222, False: 12.8k]
  ------------------
  328|  1.09k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 232, False: 12.8k]
  ------------------
  329|  1.30k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 210, False: 12.8k]
  ------------------
  330|  1.50k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 208, False: 12.8k]
  ------------------
  331|  1.72k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 220, False: 12.8k]
  ------------------
  332|  2.12k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 392, False: 12.6k]
  ------------------
  333|  2.32k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 200, False: 12.8k]
  ------------------
  334|  2.52k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 200, False: 12.8k]
  ------------------
  335|  2.71k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 196, False: 12.8k]
  ------------------
  336|  3.03k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 321, False: 12.7k]
  ------------------
  337|  3.43k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 398, False: 12.6k]
  ------------------
  338|  3.69k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 261, False: 12.8k]
  ------------------
  339|  3.98k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 287, False: 12.7k]
  ------------------
  340|  4.21k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 226, False: 12.8k]
  ------------------
  341|  4.67k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 463, False: 12.6k]
  ------------------
  342|  5.06k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 395, False: 12.6k]
  ------------------
  343|  5.67k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 610, False: 12.4k]
  ------------------
  344|  6.60k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 929, False: 12.1k]
  ------------------
  345|  6.84k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 237, False: 12.8k]
  ------------------
  346|  6.84k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  6.84k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  6.84k|{                                                               \
  |  |   39|  6.84k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 3.03k, False: 3.81k]
  |  |  ------------------
  |  |   40|  3.03k|		snprintf (v, maxlen,	                        \
  |  |   41|  3.03k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  3.03k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  3.03k|			"expected '%s'."),                      \
  |  |   43|  3.03k|			exif_format_get_name (format),          \
  |  |   44|  3.03k|			exif_format_get_name (target));         \
  |  |   45|  3.03k|		break;                                          \
  |  |   46|  3.03k|	}                                                       \
  |  |   47|  6.84k|}
  ------------------
  347|  3.81k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.81k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.81k|{                                                                       \
  |  |   61|  3.81k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.48k, False: 2.32k]
  |  |  |  Branch (61:24): [True: 250, False: 1.23k]
  |  |  ------------------
  |  |   62|    250|		snprintf (v, maxlen,                                    \
  |  |   63|    250|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    250|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    250|			"expected %i or %i)."), (int) number,		\
  |  |   65|    250|			(int) t1, (int) t2);  				\
  |  |   66|    250|		break;                                                  \
  |  |   67|    250|	}                                                               \
  |  |   68|  3.81k|}
  ------------------
  348|  3.56k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 2.32k, False: 1.23k]
  ------------------
  349|  2.32k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  30.5k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 30.5k, False: 0]
  |  Branch (352:33): [True: 28.2k, False: 2.32k]
  ------------------
  353|  2.32k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 2.32k]
  ------------------
  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|  14.1k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 13.0k, False: 1.03k]
  ------------------
  361|  13.0k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 11.8k, False: 1.28k]
  ------------------
  362|  2.32k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.45k, False: 869]
  ------------------
  363|  1.45k|				snprintf (val, maxlen,
  364|  1.45k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.45k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.45k|				break;
  366|  1.45k|			}
  367|    869|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    869|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|  1.23k|		} else {
  369|       |			/* Two-component values */
  370|  1.23k|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  1.23k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.23k|{                                                               \
  |  |   39|  1.23k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 1.23k]
  |  |  ------------------
  |  |   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|  1.23k|}
  ------------------
  371|  1.23k|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  1.23k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  1.23k|{                                                                       \
  |  |   61|  1.23k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.23k, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 1.23k]
  |  |  ------------------
  |  |   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|  1.23k|}
  ------------------
  372|  1.23k|			vs = exif_get_short (entry->data, entry->order);
  373|  1.23k|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  2.35k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.95k, False: 395]
  |  Branch (376:34): [True: 1.11k, False: 843]
  ------------------
  377|  1.23k|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 395, False: 843]
  ------------------
  378|    395|				snprintf (val, maxlen,
  379|    395|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    395|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    395|			  	break;
  381|    395|			}
  382|       |
  383|       |			/* find the value */
  384|  3.31k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 3.31k, False: 0]
  |  Branch (384:45): [True: 0, False: 3.31k]
  ------------------
  385|  3.31k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 2.86k, False: 456]
  |  Branch (385:46): [True: 2.47k, False: 387]
  ------------------
  386|    843|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 470, False: 373]
  |  Branch (386:44): [True: 0, False: 373]
  ------------------
  387|    470|				snprintf (val, maxlen,
  388|    470|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    470|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    470|				break;
  390|    470|			}
  391|    373|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    373|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    373|		}
  393|  1.24k|		break;
  394|       |
  395|  1.24k|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 638, False: 12.4k]
  ------------------
  396|    638|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    638|#define CF(format,target,v,maxlen)                              \
  |  |   38|    638|{                                                               \
  |  |   39|    638|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 230, False: 408]
  |  |  ------------------
  |  |   40|    230|		snprintf (v, maxlen,	                        \
  |  |   41|    230|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    230|			"expected '%s'."),                      \
  |  |   43|    230|			exif_format_get_name (format),          \
  |  |   44|    230|			exif_format_get_name (target));         \
  |  |   45|    230|		break;                                          \
  |  |   46|    230|	}                                                       \
  |  |   47|    638|}
  ------------------
  397|    408|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    408|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    408|{                                                                       \
  |  |   51|    408|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 213, False: 195]
  |  |  ------------------
  |  |   52|    213|		snprintf (v, maxlen,                                    \
  |  |   53|    213|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    213|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    213|		break;                                                  \
  |  |   56|    213|	}                                                               \
  |  |   57|    408|}
  ------------------
  398|    195|		vl = exif_get_long (entry->data, entry->order);
  399|    195|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|    195|		break;
  401|    658|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 658, False: 12.4k]
  ------------------
  402|    658|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    658|#define CF(format,target,v,maxlen)                              \
  |  |   38|    658|{                                                               \
  |  |   39|    658|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 234, False: 424]
  |  |  ------------------
  |  |   40|    234|		snprintf (v, maxlen,	                        \
  |  |   41|    234|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    234|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    234|			"expected '%s'."),                      \
  |  |   43|    234|			exif_format_get_name (format),          \
  |  |   44|    234|			exif_format_get_name (target));         \
  |  |   45|    234|		break;                                          \
  |  |   46|    234|	}                                                       \
  |  |   47|    658|}
  ------------------
  403|    424|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    424|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    424|{                                                                       \
  |  |   51|    424|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 201, False: 223]
  |  |  ------------------
  |  |   52|    201|		snprintf (v, maxlen,                                    \
  |  |   53|    201|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    201|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    201|		break;                                                  \
  |  |   56|    201|	}                                                               \
  |  |   57|    424|}
  ------------------
  404|    223|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    223|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|    223|			entry->size);
  406|    223|		break;
  407|    391|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 391, False: 12.6k]
  ------------------
  408|    774|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 383, False: 12.7k]
  ------------------
  409|    774|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    774|#define CF(format,target,v,maxlen)                              \
  |  |   38|    774|{                                                               \
  |  |   39|    774|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 250, False: 524]
  |  |  ------------------
  |  |   40|    250|		snprintf (v, maxlen,	                        \
  |  |   41|    250|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    250|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    250|			"expected '%s'."),                      \
  |  |   43|    250|			exif_format_get_name (format),          \
  |  |   44|    250|			exif_format_get_name (target));         \
  |  |   45|    250|		break;                                          \
  |  |   46|    250|	}                                                       \
  |  |   47|    774|}
  ------------------
  410|    524|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    524|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    524|{                                                                       \
  |  |   51|    524|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 176, False: 348]
  |  |  ------------------
  |  |   52|    176|		snprintf (v, maxlen,                                    \
  |  |   53|    176|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    176|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    176|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    176|		break;                                                  \
  |  |   56|    176|	}                                                               \
  |  |   57|    524|}
  ------------------
  411|    348|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    348|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 348]
  |  |  ------------------
  ------------------
  412|    348|		break;
  413|    663|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 663, False: 12.4k]
  ------------------
  414|    663|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    663|#define CF(format,target,v,maxlen)                              \
  |  |   38|    663|{                                                               \
  |  |   39|    663|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 269, False: 394]
  |  |  ------------------
  |  |   40|    269|		snprintf (v, maxlen,	                        \
  |  |   41|    269|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    269|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    269|			"expected '%s'."),                      \
  |  |   43|    269|			exif_format_get_name (format),          \
  |  |   44|    269|			exif_format_get_name (target));         \
  |  |   45|    269|		break;                                          \
  |  |   46|    269|	}                                                       \
  |  |   47|    663|}
  ------------------
  415|    394|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    394|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    394|{                                                                       \
  |  |   51|    394|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 196, False: 198]
  |  |  ------------------
  |  |   52|    196|		snprintf (v, maxlen,                                    \
  |  |   53|    196|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    196|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    196|		break;                                                  \
  |  |   56|    196|	}                                                               \
  |  |   57|    394|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|    198|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|    198|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|    198|		break;
  420|    488|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 488, False: 12.5k]
  ------------------
  421|    488|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    488|#define CF(format,target,v,maxlen)                              \
  |  |   38|    488|{                                                               \
  |  |   39|    488|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 226, False: 262]
  |  |  ------------------
  |  |   40|    226|		snprintf (v, maxlen,	                        \
  |  |   41|    226|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    226|			"expected '%s'."),                      \
  |  |   43|    226|			exif_format_get_name (format),          \
  |  |   44|    226|			exif_format_get_name (target));         \
  |  |   45|    226|		break;                                          \
  |  |   46|    226|	}                                                       \
  |  |   47|    488|}
  ------------------
  422|    262|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    262|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    262|{                                                                       \
  |  |   61|    262|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 173, False: 89]
  |  |  |  Branch (61:24): [True: 78, False: 95]
  |  |  ------------------
  |  |   62|     78|		snprintf (v, maxlen,                                    \
  |  |   63|     78|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     78|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|     78|			"expected %i or %i)."), (int) number,		\
  |  |   65|     78|			(int) t1, (int) t2);  				\
  |  |   66|     78|		break;                                                  \
  |  |   67|     78|	}                                                               \
  |  |   68|    262|}
  ------------------
  423|    184|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    184|		break;
  425|  3.01k|	default:
  ------------------
  |  Branch (425:2): [True: 3.01k, False: 10.0k]
  ------------------
  426|  3.01k|		switch (entry->format) {
  427|    290|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 290, False: 2.72k]
  ------------------
  428|    290|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    290|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 75, False: 215]
  |  |  ------------------
  ------------------
  429|    290|		  break;
  430|    572|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 572, False: 2.44k]
  ------------------
  431|    572|		  {
  432|    572|			const unsigned char *data = entry->data;
  433|    572|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    572|			sizeleft = entry->size;
  436|   114k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 114k, False: 572]
  ------------------
  437|   114k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 114k]
  ------------------
  438|      0|					break;
  439|   114k|				vs = exif_get_short (data, entry->order);
  440|   114k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|   114k|				len = strlen(val);
  442|   114k|				data += 2;
  443|   114k|				sizeleft -= 2;
  444|   114k|			}
  445|    572|		  }
  446|    572|		  break;
  447|    522|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 522, False: 2.49k]
  ------------------
  448|    522|		  {
  449|    522|			const unsigned char *data = entry->data;
  450|    522|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    522|			sizeleft = entry->size;
  453|  63.0k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 62.5k, False: 522]
  ------------------
  454|  62.5k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 62.5k]
  ------------------
  455|      0|					break;
  456|  62.5k|				vss = exif_get_sshort (data, entry->order);
  457|  62.5k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  62.5k|				len = strlen(val);
  459|  62.5k|				data += 2;
  460|  62.5k|				sizeleft -= 2;
  461|  62.5k|			}
  462|    522|		  }
  463|    522|		  break;
  464|    530|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 530, False: 2.48k]
  ------------------
  465|    530|		  {
  466|    530|			const unsigned char *data = entry->data;
  467|    530|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    530|			sizeleft = entry->size;
  470|  42.0k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 41.5k, False: 530]
  ------------------
  471|  41.5k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 41.5k]
  ------------------
  472|      0|					break;
  473|  41.5k|				vl = exif_get_long (data, entry->order);
  474|  41.5k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  41.5k|				len = strlen(val);
  476|  41.5k|				data += 4;
  477|  41.5k|				sizeleft -= 4;
  478|  41.5k|			}
  479|    530|		  }
  480|    530|		  break;
  481|    468|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 468, False: 2.55k]
  ------------------
  482|    468|		  {
  483|    468|			const unsigned char *data = entry->data;
  484|    468|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    468|			sizeleft = entry->size;
  487|  33.8k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 33.4k, False: 468]
  ------------------
  488|  33.4k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 33.4k]
  ------------------
  489|      0|					break;
  490|  33.4k|				vsl = exif_get_slong (data, entry->order);
  491|  33.4k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  33.4k|				len = strlen(val);
  493|  33.4k|				data += 4;
  494|  33.4k|				sizeleft -= 4;
  495|  33.4k|			}
  496|    468|		  }
  497|    468|		  break;
  498|     17|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 17, False: 3.00k]
  ------------------
  499|    636|		default:
  ------------------
  |  Branch (499:3): [True: 619, False: 2.39k]
  ------------------
  500|    636|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    636|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    636|			  entry->size);
  502|    636|		  break;
  503|  3.01k|		}
  504|  3.01k|		break;
  505|  13.0k|	}
  506|       |
  507|  13.0k|	return val;
  508|  13.0k|}

mnote_pentax_tag_get_name:
  145|  32.4k|{
  146|  32.4k|	unsigned int i;
  147|       |
  148|  1.42M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (148:14): [True: 1.42M, False: 4.64k]
  ------------------
  149|  1.42M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (149:7): [True: 27.7k, False: 1.39M]
  ------------------
  150|  4.64k|	return NULL;
  151|  32.4k|}
mnote_pentax_tag_get_title:
  155|  13.0k|{
  156|  13.0k|	unsigned int i;
  157|       |
  158|  13.0k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  159|   433k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (159:14): [True: 433k, False: 0]
  ------------------
  160|   433k|		if (table[i].tag == t) {
  ------------------
  |  Branch (160:7): [True: 13.0k, False: 420k]
  ------------------
  161|  13.0k|			if (!table[i].title)
  ------------------
  |  Branch (161:8): [True: 0, False: 13.0k]
  ------------------
  162|      0|				return NULL;
  163|  13.0k|			return _(table[i].title);
  ------------------
  |  |   31|  13.0k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  164|  13.0k|		}
  165|      0|	return NULL;
  166|  13.0k|}
mnote_pentax_tag_get_description:
  170|  13.0k|{
  171|  13.0k|	unsigned int i;
  172|       |
  173|   433k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (173:14): [True: 433k, False: 0]
  ------------------
  174|   433k|		if (table[i].tag == t) {
  ------------------
  |  Branch (174:7): [True: 13.0k, False: 420k]
  ------------------
  175|  13.0k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (175:8): [True: 638, False: 12.4k]
  |  Branch (175:33): [True: 12.2k, False: 210]
  ------------------
  176|  12.8k|				return "";
  177|    210|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  178|    210|			return _(table[i].description);
  ------------------
  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  179|  13.0k|		}
  180|      0|	return NULL;
  181|  13.0k|}

