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

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

mnote_canon_entry_count_values:
  505|  47.9M|{
  506|  47.9M|	unsigned int  val;
  507|       |
  508|  47.9M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 47.9M]
  ------------------
  509|       |
  510|  47.9M|	switch (entry->tag) {
  511|   162k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 162k, False: 47.7M]
  ------------------
  512|   163k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 609, False: 47.9M]
  ------------------
  513|   163k|		return entry->components;
  514|   490k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 490k, False: 47.4M]
  ------------------
  515|  1.80M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.31M, False: 46.6M]
  ------------------
  516|  44.9M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 43.1M, False: 4.79M]
  ------------------
  517|  45.0M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 92.0k, False: 47.8M]
  ------------------
  518|  45.0M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 77.0k, False: 44.9M]
  ------------------
  519|       |
  520|  44.9M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|  44.9M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|  44.9M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 44.8M, False: 158k]
  |  |  ------------------
  ------------------
  523|  2.73M|	default:
  ------------------
  |  Branch (523:2): [True: 2.73M, False: 45.2M]
  ------------------
  524|  2.73M|		return 1;
  525|  47.9M|	}
  526|  47.9M|}
mnote_canon_entry_get_value:
  552|  1.12M|{
  553|  1.12M|	char buf[128];
  554|  1.12M|	ExifLong vl;
  555|  1.12M|	ExifSLong vsl;
  556|  1.12M|	ExifShort vs, n;
  557|  1.12M|	ExifSShort vss;
  558|  1.12M|	unsigned char *data;
  559|  1.12M|	size_t	size;
  560|  1.12M|	double d;
  561|       |
  562|  1.12M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.12M]
  ------------------
  563|      0|		return NULL;
  564|  1.12M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.12M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.12M|	data = entry->data;
  568|  1.12M|	size = entry->size;
  569|       |
  570|  1.12M|	memset (val, 0, maxlen);
  571|  1.12M|	maxlen--;
  572|       |
  573|  1.12M|	switch (entry->tag) {
  574|  3.41k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 3.41k, False: 1.12M]
  ------------------
  575|  3.41k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.41k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.41k|{                                                               \
  |  |   38|  3.41k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.41k]
  |  |  ------------------
  |  |   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.41k|}
  ------------------
  576|       |
  577|  3.41k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 3.41k]
  ------------------
  578|  3.41k|		n = exif_get_short (data, entry->order) / 2;
  579|  3.41k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 3.41k]
  ------------------
  580|       |
  581|  3.41k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.41k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.41k|{                                                                       \
  |  |   50|  3.41k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 490, False: 2.92k]
  |  |  ------------------
  |  |   51|    490|                snprintf (v, maxlen,                                    \
  |  |   52|    490|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    490|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    490|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    490|                break;                                                  \
  |  |   55|    490|        }                                                               \
  |  |   56|  3.41k|}
  ------------------
  582|       |
  583|  2.92k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.92k]
  ------------------
  584|  2.92k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.92k|		switch (t) {
  586|    592|		case 1:
  ------------------
  |  Branch (586:3): [True: 592, False: 2.33k]
  ------------------
  587|    592|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 211, False: 381]
  ------------------
  588|    211|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    211|				break;
  590|    211|			}
  591|    381|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    381|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    381|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.92k]
  ------------------
  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.92k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.92k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.92k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.92k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.92k]
  ------------------
  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.92k]
  ------------------
  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.92k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.92k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.92k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  2.33k|		default:
  ------------------
  |  Branch (621:3): [True: 2.33k, False: 592]
  ------------------
  622|  2.33k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.92k|		}
  624|  2.92k|		break;
  625|       |
  626|  2.92k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.34k, False: 1.12M]
  ------------------
  627|  1.34k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.34k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.34k|{                                                               \
  |  |   38|  1.34k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 326, False: 1.01k]
  |  |  ------------------
  |  |   39|    326|                snprintf (v, maxlen,                            \
  |  |   40|    326|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    326|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    326|                        "expected '%s'."),                      \
  |  |   42|    326|                        exif_format_get_name (format),          \
  |  |   43|    326|                        exif_format_get_name (target));         \
  |  |   44|    326|                break;                                          \
  |  |   45|    326|        }                                                       \
  |  |   46|  1.34k|}
  ------------------
  628|  1.01k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.01k]
  ------------------
  629|  1.01k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.01k|		switch (t) {
  631|    253|		case 1:
  ------------------
  |  Branch (631:3): [True: 253, False: 761]
  ------------------
  632|    253|			snprintf (val, maxlen, "%u", vs);
  633|    253|			break;
  634|    252|		case 2:
  ------------------
  |  Branch (634:3): [True: 252, False: 762]
  ------------------
  635|    501|		case 3:
  ------------------
  |  Branch (635:3): [True: 249, False: 765]
  ------------------
  636|    501|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    501|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    501|			break;
  638|    260|		default:
  ------------------
  |  Branch (638:3): [True: 260, False: 754]
  ------------------
  639|    260|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.01k|		}
  641|  1.01k|		break;
  642|       |
  643|  7.91k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 7.91k, False: 1.11M]
  ------------------
  644|  7.91k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  7.91k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  7.91k|{                                                               \
  |  |   38|  7.91k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 7.91k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  7.91k|}
  ------------------
  645|  7.91k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 7.91k]
  ------------------
  646|  7.91k|		n = exif_get_short (data, entry->order) / 2;
  647|  7.91k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 7.91k]
  ------------------
  648|  7.91k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  7.91k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  7.91k|{                                                                       \
  |  |   50|  7.91k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.46k, False: 6.45k]
  |  |  ------------------
  |  |   51|  1.46k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.46k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.46k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.46k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.46k|                break;                                                  \
  |  |   55|  1.46k|        }                                                               \
  |  |   56|  7.91k|}
  ------------------
  649|  6.45k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 6.45k]
  ------------------
  650|  6.45k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  6.45k|		switch (t) {
  652|    732|		case 0:
  ------------------
  |  Branch (652:3): [True: 732, False: 5.71k]
  ------------------
  653|    732|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    732|			break;
  655|    732|		case 1:
  ------------------
  |  Branch (655:3): [True: 732, False: 5.71k]
  ------------------
  656|    732|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    732|			break;
  658|    732|		case 2:
  ------------------
  |  Branch (658:3): [True: 732, False: 5.71k]
  ------------------
  659|  1.43k|		case 5:
  ------------------
  |  Branch (659:3): [True: 698, False: 5.75k]
  ------------------
  660|  1.43k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 6.45k]
  ------------------
  661|  1.43k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 6.45k]
  ------------------
  662|  1.43k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.43k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.43k|			break;
  664|    732|		case 3:
  ------------------
  |  Branch (664:3): [True: 732, False: 5.71k]
  ------------------
  665|    732|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 6.45k]
  ------------------
  666|    732|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    732|			break;
  668|    732|		case 4:
  ------------------
  |  Branch (668:3): [True: 732, False: 5.71k]
  ------------------
  669|    732|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 6.45k]
  ------------------
  670|    732|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    732|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 281, False: 451]
  ------------------
  672|    281|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    281|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    451|			else
  674|    451|				snprintf (val, maxlen, "%.0f", d);
  675|    732|			break;
  676|    697|		case 8:
  ------------------
  |  Branch (676:3): [True: 697, False: 5.75k]
  ------------------
  677|    697|			snprintf (val, maxlen, "%u", vss);
  678|    697|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 6.45k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 6.45k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 6.45k]
  ------------------
  684|      0|			snprintf (val, maxlen, _("%u mm"), vss);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  685|      0|			break;
  686|      0|		case 28:
  ------------------
  |  Branch (686:3): [True: 0, False: 6.45k]
  ------------------
  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.39k|		default:
  ------------------
  |  Branch (693:3): [True: 1.39k, False: 5.05k]
  ------------------
  694|  1.39k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  6.45k|		}
  696|  6.45k|		break;
  697|       |
  698|  6.45k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.12M]
  ------------------
  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|    335|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 335, False: 1.12M]
  ------------------
  706|    335|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    335|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    335|{                                                                       \
  |  |   50|    335|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 98, False: 237]
  |  |  ------------------
  |  |   51|     98|                snprintf (v, maxlen,                                    \
  |  |   52|     98|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     98|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|     98|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|     98|                break;                                                  \
  |  |   55|     98|        }                                                               \
  |  |   56|    335|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    645|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 408, False: 1.12M]
  ------------------
  710|    645|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    645|#define CF(format,target,v,maxlen)                              \
  |  |   37|    645|{                                                               \
  |  |   38|    645|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 213, False: 432]
  |  |  ------------------
  |  |   39|    213|                snprintf (v, maxlen,                            \
  |  |   40|    213|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    213|                        "expected '%s'."),                      \
  |  |   42|    213|                        exif_format_get_name (format),          \
  |  |   43|    213|                        exif_format_get_name (target));         \
  |  |   44|    213|                break;                                          \
  |  |   45|    213|        }                                                       \
  |  |   46|    645|}
  ------------------
  711|    432|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    432|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 177, False: 255]
  |  |  ------------------
  ------------------
  712|    432|		break;
  713|       |
  714|    661|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 661, False: 1.12M]
  ------------------
  715|    661|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    661|#define CF(format,target,v,maxlen)                              \
  |  |   37|    661|{                                                               \
  |  |   38|    661|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 254, False: 407]
  |  |  ------------------
  |  |   39|    254|                snprintf (v, maxlen,                            \
  |  |   40|    254|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    254|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    254|                        "expected '%s'."),                      \
  |  |   42|    254|                        exif_format_get_name (format),          \
  |  |   43|    254|                        exif_format_get_name (target));         \
  |  |   44|    254|                break;                                          \
  |  |   45|    254|        }                                                       \
  |  |   46|    661|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    407|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    407|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 79, False: 328]
  |  |  ------------------
  ------------------
  718|    407|		break;
  719|       |
  720|    857|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 857, False: 1.12M]
  ------------------
  721|    857|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    857|#define CF(format,target,v,maxlen)                              \
  |  |   37|    857|{                                                               \
  |  |   38|    857|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 152, False: 705]
  |  |  ------------------
  |  |   39|    152|                snprintf (v, maxlen,                            \
  |  |   40|    152|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    152|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    152|                        "expected '%s'."),                      \
  |  |   42|    152|                        exif_format_get_name (format),          \
  |  |   43|    152|                        exif_format_get_name (target));         \
  |  |   44|    152|                break;                                          \
  |  |   45|    152|        }                                                       \
  |  |   46|    857|}
  ------------------
  722|    705|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    705|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    705|{                                                                       \
  |  |   50|    705|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 318, False: 387]
  |  |  ------------------
  |  |   51|    318|                snprintf (v, maxlen,                                    \
  |  |   52|    318|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    318|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    318|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    318|                break;                                                  \
  |  |   55|    318|        }                                                               \
  |  |   56|    705|}
  ------------------
  723|    387|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 387]
  ------------------
  724|    387|		vl = exif_get_long (data, entry->order);
  725|    387|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    387|				(unsigned long) vl/10000,
  727|    387|				(unsigned long) vl%10000);
  728|    387|		break;
  729|       |
  730|    634|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 634, False: 1.12M]
  ------------------
  731|    634|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    634|#define CF(format,target,v,maxlen)                              \
  |  |   37|    634|{                                                               \
  |  |   38|    634|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 225, False: 409]
  |  |  ------------------
  |  |   39|    225|                snprintf (v, maxlen,                            \
  |  |   40|    225|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    225|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    225|                        "expected '%s'."),                      \
  |  |   42|    225|                        exif_format_get_name (format),          \
  |  |   43|    225|                        exif_format_get_name (target));         \
  |  |   44|    225|                break;                                          \
  |  |   45|    225|        }                                                       \
  |  |   46|    634|}
  ------------------
  732|    409|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    409|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    409|{                                                                       \
  |  |   50|    409|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 152, False: 257]
  |  |  ------------------
  |  |   51|    152|                snprintf (v, maxlen,                                    \
  |  |   52|    152|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    152|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    152|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    152|                break;                                                  \
  |  |   55|    152|        }                                                               \
  |  |   56|    409|}
  ------------------
  733|    257|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 257]
  ------------------
  734|    257|		vl = exif_get_long (data, entry->order);
  735|    257|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|    257|		break;
  737|       |
  738|  1.10M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.10M, False: 20.8k]
  ------------------
  739|  1.10M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.10M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.10M|{                                                               \
  |  |   38|  1.10M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.10M]
  |  |  ------------------
  |  |   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.10M|}
  ------------------
  740|  1.10M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.10M]
  ------------------
  741|  1.10M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.10M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.10M]
  ------------------
  743|  1.10M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.10M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.10M|{                                                                       \
  |  |   50|  1.10M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.09M, False: 10.1k]
  |  |  ------------------
  |  |   51|  1.09M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.09M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.09M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.09M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.09M|                break;                                                  \
  |  |   55|  1.09M|        }                                                               \
  |  |   56|  1.10M|}
  ------------------
  744|  10.1k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 10.1k]
  ------------------
  745|  10.1k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  10.1k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  10.1k|		strncat (val, buf, maxlen - strlen (val));
  748|  10.1k|		break;
  749|       |
  750|  3.02k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 3.02k, False: 1.12M]
  ------------------
  751|  3.02k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.02k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.02k|{                                                               \
  |  |   38|  3.02k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   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.02k|}
  ------------------
  752|  3.02k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 3.02k]
  ------------------
  753|  3.02k|		n = exif_get_short (data, entry->order) / 2;
  754|  3.02k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 3.02k]
  ------------------
  755|  3.02k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.02k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.02k|{                                                                       \
  |  |   50|  3.02k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 956, False: 2.06k]
  |  |  ------------------
  |  |   51|    956|                snprintf (v, maxlen,                                    \
  |  |   52|    956|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    956|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    956|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    956|                break;                                                  \
  |  |   55|    956|        }                                                               \
  |  |   56|  3.02k|}
  ------------------
  756|  2.06k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 2.06k]
  ------------------
  757|  2.06k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  2.06k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  2.06k|		break;
  760|       |
  761|  2.21k|	default:
  ------------------
  |  Branch (761:2): [True: 2.21k, False: 1.12M]
  ------------------
  762|  2.21k|		switch (entry->format) {
  763|    309|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 309, False: 1.90k]
  ------------------
  764|    309|		  {
  765|    309|			size_t i, len = strlen(val);
  766|  59.5k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 59.1k, False: 309]
  ------------------
  767|  59.1k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 59.1k]
  ------------------
  768|      0|					break;
  769|  59.1k|				vs = exif_get_short (data, entry->order);
  770|  59.1k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  59.1k|				len = strlen(val);
  772|  59.1k|				data += 2;
  773|  59.1k|				size -= 2;
  774|  59.1k|			}
  775|    309|		  }
  776|    309|		  break;
  777|    271|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 271, False: 1.94k]
  ------------------
  778|    271|		  {
  779|    271|			size_t i, len = strlen(val);
  780|  43.4k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 43.2k, False: 271]
  ------------------
  781|  43.2k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 43.2k]
  ------------------
  782|      0|					break;
  783|  43.2k|				vss = exif_get_sshort (data, entry->order);
  784|  43.2k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  43.2k|				data += 2;
  786|  43.2k|				size -= 2;
  787|  43.2k|			}
  788|    271|		  }
  789|    271|		  break;
  790|    237|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 237, False: 1.97k]
  ------------------
  791|    237|		  {
  792|    237|			size_t i, len = strlen(val);
  793|  92.7k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 92.4k, False: 237]
  ------------------
  794|  92.4k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 92.4k]
  ------------------
  795|      0|					break;
  796|  92.4k|				vl = exif_get_long (data, entry->order);
  797|  92.4k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  92.4k|				data += 4;
  799|  92.4k|				size -= 4;
  800|  92.4k|			}
  801|    237|		  }
  802|    237|		  break;
  803|    318|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 318, False: 1.89k]
  ------------------
  804|    318|		  {
  805|    318|			size_t i, len = strlen(val);
  806|  44.0k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 43.7k, False: 318]
  ------------------
  807|  43.7k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 43.7k]
  ------------------
  808|      0|					break;
  809|  43.7k|				vsl = exif_get_slong (data, entry->order);
  810|  43.7k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  43.7k|				data += 4;
  812|  43.7k|				size -= 4;
  813|  43.7k|			}
  814|    318|		  }
  815|    318|		  break;
  816|    834|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 834, False: 1.37k]
  ------------------
  817|    834|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    834|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 43, False: 791]
  |  |  ------------------
  ------------------
  818|    834|			break;
  819|    242|		default:
  ------------------
  |  Branch (819:3): [True: 242, False: 1.96k]
  ------------------
  820|    242|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    242|			  entry->size);
  822|    242|		  break;
  823|  2.21k|		}
  824|  2.21k|		break;
  825|  1.12M|	}
  826|  1.12M|	return val;
  827|  1.12M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  6.05k|{
  445|  6.05k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  87.5k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 86.7k, False: 832]
  |  Branch (448:32): [True: 62.2k, False: 24.4k]
  ------------------
  449|  82.8k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 21.3k, False: 3.06k]
  |  Branch (449:31): [True: 20.5k, False: 820]
  ------------------
  450|  82.8k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 20.5k, False: 62.2k]
  |  Branch (450:33): [True: 1.33k, False: 19.2k]
  ------------------
  451|  1.33k|			break;
  452|  1.33k|		}
  453|  82.8k|	}
  454|  6.05k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.41k, False: 3.63k]
  |  Branch (454:32): [True: 1.33k, False: 1.07k]
  |  Branch (454:58): [True: 1.33k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.33k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.33k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.71k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.71k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.71k|	}
  461|  6.05k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    732|{
  535|    732|	return pow (2, x / 2.);
  536|    732|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    732|{
  547|    732|	return 3.125 * pow (2, x);
  548|    732|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    732|{
  541|    732|	return 1.0 / pow (2, x);
  542|    732|}

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

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

exif_data_get_mnote_data:
   93|  10.0k|{
   94|  10.0k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 10.0k, False: 0]
  |  Branch (94:15): [True: 10.0k, False: 0]
  ------------------
   95|  10.0k|}
exif_data_new_mem:
  110|  10.0k|{
  111|  10.0k|	ExifData *data;
  112|  10.0k|	unsigned int i;
  113|       |
  114|  10.0k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 10.0k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  10.0k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  10.0k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 10.0k]
  ------------------
  119|      0|		return (NULL);
  120|  10.0k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  10.0k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 10.0k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  10.0k|	data->priv->ref_count = 1;
  126|       |
  127|  10.0k|	data->priv->mem = mem;
  128|  10.0k|	exif_mem_ref (mem);
  129|       |
  130|  60.3k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 50.2k, False: 10.0k]
  ------------------
  131|  50.2k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  50.2k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 50.2k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  50.2k|		data->ifd[i]->parent = data;
  137|  50.2k|	}
  138|       |
  139|       |	/* Default options */
  140|  10.0k|#ifndef NO_VERBOSE_TAG_STRINGS
  141|       |	/*
  142|       |	 * When the tag list is compiled away, setting this option prevents
  143|       |	 * any tags from being loaded
  144|       |	 */
  145|  10.0k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  10.0k|#endif
  147|  10.0k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  10.0k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  10.0k|	return (data);
  153|  10.0k|}
exif_data_load_data:
  858|  10.0k|{
  859|  10.0k|	unsigned int l;
  860|  10.0k|	ExifLong offset;
  861|  10.0k|	ExifShort n;
  862|  10.0k|	const unsigned char *d = d_orig;
  863|  10.0k|	unsigned int len, fullds;
  864|       |
  865|  10.0k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 10.0k]
  |  Branch (865:15): [True: 0, False: 10.0k]
  |  Branch (865:30): [True: 0, False: 10.0k]
  |  Branch (865:36): [True: 0, False: 10.0k]
  ------------------
  866|      0|		return;
  867|       |
  868|  10.0k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  10.0k|		  "Parsing %i byte(s) EXIF data...\n", ds);
  870|       |
  871|       |	/*
  872|       |	 * It can be that the data starts with the EXIF header. If it does
  873|       |	 * not, search the EXIF marker.
  874|       |	 */
  875|  10.0k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 19, False: 10.0k]
  ------------------
  876|     19|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     19|#define LOG_TOO_SMALL \
  |  |  852|     19|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     19|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     19|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     19|		return;
  878|     19|	}
  879|  10.0k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 9.87k, False: 163]
  ------------------
  880|  9.87k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  9.87k|			  "Found EXIF header at start.");
  882|  9.87k|	} else {
  883|    856|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 842, False: 14]
  ------------------
  884|  1.15k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.14k, False: 4]
  |  Branch (884:17): [True: 310, False: 838]
  ------------------
  885|    310|				d++;
  886|    310|				ds--;
  887|    310|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|    842|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|    838|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 838, False: 4]
  |  Branch (890:14): [True: 271, False: 567]
  ------------------
  891|    271|				d++;
  892|    271|				ds--;
  893|    271|				continue;
  894|    271|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    571|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    567|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 567, False: 4]
  |  Branch (897:14): [True: 296, False: 271]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    296|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 265, False: 31]
  |  Branch (904:22): [True: 51, False: 214]
  ------------------
  905|     51|					break;
  906|       |				/* fallthrough */
  907|    296|			}
  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|    520|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 512, False: 8]
  |  Branch (913:19): [True: 459, False: 53]
  |  Branch (913:35): [True: 452, False: 7]
  ------------------
  914|    452|				d++;
  915|    452|				ds--;
  916|    452|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    452|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 30, False: 422]
  ------------------
  918|     30|					return;
  919|    422|				d += l;
  920|    422|				ds -= l;
  921|    422|				continue;
  922|    452|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     68|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     68|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     68|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     68|			return;
  928|    520|		}
  929|     65|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 14, False: 51]
  ------------------
  930|     14|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     14|#define LOG_TOO_SMALL \
  |  |  852|     14|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     14|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     14|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     14|			return;
  932|     14|		}
  933|     51|		d++;
  934|     51|		ds--;
  935|     51|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     51|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 32, False: 19]
  ------------------
  937|     32|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     32|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     32|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     32|			return;
  940|     32|		}
  941|     19|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 2, False: 17]
  ------------------
  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|     17|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     17|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     17|			  len);
  949|     17|		d += 2;
  950|     17|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     17|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  9.89k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 8, False: 9.88k]
  ------------------
  958|      8|		LOG_TOO_SMALL;
  ------------------
  |  |  851|      8|#define LOG_TOO_SMALL \
  |  |  852|      8|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|      8|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      8|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  959|      8|		return;
  960|      8|	}
  961|  9.88k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 9.88k]
  ------------------
  962|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  963|      0|			  "ExifData", _("EXIF header not found."));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  964|      0|		return;
  965|      0|	}
  966|       |
  967|  9.88k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  9.88k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  9.88k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 34, False: 9.84k]
  ------------------
  972|     34|		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.84k|	fullds = ds;
  978|  9.84k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 13, False: 9.83k]
  ------------------
  979|     13|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  9.84k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 7.55k, False: 2.29k]
  ------------------
  983|  7.55k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.29k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 2.22k, False: 64]
  ------------------
  985|  2.22k|		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.78k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 20, False: 9.76k]
  ------------------
  994|     20|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  9.76k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  9.76k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  9.76k|		  "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.76k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 54, False: 9.71k]
  |  Branch (1002:21): [True: 8, False: 9.70k]
  ------------------
 1003|     62|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  9.70k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  9.70k|	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.70k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 1.68k, False: 8.02k]
  ------------------
 1012|  1.68k|		return;
 1013|       |
 1014|  8.02k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  8.02k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 7.84k, False: 173]
  ------------------
 1016|  7.84k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  7.84k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  7.84k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.70k, False: 6.14k]
  ------------------
 1021|  1.70k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.70k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  6.14k|		} else {
 1024|  6.14k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  6.14k|		}
 1026|  7.84k|	}
 1027|       |
 1028|       |	/*
 1029|       |	 * If we got an EXIF_TAG_MAKER_NOTE, try to interpret it. Some
 1030|       |	 * cameras use pointers in the maker note tag that point to the
 1031|       |	 * space between IFDs. Here is the only place where we have access
 1032|       |	 * to that data.
 1033|       |	 */
 1034|  8.02k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  8.02k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 8.02k, False: 0]
  ------------------
 1038|  8.02k|		exif_data_fix (data);
 1039|  8.02k|}
exif_data_unref:
 1111|  10.0k|{
 1112|  10.0k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 10.0k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  10.0k|	data->priv->ref_count--;
 1116|  10.0k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 10.0k, False: 0]
  ------------------
 1117|  10.0k|		exif_data_free (data);
 1118|  10.0k|}
exif_data_free:
 1122|  10.0k|{
 1123|  10.0k|	unsigned int i;
 1124|  10.0k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 10.0k, False: 0]
  |  Branch (1124:26): [True: 10.0k, False: 0]
  ------------------
 1125|       |
 1126|  10.0k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 10.0k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  60.3k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 50.2k, False: 10.0k]
  ------------------
 1130|  50.2k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 50.2k, False: 0]
  ------------------
 1131|  50.2k|			exif_content_unref (data->ifd[i]);
 1132|  50.2k|			data->ifd[i] = NULL;
 1133|  50.2k|		}
 1134|  50.2k|	}
 1135|       |
 1136|  10.0k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 179, False: 9.87k]
  ------------------
 1137|    179|		exif_mem_free (mem, data->data);
 1138|    179|		data->data = NULL;
 1139|    179|	}
 1140|       |
 1141|  10.0k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 10.0k, False: 0]
  ------------------
 1142|  10.0k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 10.0k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  10.0k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 6.77k, False: 3.28k]
  ------------------
 1147|  6.77k|			exif_mnote_data_unref (data->priv->md);
 1148|  6.77k|			data->priv->md = NULL;
 1149|  6.77k|		}
 1150|  10.0k|		exif_mem_free (mem, data->priv);
 1151|  10.0k|		exif_mem_free (mem, data);
 1152|  10.0k|	}
 1153|       |
 1154|  10.0k|	exif_mem_unref (mem);
 1155|  10.0k|}
exif_data_get_byte_order:
 1186|   154k|{
 1187|   154k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 154k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   154k|	return (data->priv->order);
 1191|   154k|}
exif_data_foreach_content:
 1196|  18.0k|{
 1197|  18.0k|	unsigned int i;
 1198|       |
 1199|  18.0k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 18.0k]
  |  Branch (1199:15): [True: 0, False: 18.0k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   108k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 90.3k, False: 18.0k]
  ------------------
 1203|  90.3k|		func (data->ifd[i], user_data);
 1204|  18.0k|}
exif_data_log:
 1246|  10.0k|{
 1247|  10.0k|	unsigned int i;
 1248|       |
 1249|  10.0k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 10.0k]
  |  Branch (1249:15): [True: 0, False: 10.0k]
  ------------------
 1250|      0|		return;
 1251|  10.0k|	exif_log_unref (data->priv->log);
 1252|  10.0k|	data->priv->log = log;
 1253|  10.0k|	exif_log_ref (log);
 1254|       |
 1255|  60.3k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 50.2k, False: 10.0k]
  ------------------
 1256|  50.2k|		exif_content_log (data->ifd[i], log);
 1257|  10.0k|}
exif_data_get_log:
 1263|   119k|{
 1264|   119k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 119k]
  |  Branch (1264:15): [True: 0, False: 119k]
  ------------------
 1265|      0|		return NULL;
 1266|   119k|	return data->priv->log;
 1267|   119k|}
exif_data_set_option:
 1309|  20.1k|{
 1310|  20.1k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 20.1k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  20.1k|	d->priv->options |= o;
 1314|  20.1k|}
exif_data_fix:
 1355|  8.02k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  8.02k|}
exif_data_set_data_type:
 1361|  10.0k|{
 1362|  10.0k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 10.0k]
  |  Branch (1362:12): [True: 0, False: 10.0k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  10.0k|	d->priv->data_type = dt;
 1366|  10.0k|}
exif_data_get_data_type:
 1370|  50.1k|{
 1371|  50.1k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1371:10): [True: 50.1k, False: 0]
  |  Branch (1371:15): [True: 50.1k, False: 0]
  ------------------
 1372|  50.1k|}
exif-data.c:exif_data_load_data_content:
  401|  35.8M|{
  402|  35.8M|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  403|  35.8M|	ExifShort n;
  404|  35.8M|	ExifEntry *entry;
  405|  35.8M|	unsigned int i;
  406|  35.8M|	ExifTag tag;
  407|       |
  408|  35.8M|	if (!data || !data->priv) 
  ------------------
  |  Branch (408:6): [True: 0, False: 35.8M]
  |  Branch (408:15): [True: 0, False: 35.8M]
  ------------------
  409|      0|		return;
  410|       |
  411|       |	/* check for valid ExifIfd enum range */
  412|  35.8M|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (412:6): [True: 0, False: 35.8M]
  |  Branch (412:26): [True: 0, False: 35.8M]
  ------------------
  413|      0|	  return;
  414|       |
  415|  35.8M|	if (recursion_cost > 170) {
  ------------------
  |  Branch (415:6): [True: 34.2M, False: 1.62M]
  ------------------
  416|       |		/*
  417|       |		 * recursion_cost is a logarithmic-scale indicator of how expensive this
  418|       |		 * recursive call might end up being. It is an indicator of the depth of
  419|       |		 * recursion as well as the potential for worst-case future recursive
  420|       |		 * calls. Since it's difficult to tell ahead of time how often recursion
  421|       |		 * will occur, this assumes the worst by assuming every tag could end up
  422|       |		 * causing recursion.
  423|       |		 * The value of 170 was chosen to limit typical EXIF structures to a
  424|       |		 * recursive depth of about 6, but pathological ones (those with very
  425|       |		 * many tags) to only 2.
  426|       |		 */
  427|  34.2M|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  428|  34.2M|			  "Deep/expensive recursion detected!");
  429|  34.2M|		return;
  430|  34.2M|	}
  431|       |
  432|       |	/* Read the number of entries */
  433|  1.62M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  1.62M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 4, False: 1.62M]
  |  |  |  Branch (53:81): [True: 0, False: 1.62M]
  |  |  |  Branch (53:112): [True: 616, False: 1.62M]
  |  |  ------------------
  ------------------
  434|    620|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|    620|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|    620|		return;
  437|    620|	}
  438|  1.62M|	n = exif_get_short (d + offset, data->priv->order);
  439|  1.62M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  1.62M|	          "Loading %hu entries...", n);
  441|  1.62M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  1.62M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  1.62M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 321, False: 1.61M]
  |  |  |  Branch (53:81): [True: 1.60M, False: 17.9k]
  |  |  |  Branch (53:112): [True: 515, False: 17.4k]
  |  |  ------------------
  ------------------
  445|  1.60M|		n = (ds - offset) / 12;
  446|  1.60M|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  447|  1.60M|				  "Short data; only loading %hu entries...", n);
  448|  1.60M|	}
  449|       |
  450|   110M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (450:14): [True: 108M, False: 1.61M]
  ------------------
  451|       |
  452|   108M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   108M|		switch (tag) {
  454|   631k|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 631k, False: 108M]
  ------------------
  455|  35.2M|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (455:3): [True: 34.5M, False: 74.2M]
  ------------------
  456|  70.2M|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (456:3): [True: 35.0M, False: 73.8M]
  ------------------
  457|  70.2M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (457:3): [True: 6.30k, False: 108M]
  ------------------
  458|  70.2M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 8.57k, False: 108M]
  ------------------
  459|  70.2M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  70.2M|					   data->priv->order);
  461|  70.2M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 5.40k, False: 70.2M]
  ------------------
  462|  5.40k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  5.40k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  5.40k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 3.84k, False: 1.56k]
  ------------------
  465|  3.84k|					return;
  466|  1.56k|				break;
  467|  5.40k|			}
  468|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  469|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  470|       |			 */
  471|  70.2M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  70.2M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  70.2M|				  exif_tag_get_name(tag), o);
  474|  70.2M|			switch (tag) {
  475|   630k|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 630k, False: 69.6M]
  ------------------
  476|   630k|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|   630k|#define CHECK_REC(i) 					\
  |  |  357|   630k|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 3.38k, False: 626k]
  |  |  ------------------
  |  |  358|  3.38k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  3.38k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  3.38k|		"'%s' detected. Skipping...",		\
  |  |  361|  3.38k|		exif_ifd_get_name (i));			\
  |  |  362|  3.38k|	break;						\
  |  |  363|   626k|}							\
  |  |  364|   626k|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 3.98k, False: 623k]
  |  |  ------------------
  |  |  365|  3.98k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  3.98k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  3.98k|		"'%s' multiple times detected. "	\
  |  |  368|  3.98k|		"Skipping...",				\
  |  |  369|  3.98k|		exif_ifd_get_name (i));			\
  |  |  370|  3.98k|	break;						\
  |  |  371|  3.98k|}
  ------------------
  477|   623k|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|   623k|					recursion_cost + level_cost(n));
  479|   623k|				break;
  480|  34.5M|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (480:4): [True: 34.5M, False: 35.7M]
  ------------------
  481|  34.5M|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  356|  34.5M|#define CHECK_REC(i) 					\
  |  |  357|  34.5M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.0M, False: 17.5M]
  |  |  ------------------
  |  |  358|  17.0M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.0M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.0M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.0M|		exif_ifd_get_name (i));			\
  |  |  362|  17.0M|	break;						\
  |  |  363|  17.5M|}							\
  |  |  364|  17.5M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 1.03k, False: 17.5M]
  |  |  ------------------
  |  |  365|  1.03k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  1.03k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  1.03k|		"'%s' multiple times detected. "	\
  |  |  368|  1.03k|		"Skipping...",				\
  |  |  369|  1.03k|		exif_ifd_get_name (i));			\
  |  |  370|  1.03k|	break;						\
  |  |  371|  1.03k|}
  ------------------
  482|  17.5M|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  483|  17.5M|					recursion_cost + level_cost(n));
  484|  17.5M|				break;
  485|  35.0M|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (485:4): [True: 35.0M, False: 35.2M]
  ------------------
  486|  35.0M|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  356|  35.0M|#define CHECK_REC(i) 					\
  |  |  357|  35.0M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.3M, False: 17.7M]
  |  |  ------------------
  |  |  358|  17.3M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.3M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.3M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.3M|		exif_ifd_get_name (i));			\
  |  |  362|  17.3M|	break;						\
  |  |  363|  17.7M|}							\
  |  |  364|  17.7M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 910, False: 17.7M]
  |  |  ------------------
  |  |  365|    910|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    910|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    910|		"'%s' multiple times detected. "	\
  |  |  368|    910|		"Skipping...",				\
  |  |  369|    910|		exif_ifd_get_name (i));			\
  |  |  370|    910|	break;						\
  |  |  371|    910|}
  ------------------
  487|  17.7M|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  488|  17.7M|					recursion_cost + level_cost(n));
  489|  17.7M|				break;
  490|  7.37k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 7.37k, False: 70.2M]
  ------------------
  491|  7.37k|				thumbnail_offset = o;
  492|  7.37k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 6.54k, False: 835]
  |  Branch (492:29): [True: 2.56k, False: 3.97k]
  ------------------
  493|  2.56k|					exif_data_load_data_thumbnail (data, d,
  494|  2.56k|								       ds, thumbnail_offset,
  495|  2.56k|								       thumbnail_length);
  496|  7.37k|				break;
  497|  5.55k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 5.55k, False: 70.2M]
  ------------------
  498|  5.55k|				thumbnail_length = o;
  499|  5.55k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 2.76k, False: 2.79k]
  |  Branch (499:29): [True: 2.05k, False: 703]
  ------------------
  500|  2.05k|					exif_data_load_data_thumbnail (data, d,
  501|  2.05k|								       ds, thumbnail_offset,
  502|  2.05k|								       thumbnail_length);
  503|  5.55k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 70.2M]
  ------------------
  505|      0|				return;
  506|  70.2M|			}
  507|  70.2M|			break;
  508|  70.2M|		default:
  ------------------
  |  Branch (508:3): [True: 38.5M, False: 70.2M]
  ------------------
  509|       |
  510|       |			/*
  511|       |			 * If we don't know the tag, don't fail. It could be that new 
  512|       |			 * versions of the standard have defined additional tags. Note that
  513|       |			 * 0 is a valid tag in the GPS IFD.
  514|       |			 */
  515|  38.5M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.3M, False: 267k]
  ------------------
  516|       |
  517|       |				/*
  518|       |				 * Special case: Tag and format 0. That's against specification
  519|       |				 * (at least up to 2.2). But Photoshop writes it anyways.
  520|       |				 */
  521|  38.3M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (521:9): [True: 249k, False: 38.0M]
  ------------------
  522|   249k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   249k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   249k|						  exif_ifd_get_name (ifd));
  525|   249k|					break;
  526|   249k|				}
  527|  38.0M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  528|  38.0M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  529|  38.0M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  530|  38.0M|					  exif_ifd_get_name (ifd));
  531|  38.0M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (531:9): [True: 38.0M, False: 0]
  ------------------
  532|  38.0M|					break;
  533|  38.0M|			}
  534|   267k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   267k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 267k]
  ------------------
  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|   267k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 31.2k, False: 236k]
  ------------------
  541|   267k|						   offset + 12 * i))
  542|  31.2k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   267k|			exif_entry_unref (entry);
  544|   267k|			break;
  545|   108M|		}
  546|   108M|	}
  547|  1.62M|}
exif-data.c:level_cost:
  380|  35.8M|{
  381|  35.8M|    static const double log_1_1 = 0.09531017980432493;
  382|       |
  383|       |	/* Adding 0.1 protects against the case where n==1 */
  384|  35.8M|	return ceil(log(n + 0.1)/log_1_1);
  385|  35.8M|}
exif-data.c:exif_data_load_data_thumbnail:
  334|  4.62k|{
  335|       |	/* Sanity checks */
  336|  4.62k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 4.62k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  4.62k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  4.62k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 4.62k]
  |  |  |  Branch (53:81): [True: 0, False: 4.62k]
  |  |  |  Branch (53:112): [True: 1.96k, False: 2.66k]
  |  |  ------------------
  ------------------
  341|  1.96k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  1.96k|		return;
  343|  1.96k|	}
  344|  2.66k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 2.48k, False: 179]
  ------------------
  345|  2.48k|		exif_mem_free (data->priv->mem, data->data);
  346|  2.66k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 2.66k]
  ------------------
  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.66k|	data->size = s;
  352|  2.66k|	memcpy (data->data, d + o, s);
  353|  2.66k|}
exif-data.c:exif_data_load_data_entry:
  169|   267k|{
  170|   267k|	unsigned int s, doff;
  171|       |
  172|   267k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   267k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   267k|	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|   267k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   267k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   267k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   267k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   267k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 173k, False: 94.1k]
  |  Branch (186:33): [True: 39.4k, False: 54.6k]
  ------------------
  187|   212k|		return 0;
  188|   212k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  54.6k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 43.3k, False: 11.3k]
  ------------------
  195|  43.3k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  11.3k|	else
  197|  11.3k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  54.6k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 19.5k, False: 35.1k]
  ------------------
  201|  19.5k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  19.5k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  19.5k|		return 0;
  204|  19.5k|	}
  205|       |
  206|  35.1k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 3.91k, False: 31.2k]
  ------------------
  207|  3.91k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  3.91k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  3.91k|		return 0;
  210|  3.91k|	}
  211|       |
  212|  31.2k|	entry->data = exif_data_alloc (data, s);
  213|  31.2k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 31.2k, False: 0]
  ------------------
  214|  31.2k|		entry->size = s;
  215|  31.2k|		memcpy (entry->data, d + doff, s);
  216|  31.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|  31.2k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.51k, False: 22.7k]
  ------------------
  223|  8.51k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.51k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.51k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 7.56k, False: 951]
  ------------------
  227|  7.56k|			exif_log (data->priv->log,
  228|  7.56k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  7.56k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  7.56k|					       "%02x %02x %02x...).",
  231|  7.56k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  7.56k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  7.56k|					       entry->data[6]);
  234|  7.56k|		}
  235|  8.51k|		data->priv->offset_mnote = doff;
  236|  8.51k|	}
  237|  31.2k|	return 1;
  238|  31.2k|}
exif-data.c:interpret_maker_note:
  802|  8.02k|{
  803|  8.02k|	int mnoteid;
  804|  8.02k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  8.02k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 8.02k]
  |  |  ------------------
  |  |  254|  8.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  8.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 8.02k]
  |  |  ------------------
  |  |  256|  8.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  8.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 6.99k, False: 1.02k]
  |  |  ------------------
  |  |  258|  8.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  8.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  260|  1.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  1.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 1.02k]
  |  |  ------------------
  |  |  262|  1.02k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  805|  8.02k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 1.02k, False: 6.99k]
  ------------------
  806|  1.02k|		return;
  807|       |	
  808|  6.99k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 3.84k, False: 3.15k]
  ------------------
  809|  3.84k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  3.84k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  3.84k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  3.84k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 841, False: 2.31k]
  ------------------
  814|    841|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    841|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    841|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  817|       |
  818|  2.31k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (818:13): [True: 1.06k, False: 1.25k]
  ------------------
  819|  1.06k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|  1.06k|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|  1.06k|		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.02k, False: 225]
  ------------------
  826|  1.02k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|  1.02k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|  1.02k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|  1.02k|	}
  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.99k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 6.77k, False: 225]
  ------------------
  842|  6.77k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  6.77k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  6.77k|						data->priv->order);
  845|  6.77k|		exif_mnote_data_set_offset (data->priv->md,
  846|  6.77k|					    data->priv->offset_mnote);
  847|  6.77k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  6.77k|	}
  849|  6.99k|}
exif-data.c:exif_data_alloc:
   77|  33.9k|{
   78|  33.9k|	void *d;
   79|       |
   80|  33.9k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 33.9k]
  |  Branch (80:15): [True: 0, False: 33.9k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  33.9k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  33.9k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 33.9k, False: 0]
  ------------------
   85|  33.9k|		return d;
   86|       |
   87|      0|	EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
   88|       |	return NULL;
   89|  33.9k|}
exif-data.c:fix_func:
 1327|  40.1k|{
 1328|  40.1k|	switch (exif_content_get_ifd (c)) {
 1329|  8.02k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 8.02k, False: 32.0k]
  ------------------
 1330|  8.02k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 158, False: 7.86k]
  ------------------
 1331|    158|			exif_content_fix (c);
 1332|  7.86k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 559, False: 7.30k]
  ------------------
 1333|    559|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    559|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    559|				  "removed.");
 1336|  2.02k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.47k, False: 559]
  ------------------
 1337|  1.47k|				unsigned int cnt = c->count;
 1338|  1.47k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.47k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.47k]
  ------------------
 1340|       |					/* safety net */
 1341|      0|					exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1342|      0|						  "failed to remove entry from entries.");
 1343|      0|					break;
 1344|      0|				}
 1345|  1.47k|			}
 1346|    559|		}
 1347|  8.02k|		break;
 1348|  32.0k|	default:
  ------------------
  |  Branch (1348:2): [True: 32.0k, False: 8.02k]
  ------------------
 1349|  32.0k|		exif_content_fix (c);
 1350|  40.1k|	}
 1351|  40.1k|}

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

exif_format_get_name:
   56|  42.8k|{
   57|  42.8k|	unsigned int i;
   58|       |
   59|  42.8k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   263k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 252k, False: 11.3k]
  ------------------
   62|   252k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 31.4k, False: 220k]
  ------------------
   63|  31.4k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  31.4k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  11.3k|	return NULL;
   65|  42.8k|}
exif_format_get_size:
   69|  1.50M|{
   70|  1.50M|	unsigned int i;
   71|       |
   72|  10.2M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 9.78M, False: 414k]
  ------------------
   73|  9.78M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.09M, False: 8.69M]
  ------------------
   74|  1.09M|			return ExifFormatTable[i].size;
   75|   414k|	return 0;
   76|  1.50M|}

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

exif_loader_write:
  171|  10.4k|{
  172|  10.4k|	unsigned int i;
  173|       |
  174|   130k|begin:
  175|   130k|	if (!eld || (len && !buf)) 
  ------------------
  |  Branch (175:6): [True: 0, False: 130k]
  |  Branch (175:15): [True: 129k, False: 225]
  |  Branch (175:22): [True: 0, False: 129k]
  ------------------
  176|      0|		return 0;
  177|       |
  178|   130k|	switch (eld->state) {
  179|    189|	case EL_EXIF_FOUND:
  ------------------
  |  Branch (179:2): [True: 189, False: 129k]
  ------------------
  180|    189|		return exif_loader_copy (eld, buf, len);
  181|  1.13k|	case EL_SKIP_BYTES:
  ------------------
  |  Branch (181:2): [True: 1.13k, False: 128k]
  ------------------
  182|  1.13k|		if (eld->size > len) { 
  ------------------
  |  Branch (182:7): [True: 164, False: 973]
  ------------------
  183|    164|			eld->size -= len; 
  184|    164|			return 1; 
  185|    164|		}
  186|    973|		len -= eld->size;
  187|    973|		buf += eld->size;
  188|    973|		eld->size = 0;
  189|    973|		eld->b_len = 0;
  190|    973|		switch (eld->data_format) {
  191|     59|		case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (191:3): [True: 59, False: 914]
  ------------------
  192|     59|			eld->state = EL_READ_SIZE_BYTE_24;
  193|     59|			break;
  194|    914|		default:
  ------------------
  |  Branch (194:3): [True: 914, False: 59]
  ------------------
  195|    914|			eld->state = EL_READ;
  196|    914|			break;
  197|    973|		}
  198|    973|		break;
  199|       |
  200|   127k|	case EL_READ:
  ------------------
  |  Branch (200:2): [True: 127k, False: 2.14k]
  ------------------
  201|   128k|	default:
  ------------------
  |  Branch (201:2): [True: 823, False: 129k]
  ------------------
  202|   128k|		break;
  203|   130k|	}
  204|       |
  205|   129k|	if (!len)
  ------------------
  |  Branch (205:6): [True: 63, False: 129k]
  ------------------
  206|     63|		return 1;
  207|   129k|	exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
  208|   129k|		  "Scanning %i byte(s) of data...", len);
  209|       |
  210|       |	/*
  211|       |	 * First fill the small buffer. Only continue if the buffer
  212|       |	 * is filled. Note that EXIF data contains at least 12 bytes.
  213|       |	 */
  214|   129k|	i = MIN (len, sizeof (eld->b) - eld->b_len);
  ------------------
  |  |  182|   129k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 24, False: 129k]
  |  |  ------------------
  ------------------
  215|   129k|	if (i) {
  ------------------
  |  Branch (215:6): [True: 129k, False: 0]
  ------------------
  216|   129k|		memcpy (&eld->b[eld->b_len], buf, i);
  217|   129k|		eld->b_len += i;
  218|   129k|		if (eld->b_len < sizeof (eld->b)) 
  ------------------
  |  Branch (218:7): [True: 24, False: 129k]
  ------------------
  219|     24|			return 1;
  220|   129k|		buf += i;
  221|   129k|		len -= i;
  222|   129k|	}
  223|       |
  224|   129k|	switch (eld->data_format) {
  225|  10.6k|	case EL_DATA_FORMAT_UNKNOWN:
  ------------------
  |  Branch (225:2): [True: 10.6k, False: 118k]
  ------------------
  226|       |
  227|       |		/* Check the small buffer against known formats. */
  228|  10.6k|		if (!memcmp (eld->b, "FUJIFILM", 8)) {
  ------------------
  |  Branch (228:7): [True: 60, False: 10.5k]
  ------------------
  229|       |
  230|       |			/* Skip to byte 84. There is another offset there. */
  231|     60|			eld->data_format = EL_DATA_FORMAT_FUJI_RAW;
  232|     60|			eld->size = 84;
  233|     60|			eld->state = EL_SKIP_BYTES;
  234|     60|			eld->size = 84;
  235|       |
  236|  10.5k|		} else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) {
  ------------------
  |  Branch (236:14): [True: 9.73k, False: 859]
  ------------------
  237|       |
  238|       |			/* Read the size (2 bytes). */
  239|  9.73k|			eld->data_format = EL_DATA_FORMAT_EXIF;
  240|  9.73k|			eld->state = EL_READ_SIZE_BYTE_08;
  241|  9.73k|		}
  242|   129k|	default:
  ------------------
  |  Branch (242:2): [True: 118k, False: 10.6k]
  ------------------
  243|   129k|		break;
  244|   129k|	}
  245|       |
  246|  1.59M|	for (i = 0; i < sizeof (eld->b); i++) {
  ------------------
  |  Branch (246:14): [True: 1.47M, False: 119k]
  ------------------
  247|  1.47M|		switch (eld->state) {
  248|  9.88k|		case EL_EXIF_FOUND:
  ------------------
  |  Branch (248:3): [True: 9.88k, False: 1.46M]
  ------------------
  249|  9.88k|			if (!exif_loader_copy (eld, eld->b + i,
  ------------------
  |  Branch (249:8): [True: 8, False: 9.87k]
  ------------------
  250|  9.88k|					sizeof (eld->b) - i)) 
  251|      8|				return 0;
  252|  9.87k|			return exif_loader_copy (eld, buf, len);
  253|  9.19k|		case EL_SKIP_BYTES:
  ------------------
  |  Branch (253:3): [True: 9.19k, False: 1.46M]
  ------------------
  254|  9.19k|			switch (eld->size) {
  255|  6.26k|                            case 0:
  ------------------
  |  Branch (255:29): [True: 6.26k, False: 2.93k]
  ------------------
  256|  6.26k|			        eld->state = EL_READ;
  257|  6.26k|				i--;   /* reprocess this byte */
  258|  6.26k|				break;
  259|    977|                            case 1:
  ------------------
  |  Branch (259:29): [True: 977, False: 8.22k]
  ------------------
  260|    977|                                eld->size = 0;
  261|    977|			        eld->state = EL_READ;
  262|    977|				break;
  263|  1.95k|                            default:
  ------------------
  |  Branch (263:29): [True: 1.95k, False: 7.24k]
  ------------------
  264|  1.95k|                                eld->size--;
  265|  1.95k|				break;
  266|  9.19k|			}
  267|  9.19k|			break;
  268|       |
  269|  9.19k|		case EL_READ_SIZE_BYTE_24:
  ------------------
  |  Branch (269:3): [True: 58, False: 1.47M]
  ------------------
  270|     58|			eld->size |= (unsigned int)eld->b[i] << 24;
  271|     58|			eld->state = EL_READ_SIZE_BYTE_16;
  272|     58|			break;
  273|     58|		case EL_READ_SIZE_BYTE_16:
  ------------------
  |  Branch (273:3): [True: 58, False: 1.47M]
  ------------------
  274|     58|			eld->size |= (unsigned int)eld->b[i] << 16;
  275|     58|			eld->state = EL_READ_SIZE_BYTE_08;
  276|     58|			break;
  277|  18.4k|		case EL_READ_SIZE_BYTE_08:
  ------------------
  |  Branch (277:3): [True: 18.4k, False: 1.45M]
  ------------------
  278|  18.4k|			eld->size |= (unsigned int)eld->b[i] << 8;
  279|  18.4k|			eld->state = EL_READ_SIZE_BYTE_00;
  280|  18.4k|			break;
  281|  18.3k|		case EL_READ_SIZE_BYTE_00:
  ------------------
  |  Branch (281:3): [True: 18.3k, False: 1.45M]
  ------------------
  282|  18.3k|			eld->size |= eld->b[i] << 0;
  283|  18.3k|			switch (eld->data_format) {
  284|  8.26k|			case EL_DATA_FORMAT_JPEG:
  ------------------
  |  Branch (284:4): [True: 8.26k, False: 10.1k]
  ------------------
  285|  8.26k|				eld->state = EL_SKIP_BYTES;
  286|  8.26k|				if (eld->size < 2) {
  ------------------
  |  Branch (286:9): [True: 3.69k, False: 4.56k]
  ------------------
  287|       |				    /* Actually it's malformed... */
  288|  3.69k|				    eld->size = 0;
  289|  3.69k|				} else
  290|  4.56k|				    eld->size -= 2;
  291|  8.26k|				break;
  292|     58|			case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (292:4): [True: 58, False: 18.3k]
  ------------------
  293|     58|				eld->data_format = EL_DATA_FORMAT_EXIF;
  294|     58|				eld->state = EL_SKIP_BYTES;
  295|     58|				if (eld->size < 86) {
  ------------------
  |  Branch (295:9): [True: 5, False: 53]
  ------------------
  296|       |				    /* Actually it's malformed... */
  297|      5|				    eld->size = 0;
  298|      5|				} else
  299|     53|				    eld->size -= 86;	/* and put this in an else */
  300|     58|				break;
  301|  10.0k|			case EL_DATA_FORMAT_EXIF:
  ------------------
  |  Branch (301:4): [True: 10.0k, False: 8.32k]
  ------------------
  302|  10.0k|				eld->state = EL_EXIF_FOUND;
  303|  10.0k|				break;
  304|      0|			default:
  ------------------
  |  Branch (304:4): [True: 0, False: 18.3k]
  ------------------
  305|      0|				break;
  306|  18.3k|			}
  307|  18.3k|			break;
  308|       |
  309|  1.41M|		default:
  ------------------
  |  Branch (309:3): [True: 1.41M, False: 56.0k]
  ------------------
  310|  1.41M|			switch (eld->b[i]) {
  311|  1.61k|			case JPEG_MARKER_APP1:
  ------------------
  |  |   46|  1.61k|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (311:4): [True: 1.61k, False: 1.41M]
  ------------------
  312|  1.61k|			  if (!memcmp (eld->b + i + 3, ExifHeader, MIN((ptrdiff_t)(sizeof(ExifHeader)), MAX(0, ((ptrdiff_t)(sizeof(eld->b))) - ((ptrdiff_t)i) - 3)))) {
  ------------------
  |  |  182|  3.22k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 499, False: 1.11k]
  |  |  |  Branch (182:29): [True: 3, False: 1.60k]
  |  |  |  Branch (182:42): [True: 3, False: 1.10k]
  |  |  ------------------
  ------------------
  |  Branch (312:10): [True: 338, False: 1.27k]
  ------------------
  313|    338|					eld->data_format = EL_DATA_FORMAT_EXIF;
  314|  1.27k|				} else {
  315|  1.27k|					eld->data_format = EL_DATA_FORMAT_JPEG; /* Probably JFIF - keep searching for APP1 EXIF*/
  316|  1.27k|				}
  317|  1.61k|				eld->size = 0;
  318|  1.61k|				eld->state = EL_READ_SIZE_BYTE_08;
  319|  1.61k|				break;
  320|    456|			case JPEG_MARKER_DCT:
  ------------------
  |  |   36|    456|#define JPEG_MARKER_DCT  0xc0
  ------------------
  |  Branch (320:4): [True: 456, False: 1.41M]
  ------------------
  321|    758|			case JPEG_MARKER_DHT:
  ------------------
  |  |   38|    758|#define JPEG_MARKER_DHT  0xc4
  ------------------
  |  Branch (321:4): [True: 302, False: 1.41M]
  ------------------
  322|  1.07k|			case JPEG_MARKER_DQT:
  ------------------
  |  |   42|  1.07k|#define JPEG_MARKER_DQT  0xdb
  ------------------
  |  Branch (322:4): [True: 320, False: 1.41M]
  ------------------
  323|  3.27k|			case JPEG_MARKER_APP0:
  ------------------
  |  |   44|  3.27k|#define JPEG_MARKER_APP0 0xe0
  ------------------
  |  Branch (323:4): [True: 2.19k, False: 1.41M]
  ------------------
  324|  3.64k|			case JPEG_MARKER_APP2:
  ------------------
  |  |   48|  3.64k|#define JPEG_MARKER_APP2 0xe2
  ------------------
  |  Branch (324:4): [True: 371, False: 1.41M]
  ------------------
  325|  4.37k|			case JPEG_MARKER_APP3:
  ------------------
  |  |   50|  4.37k|#define JPEG_MARKER_APP3 0xe3
  ------------------
  |  Branch (325:4): [True: 729, False: 1.41M]
  ------------------
  326|  4.86k|			case JPEG_MARKER_APP4:
  ------------------
  |  |   52|  4.86k|#define JPEG_MARKER_APP4 0xe4
  ------------------
  |  Branch (326:4): [True: 494, False: 1.41M]
  ------------------
  327|  5.09k|			case JPEG_MARKER_APP5:
  ------------------
  |  |   54|  5.09k|#define JPEG_MARKER_APP5 0xe5
  ------------------
  |  Branch (327:4): [True: 222, False: 1.41M]
  ------------------
  328|  5.68k|			case JPEG_MARKER_APP10:
  ------------------
  |  |   56|  5.68k|#define JPEG_MARKER_APP10 0xea
  ------------------
  |  Branch (328:4): [True: 595, False: 1.41M]
  ------------------
  329|  6.00k|			case JPEG_MARKER_APP11:
  ------------------
  |  |   58|  6.00k|#define JPEG_MARKER_APP11 0xeb
  ------------------
  |  Branch (329:4): [True: 321, False: 1.41M]
  ------------------
  330|  6.27k|			case JPEG_MARKER_APP13:
  ------------------
  |  |   60|  6.27k|#define JPEG_MARKER_APP13 0xed
  ------------------
  |  Branch (330:4): [True: 264, False: 1.41M]
  ------------------
  331|  6.72k|			case JPEG_MARKER_APP14:
  ------------------
  |  |   62|  6.72k|#define JPEG_MARKER_APP14 0xee
  ------------------
  |  Branch (331:4): [True: 455, False: 1.41M]
  ------------------
  332|  7.01k|			case JPEG_MARKER_COM:
  ------------------
  |  |   64|  7.01k|#define JPEG_MARKER_COM 0xfe
  ------------------
  |  Branch (332:4): [True: 284, False: 1.41M]
  ------------------
  333|  7.01k|				eld->data_format = EL_DATA_FORMAT_JPEG;
  334|  7.01k|				eld->size = 0;
  335|  7.01k|				eld->state = EL_READ_SIZE_BYTE_08;
  336|  7.01k|				break;
  337|  1.40M|			case 0xff:
  ------------------
  |  Branch (337:4): [True: 1.40M, False: 9.37k]
  ------------------
  338|  1.40M|			case JPEG_MARKER_SOI:
  ------------------
  |  |   40|  1.40M|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (338:4): [True: 670, False: 1.41M]
  ------------------
  339|  1.40M|				break;
  340|     85|			default:
  ------------------
  |  Branch (340:4): [True: 85, False: 1.41M]
  ------------------
  341|     85|				exif_log (eld->log,
  342|     85|					EXIF_LOG_CODE_CORRUPT_DATA,
  343|     85|					"ExifLoader", _("The data supplied "
  ------------------
  |  |   31|     85|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  344|     85|						"does not seem to contain "
  345|     85|						"EXIF data. JPEG Marker type 0x%02x"), eld->b[i]);
  346|     85|				exif_loader_reset (eld);
  347|     85|				return 0;
  348|  1.41M|			}
  349|  1.47M|		}
  350|  1.47M|	}
  351|       |
  352|       |	/*
  353|       |	 * If we reach this point, the buffer has not been big enough
  354|       |	 * to read all data we need. Fill it with new data.
  355|       |	 */
  356|   119k|	eld->b_len = 0;
  357|   119k|	goto begin;
  358|   129k|}
exif_loader_new:
  362|  10.4k|{
  363|  10.4k|	ExifMem *mem = exif_mem_new_default ();
  364|  10.4k|	ExifLoader *l = exif_loader_new_mem (mem);
  365|       |
  366|  10.4k|	exif_mem_unref (mem);
  367|       |
  368|  10.4k|	return l;
  369|  10.4k|}
exif_loader_new_mem:
  373|  10.4k|{
  374|  10.4k|	ExifLoader *loader;
  375|       |
  376|  10.4k|	if (!mem) 
  ------------------
  |  Branch (376:6): [True: 0, False: 10.4k]
  ------------------
  377|      0|		return NULL;
  378|       |	
  379|  10.4k|	loader = exif_mem_alloc (mem, sizeof (ExifLoader));
  380|  10.4k|	if (!loader) 
  ------------------
  |  Branch (380:6): [True: 0, False: 10.4k]
  ------------------
  381|      0|		return NULL;
  382|  10.4k|	loader->ref_count = 1;
  383|       |
  384|  10.4k|	loader->mem = mem;
  385|  10.4k|	exif_mem_ref (mem);
  386|       |
  387|  10.4k|	return loader;
  388|  10.4k|}
exif_loader_unref:
  414|  10.4k|{
  415|  10.4k|	if (!loader) 
  ------------------
  |  Branch (415:6): [True: 0, False: 10.4k]
  ------------------
  416|      0|		return;
  417|  10.4k|	if (!--loader->ref_count)
  ------------------
  |  Branch (417:6): [True: 10.4k, False: 0]
  ------------------
  418|  10.4k|		exif_loader_free (loader);
  419|  10.4k|}
exif_loader_reset:
  423|  10.4k|{
  424|  10.4k|	if (!loader) 
  ------------------
  |  Branch (424:6): [True: 0, False: 10.4k]
  ------------------
  425|      0|		return;
  426|  10.4k|	exif_mem_free (loader->mem, loader->buf); loader->buf = NULL;
  427|  10.4k|	loader->size = 0;
  428|  10.4k|	loader->bytes_read = 0;
  429|  10.4k|	loader->state = 0;
  430|  10.4k|	loader->b_len = 0;
  431|  10.4k|	loader->data_format = EL_DATA_FORMAT_UNKNOWN;
  432|  10.4k|}
exif_loader_get_data:
  436|  10.4k|{
  437|  10.4k|	ExifData *ed;
  438|       |
  439|  10.4k|	if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) ||
  ------------------
  |  Branch (439:6): [True: 0, False: 10.4k]
  |  Branch (439:17): [True: 98, False: 10.3k]
  ------------------
  440|  10.3k|	    !loader->bytes_read)
  ------------------
  |  Branch (440:6): [True: 257, False: 10.0k]
  ------------------
  441|    355|		return NULL;
  442|       |
  443|  10.0k|	ed = exif_data_new_mem (loader->mem);
  444|  10.0k|	exif_data_log (ed, loader->log);
  445|  10.0k|	exif_data_load_data (ed, loader->buf, loader->bytes_read);
  446|       |
  447|  10.0k|	return ed;
  448|  10.4k|}
exif-loader.c:exif_loader_copy:
  151|  19.9k|{
  152|  19.9k|	if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) 
  ------------------
  |  Branch (152:6): [True: 0, False: 19.9k]
  |  Branch (152:15): [True: 19.9k, False: 40]
  |  Branch (152:22): [True: 0, False: 19.9k]
  |  Branch (152:31): [True: 2, False: 19.9k]
  ------------------
  153|      2|		return 0;
  154|       |
  155|       |	/* If needed, allocate the buffer. */
  156|  19.9k|	if (!eld->buf) 
  ------------------
  |  Branch (156:6): [True: 10.0k, False: 9.87k]
  ------------------
  157|  10.0k|		eld->buf = exif_loader_alloc (eld, eld->size);
  158|  19.9k|	if (!eld->buf) 
  ------------------
  |  Branch (158:6): [True: 0, False: 19.9k]
  ------------------
  159|      0|		return 0;
  160|       |
  161|       |	/* Copy memory */
  162|  19.9k|	len = MIN (len, eld->size - eld->bytes_read);
  ------------------
  |  |  182|  19.9k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 19.8k, False: 88]
  |  |  ------------------
  ------------------
  163|  19.9k|	memcpy (eld->buf + eld->bytes_read, buf, len);
  164|  19.9k|	eld->bytes_read += len;
  165|       |
  166|  19.9k|	return (eld->bytes_read >= eld->size) ? 0 : 1;
  ------------------
  |  Branch (166:9): [True: 88, False: 19.8k]
  ------------------
  167|  19.9k|}
exif-loader.c:exif_loader_alloc:
  109|  10.0k|{
  110|  10.0k|	void *d;
  111|       |
  112|  10.0k|	if (!l || !i) 
  ------------------
  |  Branch (112:6): [True: 0, False: 10.0k]
  |  Branch (112:12): [True: 0, False: 10.0k]
  ------------------
  113|      0|		return NULL;
  114|       |
  115|  10.0k|	d = exif_mem_alloc (l->mem, i);
  116|  10.0k|	if (d) 
  ------------------
  |  Branch (116:6): [True: 10.0k, False: 0]
  ------------------
  117|  10.0k|		return d;
  118|       |
  119|      0|	EXIF_LOG_NO_MEMORY (l->log, "ExifLog", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  120|       |	return NULL;
  121|  10.0k|}
exif-loader.c:exif_loader_free:
  399|  10.4k|{
  400|  10.4k|	ExifMem *mem;
  401|       |
  402|  10.4k|	if (!loader) 
  ------------------
  |  Branch (402:6): [True: 0, False: 10.4k]
  ------------------
  403|      0|		return;
  404|       |
  405|  10.4k|	mem = loader->mem;
  406|  10.4k|	exif_loader_reset (loader);
  407|  10.4k|	exif_log_unref (loader->log);
  408|  10.4k|	exif_mem_free (mem, loader);
  409|  10.4k|	exif_mem_unref (mem);
  410|  10.4k|}

exif_log_ref:
  100|  16.8k|{
  101|  16.8k|	if (!log) return;
  ------------------
  |  Branch (101:6): [True: 16.8k, False: 0]
  ------------------
  102|      0|	log->ref_count++;
  103|      0|}
exif_log_unref:
  107|  84.2k|{
  108|  84.2k|	if (!log) return;
  ------------------
  |  Branch (108:6): [True: 84.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|   181M|{
  140|   181M|	va_list args;
  141|       |
  142|   181M|	va_start (args, format);
  143|   181M|	exif_logv (log, code, domain, format, args);
  144|       |	va_end (args);
  145|   181M|}
exif_logv:
  150|   181M|{
  151|   181M|	if (!log) return;
  ------------------
  |  Branch (151:6): [True: 181M, False: 0]
  ------------------
  152|      0|	if (!log->func) return;
  ------------------
  |  Branch (152:6): [True: 0, False: 0]
  ------------------
  153|      0|	log->func (log, code, domain, format, args, log->data);
  154|      0|}

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

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

exif_tag_table_count:
  978|   401M|{
  979|   401M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   401M|}
exif_tag_table_get_tag:
  985|  5.44M|{
  986|  5.44M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.44M, False: 0]
  ------------------
  987|  5.44M|}
exif_tag_get_name_in_ifd:
 1043|   390M|{
 1044|   390M|	unsigned int i;
 1045|   390M|	int first;
 1046|       |
 1047|   390M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 390M]
  ------------------
 1048|      0|		return NULL;
 1049|   390M|	first = exif_tag_table_first(tag);
 1050|   390M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 36.9M, False: 354M]
  ------------------
 1051|  36.9M|		return NULL;
 1052|       |
 1053|   707M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 707M, False: 1.28k]
  ------------------
 1054|   707M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 354M, False: 353M]
  ------------------
 1055|   354M|		   if (RECORDED)
  ------------------
  |  | 1035|   354M|#define RECORDED \
  |  | 1036|   354M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 589k, False: 353M]
  |  |  ------------------
  |  | 1037|   354M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 353M]
  |  |  ------------------
  |  | 1038|   354M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.87k, False: 353M]
  |  |  ------------------
  |  | 1039|   354M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 15.8k, False: 353M]
  |  |  ------------------
  ------------------
 1056|   606k|			   break;
 1057|   354M|		} else
 1058|   353M|			return NULL; /* Recorded tag not found in the table */
 1059|   707M|	}
 1060|   608k|	return ExifTagTable[i].name;
 1061|   354M|}
exif_tag_get_name:
 1152|  70.5M|{
 1153|  70.5M|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|  70.5M|}
exif_tag_get_support_level_in_ifd:
 1261|  5.46M|{
 1262|  5.46M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.46M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.46M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.46M, False: 0]
  ------------------
 1266|  5.46M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.46M|}
exif-tag.c:exif_tag_table_first:
 1016|   396M|{
 1017|   396M|	int i;
 1018|   396M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   396M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   396M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 36.9M, False: 359M]
  ------------------
 1021|  36.9M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|   359M|	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|   359M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 358M, False: 1.20M]
  |  Branch (1029:20): [True: 362k, False: 358M]
  ------------------
 1030|   362k|		--i;
 1031|   362k|	}
 1032|   359M|	return i;
 1033|   396M|}
exif-tag.c:match_tag:
 1003|  2.80G|{
 1004|  2.80G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.80G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  70.5M|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|  70.5M|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|  70.5M|		EXIF_IFD_EXIF,
 1134|  70.5M|		EXIF_IFD_0,
 1135|  70.5M|		EXIF_IFD_1,
 1136|  70.5M|		EXIF_IFD_INTEROPERABILITY,
 1137|  70.5M|		EXIF_IFD_GPS
 1138|  70.5M|	};
 1139|  70.5M|	int i;
 1140|   422M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 352M, False: 70.2M]
  ------------------
 1141|   352M|		const char *result = func(tag, ifds[i]);
 1142|   352M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 290k, False: 352M]
  ------------------
 1143|   290k|			return result;
 1144|   290k|		}
 1145|   352M|	}
 1146|  70.2M|	return (const char *) NULL;
 1147|  70.5M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.46M|{
 1228|  5.46M|	unsigned int i;
 1229|  5.46M|	int first = exif_tag_table_first(tag);
 1230|  5.46M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.46M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  9.30M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 9.29M, False: 16.2k]
  ------------------
 1234|  9.29M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.56M, False: 3.72M]
  ------------------
 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.56M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.56M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.80M, False: 3.75M]
  ------------------
 1242|  1.80M|				unsigned int dt;
 1243|  8.92M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 7.20M, False: 1.72M]
  ------------------
 1244|  7.20M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 81.9k, False: 7.12M]
  ------------------
 1245|  81.9k|						break;
 1246|  7.20M|				}
 1247|  1.80M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.72M, False: 81.9k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.72M|					return supp;
 1250|  1.80M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.56M|		} else {
 1253|  3.72M|			break; /* We've reached the end of the matching tags */
 1254|  3.72M|		}
 1255|  9.29M|	}
 1256|  3.74M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.46M|}

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

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

mnote_fuji_entry_get_value:
  194|  9.84k|{
  195|  9.84k|	ExifLong  vl;
  196|  9.84k|	ExifSLong vsl;
  197|  9.84k|	ExifShort vs, vs2;
  198|  9.84k|	ExifSShort vss;
  199|  9.84k|	ExifRational vr;
  200|  9.84k|	ExifSRational vsr;
  201|  9.84k|	int i, j;
  202|       |
  203|  9.84k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 9.84k]
  ------------------
  204|  9.84k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 9.84k]
  ------------------
  205|       |
  206|  9.84k|	memset (val, 0, maxlen);
  207|  9.84k|	maxlen--;
  208|       |
  209|  9.84k|	switch (entry->tag) {
  210|  1.19k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.19k, False: 8.64k]
  ------------------
  211|  1.19k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.19k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.19k|{                                                               \
  |  |   35|  1.19k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 712, False: 486]
  |  |  ------------------
  |  |   36|    712|                snprintf (v, maxlen,	                        \
  |  |   37|    712|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    712|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    712|                        "expected '%s'."),                      \
  |  |   39|    712|                        exif_format_get_name (format),          \
  |  |   40|    712|                        exif_format_get_name (target));         \
  |  |   41|    712|                break;                                          \
  |  |   42|    712|        }                                                       \
  |  |   43|  1.19k|}
  ------------------
  212|    486|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    486|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    486|{                                                                       \
  |  |   47|    486|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 237, False: 249]
  |  |  ------------------
  |  |   48|    237|                snprintf (v, maxlen,                                    \
  |  |   49|    237|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    237|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    237|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    237|                break;                                                  \
  |  |   52|    237|        }                                                               \
  |  |   53|    486|}
  ------------------
  213|    249|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    249|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 249]
  |  |  ------------------
  ------------------
  214|    249|		break;
  215|    220|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 220, False: 9.62k]
  ------------------
  216|    326|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 106, False: 9.73k]
  ------------------
  217|    576|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 250, False: 9.59k]
  ------------------
  218|    822|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 246, False: 9.59k]
  ------------------
  219|  1.05k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 231, False: 9.61k]
  ------------------
  220|  1.30k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 255, False: 9.58k]
  ------------------
  221|  1.74k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 438, False: 9.40k]
  ------------------
  222|  2.04k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 298, False: 9.54k]
  ------------------
  223|  2.25k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 210, False: 9.63k]
  ------------------
  224|  2.56k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 315, False: 9.52k]
  ------------------
  225|  2.67k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 110, False: 9.73k]
  ------------------
  226|  2.75k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 80, False: 9.76k]
  ------------------
  227|  2.99k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 233, False: 9.61k]
  ------------------
  228|  3.19k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 203, False: 9.64k]
  ------------------
  229|  3.52k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 333, False: 9.51k]
  ------------------
  230|  3.75k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 229, False: 9.61k]
  ------------------
  231|  3.98k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 226, False: 9.61k]
  ------------------
  232|  3.98k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  3.98k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  3.98k|{                                                               \
  |  |   35|  3.98k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 2.08k, False: 1.89k]
  |  |  ------------------
  |  |   36|  2.08k|                snprintf (v, maxlen,	                        \
  |  |   37|  2.08k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.08k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  2.08k|                        "expected '%s'."),                      \
  |  |   39|  2.08k|                        exif_format_get_name (format),          \
  |  |   40|  2.08k|                        exif_format_get_name (target));         \
  |  |   41|  2.08k|                break;                                          \
  |  |   42|  2.08k|        }                                                       \
  |  |   43|  3.98k|}
  ------------------
  233|  1.89k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  1.89k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  1.89k|{                                                                       \
  |  |   47|  1.89k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 285, False: 1.61k]
  |  |  ------------------
  |  |   48|    285|                snprintf (v, maxlen,                                    \
  |  |   49|    285|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    285|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    285|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    285|                break;                                                  \
  |  |   52|    285|        }                                                               \
  |  |   53|  1.89k|}
  ------------------
  234|  1.61k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  12.9k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 12.9k, False: 0]
  |  Branch (237:32): [True: 11.3k, False: 1.61k]
  ------------------
  238|  1.61k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.61k]
  ------------------
  239|      0|			snprintf (val, maxlen,
  240|      0|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  241|      0|		  	break;
  242|      0|		}
  243|       |
  244|       |		/* find the value */
  245|  8.73k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 7.83k, False: 894]
  ------------------
  246|  7.83k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 7.12k, False: 716]
  ------------------
  247|  1.61k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 1.14k, False: 461]
  ------------------
  248|  1.14k|			snprintf (val, maxlen,
  249|  1.14k|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|  1.14k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.14k|			break;
  251|  1.14k|		}
  252|    461|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    461|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    461|		break;
  254|    725|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 725, False: 9.11k]
  ------------------
  255|    725|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    725|#define CF(format,target,v,maxlen)                              \
  |  |   34|    725|{                                                               \
  |  |   35|    725|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 227, False: 498]
  |  |  ------------------
  |  |   36|    227|                snprintf (v, maxlen,	                        \
  |  |   37|    227|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    227|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    227|                        "expected '%s'."),                      \
  |  |   39|    227|                        exif_format_get_name (format),          \
  |  |   40|    227|                        exif_format_get_name (target));         \
  |  |   41|    227|                break;                                          \
  |  |   42|    227|        }                                                       \
  |  |   43|    725|}
  ------------------
  256|    498|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    498|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    498|{                                                                       \
  |  |   47|    498|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 293, False: 205]
  |  |  ------------------
  |  |   48|    293|                snprintf (v, maxlen,                                    \
  |  |   49|    293|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    293|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    293|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    293|                break;                                                  \
  |  |   52|    293|        }                                                               \
  |  |   53|    498|}
  ------------------
  257|    205|		vs = exif_get_short (entry->data, entry->order);
  258|    205|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    205|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    205|		break;
  261|    323|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 323, False: 9.52k]
  ------------------
  262|  1.14k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 817, False: 9.02k]
  ------------------
  263|  1.14k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.14k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.14k|{                                                               \
  |  |   35|  1.14k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 429, False: 711]
  |  |  ------------------
  |  |   36|    429|                snprintf (v, maxlen,	                        \
  |  |   37|    429|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    429|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    429|                        "expected '%s'."),                      \
  |  |   39|    429|                        exif_format_get_name (format),          \
  |  |   40|    429|                        exif_format_get_name (target));         \
  |  |   41|    429|                break;                                          \
  |  |   42|    429|        }                                                       \
  |  |   43|  1.14k|}
  ------------------
  264|    711|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    711|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    711|{                                                                       \
  |  |   47|    711|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 70, False: 641]
  |  |  ------------------
  |  |   48|     70|                snprintf (v, maxlen,                                    \
  |  |   49|     70|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     70|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     70|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     70|                break;                                                  \
  |  |   52|     70|        }                                                               \
  |  |   53|    711|}
  ------------------
  265|    641|		vr = exif_get_rational (entry->data, entry->order);
  266|    641|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 231, False: 410]
  ------------------
  267|    410|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    410|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    410|			  vr.denominator);
  269|    410|		break;
  270|       |
  271|  2.79k|	default:
  ------------------
  |  Branch (271:2): [True: 2.79k, False: 7.04k]
  ------------------
  272|  2.79k|		switch (entry->format) {
  273|    233|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 233, False: 2.56k]
  ------------------
  274|    233|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    233|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 80, False: 153]
  |  |  ------------------
  ------------------
  275|    233|		  break;
  276|    217|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 217, False: 2.58k]
  ------------------
  277|    217|		  vs = exif_get_short (entry->data, entry->order);
  278|    217|		  snprintf (val, maxlen, "%hu", vs);
  279|    217|		  break;
  280|    393|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 393, False: 2.40k]
  ------------------
  281|    393|		  vss = exif_get_sshort (entry->data, entry->order);
  282|    393|		  snprintf (val, maxlen, "%hi", vss);
  283|    393|		  break;
  284|    198|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 198, False: 2.60k]
  ------------------
  285|    198|		  vl = exif_get_long (entry->data, entry->order);
  286|    198|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    198|		  break;
  288|    263|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 263, False: 2.53k]
  ------------------
  289|    263|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    263|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    263|		  break;
  292|    613|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 613, False: 2.18k]
  ------------------
  293|    613|		  vr = exif_get_rational (entry->data, entry->order);
  294|    613|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 175, False: 438]
  ------------------
  295|    438|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    438|						    vr.denominator);
  297|    438|		  break;
  298|    550|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 550, False: 2.24k]
  ------------------
  299|    550|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    550|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 243, False: 307]
  ------------------
  301|    307|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    307|			  vsr.denominator);
  303|    307|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.79k]
  ------------------
  305|    331|		default:
  ------------------
  |  Branch (305:3): [True: 331, False: 2.46k]
  ------------------
  306|    331|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    331|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    331| 			  entry->size);
  308|    331|		  break;
  309|  2.79k|		}
  310|  2.79k|		break;
  311|  9.84k|	}
  312|       |
  313|  9.84k|	return (val);
  314|  9.84k|}

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

exif_mnote_data_olympus_identify:
  627|  6.99k|{
  628|  6.99k|	int variant = exif_mnote_data_olympus_identify_variant(e->data, e->size);
  629|       |
  630|  6.99k|	if (variant == nikonV0) {
  ------------------
  |  Branch (630:6): [True: 417, False: 6.58k]
  ------------------
  631|       |		/* This variant needs some extra checking with the Make */
  632|    417|		char value[5];
  633|    417|		ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|    417|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 9, False: 408]
  |  |  ------------------
  |  |  254|    417|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|    417|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 43, False: 365]
  |  |  ------------------
  |  |  256|    408|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|    408|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 365]
  |  |  ------------------
  |  |  258|    365|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|    365|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 365]
  |  |  ------------------
  |  |  260|    365|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    365|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 365]
  |  |  ------------------
  |  |  262|    365|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  634|    417|		variant = unrecognized;
  635|       |
  636|    417|		if (em) {
  ------------------
  |  Branch (636:7): [True: 52, False: 365]
  ------------------
  637|     52|			const char *v = exif_entry_get_value (em, value, sizeof(value));
  638|     52|			if (v && (!strncmp (v, "Nikon", sizeof(value)) || 
  ------------------
  |  Branch (638:8): [True: 52, False: 0]
  |  Branch (638:14): [True: 0, False: 52]
  ------------------
  639|     52|					  !strncmp (v, "NIKON", sizeof(value)) ))
  ------------------
  |  Branch (639:8): [True: 0, False: 52]
  ------------------
  640|       |				/* When saved, this variant will be written out like the
  641|       |				 * alternative nikonV2 form above instead
  642|       |				 */
  643|      0|				variant = nikonV0;
  644|     52|		}
  645|    417|	}
  646|       |
  647|  6.99k|	return variant;
  648|  6.99k|}
exif_mnote_data_olympus_new:
  653|  3.84k|{
  654|  3.84k|	ExifMnoteData *d;
  655|       |
  656|  3.84k|	if (!mem) return NULL;
  ------------------
  |  Branch (656:6): [True: 0, False: 3.84k]
  ------------------
  657|       |	
  658|  3.84k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus));
  659|  3.84k|	if (!d) return NULL;
  ------------------
  |  Branch (659:6): [True: 0, False: 3.84k]
  ------------------
  660|       |
  661|  3.84k|	exif_mnote_data_construct (d, mem);
  662|       |
  663|       |	/* Set up function pointers */
  664|  3.84k|	d->methods.free            = exif_mnote_data_olympus_free;
  665|  3.84k|	d->methods.set_byte_order  = exif_mnote_data_olympus_set_byte_order;
  666|  3.84k|	d->methods.set_offset      = exif_mnote_data_olympus_set_offset;
  667|  3.84k|	d->methods.load            = exif_mnote_data_olympus_load;
  668|  3.84k|	d->methods.save            = exif_mnote_data_olympus_save;
  669|  3.84k|	d->methods.count           = exif_mnote_data_olympus_count;
  670|  3.84k|	d->methods.get_id          = exif_mnote_data_olympus_get_id;
  671|  3.84k|	d->methods.get_name        = exif_mnote_data_olympus_get_name;
  672|  3.84k|	d->methods.get_title       = exif_mnote_data_olympus_get_title;
  673|  3.84k|	d->methods.get_description = exif_mnote_data_olympus_get_description;
  674|  3.84k|	d->methods.get_value       = exif_mnote_data_olympus_get_value;
  675|       |
  676|  3.84k|	return d;
  677|  3.84k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_identify_variant:
  596|  10.8k|{
  597|       |	/* Olympus, Nikon, Sanyo, Epson */
  598|  10.8k|	if (buf_size >= 8) {
  ------------------
  |  Branch (598:6): [True: 10.5k, False: 251]
  ------------------
  599|       |		/* Match the terminating NUL character, too */
  600|  10.5k|		if (!memcmp (buf, "OLYMPUS", 8))
  ------------------
  |  Branch (600:7): [True: 896, False: 9.68k]
  ------------------
  601|    896|			   return olympusV2;
  602|  9.68k|		else if (!memcmp (buf, "OLYMP", 6))
  ------------------
  |  Branch (602:12): [True: 2.31k, False: 7.36k]
  ------------------
  603|  2.31k|			   return olympusV1;
  604|  7.36k|		else if (!memcmp (buf, "SANYO", 6))
  ------------------
  |  Branch (604:12): [True: 2.71k, False: 4.65k]
  ------------------
  605|  2.71k|			   return sanyoV1;
  606|  4.65k|		else if (!memcmp (buf, "EPSON", 6))
  ------------------
  |  Branch (606:12): [True: 1.32k, False: 3.33k]
  ------------------
  607|  1.32k|			   return epsonV1;
  608|  3.33k|		else if (!memcmp (buf, "Nikon", 6)) {
  ------------------
  |  Branch (608:12): [True: 389, False: 2.94k]
  ------------------
  609|    389|			switch (buf[6]) {
  610|    150|				case 1:  return nikonV1;
  ------------------
  |  Branch (610:5): [True: 150, False: 239]
  ------------------
  611|    233|				case 2:  return nikonV2;
  ------------------
  |  Branch (611:5): [True: 233, False: 156]
  ------------------
  612|      6|				default: return 0; /* Unrecognized Nikon variant */
  ------------------
  |  Branch (612:5): [True: 6, False: 383]
  ------------------
  613|    389|			}
  614|    389|		}
  615|  10.5k|	}
  616|       |
  617|       |	/* Another variant of Nikon */
  618|  3.19k|	if ((buf_size >= 2) && (buf[0] == 0x00) && (buf[1] == 0x1b)) {
  ------------------
  |  Branch (618:6): [True: 3.17k, False: 24]
  |  Branch (618:25): [True: 474, False: 2.69k]
  |  Branch (618:45): [True: 431, False: 43]
  ------------------
  619|    431|		return nikonV0;
  620|    431|	}
  621|       |
  622|  2.76k|	return unrecognized;
  623|  3.19k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_free:
   69|  3.84k|{
   70|  3.84k|	if (!n) return;
  ------------------
  |  Branch (70:6): [True: 0, False: 3.84k]
  ------------------
   71|       |
   72|  3.84k|	exif_mnote_data_olympus_clear ((ExifMnoteDataOlympus *) n);
   73|  3.84k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_clear:
   49|  7.46k|{
   50|  7.46k|	ExifMnoteData *d = (ExifMnoteData *) n;
   51|  7.46k|	unsigned int i;
   52|       |
   53|  7.46k|	if (!n) return;
  ------------------
  |  Branch (53:6): [True: 0, False: 7.46k]
  ------------------
   54|       |
   55|  7.46k|	if (n->entries) {
  ------------------
  |  Branch (55:6): [True: 3.62k, False: 3.84k]
  ------------------
   56|  97.5k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (56:15): [True: 93.8k, False: 3.62k]
  ------------------
   57|  93.8k|			if (n->entries[i].data) {
  ------------------
  |  Branch (57:8): [True: 37.3k, False: 56.5k]
  ------------------
   58|  37.3k|				exif_mem_free (d->mem, n->entries[i].data);
   59|  37.3k|				n->entries[i].data = NULL;
   60|  37.3k|			}
   61|  3.62k|		exif_mem_free (d->mem, n->entries);
   62|       |		n->entries = NULL;
   63|  3.62k|		n->count = 0;
   64|  3.62k|	}
   65|  7.46k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_byte_order:
  569|  3.84k|{
  570|  3.84k|	ExifByteOrder o_orig;
  571|  3.84k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  572|  3.84k|	unsigned int i;
  573|       |
  574|  3.84k|	if (!n) return;
  ------------------
  |  Branch (574:6): [True: 0, False: 3.84k]
  ------------------
  575|       |
  576|  3.84k|	o_orig = n->order;
  577|  3.84k|	n->order = o;
  578|  3.84k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (578:14): [True: 0, False: 3.84k]
  ------------------
  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.84k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_offset:
  589|  3.84k|{
  590|  3.84k|	if (n) ((ExifMnoteDataOlympus *) n)->offset = o;
  ------------------
  |  Branch (590:6): [True: 3.84k, False: 0]
  ------------------
  591|  3.84k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_load:
  242|  3.84k|{
  243|  3.84k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en;
  244|  3.84k|	ExifShort c;
  245|  3.84k|	size_t i, tcount, o, o2, datao = 6, base = 0;
  246|       |
  247|  3.84k|	if (!n) return;
  ------------------
  |  Branch (247:6): [True: 0, False: 3.84k]
  ------------------
  248|       |
  249|  3.84k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (249:6): [True: 0, False: 3.84k]
  |  Branch (249:14): [True: 0, False: 3.84k]
  ------------------
  250|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  251|      0|			  "ExifMnoteDataOlympus", "Short MakerNote");
  252|      0|		return;
  253|      0|	}
  254|  3.84k|	o2 = 6 + n->offset; /* Start of interesting data */
  255|  3.84k|	if (CHECKOVERFLOW(o2,buf_size,10)) {
  ------------------
  |  |   40|  3.84k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 3.84k]
  |  |  |  Branch (40:81): [True: 0, False: 3.84k]
  |  |  |  Branch (40:112): [True: 8, False: 3.83k]
  |  |  ------------------
  ------------------
  256|      8|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  257|      8|			  "ExifMnoteDataOlympus", "Short MakerNote");
  258|      8|		return;
  259|      8|	}
  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.83k|	n->version = exif_mnote_data_olympus_identify_variant(buf+o2, buf_size-o2);
  283|  3.83k|	switch (n->version) {
  284|  1.14k|	case olympusV1:
  ------------------
  |  Branch (284:2): [True: 1.14k, False: 2.68k]
  ------------------
  285|  2.50k|	case sanyoV1:
  ------------------
  |  Branch (285:2): [True: 1.35k, False: 2.48k]
  ------------------
  286|  3.14k|	case epsonV1:
  ------------------
  |  Branch (286:2): [True: 645, False: 3.19k]
  ------------------
  287|  3.14k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  288|  3.14k|			"Parsing Olympus/Sanyo/Epson maker note v1...");
  289|       |
  290|       |		/* The number of entries is at position 8. */
  291|  3.14k|		if (buf[o2 + 6] == 1)
  ------------------
  |  Branch (291:7): [True: 104, False: 3.04k]
  ------------------
  292|    104|			n->order = EXIF_BYTE_ORDER_INTEL;
  293|  3.04k|		else if (buf[o2 + 6 + 1] == 1)
  ------------------
  |  Branch (293:12): [True: 20, False: 3.02k]
  ------------------
  294|     20|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  295|  3.14k|		o2 += 8;
  296|  3.14k|		c = exif_get_short (buf + o2, n->order);
  297|  3.14k|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (297:7): [True: 859, False: 2.28k]
  |  Branch (297:24): [True: 657, False: 202]
  ------------------
  298|    657|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (298:8): [True: 628, False: 29]
  ------------------
  299|    628|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  300|    628|			} else {
  301|     29|				n->order = EXIF_BYTE_ORDER_INTEL;
  302|     29|			}
  303|    657|		}
  304|  3.14k|		break;
  305|       |
  306|    446|	case olympusV2:
  ------------------
  |  Branch (306:2): [True: 446, False: 3.38k]
  ------------------
  307|       |		/* Olympus S760, S770 */
  308|    446|		datao = o2;
  309|    446|		o2 += 8;
  310|    446|		if (CHECKOVERFLOW(o2,buf_size,4)) return;
  ------------------
  |  |   40|    446|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 446]
  |  |  |  Branch (40:81): [True: 0, False: 446]
  |  |  |  Branch (40:112): [True: 2, False: 444]
  |  |  ------------------
  ------------------
  311|    444|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  312|    444|			"Parsing Olympus maker note v2 (0x%02x, %02x, %02x, %02x)...",
  313|    444|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  314|       |
  315|    444|		if ((buf[o2] == 'I') && (buf[o2 + 1] == 'I'))
  ------------------
  |  Branch (315:7): [True: 17, False: 427]
  |  Branch (315:27): [True: 8, False: 9]
  ------------------
  316|      8|			n->order = EXIF_BYTE_ORDER_INTEL;
  317|    436|		else if ((buf[o2] == 'M') && (buf[o2 + 1] == 'M'))
  ------------------
  |  Branch (317:12): [True: 12, False: 424]
  |  Branch (317:32): [True: 1, False: 11]
  ------------------
  318|      1|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  319|       |
  320|       |		/* The number of entries is at position 8+4. */
  321|    444|		o2 += 4;
  322|    444|		break;
  323|       |
  324|     73|	case nikonV1:
  ------------------
  |  Branch (324:2): [True: 73, False: 3.76k]
  ------------------
  325|     73|		o2 += 6;
  326|     73|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  327|     73|			"Parsing Nikon maker note v1 (0x%02x, %02x, %02x, "
  328|     73|			"%02x)...",
  329|     73|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  330|       |
  331|       |		/* Skip version number */
  332|     73|		o2 += 1;
  333|       |
  334|       |		/* Skip an unknown byte (00 or 0A). */
  335|     73|		o2 += 1;
  336|       |
  337|     73|		base = MNOTE_NIKON1_TAG_BASE;
  338|       |		/* Fix endianness, if needed */
  339|     73|		c = exif_get_short (buf + o2, n->order);
  340|     73|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (340:7): [True: 15, False: 58]
  |  Branch (340:24): [True: 10, False: 5]
  ------------------
  341|     10|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (341:8): [True: 6, False: 4]
  ------------------
  342|      6|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  343|      6|			} else {
  344|      4|				n->order = EXIF_BYTE_ORDER_INTEL;
  345|      4|			}
  346|     10|		}
  347|     73|		break;
  348|       |
  349|    122|	case nikonV2:
  ------------------
  |  Branch (349:2): [True: 122, False: 3.71k]
  ------------------
  350|    122|		o2 += 6;
  351|    122|		if (CHECKOVERFLOW(o2,buf_size,12)) return;
  ------------------
  |  |   40|    122|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 122]
  |  |  |  Branch (40:81): [True: 0, False: 122]
  |  |  |  Branch (40:112): [True: 4, False: 118]
  |  |  ------------------
  ------------------
  352|    118|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  353|    118|			"Parsing Nikon maker note v2 (0x%02x, %02x, %02x, "
  354|    118|			"%02x, %02x, %02x, %02x, %02x)...",
  355|    118|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3],
  356|    118|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  357|       |
  358|       |		/* Skip version number */
  359|    118|		o2 += 1;
  360|       |
  361|       |		/* Skip an unknown byte (00 or 0A). */
  362|    118|		o2 += 1;
  363|       |
  364|       |		/* Skip 2 unknown bytes (00 00). */
  365|    118|		o2 += 2;
  366|       |
  367|       |		/*
  368|       |		 * Byte order. From here the data offset
  369|       |		 * gets calculated.
  370|       |		 */
  371|    118|		datao = o2;
  372|    118|		if (!strncmp ((char *)&buf[o2], "II", 2))
  ------------------
  |  Branch (372:7): [True: 77, False: 41]
  ------------------
  373|     77|			n->order = EXIF_BYTE_ORDER_INTEL;
  374|     41|		else if (!strncmp ((char *)&buf[o2], "MM", 2))
  ------------------
  |  Branch (374:12): [True: 11, False: 30]
  ------------------
  375|     11|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  376|     30|		else {
  377|     30|			exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  378|     30|				"ExifMnoteDataOlympus", "Unknown "
  379|     30|				"byte order '%c%c'", buf[o2],
  380|     30|				buf[o2 + 1]);
  381|     30|			return;
  382|     30|		}
  383|     88|		o2 += 2;
  384|       |
  385|       |		/* Skip 2 unknown bytes (00 2A). */
  386|     88|		o2 += 2;
  387|       |
  388|       |		/* Go to where the number of entries is. */
  389|     88|		if (CHECKOVERFLOW(o2,buf_size,exif_get_long (buf + o2, n->order))) return;
  ------------------
  |  |   40|     88|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 0, False: 88]
  |  |  |  Branch (40:81): [True: 53, False: 35]
  |  |  |  Branch (40:112): [True: 14, False: 21]
  |  |  ------------------
  ------------------
  390|     21|		o2 = datao + exif_get_long (buf + o2, n->order);
  391|     21|		break;
  392|       |
  393|     14|	case nikonV0:
  ------------------
  |  Branch (393:2): [True: 14, False: 3.82k]
  ------------------
  394|     14|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  395|     14|			"Parsing Nikon maker note v0 (0x%02x, %02x, %02x, "
  396|     14|			"%02x, %02x, %02x, %02x, %02x)...",
  397|     14|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
  398|     14|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  399|       |		/* 00 1b is # of entries in Motorola order - the rest should also be in MM order */
  400|     14|		n->order = EXIF_BYTE_ORDER_MOTOROLA;
  401|     14|		break;
  402|       |
  403|     33|	default:
  ------------------
  |  Branch (403:2): [True: 33, False: 3.80k]
  ------------------
  404|     33|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  405|     33|			"Unknown Olympus variant %i.", n->version);
  406|     33|		return;
  407|  3.83k|	}
  408|       |
  409|       |	/* Sanity check the offset */
  410|  3.69k|	if (CHECKOVERFLOW(o2,buf_size,2)) {
  ------------------
  |  |   40|  3.69k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 27, False: 3.67k]
  |  |  |  Branch (40:81): [True: 0, False: 3.67k]
  |  |  |  Branch (40:112): [True: 1, False: 3.67k]
  |  |  ------------------
  ------------------
  411|     28|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  412|     28|			  "ExifMnoteOlympus", "Short MakerNote");
  413|     28|		return;
  414|     28|	}
  415|       |
  416|       |	/* Read the number of tags */
  417|  3.67k|	c = exif_get_short (buf + o2, n->order);
  418|  3.67k|	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.67k|	if (c > 300) {
  ------------------
  |  Branch (422:6): [True: 46, False: 3.62k]
  ------------------
  423|     46|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Too much tags (%d) in Olympus MakerNote", c);
  424|     46|		return;
  425|     46|	}
  426|       |
  427|       |	/* Remove any old entries */
  428|  3.62k|	exif_mnote_data_olympus_clear (n);
  429|       |
  430|       |	/* Reserve enough space for all the possible MakerNote tags */
  431|  3.62k|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c);
  432|  3.62k|	if (!n->entries) {
  ------------------
  |  Branch (432:6): [True: 0, False: 3.62k]
  ------------------
  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.62k|	tcount = 0;
  439|   105k|	for (i = c, o = o2; i; --i, o += 12) {
  ------------------
  |  Branch (439:22): [True: 104k, False: 619]
  ------------------
  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.51k, False: 103k]
  |  |  |  Branch (40:81): [True: 0, False: 103k]
  |  |  |  Branch (40:112): [True: 1.48k, False: 101k]
  |  |  ------------------
  ------------------
  443|  3.00k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  444|  3.00k|				  "ExifMnoteOlympus", "Short MakerNote");
  445|  3.00k|			break;
  446|  3.00k|		}
  447|       |
  448|   101k|	    n->entries[tcount].tag        = exif_get_short (buf + o, n->order) + base;
  449|   101k|	    n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  450|   101k|	    n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  451|   101k|	    n->entries[tcount].order      = n->order;
  452|       |
  453|   101k|	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  454|   101k|		      "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  455|   101k|		      mnote_olympus_tag_get_name (n->entries[tcount].tag));
  456|       |/*	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  457|       |			    "0x%x %d %ld*(%d)",
  458|       |		    n->entries[tcount].tag,
  459|       |		    n->entries[tcount].format,
  460|       |		    n->entries[tcount].components,
  461|       |		    (int)exif_format_get_size(n->entries[tcount].format)); */
  462|       |
  463|       |	    /* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  464|       |	     * we will check the buffer sizes closer later. */
  465|   101k|	    if (exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (465:10): [True: 53.6k, False: 48.3k]
  ------------------
  466|  53.6k|		buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (466:3): [True: 5.82k, False: 47.8k]
  ------------------
  467|   101k|	    ) {
  468|  5.82k|		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.82k|		continue;
  470|  5.82k|	    }
  471|       |	    /*
  472|       |	     * Size? If bigger than 4 bytes, the actual data is not
  473|       |	     * in the entry but somewhere else (offset).
  474|       |	     */
  475|  96.1k|	    s = exif_format_get_size (n->entries[tcount].format) *
  476|  96.1k|		   			 n->entries[tcount].components;
  477|  96.1k|		n->entries[tcount].size = s;
  478|  96.1k|		if (s) {
  ------------------
  |  Branch (478:7): [True: 39.6k, False: 56.5k]
  ------------------
  479|  39.6k|			size_t dataofs = o + 8;
  480|  39.6k|			if (s > 4) {
  ------------------
  |  Branch (480:8): [True: 21.8k, False: 17.7k]
  ------------------
  481|       |				/* The data in this case is merely a pointer */
  482|  21.8k|				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|  21.8k|			}
  498|  39.6k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   40|  39.6k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (40:52): [True: 1.65k, False: 37.9k]
  |  |  |  Branch (40:81): [True: 0, False: 37.9k]
  |  |  |  Branch (40:112): [True: 606, False: 37.3k]
  |  |  ------------------
  ------------------
  499|  2.26k|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  500|  2.26k|					  "ExifMnoteOlympus",
  501|  2.26k|					  "Tag data past end of buffer (%u > %u)",
  502|  2.26k|					  (unsigned)(dataofs + s), buf_size);
  503|  2.26k|				continue;
  504|  2.26k|			}
  505|       |
  506|  37.3k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  507|  37.3k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (507:8): [True: 0, False: 37.3k]
  ------------------
  508|      0|				EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteOlympus", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  509|      0|				continue;
  510|      0|			}
  511|  37.3k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  512|  37.3k|		}
  513|       |
  514|       |		/* Tag was successfully parsed */
  515|  93.8k|		++tcount;
  516|  93.8k|	}
  517|       |	/* Store the count of successfully parsed tags */
  518|  3.62k|	n->count = tcount;
  519|  3.62k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_count:
  523|  3.84k|{
  524|  3.84k|	return n ? ((ExifMnoteDataOlympus *) n)->count : 0;
  ------------------
  |  Branch (524:9): [True: 3.84k, False: 0]
  ------------------
  525|  3.84k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_name:
  539|  55.6k|{
  540|  55.6k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  541|       |
  542|  55.6k|	if (!n) return NULL;
  ------------------
  |  Branch (542:6): [True: 0, False: 55.6k]
  ------------------
  543|  55.6k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (543:6): [True: 0, False: 55.6k]
  ------------------
  544|  55.6k|	return mnote_olympus_tag_get_name (n->entries[i].tag);
  545|  55.6k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_title:
  549|  54.3k|{
  550|  54.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  551|       |	
  552|  54.3k|	if (!n) return NULL;
  ------------------
  |  Branch (552:6): [True: 0, False: 54.3k]
  ------------------
  553|  54.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (553:6): [True: 0, False: 54.3k]
  ------------------
  554|  54.3k|        return mnote_olympus_tag_get_title (n->entries[i].tag);
  555|  54.3k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_description:
  559|  54.3k|{
  560|  54.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  561|       |	
  562|  54.3k|	if (!n) return NULL;
  ------------------
  |  Branch (562:6): [True: 0, False: 54.3k]
  ------------------
  563|  54.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (563:6): [True: 0, False: 54.3k]
  ------------------
  564|  54.3k|        return mnote_olympus_tag_get_description (n->entries[i].tag);
  565|  54.3k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_value:
   77|  54.3k|{
   78|  54.3k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
   79|       |
   80|  54.3k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (80:6): [True: 0, False: 54.3k]
  |  Branch (80:12): [True: 0, False: 54.3k]
  ------------------
   81|  54.3k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (81:6): [True: 0, False: 54.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|  54.3k|	return mnote_olympus_entry_get_value (&n->entries[i], val, maxlen);
   88|  54.3k|}

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

mnote_olympus_tag_get_name:
  232|   157k|{
  233|   157k|	unsigned int i;
  234|       |
  235|  16.6M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (235:14): [True: 16.5M, False: 24.5k]
  ------------------
  236|  16.5M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (236:7): [True: 133k, False: 16.4M]
  ------------------
  237|  24.5k|	return NULL;
  238|   157k|}
mnote_olympus_tag_get_title:
  242|  54.3k|{
  243|  54.3k|	unsigned int i;
  244|       |
  245|  54.3k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  246|  4.63M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (246:14): [True: 4.63M, False: 0]
  ------------------
  247|  4.63M|		if (table[i].tag == t) {
  ------------------
  |  Branch (247:7): [True: 54.3k, False: 4.58M]
  ------------------
  248|  54.3k|			if (!table[i].title)
  ------------------
  |  Branch (248:8): [True: 0, False: 54.3k]
  ------------------
  249|      0|				return NULL;
  250|  54.3k|			return _(table[i].title);
  ------------------
  |  |   31|  54.3k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  251|  54.3k|		}
  252|      0|	return NULL;
  253|  54.3k|}
mnote_olympus_tag_get_description:
  257|  54.3k|{
  258|  54.3k|	unsigned int i;
  259|       |
  260|  4.63M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (260:14): [True: 4.63M, False: 0]
  ------------------
  261|  4.63M|		if (table[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 54.3k, False: 4.58M]
  ------------------
  262|  54.3k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (262:8): [True: 226, False: 54.1k]
  |  Branch (262:33): [True: 52.9k, False: 1.13k]
  ------------------
  263|  53.1k|				return "";
  264|  1.13k|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  265|  1.13k|			return _(table[i].description);
  ------------------
  |  |   31|  1.13k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  54.3k|		}
  267|      0|	return NULL;
  268|  54.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.00k, False: 243]
  |  Branch (431:24): [True: 589, False: 420]
  ------------------
  432|    589|		if (((e->data[4] == 'I') && (e->data[5] == 'I')) ||
  ------------------
  |  Branch (432:8): [True: 202, False: 387]
  |  Branch (432:31): [True: 4, False: 198]
  ------------------
  433|    585|		    ((e->data[4] == 'M') && (e->data[5] == 'M')))
  ------------------
  |  Branch (433:8): [True: 20, False: 565]
  |  Branch (433:31): [True: 4, False: 16]
  ------------------
  434|      8|			return pentaxV3;
  435|    581|		else
  436|       |			/* Uses Casio v2 tags */
  437|    581|			return pentaxV2;
  438|    589|	}
  439|       |
  440|    663|	if ((e->size >= 8) && !memcmp (e->data, "QVC", 4))
  ------------------
  |  Branch (440:6): [True: 420, False: 243]
  |  Branch (440:24): [True: 22, False: 398]
  ------------------
  441|     22|		return casioV2;
  442|       |
  443|       |	/* This isn't a very robust test, so make sure it's done last */
  444|       |	/* Maybe we should additionally check for a make of Asahi or Pentax */
  445|    641|	if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b))
  ------------------
  |  Branch (445:6): [True: 617, False: 24]
  |  Branch (445:24): [True: 449, False: 168]
  |  Branch (445:48): [True: 416, False: 33]
  ------------------
  446|    416|		return pentaxV1;
  447|       |
  448|    225|	return 0;
  449|    641|}
exif_mnote_data_pentax_new:
  453|  1.02k|{
  454|  1.02k|	ExifMnoteData *d;
  455|       |
  456|  1.02k|	if (!mem) return NULL;
  ------------------
  |  Branch (456:6): [True: 0, False: 1.02k]
  ------------------
  457|       |
  458|  1.02k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataPentax));
  459|  1.02k|	if (!d) return NULL;
  ------------------
  |  Branch (459:6): [True: 0, False: 1.02k]
  ------------------
  460|       |
  461|  1.02k|	exif_mnote_data_construct (d, mem);
  462|       |
  463|       |	/* Set up function pointers */
  464|  1.02k|	d->methods.free            = exif_mnote_data_pentax_free;
  465|  1.02k|	d->methods.set_byte_order  = exif_mnote_data_pentax_set_byte_order;
  466|  1.02k|	d->methods.set_offset      = exif_mnote_data_pentax_set_offset;
  467|  1.02k|	d->methods.load            = exif_mnote_data_pentax_load;
  468|  1.02k|	d->methods.save            = exif_mnote_data_pentax_save;
  469|  1.02k|	d->methods.count           = exif_mnote_data_pentax_count;
  470|  1.02k|	d->methods.get_id          = exif_mnote_data_pentax_get_id;
  471|  1.02k|	d->methods.get_name        = exif_mnote_data_pentax_get_name;
  472|  1.02k|	d->methods.get_title       = exif_mnote_data_pentax_get_title;
  473|  1.02k|	d->methods.get_description = exif_mnote_data_pentax_get_description;
  474|  1.02k|	d->methods.get_value       = exif_mnote_data_pentax_get_value;
  475|       |
  476|  1.02k|	return d;
  477|  1.02k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_free:
   57|  1.02k|{
   58|  1.02k|	if (!n) return;
  ------------------
  |  Branch (58:6): [True: 0, False: 1.02k]
  ------------------
   59|       |
   60|  1.02k|	exif_mnote_data_pentax_clear ((ExifMnoteDataPentax *) n);
   61|  1.02k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_clear:
   37|  1.93k|{
   38|  1.93k|	ExifMnoteData *d = (ExifMnoteData *) n;
   39|  1.93k|	unsigned int i;
   40|       |
   41|  1.93k|	if (!n) return;
  ------------------
  |  Branch (41:6): [True: 0, False: 1.93k]
  ------------------
   42|       |
   43|  1.93k|	if (n->entries) {
  ------------------
  |  Branch (43:6): [True: 905, False: 1.02k]
  ------------------
   44|  18.7k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (44:15): [True: 17.7k, False: 905]
  ------------------
   45|  17.7k|			if (n->entries[i].data) {
  ------------------
  |  Branch (45:8): [True: 6.38k, False: 11.4k]
  ------------------
   46|  6.38k|				exif_mem_free (d->mem, n->entries[i].data);
   47|  6.38k|				n->entries[i].data = NULL;
   48|  6.38k|			}
   49|    905|		exif_mem_free (d->mem, n->entries);
   50|       |		n->entries = NULL;
   51|    905|		n->count = 0;
   52|    905|	}
   53|  1.93k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_byte_order:
  409|  1.02k|{
  410|  1.02k|	ExifByteOrder o_orig;
  411|  1.02k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
  412|  1.02k|	unsigned int i;
  413|       |
  414|  1.02k|	if (!n) return;
  ------------------
  |  Branch (414:6): [True: 0, False: 1.02k]
  ------------------
  415|       |
  416|  1.02k|	o_orig = n->order;
  417|  1.02k|	n->order = o;
  418|  1.02k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (418:14): [True: 0, False: 1.02k]
  ------------------
  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.02k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_offset:
  403|  1.02k|{
  404|  1.02k|	if (d) ((ExifMnoteDataPentax *) d)->offset = o;
  ------------------
  |  Branch (404:6): [True: 1.02k, False: 0]
  ------------------
  405|  1.02k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_load:
  220|  1.02k|{
  221|  1.02k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) en;
  222|  1.02k|	size_t i, tcount, o, datao, base = 0;
  223|  1.02k|	ExifShort c;
  224|       |
  225|  1.02k|	if (!n) return;
  ------------------
  |  Branch (225:6): [True: 0, False: 1.02k]
  ------------------
  226|       |
  227|  1.02k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (227:6): [True: 0, False: 1.02k]
  |  Branch (227:14): [True: 0, False: 1.02k]
  ------------------
  228|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  229|      0|			  "ExifMnoteDataPentax", "Short MakerNote");
  230|      0|		return;
  231|      0|	}
  232|  1.02k|	datao = 6 + n->offset;
  233|  1.02k|	if (CHECKOVERFLOW(datao, buf_size, 8)) {
  ------------------
  |  |   33|  1.02k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 1.02k]
  |  |  |  Branch (33:81): [True: 0, False: 1.02k]
  |  |  |  Branch (33:112): [True: 8, False: 1.01k]
  |  |  ------------------
  ------------------
  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.01k|	if (!memcmp(buf + datao, "AOC", 4)) {
  ------------------
  |  Branch (240:6): [True: 558, False: 461]
  ------------------
  241|    558|		if ((buf[datao + 4] == 'I') && (buf[datao + 5] == 'I')) {
  ------------------
  |  Branch (241:7): [True: 192, False: 366]
  |  Branch (241:34): [True: 4, False: 188]
  ------------------
  242|      4|			n->version = pentaxV3;
  243|      4|			n->order = EXIF_BYTE_ORDER_INTEL;
  244|    554|		} else if ((buf[datao + 4] == 'M') && (buf[datao + 5] == 'M')) {
  ------------------
  |  Branch (244:14): [True: 20, False: 534]
  |  Branch (244:41): [True: 4, False: 16]
  ------------------
  245|      4|			n->version = pentaxV3;
  246|      4|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  247|    550|		} else {
  248|       |			/* Uses Casio v2 tags */
  249|    550|			n->version = pentaxV2;
  250|    550|		}
  251|    558|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  252|    558|			"Parsing Pentax maker note v%d...", (int)n->version);
  253|    558|		datao += 4 + 2;
  254|    558|		base = MNOTE_PENTAX2_TAG_BASE;
  255|    558|	} else if (!memcmp(buf + datao, "QVC", 4)) {
  ------------------
  |  Branch (255:13): [True: 23, False: 438]
  ------------------
  256|     23|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  257|     23|			"Parsing Casio maker note v2...");
  258|     23|		n->version = casioV2;
  259|     23|		base = MNOTE_CASIO2_TAG_BASE;
  260|     23|		datao += 4 + 2;
  261|    438|	} else {
  262|       |		/* probably assert(!memcmp(buf + datao, "\x00\x1b", 2)) */
  263|    438|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  264|    438|			"Parsing Pentax maker note v1...");
  265|    438|		n->version = pentaxV1;
  266|    438|	}
  267|       |
  268|       |	/* Read the number of tags */
  269|  1.01k|	c = exif_get_short (buf + datao, n->order);
  270|  1.01k|	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.01k|	if (c > 200) {
  ------------------
  |  Branch (274:6): [True: 114, False: 905]
  ------------------
  275|    114|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataPentax", "Too much tags (%d) in Pentax MakerNote", c);
  276|    114|		return;
  277|    114|	}
  278|       |
  279|       |
  280|       |	/* Remove any old entries */
  281|    905|	exif_mnote_data_pentax_clear (n);
  282|       |
  283|       |	/* Reserve enough space for all the possible MakerNote tags */
  284|    905|	n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c);
  285|    905|	if (!n->entries) {
  ------------------
  |  Branch (285:6): [True: 0, False: 905]
  ------------------
  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|    905|	tcount = 0;
  292|  19.3k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (292:25): [True: 19.3k, False: 21]
  ------------------
  293|  19.3k|		size_t s;
  294|       |
  295|  19.3k|		memset(&n->entries[tcount], 0, sizeof(MnotePentaxEntry));
  296|  19.3k|		if (CHECKOVERFLOW(o,buf_size,12)) {
  ------------------
  |  |   33|  19.3k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 269, False: 19.0k]
  |  |  |  Branch (33:81): [True: 0, False: 19.0k]
  |  |  |  Branch (33:112): [True: 391, False: 18.7k]
  |  |  ------------------
  ------------------
  297|    660|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  298|    660|				  "ExifMnoteDataPentax", "Short MakerNote");
  299|    660|			break;
  300|    660|		}
  301|       |
  302|  18.7k|		n->entries[tcount].tag        = exif_get_short (buf + o + 0, n->order) + base;
  303|  18.7k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  304|  18.7k|		n->entries[tcount].components = exif_get_long  (buf + o + 4, n->order);
  305|  18.7k|		n->entries[tcount].order      = n->order;
  306|       |
  307|  18.7k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnotePentax",
  308|  18.7k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  309|  18.7k|			  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|  18.7k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (313:8): [True: 9.41k, False: 9.28k]
  ------------------
  314|  9.41k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (314:4): [True: 224, False: 9.19k]
  ------------------
  315|  18.7k|		) {
  316|    224|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  317|    224|				  "ExifMnoteDataPentax", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  318|    224|			break;
  319|    224|		}
  320|       |		/*
  321|       |		 * Size? If bigger than 4 bytes, the actual data is not
  322|       |		 * in the entry but somewhere else (offset).
  323|       |		 */
  324|  18.4k|		s = exif_format_get_size (n->entries[tcount].format) *
  325|  18.4k|                                      n->entries[tcount].components;
  326|  18.4k|		n->entries[tcount].size = s;
  327|  18.4k|		if (s) {
  ------------------
  |  Branch (327:7): [True: 7.06k, False: 11.4k]
  ------------------
  328|  7.06k|			size_t dataofs = o + 8;
  329|  7.06k|			if (s > 4)
  ------------------
  |  Branch (329:8): [True: 2.07k, False: 4.98k]
  ------------------
  330|       |				/* The data in this case is merely a pointer */
  331|  2.07k|			   	dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  332|       |
  333|  7.06k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  7.06k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 555, False: 6.50k]
  |  |  |  Branch (33:81): [True: 0, False: 6.50k]
  |  |  |  Branch (33:112): [True: 126, False: 6.38k]
  |  |  ------------------
  ------------------
  334|    681|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  335|    681|						  "ExifMnoteDataPentax", "Tag data past end "
  336|    681|					  "of buffer (%u > %u)", (unsigned)(dataofs + s), buf_size);
  337|    681|				continue;
  338|    681|			}
  339|       |
  340|  6.38k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  341|  6.38k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (341:8): [True: 0, False: 6.38k]
  ------------------
  342|      0|				EXIF_LOG_NO_MEMORY(en->log, "ExifMnoteDataPentax", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  343|      0|				continue;
  344|      0|			}
  345|  6.38k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  346|  6.38k|		}
  347|       |
  348|       |		/* Tag was successfully parsed */
  349|  17.7k|		++tcount;
  350|  17.7k|	}
  351|       |	/* Store the count of successfully parsed tags */
  352|    905|	n->count = tcount;
  353|    905|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_count:
  357|  1.02k|{
  358|  1.02k|	return n ? ((ExifMnoteDataPentax *) n)->count : 0;
  ------------------
  |  Branch (358:9): [True: 1.02k, False: 0]
  ------------------
  359|  1.02k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_name:
  373|  12.4k|{
  374|  12.4k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  375|       |
  376|  12.4k|	if (!note) return NULL;
  ------------------
  |  Branch (376:6): [True: 0, False: 12.4k]
  ------------------
  377|  12.4k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (377:6): [True: 0, False: 12.4k]
  ------------------
  378|  12.4k|	return mnote_pentax_tag_get_name (note->entries[n].tag);
  379|  12.4k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_title:
  383|  12.0k|{
  384|  12.0k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  385|       |
  386|  12.0k|	if (!note) return NULL;
  ------------------
  |  Branch (386:6): [True: 0, False: 12.0k]
  ------------------
  387|  12.0k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (387:6): [True: 0, False: 12.0k]
  ------------------
  388|  12.0k|	return mnote_pentax_tag_get_title (note->entries[n].tag);
  389|  12.0k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_description:
  393|  12.0k|{
  394|  12.0k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  395|       |	
  396|  12.0k|	if (!note) return NULL;
  ------------------
  |  Branch (396:6): [True: 0, False: 12.0k]
  ------------------
  397|  12.0k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (397:6): [True: 0, False: 12.0k]
  ------------------
  398|  12.0k|	return mnote_pentax_tag_get_description (note->entries[n].tag);
  399|  12.0k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_value:
   65|  12.0k|{
   66|  12.0k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
   67|       |
   68|  12.0k|	if (!n) return NULL;
  ------------------
  |  Branch (68:6): [True: 0, False: 12.0k]
  ------------------
   69|  12.0k|	if (n->count <= i) return NULL;
  ------------------
  |  Branch (69:6): [True: 0, False: 12.0k]
  ------------------
   70|  12.0k|	return mnote_pentax_entry_get_value (&n->entries[i], val, maxlen);
   71|  12.0k|}

mnote_pentax_entry_get_value:
  312|  12.0k|{
  313|  12.0k|	ExifLong vl;
  314|  12.0k|	ExifSLong vsl;
  315|  12.0k|	ExifShort vs, vs2;
  316|  12.0k|	ExifSShort vss;
  317|  12.0k|	int i = 0, j = 0;
  318|       |
  319|  12.0k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 12.0k]
  ------------------
  320|  12.0k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 12.0k]
  ------------------
  321|       |
  322|  12.0k|	memset (val, 0, maxlen);
  323|  12.0k|	maxlen--;
  324|       |
  325|  12.0k|	switch (entry->tag) {
  326|    385|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 385, False: 11.6k]
  ------------------
  327|    698|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 313, False: 11.7k]
  ------------------
  328|    930|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 232, False: 11.8k]
  ------------------
  329|  1.19k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 263, False: 11.8k]
  ------------------
  330|  1.40k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 209, False: 11.8k]
  ------------------
  331|  1.62k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 218, False: 11.8k]
  ------------------
  332|  1.99k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 372, False: 11.7k]
  ------------------
  333|  2.19k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 202, False: 11.8k]
  ------------------
  334|  2.32k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 128, False: 11.9k]
  ------------------
  335|  2.56k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 245, False: 11.8k]
  ------------------
  336|  2.90k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 340, False: 11.7k]
  ------------------
  337|  3.21k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 310, False: 11.7k]
  ------------------
  338|  3.52k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 309, False: 11.7k]
  ------------------
  339|  3.82k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 301, False: 11.7k]
  ------------------
  340|  3.92k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 101, False: 11.9k]
  ------------------
  341|  4.22k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 298, False: 11.7k]
  ------------------
  342|  4.43k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 210, False: 11.8k]
  ------------------
  343|  4.92k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 484, False: 11.5k]
  ------------------
  344|  5.48k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 569, False: 11.5k]
  ------------------
  345|  5.83k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 350, False: 11.7k]
  ------------------
  346|  5.83k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  5.83k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  5.83k|{                                                               \
  |  |   39|  5.83k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 2.90k, False: 2.93k]
  |  |  ------------------
  |  |   40|  2.90k|		snprintf (v, maxlen,	                        \
  |  |   41|  2.90k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.90k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  2.90k|			"expected '%s'."),                      \
  |  |   43|  2.90k|			exif_format_get_name (format),          \
  |  |   44|  2.90k|			exif_format_get_name (target));         \
  |  |   45|  2.90k|		break;                                          \
  |  |   46|  2.90k|	}                                                       \
  |  |   47|  5.83k|}
  ------------------
  347|  2.93k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  2.93k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  2.93k|{                                                                       \
  |  |   61|  2.93k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.01k, False: 1.92k]
  |  |  |  Branch (61:24): [True: 108, False: 907]
  |  |  ------------------
  |  |   62|    108|		snprintf (v, maxlen,                                    \
  |  |   63|    108|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    108|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    108|			"expected %i or %i)."), (int) number,		\
  |  |   65|    108|			(int) t1, (int) t2);  				\
  |  |   66|    108|		break;                                                  \
  |  |   67|    108|	}                                                               \
  |  |   68|  2.93k|}
  ------------------
  348|  2.83k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 1.92k, False: 907]
  ------------------
  349|  1.92k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  24.7k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 24.7k, False: 0]
  |  Branch (352:33): [True: 22.8k, False: 1.92k]
  ------------------
  353|  1.92k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 1.92k]
  ------------------
  354|      0|				snprintf (val, maxlen,
  355|      0|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  356|      0|			  	break;
  357|      0|			}
  358|       |
  359|       |			/* find the value */
  360|  11.4k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 10.2k, False: 1.17k]
  ------------------
  361|  10.2k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 9.49k, False: 753]
  ------------------
  362|  1.92k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.36k, False: 558]
  ------------------
  363|  1.36k|				snprintf (val, maxlen,
  364|  1.36k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.36k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.36k|				break;
  366|  1.36k|			}
  367|    558|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    558|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|    907|		} else {
  369|       |			/* Two-component values */
  370|    907|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|    907|#define CF(format,target,v,maxlen)                              \
  |  |   38|    907|{                                                               \
  |  |   39|    907|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 907]
  |  |  ------------------
  |  |   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|    907|}
  ------------------
  371|    907|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|    907|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    907|{                                                                       \
  |  |   61|    907|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 907, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 907]
  |  |  ------------------
  |  |   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|    907|}
  ------------------
  372|    907|			vs = exif_get_short (entry->data, entry->order);
  373|    907|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  1.88k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.50k, False: 380]
  |  Branch (376:34): [True: 973, False: 527]
  ------------------
  377|    907|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 380, False: 527]
  ------------------
  378|    380|				snprintf (val, maxlen,
  379|    380|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    380|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    380|			  	break;
  381|    380|			}
  382|       |
  383|       |			/* find the value */
  384|  1.91k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 1.91k, False: 0]
  |  Branch (384:45): [True: 0, False: 1.91k]
  ------------------
  385|  1.91k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.65k, False: 265]
  |  Branch (385:46): [True: 1.39k, False: 262]
  ------------------
  386|    527|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 275, False: 252]
  |  Branch (386:44): [True: 0, False: 252]
  ------------------
  387|    275|				snprintf (val, maxlen,
  388|    275|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    275|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    275|				break;
  390|    275|			}
  391|    252|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    252|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    252|		}
  393|    810|		break;
  394|       |
  395|    810|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 588, False: 11.4k]
  ------------------
  396|    588|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    588|#define CF(format,target,v,maxlen)                              \
  |  |   38|    588|{                                                               \
  |  |   39|    588|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 110, False: 478]
  |  |  ------------------
  |  |   40|    110|		snprintf (v, maxlen,	                        \
  |  |   41|    110|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    110|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    110|			"expected '%s'."),                      \
  |  |   43|    110|			exif_format_get_name (format),          \
  |  |   44|    110|			exif_format_get_name (target));         \
  |  |   45|    110|		break;                                          \
  |  |   46|    110|	}                                                       \
  |  |   47|    588|}
  ------------------
  397|    478|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    478|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    478|{                                                                       \
  |  |   51|    478|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 404, False: 74]
  |  |  ------------------
  |  |   52|    404|		snprintf (v, maxlen,                                    \
  |  |   53|    404|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    404|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    404|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    404|		break;                                                  \
  |  |   56|    404|	}                                                               \
  |  |   57|    478|}
  ------------------
  398|     74|		vl = exif_get_long (entry->data, entry->order);
  399|     74|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|     74|		break;
  401|    615|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 615, False: 11.4k]
  ------------------
  402|    615|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    615|#define CF(format,target,v,maxlen)                              \
  |  |   38|    615|{                                                               \
  |  |   39|    615|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 267, False: 348]
  |  |  ------------------
  |  |   40|    267|		snprintf (v, maxlen,	                        \
  |  |   41|    267|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    267|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    267|			"expected '%s'."),                      \
  |  |   43|    267|			exif_format_get_name (format),          \
  |  |   44|    267|			exif_format_get_name (target));         \
  |  |   45|    267|		break;                                          \
  |  |   46|    267|	}                                                       \
  |  |   47|    615|}
  ------------------
  403|    348|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    348|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    348|{                                                                       \
  |  |   51|    348|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 230, False: 118]
  |  |  ------------------
  |  |   52|    230|		snprintf (v, maxlen,                                    \
  |  |   53|    230|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    230|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    230|		break;                                                  \
  |  |   56|    230|	}                                                               \
  |  |   57|    348|}
  ------------------
  404|    118|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    118|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|    118|			entry->size);
  406|    118|		break;
  407|    294|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 294, False: 11.7k]
  ------------------
  408|    733|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 439, False: 11.6k]
  ------------------
  409|    733|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    733|#define CF(format,target,v,maxlen)                              \
  |  |   38|    733|{                                                               \
  |  |   39|    733|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 318, False: 415]
  |  |  ------------------
  |  |   40|    318|		snprintf (v, maxlen,	                        \
  |  |   41|    318|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    318|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    318|			"expected '%s'."),                      \
  |  |   43|    318|			exif_format_get_name (format),          \
  |  |   44|    318|			exif_format_get_name (target));         \
  |  |   45|    318|		break;                                          \
  |  |   46|    318|	}                                                       \
  |  |   47|    733|}
  ------------------
  410|    415|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    415|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    415|{                                                                       \
  |  |   51|    415|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 330, False: 85]
  |  |  ------------------
  |  |   52|    330|		snprintf (v, maxlen,                                    \
  |  |   53|    330|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    330|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    330|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    330|		break;                                                  \
  |  |   56|    330|	}                                                               \
  |  |   57|    415|}
  ------------------
  411|     85|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|     85|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 85]
  |  |  ------------------
  ------------------
  412|     85|		break;
  413|    685|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 685, False: 11.3k]
  ------------------
  414|    685|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    685|#define CF(format,target,v,maxlen)                              \
  |  |   38|    685|{                                                               \
  |  |   39|    685|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 253, False: 432]
  |  |  ------------------
  |  |   40|    253|		snprintf (v, maxlen,	                        \
  |  |   41|    253|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    253|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    253|			"expected '%s'."),                      \
  |  |   43|    253|			exif_format_get_name (format),          \
  |  |   44|    253|			exif_format_get_name (target));         \
  |  |   45|    253|		break;                                          \
  |  |   46|    253|	}                                                       \
  |  |   47|    685|}
  ------------------
  415|    432|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    432|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    432|{                                                                       \
  |  |   51|    432|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 226, False: 206]
  |  |  ------------------
  |  |   52|    226|		snprintf (v, maxlen,                                    \
  |  |   53|    226|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    226|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    226|		break;                                                  \
  |  |   56|    226|	}                                                               \
  |  |   57|    432|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|    206|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|    206|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|    206|		break;
  420|    738|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 738, False: 11.3k]
  ------------------
  421|    738|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    738|#define CF(format,target,v,maxlen)                              \
  |  |   38|    738|{                                                               \
  |  |   39|    738|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 301, False: 437]
  |  |  ------------------
  |  |   40|    301|		snprintf (v, maxlen,	                        \
  |  |   41|    301|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    301|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    301|			"expected '%s'."),                      \
  |  |   43|    301|			exif_format_get_name (format),          \
  |  |   44|    301|			exif_format_get_name (target));         \
  |  |   45|    301|		break;                                          \
  |  |   46|    301|	}                                                       \
  |  |   47|    738|}
  ------------------
  422|    437|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    437|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    437|{                                                                       \
  |  |   61|    437|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 330, False: 107]
  |  |  |  Branch (61:24): [True: 251, False: 79]
  |  |  ------------------
  |  |   62|    251|		snprintf (v, maxlen,                                    \
  |  |   63|    251|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    251|			"expected %i or %i)."), (int) number,		\
  |  |   65|    251|			(int) t1, (int) t2);  				\
  |  |   66|    251|		break;                                                  \
  |  |   67|    251|	}                                                               \
  |  |   68|    437|}
  ------------------
  423|    186|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    186|		break;
  425|  2.88k|	default:
  ------------------
  |  Branch (425:2): [True: 2.88k, False: 9.19k]
  ------------------
  426|  2.88k|		switch (entry->format) {
  427|    323|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 323, False: 2.55k]
  ------------------
  428|    323|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    323|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 90, False: 233]
  |  |  ------------------
  ------------------
  429|    323|		  break;
  430|    395|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 395, False: 2.48k]
  ------------------
  431|    395|		  {
  432|    395|			const unsigned char *data = entry->data;
  433|    395|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    395|			sizeleft = entry->size;
  436|  75.4k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 75.0k, False: 395]
  ------------------
  437|  75.0k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 75.0k]
  ------------------
  438|      0|					break;
  439|  75.0k|				vs = exif_get_short (data, entry->order);
  440|  75.0k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|  75.0k|				len = strlen(val);
  442|  75.0k|				data += 2;
  443|  75.0k|				sizeleft -= 2;
  444|  75.0k|			}
  445|    395|		  }
  446|    395|		  break;
  447|    565|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 565, False: 2.31k]
  ------------------
  448|    565|		  {
  449|    565|			const unsigned char *data = entry->data;
  450|    565|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    565|			sizeleft = entry->size;
  453|  29.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 28.7k, False: 565]
  ------------------
  454|  28.7k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 28.7k]
  ------------------
  455|      0|					break;
  456|  28.7k|				vss = exif_get_sshort (data, entry->order);
  457|  28.7k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  28.7k|				len = strlen(val);
  459|  28.7k|				data += 2;
  460|  28.7k|				sizeleft -= 2;
  461|  28.7k|			}
  462|    565|		  }
  463|    565|		  break;
  464|    464|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 464, False: 2.41k]
  ------------------
  465|    464|		  {
  466|    464|			const unsigned char *data = entry->data;
  467|    464|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    464|			sizeleft = entry->size;
  470|  35.7k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 35.2k, False: 464]
  ------------------
  471|  35.2k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 35.2k]
  ------------------
  472|      0|					break;
  473|  35.2k|				vl = exif_get_long (data, entry->order);
  474|  35.2k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  35.2k|				len = strlen(val);
  476|  35.2k|				data += 4;
  477|  35.2k|				sizeleft -= 4;
  478|  35.2k|			}
  479|    464|		  }
  480|    464|		  break;
  481|    614|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 614, False: 2.26k]
  ------------------
  482|    614|		  {
  483|    614|			const unsigned char *data = entry->data;
  484|    614|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    614|			sizeleft = entry->size;
  487|  42.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 41.7k, False: 614]
  ------------------
  488|  41.7k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 41.7k]
  ------------------
  489|      0|					break;
  490|  41.7k|				vsl = exif_get_slong (data, entry->order);
  491|  41.7k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  41.7k|				len = strlen(val);
  493|  41.7k|				data += 4;
  494|  41.7k|				sizeleft -= 4;
  495|  41.7k|			}
  496|    614|		  }
  497|    614|		  break;
  498|     12|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 12, False: 2.86k]
  ------------------
  499|    519|		default:
  ------------------
  |  Branch (499:3): [True: 507, False: 2.37k]
  ------------------
  500|    519|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    519|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    519|			  entry->size);
  502|    519|		  break;
  503|  2.88k|		}
  504|  2.88k|		break;
  505|  12.0k|	}
  506|       |
  507|  12.0k|	return val;
  508|  12.0k|}

mnote_pentax_tag_get_name:
  145|  31.1k|{
  146|  31.1k|	unsigned int i;
  147|       |
  148|  1.44M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (148:14): [True: 1.44M, False: 5.11k]
  ------------------
  149|  1.44M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (149:7): [True: 25.9k, False: 1.41M]
  ------------------
  150|  5.11k|	return NULL;
  151|  31.1k|}
mnote_pentax_tag_get_title:
  155|  12.0k|{
  156|  12.0k|	unsigned int i;
  157|       |
  158|  12.0k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  159|   412k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (159:14): [True: 412k, False: 0]
  ------------------
  160|   412k|		if (table[i].tag == t) {
  ------------------
  |  Branch (160:7): [True: 12.0k, False: 400k]
  ------------------
  161|  12.0k|			if (!table[i].title)
  ------------------
  |  Branch (161:8): [True: 0, False: 12.0k]
  ------------------
  162|      0|				return NULL;
  163|  12.0k|			return _(table[i].title);
  ------------------
  |  |   31|  12.0k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  164|  12.0k|		}
  165|      0|	return NULL;
  166|  12.0k|}
mnote_pentax_tag_get_description:
  170|  12.0k|{
  171|  12.0k|	unsigned int i;
  172|       |
  173|   412k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (173:14): [True: 412k, False: 0]
  ------------------
  174|   412k|		if (table[i].tag == t) {
  ------------------
  |  Branch (174:7): [True: 12.0k, False: 400k]
  ------------------
  175|  12.0k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (175:8): [True: 588, False: 11.4k]
  |  Branch (175:33): [True: 11.3k, False: 183]
  ------------------
  176|  11.8k|				return "";
  177|    183|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  178|    183|			return _(table[i].description);
  ------------------
  |  |   31|    183|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  179|  12.0k|		}
  180|      0|	return NULL;
  181|  12.0k|}

