_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|  52.4k|void data_func(ExifContent *content, void *user_data) {
   26|       |  exif_content_foreach_entry(content, content_func, NULL);
   27|  52.4k|}
LLVMFuzzerTestOneInput:
   56|  10.8k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   57|  10.8k|  ExifLoader *loader = exif_loader_new();
   58|  10.8k|  ExifData *exif_data;
   59|  10.8k|  if (!loader) {
  ------------------
  |  Branch (59:7): [True: 0, False: 10.8k]
  ------------------
   60|      0|    return 0;
   61|      0|  }
   62|  10.8k|  exif_loader_write(loader, const_cast<unsigned char*>(data), size);
   63|  10.8k|  exif_data = exif_loader_get_data(loader);
   64|  10.8k|  if(!exif_data) {
  ------------------
  |  Branch (64:6): [True: 372, False: 10.4k]
  ------------------
   65|    372|    exif_loader_unref(loader);
   66|    372|    return 0;
   67|    372|  }
   68|  10.4k|  exif_data_foreach_content(exif_data, data_func, NULL);
   69|  10.4k|  test_exif_data (exif_data);
   70|  10.4k|  exif_loader_unref(loader);
   71|  10.4k|  exif_data_unref(exif_data);
   72|  10.4k|  return 0;
   73|  10.8k|}
exif_loader_fuzzer.cc:_ZL14test_exif_dataP9_ExifData:
   30|  10.4k|test_exif_data (ExifData *d) {
   31|  10.4k|  unsigned int i, c;
   32|  10.4k|  char v[1024], *p;
   33|  10.4k|  ExifMnoteData *md;
   34|       |
   35|  10.4k|  md = exif_data_get_mnote_data (d);
   36|  10.4k|  if (!md) {
  ------------------
  |  Branch (36:7): [True: 3.58k, False: 6.90k]
  ------------------
   37|  3.58k|    return;
   38|  3.58k|  }
   39|       |
   40|  6.90k|  exif_mnote_data_ref (md);
   41|  6.90k|  exif_mnote_data_unref (md);
   42|       |
   43|  6.90k|  c = exif_mnote_data_count (md);
   44|  1.60M|  for (i = 0; i < c; i++) {
  ------------------
  |  Branch (44:15): [True: 1.60M, False: 4.66k]
  ------------------
   45|  1.60M|    const char *name = exif_mnote_data_get_name (md, i);
   46|  1.60M|    if (!name) {
  ------------------
  |  Branch (46:9): [True: 2.23k, False: 1.59M]
  ------------------
   47|  2.23k|      break;
   48|  2.23k|    }
   49|  1.59M|    exif_mnote_data_get_title (md, i);
   50|  1.59M|    exif_mnote_data_get_description (md, i);
   51|  1.59M|    exif_mnote_data_get_value (md, i, v, sizeof (v));
   52|  1.59M|  }
   53|  6.90k|}

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

mnote_canon_entry_count_values:
  505|   148M|{
  506|   148M|	unsigned int  val;
  507|       |
  508|   148M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 148M]
  ------------------
  509|       |
  510|   148M|	switch (entry->tag) {
  511|   196k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 196k, False: 148M]
  ------------------
  512|   197k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 598, False: 148M]
  ------------------
  513|   197k|		return entry->components;
  514|  2.06M|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 2.06M, False: 146M]
  ------------------
  515|  3.20M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.13M, False: 147M]
  ------------------
  516|   144M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 141M, False: 7.11M]
  ------------------
  517|   144M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 83.0k, False: 148M]
  ------------------
  518|   144M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 45.0k, False: 144M]
  ------------------
  519|       |
  520|   144M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|   144M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|   144M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 135M, False: 9.49M]
  |  |  ------------------
  ------------------
  523|  3.63M|	default:
  ------------------
  |  Branch (523:2): [True: 3.63M, False: 145M]
  ------------------
  524|  3.63M|		return 1;
  525|   148M|	}
  526|   148M|}
mnote_canon_entry_get_value:
  552|  1.52M|{
  553|  1.52M|	char buf[128];
  554|  1.52M|	ExifLong vl;
  555|  1.52M|	ExifSLong vsl;
  556|  1.52M|	ExifShort vs, n;
  557|  1.52M|	ExifSShort vss;
  558|  1.52M|	unsigned char *data;
  559|  1.52M|	size_t	size;
  560|  1.52M|	double d;
  561|       |
  562|  1.52M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.52M]
  ------------------
  563|      0|		return NULL;
  564|  1.52M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.52M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.52M|	data = entry->data;
  568|  1.52M|	size = entry->size;
  569|       |
  570|  1.52M|	memset (val, 0, maxlen);
  571|  1.52M|	maxlen--;
  572|       |
  573|  1.52M|	switch (entry->tag) {
  574|  2.47k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 2.47k, False: 1.52M]
  ------------------
  575|  2.47k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.47k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.47k|{                                                               \
  |  |   38|  2.47k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.47k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  2.47k|}
  ------------------
  576|       |
  577|  2.47k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 2.47k]
  ------------------
  578|  2.47k|		n = exif_get_short (data, entry->order) / 2;
  579|  2.47k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 2.47k]
  ------------------
  580|       |
  581|  2.47k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.47k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.47k|{                                                                       \
  |  |   50|  2.47k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 360, False: 2.11k]
  |  |  ------------------
  |  |   51|    360|                snprintf (v, maxlen,                                    \
  |  |   52|    360|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    360|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    360|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    360|                break;                                                  \
  |  |   55|    360|        }                                                               \
  |  |   56|  2.47k|}
  ------------------
  582|       |
  583|  2.11k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.11k]
  ------------------
  584|  2.11k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.11k|		switch (t) {
  586|    428|		case 1:
  ------------------
  |  Branch (586:3): [True: 428, False: 1.68k]
  ------------------
  587|    428|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 198, False: 230]
  ------------------
  588|    198|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    198|				break;
  590|    198|			}
  591|    230|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    230|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.11k]
  ------------------
  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.11k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.11k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.11k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.11k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.11k]
  ------------------
  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.11k]
  ------------------
  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.11k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.11k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.11k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  1.68k|		default:
  ------------------
  |  Branch (621:3): [True: 1.68k, False: 428]
  ------------------
  622|  1.68k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.11k|		}
  624|  2.11k|		break;
  625|       |
  626|  2.11k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.76k, False: 1.52M]
  ------------------
  627|  1.76k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.76k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.76k|{                                                               \
  |  |   38|  1.76k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 394, False: 1.36k]
  |  |  ------------------
  |  |   39|    394|                snprintf (v, maxlen,                            \
  |  |   40|    394|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    394|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    394|                        "expected '%s'."),                      \
  |  |   42|    394|                        exif_format_get_name (format),          \
  |  |   43|    394|                        exif_format_get_name (target));         \
  |  |   44|    394|                break;                                          \
  |  |   45|    394|        }                                                       \
  |  |   46|  1.76k|}
  ------------------
  628|  1.36k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.36k]
  ------------------
  629|  1.36k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.36k|		switch (t) {
  631|    343|		case 1:
  ------------------
  |  Branch (631:3): [True: 343, False: 1.02k]
  ------------------
  632|    343|			snprintf (val, maxlen, "%u", vs);
  633|    343|			break;
  634|    339|		case 2:
  ------------------
  |  Branch (634:3): [True: 339, False: 1.02k]
  ------------------
  635|    675|		case 3:
  ------------------
  |  Branch (635:3): [True: 336, False: 1.03k]
  ------------------
  636|    675|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    675|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    675|			break;
  638|    350|		default:
  ------------------
  |  Branch (638:3): [True: 350, False: 1.01k]
  ------------------
  639|    350|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.36k|		}
  641|  1.36k|		break;
  642|       |
  643|  6.79k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 6.79k, False: 1.51M]
  ------------------
  644|  6.79k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  6.79k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  6.79k|{                                                               \
  |  |   38|  6.79k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 6.79k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  6.79k|}
  ------------------
  645|  6.79k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 6.79k]
  ------------------
  646|  6.79k|		n = exif_get_short (data, entry->order) / 2;
  647|  6.79k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 6.79k]
  ------------------
  648|  6.79k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  6.79k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  6.79k|{                                                                       \
  |  |   50|  6.79k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.36k, False: 5.42k]
  |  |  ------------------
  |  |   51|  1.36k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.36k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.36k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.36k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.36k|                break;                                                  \
  |  |   55|  1.36k|        }                                                               \
  |  |   56|  6.79k|}
  ------------------
  649|  5.42k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 5.42k]
  ------------------
  650|  5.42k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  5.42k|		switch (t) {
  652|    630|		case 0:
  ------------------
  |  Branch (652:3): [True: 630, False: 4.79k]
  ------------------
  653|    630|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    630|			break;
  655|    630|		case 1:
  ------------------
  |  Branch (655:3): [True: 630, False: 4.79k]
  ------------------
  656|    630|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    630|			break;
  658|    630|		case 2:
  ------------------
  |  Branch (658:3): [True: 630, False: 4.79k]
  ------------------
  659|  1.19k|		case 5:
  ------------------
  |  Branch (659:3): [True: 568, False: 4.85k]
  ------------------
  660|  1.19k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 5.42k]
  ------------------
  661|  1.19k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 5.42k]
  ------------------
  662|  1.19k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.19k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.19k|			break;
  664|    629|		case 3:
  ------------------
  |  Branch (664:3): [True: 629, False: 4.79k]
  ------------------
  665|    629|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 5.42k]
  ------------------
  666|    629|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    629|			break;
  668|    629|		case 4:
  ------------------
  |  Branch (668:3): [True: 629, False: 4.79k]
  ------------------
  669|    629|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 5.42k]
  ------------------
  670|    629|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    629|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 400, False: 229]
  ------------------
  672|    400|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    400|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    229|			else
  674|    229|				snprintf (val, maxlen, "%.0f", d);
  675|    629|			break;
  676|    566|		case 8:
  ------------------
  |  Branch (676:3): [True: 566, False: 4.85k]
  ------------------
  677|    566|			snprintf (val, maxlen, "%u", vss);
  678|    566|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 5.42k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 5.42k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 5.42k]
  ------------------
  684|      0|			snprintf (val, maxlen, _("%u mm"), vss);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  685|      0|			break;
  686|      0|		case 28:
  ------------------
  |  Branch (686:3): [True: 0, False: 5.42k]
  ------------------
  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.14k|		default:
  ------------------
  |  Branch (693:3): [True: 1.14k, False: 4.28k]
  ------------------
  694|  1.14k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  5.42k|		}
  696|  5.42k|		break;
  697|       |
  698|  5.42k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.52M]
  ------------------
  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|    496|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 496, False: 1.52M]
  ------------------
  706|    496|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    496|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    496|{                                                                       \
  |  |   50|    496|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 274, False: 222]
  |  |  ------------------
  |  |   51|    274|                snprintf (v, maxlen,                                    \
  |  |   52|    274|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    274|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    274|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    274|                break;                                                  \
  |  |   55|    274|        }                                                               \
  |  |   56|    496|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    691|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 469, False: 1.52M]
  ------------------
  710|    691|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    691|#define CF(format,target,v,maxlen)                              \
  |  |   37|    691|{                                                               \
  |  |   38|    691|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 286, False: 405]
  |  |  ------------------
  |  |   39|    286|                snprintf (v, maxlen,                            \
  |  |   40|    286|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    286|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    286|                        "expected '%s'."),                      \
  |  |   42|    286|                        exif_format_get_name (format),          \
  |  |   43|    286|                        exif_format_get_name (target));         \
  |  |   44|    286|                break;                                          \
  |  |   45|    286|        }                                                       \
  |  |   46|    691|}
  ------------------
  711|    405|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    405|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 129, False: 276]
  |  |  ------------------
  ------------------
  712|    405|		break;
  713|       |
  714|    787|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 787, False: 1.52M]
  ------------------
  715|    787|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    787|#define CF(format,target,v,maxlen)                              \
  |  |   37|    787|{                                                               \
  |  |   38|    787|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 320, False: 467]
  |  |  ------------------
  |  |   39|    320|                snprintf (v, maxlen,                            \
  |  |   40|    320|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    320|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    320|                        "expected '%s'."),                      \
  |  |   42|    320|                        exif_format_get_name (format),          \
  |  |   43|    320|                        exif_format_get_name (target));         \
  |  |   44|    320|                break;                                          \
  |  |   45|    320|        }                                                       \
  |  |   46|    787|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    467|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    467|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 85, False: 382]
  |  |  ------------------
  ------------------
  718|    467|		break;
  719|       |
  720|    772|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 772, False: 1.52M]
  ------------------
  721|    772|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    772|#define CF(format,target,v,maxlen)                              \
  |  |   37|    772|{                                                               \
  |  |   38|    772|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 140, False: 632]
  |  |  ------------------
  |  |   39|    140|                snprintf (v, maxlen,                            \
  |  |   40|    140|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    140|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    140|                        "expected '%s'."),                      \
  |  |   42|    140|                        exif_format_get_name (format),          \
  |  |   43|    140|                        exif_format_get_name (target));         \
  |  |   44|    140|                break;                                          \
  |  |   45|    140|        }                                                       \
  |  |   46|    772|}
  ------------------
  722|    632|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    632|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    632|{                                                                       \
  |  |   50|    632|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 421, False: 211]
  |  |  ------------------
  |  |   51|    421|                snprintf (v, maxlen,                                    \
  |  |   52|    421|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    421|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    421|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    421|                break;                                                  \
  |  |   55|    421|        }                                                               \
  |  |   56|    632|}
  ------------------
  723|    211|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 211]
  ------------------
  724|    211|		vl = exif_get_long (data, entry->order);
  725|    211|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    211|				(unsigned long) vl/10000,
  727|    211|				(unsigned long) vl%10000);
  728|    211|		break;
  729|       |
  730|    808|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 808, False: 1.52M]
  ------------------
  731|    808|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    808|#define CF(format,target,v,maxlen)                              \
  |  |   37|    808|{                                                               \
  |  |   38|    808|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 339, False: 469]
  |  |  ------------------
  |  |   39|    339|                snprintf (v, maxlen,                            \
  |  |   40|    339|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    339|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    339|                        "expected '%s'."),                      \
  |  |   42|    339|                        exif_format_get_name (format),          \
  |  |   43|    339|                        exif_format_get_name (target));         \
  |  |   44|    339|                break;                                          \
  |  |   45|    339|        }                                                       \
  |  |   46|    808|}
  ------------------
  732|    469|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    469|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    469|{                                                                       \
  |  |   50|    469|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 196, False: 273]
  |  |  ------------------
  |  |   51|    196|                snprintf (v, maxlen,                                    \
  |  |   52|    196|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    196|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    196|                break;                                                  \
  |  |   55|    196|        }                                                               \
  |  |   56|    469|}
  ------------------
  733|    273|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 273]
  ------------------
  734|    273|		vl = exif_get_long (data, entry->order);
  735|    273|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|    273|		break;
  737|       |
  738|  1.50M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.50M, False: 19.0k]
  ------------------
  739|  1.50M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.50M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.50M|{                                                               \
  |  |   38|  1.50M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.50M]
  |  |  ------------------
  |  |   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.50M|}
  ------------------
  740|  1.50M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.50M]
  ------------------
  741|  1.50M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.50M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.50M]
  ------------------
  743|  1.50M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.50M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.50M|{                                                                       \
  |  |   50|  1.50M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.48M, False: 23.1k]
  |  |  ------------------
  |  |   51|  1.48M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.48M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.48M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.48M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.48M|                break;                                                  \
  |  |   55|  1.48M|        }                                                               \
  |  |   56|  1.50M|}
  ------------------
  744|  23.1k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 23.1k]
  ------------------
  745|  23.1k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  23.1k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  23.1k|		strncat (val, buf, maxlen - strlen (val));
  748|  23.1k|		break;
  749|       |
  750|  2.66k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.66k, False: 1.52M]
  ------------------
  751|  2.66k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.66k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.66k|{                                                               \
  |  |   38|  2.66k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.66k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  2.66k|}
  ------------------
  752|  2.66k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.66k]
  ------------------
  753|  2.66k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.66k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.66k]
  ------------------
  755|  2.66k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.66k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.66k|{                                                                       \
  |  |   50|  2.66k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 610, False: 2.05k]
  |  |  ------------------
  |  |   51|    610|                snprintf (v, maxlen,                                    \
  |  |   52|    610|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    610|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    610|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    610|                break;                                                  \
  |  |   55|    610|        }                                                               \
  |  |   56|  2.66k|}
  ------------------
  756|  2.05k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 2.05k]
  ------------------
  757|  2.05k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  2.05k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  2.05k|		break;
  760|       |
  761|  2.04k|	default:
  ------------------
  |  Branch (761:2): [True: 2.04k, False: 1.52M]
  ------------------
  762|  2.04k|		switch (entry->format) {
  763|    191|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 191, False: 1.85k]
  ------------------
  764|    191|		  {
  765|    191|			size_t i, len = strlen(val);
  766|  55.1k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 54.9k, False: 191]
  ------------------
  767|  54.9k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 54.9k]
  ------------------
  768|      0|					break;
  769|  54.9k|				vs = exif_get_short (data, entry->order);
  770|  54.9k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  54.9k|				len = strlen(val);
  772|  54.9k|				data += 2;
  773|  54.9k|				size -= 2;
  774|  54.9k|			}
  775|    191|		  }
  776|    191|		  break;
  777|    255|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 255, False: 1.78k]
  ------------------
  778|    255|		  {
  779|    255|			size_t i, len = strlen(val);
  780|  24.3k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 24.1k, False: 255]
  ------------------
  781|  24.1k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 24.1k]
  ------------------
  782|      0|					break;
  783|  24.1k|				vss = exif_get_sshort (data, entry->order);
  784|  24.1k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  24.1k|				data += 2;
  786|  24.1k|				size -= 2;
  787|  24.1k|			}
  788|    255|		  }
  789|    255|		  break;
  790|    318|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 318, False: 1.72k]
  ------------------
  791|    318|		  {
  792|    318|			size_t i, len = strlen(val);
  793|  35.6k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 35.3k, False: 318]
  ------------------
  794|  35.3k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 35.3k]
  ------------------
  795|      0|					break;
  796|  35.3k|				vl = exif_get_long (data, entry->order);
  797|  35.3k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  35.3k|				data += 4;
  799|  35.3k|				size -= 4;
  800|  35.3k|			}
  801|    318|		  }
  802|    318|		  break;
  803|    296|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 296, False: 1.74k]
  ------------------
  804|    296|		  {
  805|    296|			size_t i, len = strlen(val);
  806|  45.0k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 44.7k, False: 296]
  ------------------
  807|  44.7k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 44.7k]
  ------------------
  808|      0|					break;
  809|  44.7k|				vsl = exif_get_slong (data, entry->order);
  810|  44.7k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  44.7k|				data += 4;
  812|  44.7k|				size -= 4;
  813|  44.7k|			}
  814|    296|		  }
  815|    296|		  break;
  816|    745|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 745, False: 1.29k]
  ------------------
  817|    745|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    745|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 51, False: 694]
  |  |  ------------------
  ------------------
  818|    745|			break;
  819|    237|		default:
  ------------------
  |  Branch (819:3): [True: 237, False: 1.80k]
  ------------------
  820|    237|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    237|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    237|			  entry->size);
  822|    237|		  break;
  823|  2.04k|		}
  824|  2.04k|		break;
  825|  1.52M|	}
  826|  1.52M|	return val;
  827|  1.52M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  5.22k|{
  445|  5.22k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  75.0k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 74.1k, False: 910]
  |  Branch (448:32): [True: 56.0k, False: 18.1k]
  ------------------
  449|  70.9k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 15.6k, False: 2.45k]
  |  Branch (449:31): [True: 14.9k, False: 701]
  ------------------
  450|  70.9k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 14.9k, False: 56.0k]
  |  Branch (450:33): [True: 1.16k, False: 13.7k]
  ------------------
  451|  1.16k|			break;
  452|  1.16k|		}
  453|  70.9k|	}
  454|  5.22k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.21k, False: 3.01k]
  |  Branch (454:32): [True: 1.16k, False: 1.04k]
  |  Branch (454:58): [True: 1.16k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.16k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.16k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.06k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.06k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.06k|	}
  461|  5.22k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    629|{
  535|    629|	return pow (2, x / 2.);
  536|    629|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    630|{
  547|    630|	return 3.125 * pow (2, x);
  548|    630|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    629|{
  541|    629|	return 1.0 / pow (2, x);
  542|    629|}

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

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

exif_data_get_mnote_data:
   93|  10.4k|{
   94|  10.4k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 10.4k, False: 0]
  |  Branch (94:15): [True: 10.4k, False: 0]
  ------------------
   95|  10.4k|}
exif_data_new_mem:
  110|  10.4k|{
  111|  10.4k|	ExifData *data;
  112|  10.4k|	unsigned int i;
  113|       |
  114|  10.4k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 10.4k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  10.4k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  10.4k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 10.4k]
  ------------------
  119|      0|		return (NULL);
  120|  10.4k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  10.4k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 10.4k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  10.4k|	data->priv->ref_count = 1;
  126|       |
  127|  10.4k|	data->priv->mem = mem;
  128|  10.4k|	exif_mem_ref (mem);
  129|       |
  130|  62.8k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 52.4k, False: 10.4k]
  ------------------
  131|  52.4k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  52.4k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 52.4k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  52.4k|		data->ifd[i]->parent = data;
  137|  52.4k|	}
  138|       |
  139|       |	/* Default options */
  140|  10.4k|#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.4k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  10.4k|#endif
  147|  10.4k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  10.4k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  10.4k|	return (data);
  153|  10.4k|}
exif_data_load_data:
  858|  10.4k|{
  859|  10.4k|	unsigned int l;
  860|  10.4k|	ExifLong offset;
  861|  10.4k|	ExifShort n;
  862|  10.4k|	const unsigned char *d = d_orig;
  863|  10.4k|	unsigned int len, fullds;
  864|       |
  865|  10.4k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 10.4k]
  |  Branch (865:15): [True: 0, False: 10.4k]
  |  Branch (865:30): [True: 0, False: 10.4k]
  |  Branch (865:36): [True: 0, False: 10.4k]
  ------------------
  866|      0|		return;
  867|       |
  868|  10.4k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  10.4k|		  "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.4k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 25, False: 10.4k]
  ------------------
  876|     25|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     25|#define LOG_TOO_SMALL \
  |  |  852|     25|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     25|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     25|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     25|		return;
  878|     25|	}
  879|  10.4k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 10.2k, False: 178]
  ------------------
  880|  10.2k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  10.2k|			  "Found EXIF header at start.");
  882|  10.2k|	} else {
  883|  1.15k|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 1.13k, False: 18]
  ------------------
  884|  1.53k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.52k, False: 7]
  |  Branch (884:17): [True: 393, False: 1.13k]
  ------------------
  885|    393|				d++;
  886|    393|				ds--;
  887|    393|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|  1.13k|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|  1.13k|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 1.13k, False: 7]
  |  Branch (890:14): [True: 434, False: 696]
  ------------------
  891|    434|				d++;
  892|    434|				ds--;
  893|    434|				continue;
  894|    434|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    703|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    696|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 696, False: 7]
  |  Branch (897:14): [True: 398, False: 298]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    398|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 359, False: 39]
  |  Branch (904:22): [True: 57, False: 302]
  ------------------
  905|     57|					break;
  906|       |				/* fallthrough */
  907|    398|			}
  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|    646|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 635, False: 11]
  |  Branch (913:19): [True: 582, False: 53]
  |  Branch (913:35): [True: 577, False: 5]
  ------------------
  914|    577|				d++;
  915|    577|				ds--;
  916|    577|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    577|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 34, False: 543]
  ------------------
  918|     34|					return;
  919|    543|				d += l;
  920|    543|				ds -= l;
  921|    543|				continue;
  922|    577|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     69|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     69|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     69|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     69|			return;
  928|    646|		}
  929|     75|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 18, False: 57]
  ------------------
  930|     18|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     18|#define LOG_TOO_SMALL \
  |  |  852|     18|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     18|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     18|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     18|			return;
  932|     18|		}
  933|     57|		d++;
  934|     57|		ds--;
  935|     57|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     57|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 39, False: 18]
  ------------------
  937|     39|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     39|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     39|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     39|			return;
  940|     39|		}
  941|     18|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 2, False: 16]
  ------------------
  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|     16|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     16|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     16|			  len);
  949|     16|		d += 2;
  950|     16|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     16|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  10.2k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 3, False: 10.2k]
  ------------------
  958|      3|		LOG_TOO_SMALL;
  ------------------
  |  |  851|      3|#define LOG_TOO_SMALL \
  |  |  852|      3|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|      3|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      3|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  959|      3|		return;
  960|      3|	}
  961|  10.2k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 10.2k]
  ------------------
  962|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  963|      0|			  "ExifData", _("EXIF header not found."));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  964|      0|		return;
  965|      0|	}
  966|       |
  967|  10.2k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  10.2k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  10.2k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 46, False: 10.2k]
  ------------------
  972|     46|		return;
  973|       |
  974|       |	/* The JPEG APP1 section can be no longer than 64 KiB (including a
  975|       |	   16-bit length), so cap the data length to protect against overflow
  976|       |	   in future offset calculations */
  977|  10.2k|	fullds = ds;
  978|  10.2k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 10, False: 10.2k]
  ------------------
  979|     10|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  10.2k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 7.82k, False: 2.41k]
  ------------------
  983|  7.82k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.41k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 2.35k, False: 63]
  ------------------
  985|  2.35k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
  986|     63|	else {
  987|     63|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  988|     63|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     63|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  989|     63|		return;
  990|     63|	}
  991|       |
  992|       |	/* Fixed value */
  993|  10.1k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 21, False: 10.1k]
  ------------------
  994|     21|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  10.1k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  10.1k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  10.1k|		  "IFD 0 at %i.", (int) offset);
 1000|       |
 1001|       |	/* ds is restricted to 16 bit above, so offset is restricted too, and offset+8 should not overflow. */
 1002|  10.1k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 55, False: 10.1k]
  |  Branch (1002:21): [True: 7, False: 10.1k]
  ------------------
 1003|     62|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  10.1k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  10.1k|	n = exif_get_short (d + 6 + offset, data->priv->order);
 1010|       |	/* offset < 2<<16, n is 16 bit at most, so this op will not overflow */
 1011|  10.1k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 1.95k, False: 8.14k]
  ------------------
 1012|  1.95k|		return;
 1013|       |
 1014|  8.14k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  8.14k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 7.98k, False: 159]
  ------------------
 1016|  7.98k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  7.98k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  7.98k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.80k, False: 6.18k]
  ------------------
 1021|  1.80k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.80k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  6.18k|		} else {
 1024|  6.18k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  6.18k|		}
 1026|  7.98k|	}
 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.14k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  8.14k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 8.14k, False: 0]
  ------------------
 1038|  8.14k|		exif_data_fix (data);
 1039|  8.14k|}
exif_data_unref:
 1111|  10.4k|{
 1112|  10.4k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 10.4k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  10.4k|	data->priv->ref_count--;
 1116|  10.4k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 10.4k, False: 0]
  ------------------
 1117|  10.4k|		exif_data_free (data);
 1118|  10.4k|}
exif_data_free:
 1122|  10.4k|{
 1123|  10.4k|	unsigned int i;
 1124|  10.4k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 10.4k, False: 0]
  |  Branch (1124:26): [True: 10.4k, False: 0]
  ------------------
 1125|       |
 1126|  10.4k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 10.4k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  62.8k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 52.4k, False: 10.4k]
  ------------------
 1130|  52.4k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 52.4k, False: 0]
  ------------------
 1131|  52.4k|			exif_content_unref (data->ifd[i]);
 1132|  52.4k|			data->ifd[i] = NULL;
 1133|  52.4k|		}
 1134|  52.4k|	}
 1135|       |
 1136|  10.4k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 183, False: 10.3k]
  ------------------
 1137|    183|		exif_mem_free (mem, data->data);
 1138|    183|		data->data = NULL;
 1139|    183|	}
 1140|       |
 1141|  10.4k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 10.4k, False: 0]
  ------------------
 1142|  10.4k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 10.4k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  10.4k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 6.90k, False: 3.58k]
  ------------------
 1147|  6.90k|			exif_mnote_data_unref (data->priv->md);
 1148|  6.90k|			data->priv->md = NULL;
 1149|  6.90k|		}
 1150|  10.4k|		exif_mem_free (mem, data->priv);
 1151|  10.4k|		exif_mem_free (mem, data);
 1152|  10.4k|	}
 1153|       |
 1154|  10.4k|	exif_mem_unref (mem);
 1155|  10.4k|}
exif_data_get_byte_order:
 1186|   155k|{
 1187|   155k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 155k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   155k|	return (data->priv->order);
 1191|   155k|}
exif_data_foreach_content:
 1196|  18.6k|{
 1197|  18.6k|	unsigned int i;
 1198|       |
 1199|  18.6k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 18.6k]
  |  Branch (1199:15): [True: 0, False: 18.6k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   111k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 93.1k, False: 18.6k]
  ------------------
 1203|  93.1k|		func (data->ifd[i], user_data);
 1204|  18.6k|}
exif_data_log:
 1246|  10.4k|{
 1247|  10.4k|	unsigned int i;
 1248|       |
 1249|  10.4k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 10.4k]
  |  Branch (1249:15): [True: 0, False: 10.4k]
  ------------------
 1250|      0|		return;
 1251|  10.4k|	exif_log_unref (data->priv->log);
 1252|  10.4k|	data->priv->log = log;
 1253|  10.4k|	exif_log_ref (log);
 1254|       |
 1255|  62.8k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 52.4k, False: 10.4k]
  ------------------
 1256|  52.4k|		exif_content_log (data->ifd[i], log);
 1257|  10.4k|}
exif_data_get_log:
 1263|  50.8k|{
 1264|  50.8k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 50.8k]
  |  Branch (1264:15): [True: 0, False: 50.8k]
  ------------------
 1265|      0|		return NULL;
 1266|  50.8k|	return data->priv->log;
 1267|  50.8k|}
exif_data_set_option:
 1309|  20.9k|{
 1310|  20.9k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 20.9k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  20.9k|	d->priv->options |= o;
 1314|  20.9k|}
exif_data_fix:
 1355|  8.14k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  8.14k|}
exif_data_set_data_type:
 1361|  10.4k|{
 1362|  10.4k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 10.4k]
  |  Branch (1362:12): [True: 0, False: 10.4k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  10.4k|	d->priv->data_type = dt;
 1366|  10.4k|}
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|  37.2M|{
  402|  37.2M|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  403|  37.2M|	ExifShort n;
  404|  37.2M|	ExifEntry *entry;
  405|  37.2M|	unsigned int i;
  406|  37.2M|	ExifTag tag;
  407|       |
  408|  37.2M|	if (!data || !data->priv) 
  ------------------
  |  Branch (408:6): [True: 0, False: 37.2M]
  |  Branch (408:15): [True: 0, False: 37.2M]
  ------------------
  409|      0|		return;
  410|       |
  411|       |	/* check for valid ExifIfd enum range */
  412|  37.2M|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (412:6): [True: 0, False: 37.2M]
  |  Branch (412:26): [True: 0, False: 37.2M]
  ------------------
  413|      0|	  return;
  414|       |
  415|  37.2M|	if (recursion_cost > 170) {
  ------------------
  |  Branch (415:6): [True: 34.6M, False: 2.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.6M|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  428|  34.6M|			  "Deep/expensive recursion detected!");
  429|  34.6M|		return;
  430|  34.6M|	}
  431|       |
  432|       |	/* Read the number of entries */
  433|  2.62M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  2.62M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 3, False: 2.62M]
  |  |  |  Branch (53:81): [True: 0, False: 2.62M]
  |  |  |  Branch (53:112): [True: 701, False: 2.62M]
  |  |  ------------------
  ------------------
  434|    704|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|    704|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|    704|		return;
  437|    704|	}
  438|  2.62M|	n = exif_get_short (d + offset, data->priv->order);
  439|  2.62M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  2.62M|	          "Loading %hu entries...", n);
  441|  2.62M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  2.62M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  2.62M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 330, False: 2.62M]
  |  |  |  Branch (53:81): [True: 2.60M, False: 22.0k]
  |  |  |  Branch (53:112): [True: 4.35k, False: 17.6k]
  |  |  ------------------
  ------------------
  445|  2.60M|		n = (ds - offset) / 12;
  446|  2.60M|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  447|  2.60M|				  "Short data; only loading %hu entries...", n);
  448|  2.60M|	}
  449|       |
  450|   112M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (450:14): [True: 110M, False: 2.62M]
  ------------------
  451|       |
  452|   110M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   110M|		switch (tag) {
  454|  1.21M|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 1.21M, False: 108M]
  ------------------
  455|  36.2M|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (455:3): [True: 35.0M, False: 75.0M]
  ------------------
  456|  71.6M|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (456:3): [True: 35.4M, False: 74.6M]
  ------------------
  457|  71.6M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (457:3): [True: 7.86k, False: 110M]
  ------------------
  458|  71.7M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 8.17k, False: 110M]
  ------------------
  459|  71.7M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  71.7M|					   data->priv->order);
  461|  71.7M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 3.69k, False: 71.7M]
  ------------------
  462|  3.69k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  3.69k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  3.69k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 2.21k, False: 1.48k]
  ------------------
  465|  2.21k|					return;
  466|  1.48k|				break;
  467|  3.69k|			}
  468|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  469|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  470|       |			 */
  471|  71.7M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  71.7M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  71.7M|				  exif_tag_get_name(tag), o);
  474|  71.7M|			switch (tag) {
  475|  1.21M|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 1.21M, False: 70.4M]
  ------------------
  476|  1.21M|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|  1.21M|#define CHECK_REC(i) 					\
  |  |  357|  1.21M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 3.76k, False: 1.21M]
  |  |  ------------------
  |  |  358|  3.76k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  3.76k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  3.76k|		"'%s' detected. Skipping...",		\
  |  |  361|  3.76k|		exif_ifd_get_name (i));			\
  |  |  362|  3.76k|	break;						\
  |  |  363|  1.21M|}							\
  |  |  364|  1.21M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 3.32k, False: 1.21M]
  |  |  ------------------
  |  |  365|  3.32k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  3.32k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  3.32k|		"'%s' multiple times detected. "	\
  |  |  368|  3.32k|		"Skipping...",				\
  |  |  369|  3.32k|		exif_ifd_get_name (i));			\
  |  |  370|  3.32k|	break;						\
  |  |  371|  3.32k|}
  ------------------
  477|  1.21M|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|  1.21M|					recursion_cost + level_cost(n));
  479|  1.21M|				break;
  480|  35.0M|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (480:4): [True: 35.0M, False: 36.6M]
  ------------------
  481|  35.0M|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  356|  35.0M|#define CHECK_REC(i) 					\
  |  |  357|  35.0M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.0M, False: 17.9M]
  |  |  ------------------
  |  |  358|  17.0M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.0M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.0M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.0M|		exif_ifd_get_name (i));			\
  |  |  362|  17.0M|	break;						\
  |  |  363|  17.9M|}							\
  |  |  364|  17.9M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 870, False: 17.9M]
  |  |  ------------------
  |  |  365|    870|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    870|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    870|		"'%s' multiple times detected. "	\
  |  |  368|    870|		"Skipping...",				\
  |  |  369|    870|		exif_ifd_get_name (i));			\
  |  |  370|    870|	break;						\
  |  |  371|    870|}
  ------------------
  482|  17.9M|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  483|  17.9M|					recursion_cost + level_cost(n));
  484|  17.9M|				break;
  485|  35.4M|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (485:4): [True: 35.4M, False: 36.2M]
  ------------------
  486|  35.4M|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  356|  35.4M|#define CHECK_REC(i) 					\
  |  |  357|  35.4M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 17.3M, False: 18.1M]
  |  |  ------------------
  |  |  358|  17.3M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  17.3M|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  17.3M|		"'%s' detected. Skipping...",		\
  |  |  361|  17.3M|		exif_ifd_get_name (i));			\
  |  |  362|  17.3M|	break;						\
  |  |  363|  18.1M|}							\
  |  |  364|  18.1M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 858, False: 18.1M]
  |  |  ------------------
  |  |  365|    858|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    858|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    858|		"'%s' multiple times detected. "	\
  |  |  368|    858|		"Skipping...",				\
  |  |  369|    858|		exif_ifd_get_name (i));			\
  |  |  370|    858|	break;						\
  |  |  371|    858|}
  ------------------
  487|  18.1M|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  488|  18.1M|					recursion_cost + level_cost(n));
  489|  18.1M|				break;
  490|  7.39k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 7.39k, False: 71.6M]
  ------------------
  491|  7.39k|				thumbnail_offset = o;
  492|  7.39k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 6.71k, False: 675]
  |  Branch (492:29): [True: 1.73k, False: 4.98k]
  ------------------
  493|  1.73k|					exif_data_load_data_thumbnail (data, d,
  494|  1.73k|								       ds, thumbnail_offset,
  495|  1.73k|								       thumbnail_length);
  496|  7.39k|				break;
  497|  6.67k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 6.67k, False: 71.6M]
  ------------------
  498|  6.67k|				thumbnail_length = o;
  499|  6.67k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 4.38k, False: 2.29k]
  |  Branch (499:29): [True: 3.67k, False: 705]
  ------------------
  500|  3.67k|					exif_data_load_data_thumbnail (data, d,
  501|  3.67k|								       ds, thumbnail_offset,
  502|  3.67k|								       thumbnail_length);
  503|  6.67k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 71.7M]
  ------------------
  505|      0|				return;
  506|  71.7M|			}
  507|  71.7M|			break;
  508|  71.7M|		default:
  ------------------
  |  Branch (508:3): [True: 38.3M, False: 71.7M]
  ------------------
  509|       |
  510|       |			/*
  511|       |			 * If we don't know the tag, don't fail. It could be that new 
  512|       |			 * versions of the standard have defined additional tags. Note that
  513|       |			 * 0 is a valid tag in the GPS IFD.
  514|       |			 */
  515|  38.3M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.1M, False: 244k]
  ------------------
  516|       |
  517|       |				/*
  518|       |				 * Special case: Tag and format 0. That's against specification
  519|       |				 * (at least up to 2.2). But Photoshop writes it anyways.
  520|       |				 */
  521|  38.1M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (521:9): [True: 208k, False: 37.9M]
  ------------------
  522|   208k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   208k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   208k|						  exif_ifd_get_name (ifd));
  525|   208k|					break;
  526|   208k|				}
  527|  37.9M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  528|  37.9M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  529|  37.9M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  530|  37.9M|					  exif_ifd_get_name (ifd));
  531|  37.9M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (531:9): [True: 37.9M, False: 0]
  ------------------
  532|  37.9M|					break;
  533|  37.9M|			}
  534|   244k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   244k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 244k]
  ------------------
  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|   244k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 29.5k, False: 215k]
  ------------------
  541|   244k|						   offset + 12 * i))
  542|  29.5k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   244k|			exif_entry_unref (entry);
  544|   244k|			break;
  545|   110M|		}
  546|   110M|	}
  547|  2.62M|}
exif-data.c:level_cost:
  380|  37.2M|{
  381|  37.2M|    static const double log_1_1 = 0.09531017980432493;
  382|       |
  383|       |	/* Adding 0.1 protects against the case where n==1 */
  384|  37.2M|	return ceil(log(n + 0.1)/log_1_1);
  385|  37.2M|}
exif-data.c:exif_data_load_data_thumbnail:
  334|  5.41k|{
  335|       |	/* Sanity checks */
  336|  5.41k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 5.41k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  5.41k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  5.41k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 5.41k]
  |  |  |  Branch (53:81): [True: 0, False: 5.41k]
  |  |  |  Branch (53:112): [True: 2.20k, False: 3.21k]
  |  |  ------------------
  ------------------
  341|  2.20k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  2.20k|		return;
  343|  2.20k|	}
  344|  3.21k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 3.02k, False: 183]
  ------------------
  345|  3.02k|		exif_mem_free (data->priv->mem, data->data);
  346|  3.21k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 3.21k]
  ------------------
  347|      0|		EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  348|      0|		data->size = 0;
  349|      0|		return;
  350|      0|	}
  351|  3.21k|	data->size = s;
  352|  3.21k|	memcpy (data->data, d + o, s);
  353|  3.21k|}
exif-data.c:exif_data_load_data_entry:
  169|   244k|{
  170|   244k|	unsigned int s, doff;
  171|       |
  172|   244k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   244k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   244k|	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|   244k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   244k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   244k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   244k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   244k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 159k, False: 85.9k]
  |  Branch (186:33): [True: 35.2k, False: 50.7k]
  ------------------
  187|   194k|		return 0;
  188|   194k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  50.7k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 39.9k, False: 10.7k]
  ------------------
  195|  39.9k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  10.7k|	else
  197|  10.7k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  50.7k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 17.2k, False: 33.4k]
  ------------------
  201|  17.2k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  17.2k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  17.2k|		return 0;
  204|  17.2k|	}
  205|       |
  206|  33.4k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 3.85k, False: 29.5k]
  ------------------
  207|  3.85k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  3.85k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  3.85k|		return 0;
  210|  3.85k|	}
  211|       |
  212|  29.5k|	entry->data = exif_data_alloc (data, s);
  213|  29.5k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 29.5k, False: 0]
  ------------------
  214|  29.5k|		entry->size = s;
  215|  29.5k|		memcpy (entry->data, d + doff, s);
  216|  29.5k|	} else {
  217|      0|		EXIF_LOG_NO_MEMORY(data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  218|      0|		return 0;
  219|      0|	}
  220|       |
  221|       |	/* If this is the MakerNote, remember the offset */
  222|  29.5k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.53k, False: 21.0k]
  ------------------
  223|  8.53k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.53k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.53k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 7.64k, False: 890]
  ------------------
  227|  7.64k|			exif_log (data->priv->log,
  228|  7.64k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  7.64k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  7.64k|					       "%02x %02x %02x...).",
  231|  7.64k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  7.64k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  7.64k|					       entry->data[6]);
  234|  7.64k|		}
  235|  8.53k|		data->priv->offset_mnote = doff;
  236|  8.53k|	}
  237|  29.5k|	return 1;
  238|  29.5k|}
exif-data.c:interpret_maker_note:
  802|  8.14k|{
  803|  8.14k|	int mnoteid;
  804|  8.14k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  8.14k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 8.14k]
  |  |  ------------------
  |  |  254|  8.14k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  8.14k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 8.14k]
  |  |  ------------------
  |  |  256|  8.14k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  8.14k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 7.12k, False: 1.02k]
  |  |  ------------------
  |  |  258|  8.14k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  8.14k|	 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.14k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 1.02k, False: 7.12k]
  ------------------
  806|  1.02k|		return;
  807|       |	
  808|  7.12k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 3.91k, False: 3.20k]
  ------------------
  809|  3.91k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  3.91k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  3.91k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  3.91k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 893, False: 2.31k]
  ------------------
  814|    893|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    893|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    893|		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.02k, False: 1.28k]
  ------------------
  819|  1.02k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|  1.02k|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|  1.02k|		data->priv->md = exif_mnote_data_fuji_new (data->priv->mem);
  822|       |
  823|       |	/* NOTE: Must do Pentax detection last because some of the
  824|       |	 * heuristics are pretty general. */
  825|  1.28k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (825:13): [True: 1.06k, False: 221]
  ------------------
  826|  1.06k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|  1.06k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|  1.06k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|  1.06k|	}
  830|       |/* Marcus: disabled until apple makernote can also be saved
  831|       |	else if ((mnoteid = exif_mnote_data_apple_identify (data, e)) != 0) {
  832|       |		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  833|       |			"ExifData", "Apple MakerNote variant type %d", mnoteid);
  834|       |		data->priv->md = exif_mnote_data_apple_new (data->priv->mem);
  835|       |	}
  836|       |*/
  837|       |
  838|       |	/* 
  839|       |	 * If we are able to interpret the maker note, do so.
  840|       |	 */
  841|  7.12k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 6.90k, False: 221]
  ------------------
  842|  6.90k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  6.90k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  6.90k|						data->priv->order);
  845|  6.90k|		exif_mnote_data_set_offset (data->priv->md,
  846|  6.90k|					    data->priv->offset_mnote);
  847|  6.90k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  6.90k|	}
  849|  7.12k|}
exif-data.c:exif_data_alloc:
   77|  32.7k|{
   78|  32.7k|	void *d;
   79|       |
   80|  32.7k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 32.7k]
  |  Branch (80:15): [True: 0, False: 32.7k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  32.7k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  32.7k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 32.7k, False: 0]
  ------------------
   85|  32.7k|		return d;
   86|       |
   87|      0|	EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", i);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
   88|       |	return NULL;
   89|  32.7k|}
exif-data.c:fix_func:
 1327|  40.7k|{
 1328|  40.7k|	switch (exif_content_get_ifd (c)) {
 1329|  8.14k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 8.14k, False: 32.5k]
  ------------------
 1330|  8.14k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 166, False: 7.98k]
  ------------------
 1331|    166|			exif_content_fix (c);
 1332|  7.98k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 469, False: 7.51k]
  ------------------
 1333|    469|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    469|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    469|				  "removed.");
 1336|  1.79k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.32k, False: 469]
  ------------------
 1337|  1.32k|				unsigned int cnt = c->count;
 1338|  1.32k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.32k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.32k]
  ------------------
 1340|       |					/* safety net */
 1341|      0|					exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1342|      0|					"failed to remove last entry from entries.");
 1343|      0|					c->count--;
 1344|      0|				}
 1345|  1.32k|			}
 1346|    469|		}
 1347|  8.14k|		break;
 1348|  32.5k|	default:
  ------------------
  |  Branch (1348:2): [True: 32.5k, False: 8.14k]
  ------------------
 1349|  32.5k|		exif_content_fix (c);
 1350|  40.7k|	}
 1351|  40.7k|}

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

exif_format_get_name:
   56|  43.1k|{
   57|  43.1k|	unsigned int i;
   58|       |
   59|  43.1k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   268k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 256k, False: 11.6k]
  ------------------
   62|   256k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 31.4k, False: 225k]
  ------------------
   63|  31.4k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  31.4k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  11.6k|	return NULL;
   65|  43.1k|}
exif_format_get_size:
   69|  1.45M|{
   70|  1.45M|	unsigned int i;
   71|       |
   72|  9.74M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 9.35M, False: 387k]
  ------------------
   73|  9.35M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.06M, False: 8.28M]
  ------------------
   74|  1.06M|			return ExifFormatTable[i].size;
   75|   387k|	return 0;
   76|  1.45M|}

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

exif_loader_write:
  171|  10.8k|{
  172|  10.8k|	unsigned int i;
  173|       |
  174|  81.9k|begin:
  175|  81.9k|	if (!eld || (len && !buf)) 
  ------------------
  |  Branch (175:6): [True: 0, False: 81.9k]
  |  Branch (175:15): [True: 81.6k, False: 236]
  |  Branch (175:22): [True: 0, False: 81.6k]
  ------------------
  176|      0|		return 0;
  177|       |
  178|  81.9k|	switch (eld->state) {
  179|    206|	case EL_EXIF_FOUND:
  ------------------
  |  Branch (179:2): [True: 206, False: 81.6k]
  ------------------
  180|    206|		return exif_loader_copy (eld, buf, len);
  181|  1.04k|	case EL_SKIP_BYTES:
  ------------------
  |  Branch (181:2): [True: 1.04k, False: 80.8k]
  ------------------
  182|  1.04k|		if (eld->size > len) { 
  ------------------
  |  Branch (182:7): [True: 174, False: 872]
  ------------------
  183|    174|			eld->size -= len; 
  184|    174|			return 1; 
  185|    174|		}
  186|    872|		len -= eld->size;
  187|    872|		buf += eld->size;
  188|    872|		eld->size = 0;
  189|    872|		eld->b_len = 0;
  190|    872|		switch (eld->data_format) {
  191|     61|		case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (191:3): [True: 61, False: 811]
  ------------------
  192|     61|			eld->state = EL_READ_SIZE_BYTE_24;
  193|     61|			break;
  194|    811|		default:
  ------------------
  |  Branch (194:3): [True: 811, False: 61]
  ------------------
  195|    811|			eld->state = EL_READ;
  196|    811|			break;
  197|    872|		}
  198|    872|		break;
  199|       |
  200|  80.2k|	case EL_READ:
  ------------------
  |  Branch (200:2): [True: 80.2k, False: 1.65k]
  ------------------
  201|  80.6k|	default:
  ------------------
  |  Branch (201:2): [True: 400, False: 81.5k]
  ------------------
  202|  80.6k|		break;
  203|  81.9k|	}
  204|       |
  205|  81.5k|	if (!len)
  ------------------
  |  Branch (205:6): [True: 63, False: 81.4k]
  ------------------
  206|     63|		return 1;
  207|  81.4k|	exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
  208|  81.4k|		  "Scanning %i byte(s) of data...", len);
  209|       |
  210|       |	/*
  211|       |	 * First fill the small buffer. Only continue if the buffer
  212|       |	 * is filled. Note that EXIF data contains at least 12 bytes.
  213|       |	 */
  214|  81.4k|	i = MIN (len, sizeof (eld->b) - eld->b_len);
  ------------------
  |  |  182|  81.4k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 20, False: 81.4k]
  |  |  ------------------
  ------------------
  215|  81.4k|	if (i) {
  ------------------
  |  Branch (215:6): [True: 81.4k, False: 0]
  ------------------
  216|  81.4k|		memcpy (&eld->b[eld->b_len], buf, i);
  217|  81.4k|		eld->b_len += i;
  218|  81.4k|		if (eld->b_len < sizeof (eld->b)) 
  ------------------
  |  Branch (218:7): [True: 20, False: 81.4k]
  ------------------
  219|     20|			return 1;
  220|  81.4k|		buf += i;
  221|  81.4k|		len -= i;
  222|  81.4k|	}
  223|       |
  224|  81.4k|	switch (eld->data_format) {
  225|  11.1k|	case EL_DATA_FORMAT_UNKNOWN:
  ------------------
  |  Branch (225:2): [True: 11.1k, False: 70.2k]
  ------------------
  226|       |
  227|       |		/* Check the small buffer against known formats. */
  228|  11.1k|		if (!memcmp (eld->b, "FUJIFILM", 8)) {
  ------------------
  |  Branch (228:7): [True: 62, False: 11.1k]
  ------------------
  229|       |
  230|       |			/* Skip to byte 84. There is another offset there. */
  231|     62|			eld->data_format = EL_DATA_FORMAT_FUJI_RAW;
  232|     62|			eld->size = 84;
  233|     62|			eld->state = EL_SKIP_BYTES;
  234|     62|			eld->size = 84;
  235|       |
  236|  11.1k|		} else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) {
  ------------------
  |  Branch (236:14): [True: 10.1k, False: 928]
  ------------------
  237|       |
  238|       |			/* Read the size (2 bytes). */
  239|  10.1k|			eld->data_format = EL_DATA_FORMAT_EXIF;
  240|  10.1k|			eld->state = EL_READ_SIZE_BYTE_08;
  241|  10.1k|		}
  242|  81.4k|	default:
  ------------------
  |  Branch (242:2): [True: 70.2k, False: 11.1k]
  ------------------
  243|  81.4k|		break;
  244|  81.4k|	}
  245|       |
  246|   959k|	for (i = 0; i < sizeof (eld->b); i++) {
  ------------------
  |  Branch (246:14): [True: 888k, False: 71.0k]
  ------------------
  247|   888k|		switch (eld->state) {
  248|  10.2k|		case EL_EXIF_FOUND:
  ------------------
  |  Branch (248:3): [True: 10.2k, False: 877k]
  ------------------
  249|  10.2k|			if (!exif_loader_copy (eld, eld->b + i,
  ------------------
  |  Branch (249:8): [True: 10, False: 10.2k]
  ------------------
  250|  10.2k|					sizeof (eld->b) - i)) 
  251|     10|				return 0;
  252|  10.2k|			return exif_loader_copy (eld, buf, len);
  253|  7.83k|		case EL_SKIP_BYTES:
  ------------------
  |  Branch (253:3): [True: 7.83k, False: 880k]
  ------------------
  254|  7.83k|			switch (eld->size) {
  255|  3.92k|                            case 0:
  ------------------
  |  Branch (255:29): [True: 3.92k, False: 3.91k]
  ------------------
  256|  3.92k|			        eld->state = EL_READ;
  257|  3.92k|				i--;   /* reprocess this byte */
  258|  3.92k|				break;
  259|  1.17k|                            case 1:
  ------------------
  |  Branch (259:29): [True: 1.17k, False: 6.65k]
  ------------------
  260|  1.17k|                                eld->size = 0;
  261|  1.17k|			        eld->state = EL_READ;
  262|  1.17k|				break;
  263|  2.73k|                            default:
  ------------------
  |  Branch (263:29): [True: 2.73k, False: 5.09k]
  ------------------
  264|  2.73k|                                eld->size--;
  265|  2.73k|				break;
  266|  7.83k|			}
  267|  7.83k|			break;
  268|       |
  269|  7.83k|		case EL_READ_SIZE_BYTE_24:
  ------------------
  |  Branch (269:3): [True: 60, False: 888k]
  ------------------
  270|     60|			eld->size |= (unsigned int)eld->b[i] << 24;
  271|     60|			eld->state = EL_READ_SIZE_BYTE_16;
  272|     60|			break;
  273|     60|		case EL_READ_SIZE_BYTE_16:
  ------------------
  |  Branch (273:3): [True: 60, False: 888k]
  ------------------
  274|     60|			eld->size |= (unsigned int)eld->b[i] << 16;
  275|     60|			eld->state = EL_READ_SIZE_BYTE_08;
  276|     60|			break;
  277|  16.6k|		case EL_READ_SIZE_BYTE_08:
  ------------------
  |  Branch (277:3): [True: 16.6k, False: 871k]
  ------------------
  278|  16.6k|			eld->size |= (unsigned int)eld->b[i] << 8;
  279|  16.6k|			eld->state = EL_READ_SIZE_BYTE_00;
  280|  16.6k|			break;
  281|  16.5k|		case EL_READ_SIZE_BYTE_00:
  ------------------
  |  Branch (281:3): [True: 16.5k, False: 871k]
  ------------------
  282|  16.5k|			eld->size |= eld->b[i] << 0;
  283|  16.5k|			switch (eld->data_format) {
  284|  6.02k|			case EL_DATA_FORMAT_JPEG:
  ------------------
  |  Branch (284:4): [True: 6.02k, False: 10.5k]
  ------------------
  285|  6.02k|				eld->state = EL_SKIP_BYTES;
  286|  6.02k|				if (eld->size < 2) {
  ------------------
  |  Branch (286:9): [True: 2.67k, False: 3.34k]
  ------------------
  287|       |				    /* Actually it's malformed... */
  288|  2.67k|				    eld->size = 0;
  289|  2.67k|				} else
  290|  3.34k|				    eld->size -= 2;
  291|  6.02k|				break;
  292|     60|			case EL_DATA_FORMAT_FUJI_RAW:
  ------------------
  |  Branch (292:4): [True: 60, False: 16.5k]
  ------------------
  293|     60|				eld->data_format = EL_DATA_FORMAT_EXIF;
  294|     60|				eld->state = EL_SKIP_BYTES;
  295|     60|				if (eld->size < 86) {
  ------------------
  |  Branch (295:9): [True: 7, False: 53]
  ------------------
  296|       |				    /* Actually it's malformed... */
  297|      7|				    eld->size = 0;
  298|      7|				} else
  299|     53|				    eld->size -= 86;	/* and put this in an else */
  300|     60|				break;
  301|  10.5k|			case EL_DATA_FORMAT_EXIF:
  ------------------
  |  Branch (301:4): [True: 10.5k, False: 6.08k]
  ------------------
  302|  10.5k|				eld->state = EL_EXIF_FOUND;
  303|  10.5k|				break;
  304|      0|			default:
  ------------------
  |  Branch (304:4): [True: 0, False: 16.5k]
  ------------------
  305|      0|				break;
  306|  16.5k|			}
  307|  16.5k|			break;
  308|       |
  309|   836k|		default:
  ------------------
  |  Branch (309:3): [True: 836k, False: 51.4k]
  ------------------
  310|   836k|			switch (eld->b[i]) {
  311|  1.67k|			case JPEG_MARKER_APP1:
  ------------------
  |  |   46|  1.67k|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (311:4): [True: 1.67k, False: 834k]
  ------------------
  312|  1.67k|			  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.35k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 510, False: 1.16k]
  |  |  |  Branch (182:29): [True: 7, False: 1.66k]
  |  |  |  Branch (182:42): [True: 7, False: 1.15k]
  |  |  ------------------
  ------------------
  |  Branch (312:10): [True: 310, False: 1.36k]
  ------------------
  313|    310|					eld->data_format = EL_DATA_FORMAT_EXIF;
  314|  1.36k|				} else {
  315|  1.36k|					eld->data_format = EL_DATA_FORMAT_JPEG; /* Probably JFIF - keep searching for APP1 EXIF*/
  316|  1.36k|				}
  317|  1.67k|				eld->size = 0;
  318|  1.67k|				eld->state = EL_READ_SIZE_BYTE_08;
  319|  1.67k|				break;
  320|    265|			case JPEG_MARKER_DCT:
  ------------------
  |  |   36|    265|#define JPEG_MARKER_DCT  0xc0
  ------------------
  |  Branch (320:4): [True: 265, False: 836k]
  ------------------
  321|    461|			case JPEG_MARKER_DHT:
  ------------------
  |  |   38|    461|#define JPEG_MARKER_DHT  0xc4
  ------------------
  |  Branch (321:4): [True: 196, False: 836k]
  ------------------
  322|    989|			case JPEG_MARKER_DQT:
  ------------------
  |  |   42|    989|#define JPEG_MARKER_DQT  0xdb
  ------------------
  |  Branch (322:4): [True: 528, False: 836k]
  ------------------
  323|  1.84k|			case JPEG_MARKER_APP0:
  ------------------
  |  |   44|  1.84k|#define JPEG_MARKER_APP0 0xe0
  ------------------
  |  Branch (323:4): [True: 854, False: 835k]
  ------------------
  324|  2.11k|			case JPEG_MARKER_APP2:
  ------------------
  |  |   48|  2.11k|#define JPEG_MARKER_APP2 0xe2
  ------------------
  |  Branch (324:4): [True: 268, False: 836k]
  ------------------
  325|  2.39k|			case JPEG_MARKER_APP3:
  ------------------
  |  |   50|  2.39k|#define JPEG_MARKER_APP3 0xe3
  ------------------
  |  Branch (325:4): [True: 284, False: 836k]
  ------------------
  326|  2.87k|			case JPEG_MARKER_APP4:
  ------------------
  |  |   52|  2.87k|#define JPEG_MARKER_APP4 0xe4
  ------------------
  |  Branch (326:4): [True: 477, False: 836k]
  ------------------
  327|  3.25k|			case JPEG_MARKER_APP5:
  ------------------
  |  |   54|  3.25k|#define JPEG_MARKER_APP5 0xe5
  ------------------
  |  Branch (327:4): [True: 384, False: 836k]
  ------------------
  328|  3.56k|			case JPEG_MARKER_APP10:
  ------------------
  |  |   56|  3.56k|#define JPEG_MARKER_APP10 0xea
  ------------------
  |  Branch (328:4): [True: 312, False: 836k]
  ------------------
  329|  3.84k|			case JPEG_MARKER_APP11:
  ------------------
  |  |   58|  3.84k|#define JPEG_MARKER_APP11 0xeb
  ------------------
  |  Branch (329:4): [True: 275, False: 836k]
  ------------------
  330|  4.16k|			case JPEG_MARKER_APP13:
  ------------------
  |  |   60|  4.16k|#define JPEG_MARKER_APP13 0xed
  ------------------
  |  Branch (330:4): [True: 319, False: 836k]
  ------------------
  331|  4.46k|			case JPEG_MARKER_APP14:
  ------------------
  |  |   62|  4.46k|#define JPEG_MARKER_APP14 0xee
  ------------------
  |  Branch (331:4): [True: 301, False: 836k]
  ------------------
  332|  4.67k|			case JPEG_MARKER_COM:
  ------------------
  |  |   64|  4.67k|#define JPEG_MARKER_COM 0xfe
  ------------------
  |  Branch (332:4): [True: 208, False: 836k]
  ------------------
  333|  4.67k|				eld->data_format = EL_DATA_FORMAT_JPEG;
  334|  4.67k|				eld->size = 0;
  335|  4.67k|				eld->state = EL_READ_SIZE_BYTE_08;
  336|  4.67k|				break;
  337|   828k|			case 0xff:
  ------------------
  |  Branch (337:4): [True: 828k, False: 8.16k]
  ------------------
  338|   830k|			case JPEG_MARKER_SOI:
  ------------------
  |  |   40|   830k|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (338:4): [True: 1.72k, False: 834k]
  ------------------
  339|   830k|				break;
  340|     93|			default:
  ------------------
  |  Branch (340:4): [True: 93, False: 836k]
  ------------------
  341|     93|				exif_log (eld->log,
  342|     93|					EXIF_LOG_CODE_CORRUPT_DATA,
  343|     93|					"ExifLoader", _("The data supplied "
  ------------------
  |  |   31|     93|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  344|     93|						"does not seem to contain "
  345|     93|						"EXIF data. JPEG Marker type 0x%02x"), eld->b[i]);
  346|     93|				exif_loader_reset (eld);
  347|     93|				return 0;
  348|   836k|			}
  349|   888k|		}
  350|   888k|	}
  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|  71.0k|	eld->b_len = 0;
  357|  71.0k|	goto begin;
  358|  81.4k|}
exif_loader_new:
  362|  10.8k|{
  363|  10.8k|	ExifMem *mem = exif_mem_new_default ();
  364|  10.8k|	ExifLoader *l = exif_loader_new_mem (mem);
  365|       |
  366|  10.8k|	exif_mem_unref (mem);
  367|       |
  368|  10.8k|	return l;
  369|  10.8k|}
exif_loader_new_mem:
  373|  10.8k|{
  374|  10.8k|	ExifLoader *loader;
  375|       |
  376|  10.8k|	if (!mem) 
  ------------------
  |  Branch (376:6): [True: 0, False: 10.8k]
  ------------------
  377|      0|		return NULL;
  378|       |	
  379|  10.8k|	loader = exif_mem_alloc (mem, sizeof (ExifLoader));
  380|  10.8k|	if (!loader) 
  ------------------
  |  Branch (380:6): [True: 0, False: 10.8k]
  ------------------
  381|      0|		return NULL;
  382|  10.8k|	loader->ref_count = 1;
  383|       |
  384|  10.8k|	loader->mem = mem;
  385|  10.8k|	exif_mem_ref (mem);
  386|       |
  387|  10.8k|	return loader;
  388|  10.8k|}
exif_loader_unref:
  414|  10.8k|{
  415|  10.8k|	if (!loader) 
  ------------------
  |  Branch (415:6): [True: 0, False: 10.8k]
  ------------------
  416|      0|		return;
  417|  10.8k|	if (!--loader->ref_count)
  ------------------
  |  Branch (417:6): [True: 10.8k, False: 0]
  ------------------
  418|  10.8k|		exif_loader_free (loader);
  419|  10.8k|}
exif_loader_reset:
  423|  10.9k|{
  424|  10.9k|	if (!loader) 
  ------------------
  |  Branch (424:6): [True: 0, False: 10.9k]
  ------------------
  425|      0|		return;
  426|  10.9k|	exif_mem_free (loader->mem, loader->buf); loader->buf = NULL;
  427|  10.9k|	loader->size = 0;
  428|  10.9k|	loader->bytes_read = 0;
  429|  10.9k|	loader->state = 0;
  430|  10.9k|	loader->b_len = 0;
  431|  10.9k|	loader->data_format = EL_DATA_FORMAT_UNKNOWN;
  432|  10.9k|}
exif_loader_get_data:
  436|  10.8k|{
  437|  10.8k|	ExifData *ed;
  438|       |
  439|  10.8k|	if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) ||
  ------------------
  |  Branch (439:6): [True: 0, False: 10.8k]
  |  Branch (439:17): [True: 101, False: 10.7k]
  ------------------
  440|  10.7k|	    !loader->bytes_read)
  ------------------
  |  Branch (440:6): [True: 271, False: 10.4k]
  ------------------
  441|    372|		return NULL;
  442|       |
  443|  10.4k|	ed = exif_data_new_mem (loader->mem);
  444|  10.4k|	exif_data_log (ed, loader->log);
  445|  10.4k|	exif_data_load_data (ed, loader->buf, loader->bytes_read);
  446|       |
  447|  10.4k|	return ed;
  448|  10.8k|}
exif-loader.c:exif_loader_copy:
  151|  20.7k|{
  152|  20.7k|	if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) 
  ------------------
  |  Branch (152:6): [True: 0, False: 20.7k]
  |  Branch (152:15): [True: 20.7k, False: 44]
  |  Branch (152:22): [True: 0, False: 20.7k]
  |  Branch (152:31): [True: 4, False: 20.7k]
  ------------------
  153|      4|		return 0;
  154|       |
  155|       |	/* If needed, allocate the buffer. */
  156|  20.7k|	if (!eld->buf) 
  ------------------
  |  Branch (156:6): [True: 10.5k, False: 10.2k]
  ------------------
  157|  10.5k|		eld->buf = exif_loader_alloc (eld, eld->size);
  158|  20.7k|	if (!eld->buf) 
  ------------------
  |  Branch (158:6): [True: 0, False: 20.7k]
  ------------------
  159|      0|		return 0;
  160|       |
  161|       |	/* Copy memory */
  162|  20.7k|	len = MIN (len, eld->size - eld->bytes_read);
  ------------------
  |  |  182|  20.7k|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 20.6k, False: 92]
  |  |  ------------------
  ------------------
  163|  20.7k|	memcpy (eld->buf + eld->bytes_read, buf, len);
  164|  20.7k|	eld->bytes_read += len;
  165|       |
  166|  20.7k|	return (eld->bytes_read >= eld->size) ? 0 : 1;
  ------------------
  |  Branch (166:9): [True: 92, False: 20.6k]
  ------------------
  167|  20.7k|}
exif-loader.c:exif_loader_alloc:
  109|  10.5k|{
  110|  10.5k|	void *d;
  111|       |
  112|  10.5k|	if (!l || !i) 
  ------------------
  |  Branch (112:6): [True: 0, False: 10.5k]
  |  Branch (112:12): [True: 0, False: 10.5k]
  ------------------
  113|      0|		return NULL;
  114|       |
  115|  10.5k|	d = exif_mem_alloc (l->mem, i);
  116|  10.5k|	if (d) 
  ------------------
  |  Branch (116:6): [True: 10.5k, False: 0]
  ------------------
  117|  10.5k|		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.5k|}
exif-loader.c:exif_loader_free:
  399|  10.8k|{
  400|  10.8k|	ExifMem *mem;
  401|       |
  402|  10.8k|	if (!loader) 
  ------------------
  |  Branch (402:6): [True: 0, False: 10.8k]
  ------------------
  403|      0|		return;
  404|       |
  405|  10.8k|	mem = loader->mem;
  406|  10.8k|	exif_loader_reset (loader);
  407|  10.8k|	exif_log_unref (loader->log);
  408|  10.8k|	exif_mem_free (mem, loader);
  409|  10.8k|	exif_mem_unref (mem);
  410|  10.8k|}

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

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

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

exif_tag_table_count:
  978|   408M|{
  979|   408M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   408M|}
exif_tag_table_get_tag:
  985|  5.53M|{
  986|  5.53M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.53M, False: 0]
  ------------------
  987|  5.53M|}
exif_tag_get_name_in_ifd:
 1043|   397M|{
 1044|   397M|	unsigned int i;
 1045|   397M|	int first;
 1046|       |
 1047|   397M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 397M]
  ------------------
 1048|      0|		return NULL;
 1049|   397M|	first = exif_tag_table_first(tag);
 1050|   397M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 36.8M, False: 360M]
  ------------------
 1051|  36.8M|		return NULL;
 1052|       |
 1053|   721M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 721M, False: 1.30k]
  ------------------
 1054|   721M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 361M, False: 360M]
  ------------------
 1055|   361M|		   if (RECORDED)
  ------------------
  |  | 1035|   361M|#define RECORDED \
  |  | 1036|   361M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 546k, False: 360M]
  |  |  ------------------
  |  | 1037|   361M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 360M]
  |  |  ------------------
  |  | 1038|   361M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.58k, False: 360M]
  |  |  ------------------
  |  | 1039|   361M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 14.6k, False: 360M]
  |  |  ------------------
  ------------------
 1056|   562k|			   break;
 1057|   361M|		} else
 1058|   360M|			return NULL; /* Recorded tag not found in the table */
 1059|   721M|	}
 1060|   564k|	return ExifTagTable[i].name;
 1061|   360M|}
exif_tag_get_name:
 1152|  71.9M|{
 1153|  71.9M|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|  71.9M|}
exif_tag_get_support_level_in_ifd:
 1261|  5.55M|{
 1262|  5.55M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.55M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.55M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.55M, False: 0]
  ------------------
 1266|  5.55M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.55M|}
exif-tag.c:exif_tag_table_first:
 1016|   403M|{
 1017|   403M|	int i;
 1018|   403M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   403M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   403M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 36.8M, False: 366M]
  ------------------
 1021|  36.8M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|   366M|	i = entry - ExifTagTable;
 1025|       |
 1026|       |	/* There may be other entries with the same tag number, so search
 1027|       |	 * backwards to find the first
 1028|       |	 */
 1029|   366M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 365M, False: 1.09M]
  |  Branch (1029:20): [True: 347k, False: 365M]
  ------------------
 1030|   347k|		--i;
 1031|   347k|	}
 1032|   366M|	return i;
 1033|   403M|}
exif-tag.c:match_tag:
 1003|  2.84G|{
 1004|  2.84G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.84G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  71.9M|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|  71.9M|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|  71.9M|		EXIF_IFD_EXIF,
 1134|  71.9M|		EXIF_IFD_0,
 1135|  71.9M|		EXIF_IFD_1,
 1136|  71.9M|		EXIF_IFD_INTEROPERABILITY,
 1137|  71.9M|		EXIF_IFD_GPS
 1138|  71.9M|	};
 1139|  71.9M|	int i;
 1140|   431M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 359M, False: 71.6M]
  ------------------
 1141|   359M|		const char *result = func(tag, ifds[i]);
 1142|   359M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 267k, False: 359M]
  ------------------
 1143|   267k|			return result;
 1144|   267k|		}
 1145|   359M|	}
 1146|  71.6M|	return (const char *) NULL;
 1147|  71.9M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.55M|{
 1228|  5.55M|	unsigned int i;
 1229|  5.55M|	int first = exif_tag_table_first(tag);
 1230|  5.55M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.55M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  9.45M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 9.43M, False: 16.4k]
  ------------------
 1234|  9.43M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.65M, False: 3.78M]
  ------------------
 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.65M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.65M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.83M, False: 3.81M]
  ------------------
 1242|  1.83M|				unsigned int dt;
 1243|  9.06M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 7.31M, False: 1.74M]
  ------------------
 1244|  7.31M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 83.2k, False: 7.23M]
  ------------------
 1245|  83.2k|						break;
 1246|  7.31M|				}
 1247|  1.83M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.74M, False: 83.2k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.74M|					return supp;
 1250|  1.83M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.65M|		} else {
 1253|  3.78M|			break; /* We've reached the end of the matching tags */
 1254|  3.78M|		}
 1255|  9.43M|	}
 1256|  3.80M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.55M|}

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

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

mnote_fuji_entry_get_value:
  194|  8.96k|{
  195|  8.96k|	ExifLong  vl;
  196|  8.96k|	ExifSLong vsl;
  197|  8.96k|	ExifShort vs, vs2;
  198|  8.96k|	ExifSShort vss;
  199|  8.96k|	ExifRational vr;
  200|  8.96k|	ExifSRational vsr;
  201|  8.96k|	int i, j;
  202|       |
  203|  8.96k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 8.96k]
  ------------------
  204|  8.96k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 8.96k]
  ------------------
  205|       |
  206|  8.96k|	memset (val, 0, maxlen);
  207|  8.96k|	maxlen--;
  208|       |
  209|  8.96k|	switch (entry->tag) {
  210|  1.08k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.08k, False: 7.88k]
  ------------------
  211|  1.08k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.08k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.08k|{                                                               \
  |  |   35|  1.08k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 659, False: 422]
  |  |  ------------------
  |  |   36|    659|                snprintf (v, maxlen,	                        \
  |  |   37|    659|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    659|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    659|                        "expected '%s'."),                      \
  |  |   39|    659|                        exif_format_get_name (format),          \
  |  |   40|    659|                        exif_format_get_name (target));         \
  |  |   41|    659|                break;                                          \
  |  |   42|    659|        }                                                       \
  |  |   43|  1.08k|}
  ------------------
  212|    422|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    422|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    422|{                                                                       \
  |  |   47|    422|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 217, False: 205]
  |  |  ------------------
  |  |   48|    217|                snprintf (v, maxlen,                                    \
  |  |   49|    217|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    217|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    217|                break;                                                  \
  |  |   52|    217|        }                                                               \
  |  |   53|    422|}
  ------------------
  213|    205|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    205|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 205]
  |  |  ------------------
  ------------------
  214|    205|		break;
  215|    233|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 233, False: 8.73k]
  ------------------
  216|    627|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 394, False: 8.57k]
  ------------------
  217|    833|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 206, False: 8.76k]
  ------------------
  218|  1.16k|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 334, False: 8.63k]
  ------------------
  219|  1.37k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 204, False: 8.76k]
  ------------------
  220|  1.58k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 213, False: 8.75k]
  ------------------
  221|  1.90k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 316, False: 8.65k]
  ------------------
  222|  2.10k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 204, False: 8.76k]
  ------------------
  223|  2.20k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 100, False: 8.86k]
  ------------------
  224|  2.28k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 76, False: 8.89k]
  ------------------
  225|  2.35k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 74, False: 8.89k]
  ------------------
  226|  2.42k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 71, False: 8.89k]
  ------------------
  227|  2.63k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 209, False: 8.75k]
  ------------------
  228|  2.83k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 199, False: 8.76k]
  ------------------
  229|  3.16k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 331, False: 8.63k]
  ------------------
  230|  3.39k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 227, False: 8.74k]
  ------------------
  231|  3.62k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 236, False: 8.73k]
  ------------------
  232|  3.62k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  3.62k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  3.62k|{                                                               \
  |  |   35|  3.62k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 1.82k, False: 1.80k]
  |  |  ------------------
  |  |   36|  1.82k|                snprintf (v, maxlen,	                        \
  |  |   37|  1.82k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.82k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  1.82k|                        "expected '%s'."),                      \
  |  |   39|  1.82k|                        exif_format_get_name (format),          \
  |  |   40|  1.82k|                        exif_format_get_name (target));         \
  |  |   41|  1.82k|                break;                                          \
  |  |   42|  1.82k|        }                                                       \
  |  |   43|  3.62k|}
  ------------------
  233|  1.80k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  1.80k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  1.80k|{                                                                       \
  |  |   47|  1.80k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 311, False: 1.49k]
  |  |  ------------------
  |  |   48|    311|                snprintf (v, maxlen,                                    \
  |  |   49|    311|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    311|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    311|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    311|                break;                                                  \
  |  |   52|    311|        }                                                               \
  |  |   53|  1.80k|}
  ------------------
  234|  1.49k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  10.2k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 10.2k, False: 0]
  |  Branch (237:32): [True: 8.74k, False: 1.49k]
  ------------------
  238|  1.49k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.49k]
  ------------------
  239|      0|			snprintf (val, maxlen,
  240|      0|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  241|      0|		  	break;
  242|      0|		}
  243|       |
  244|       |		/* find the value */
  245|  6.19k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 5.57k, False: 622]
  ------------------
  246|  5.57k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 4.70k, False: 873]
  ------------------
  247|  1.49k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 863, False: 632]
  ------------------
  248|    863|			snprintf (val, maxlen,
  249|    863|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|    863|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|    863|			break;
  251|    863|		}
  252|    632|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    632|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    632|		break;
  254|    636|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 636, False: 8.33k]
  ------------------
  255|    636|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    636|#define CF(format,target,v,maxlen)                              \
  |  |   34|    636|{                                                               \
  |  |   35|    636|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 233, False: 403]
  |  |  ------------------
  |  |   36|    233|                snprintf (v, maxlen,	                        \
  |  |   37|    233|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    233|                        "expected '%s'."),                      \
  |  |   39|    233|                        exif_format_get_name (format),          \
  |  |   40|    233|                        exif_format_get_name (target));         \
  |  |   41|    233|                break;                                          \
  |  |   42|    233|        }                                                       \
  |  |   43|    636|}
  ------------------
  256|    403|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    403|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    403|{                                                                       \
  |  |   47|    403|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 202, False: 201]
  |  |  ------------------
  |  |   48|    202|                snprintf (v, maxlen,                                    \
  |  |   49|    202|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    202|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    202|                break;                                                  \
  |  |   52|    202|        }                                                               \
  |  |   53|    403|}
  ------------------
  257|    201|		vs = exif_get_short (entry->data, entry->order);
  258|    201|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    201|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    201|		break;
  261|    193|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 193, False: 8.77k]
  ------------------
  262|  1.12k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 932, False: 8.03k]
  ------------------
  263|  1.12k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.12k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.12k|{                                                               \
  |  |   35|  1.12k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 379, False: 746]
  |  |  ------------------
  |  |   36|    379|                snprintf (v, maxlen,	                        \
  |  |   37|    379|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    379|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    379|                        "expected '%s'."),                      \
  |  |   39|    379|                        exif_format_get_name (format),          \
  |  |   40|    379|                        exif_format_get_name (target));         \
  |  |   41|    379|                break;                                          \
  |  |   42|    379|        }                                                       \
  |  |   43|  1.12k|}
  ------------------
  264|    746|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    746|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    746|{                                                                       \
  |  |   47|    746|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 83, False: 663]
  |  |  ------------------
  |  |   48|     83|                snprintf (v, maxlen,                                    \
  |  |   49|     83|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     83|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     83|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     83|                break;                                                  \
  |  |   52|     83|        }                                                               \
  |  |   53|    746|}
  ------------------
  265|    663|		vr = exif_get_rational (entry->data, entry->order);
  266|    663|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 225, False: 438]
  ------------------
  267|    438|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    438|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    438|			  vr.denominator);
  269|    438|		break;
  270|       |
  271|  2.49k|	default:
  ------------------
  |  Branch (271:2): [True: 2.49k, False: 6.46k]
  ------------------
  272|  2.49k|		switch (entry->format) {
  273|    366|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 366, False: 2.13k]
  ------------------
  274|    366|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    366|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 205, False: 161]
  |  |  ------------------
  ------------------
  275|    366|		  break;
  276|    209|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 209, False: 2.28k]
  ------------------
  277|    209|		  vs = exif_get_short (entry->data, entry->order);
  278|    209|		  snprintf (val, maxlen, "%hu", vs);
  279|    209|		  break;
  280|     99|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 99, False: 2.39k]
  ------------------
  281|     99|		  vss = exif_get_sshort (entry->data, entry->order);
  282|     99|		  snprintf (val, maxlen, "%hi", vss);
  283|     99|		  break;
  284|    199|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 199, False: 2.29k]
  ------------------
  285|    199|		  vl = exif_get_long (entry->data, entry->order);
  286|    199|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    199|		  break;
  288|    266|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 266, False: 2.23k]
  ------------------
  289|    266|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    266|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    266|		  break;
  292|    410|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 410, False: 2.08k]
  ------------------
  293|    410|		  vr = exif_get_rational (entry->data, entry->order);
  294|    410|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 110, False: 300]
  ------------------
  295|    300|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    300|						    vr.denominator);
  297|    300|		  break;
  298|    594|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 594, False: 1.90k]
  ------------------
  299|    594|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    594|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 240, False: 354]
  ------------------
  301|    354|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    354|			  vsr.denominator);
  303|    354|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.49k]
  ------------------
  305|    355|		default:
  ------------------
  |  Branch (305:3): [True: 355, False: 2.14k]
  ------------------
  306|    355|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    355|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    355| 			  entry->size);
  308|    355|		  break;
  309|  2.49k|		}
  310|  2.49k|		break;
  311|  8.96k|	}
  312|       |
  313|  8.96k|	return (val);
  314|  8.96k|}

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

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

mnote_olympus_entry_get_value:
  276|  52.5k|{
  277|  52.5k|	char         buf[30];
  278|  52.5k|	ExifLong     vl;
  279|  52.5k|	ExifSLong    vsl;
  280|  52.5k|	ExifShort    vs = 0;
  281|  52.5k|	ExifSShort   vss = 0;
  282|  52.5k|	ExifRational vr, vr2;
  283|  52.5k|	ExifSRational vsr;
  284|  52.5k|	int          i, j;
  285|  52.5k|	double       r, b;
  286|       |
  287|  52.5k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 52.5k]
  ------------------
  288|      0|		return (NULL);
  289|  52.5k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 52.5k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  52.5k|	memset (v, 0, maxlen);
  293|  52.5k|	maxlen--;
  294|       |
  295|  52.5k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 17.6k, False: 34.9k]
  |  Branch (295:24): [True: 3.53k, False: 14.1k]
  ------------------
  296|  3.53k|		return (v);
  297|       |
  298|  49.0k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 14.1k, False: 34.9k]
  |  Branch (298:24): [True: 0, False: 14.1k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  49.0k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    838|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 838, False: 48.2k]
  ------------------
  305|    838|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    838|#define CF(format,target,v,maxlen)                              \
  |  |   36|    838|{                                                               \
  |  |   37|    838|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 279, False: 559]
  |  |  ------------------
  |  |   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|    838|}
  ------------------
  306|    559|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    559|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    559|{                                                                       \
  |  |   62|    559|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 213, False: 346]
  |  |  ------------------
  |  |   63|    213|                snprintf (v, maxlen,                                    \
  |  |   64|    213|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    213|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    213|                break;                                                  \
  |  |   67|    213|        }                                                               \
  |  |   68|    559|}
  ------------------
  307|    346|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    346|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 76, False: 270]
  ------------------
  309|     76|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|     76|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 76]
  |  |  ------------------
  ------------------
  310|    270|		} else {
  311|    270|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    270|		}
  313|    346|		break;
  314|    533|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 533, False: 48.5k]
  ------------------
  315|    533|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    533|#define CF(format,target,v,maxlen)                              \
  |  |   36|    533|{                                                               \
  |  |   37|    533|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 252, False: 281]
  |  |  ------------------
  |  |   38|    252|                snprintf (v, maxlen,	                        \
  |  |   39|    252|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    252|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    252|                        "expected '%s'."),                      \
  |  |   41|    252|                        exif_format_get_name (format),          \
  |  |   42|    252|                        exif_format_get_name (target));         \
  |  |   43|    252|                break;                                          \
  |  |   44|    252|        }                                                       \
  |  |   45|    533|}
  ------------------
  316|    281|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    281|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    281|{                                                                       \
  |  |   62|    281|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 203, False: 78]
  |  |  ------------------
  |  |   63|    203|                snprintf (v, maxlen,                                    \
  |  |   64|    203|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    203|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    203|                break;                                                  \
  |  |   67|    203|        }                                                               \
  |  |   68|    281|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|     78|                vs = exif_get_short (entry->data + 2, entry->order);
  319|     78|                snprintf (v, maxlen, "ISO %hd", vs);
  320|     78|                break;
  321|    503|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 503, False: 48.5k]
  ------------------
  322|    503|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    503|#define CF(format,target,v,maxlen)                              \
  |  |   36|    503|{                                                               \
  |  |   37|    503|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 239, False: 264]
  |  |  ------------------
  |  |   38|    239|                snprintf (v, maxlen,	                        \
  |  |   39|    239|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    239|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    239|                        "expected '%s'."),                      \
  |  |   41|    239|                        exif_format_get_name (format),          \
  |  |   42|    239|                        exif_format_get_name (target));         \
  |  |   43|    239|                break;                                          \
  |  |   44|    239|        }                                                       \
  |  |   45|    503|}
  ------------------
  323|    264|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    264|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    264|{                                                                       \
  |  |   62|    264|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 69, False: 195]
  |  |  ------------------
  |  |   63|     69|                snprintf (v, maxlen,                                    \
  |  |   64|     69|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     69|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     69|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     69|                break;                                                  \
  |  |   67|     69|        }                                                               \
  |  |   68|    264|}
  ------------------
  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|    239|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 239, False: 48.8k]
  ------------------
  329|    453|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 214, False: 48.8k]
  ------------------
  330|    708|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 255, False: 48.8k]
  ------------------
  331|    926|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 218, False: 48.8k]
  ------------------
  332|  1.18k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 257, False: 48.7k]
  ------------------
  333|  1.43k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 254, False: 48.8k]
  ------------------
  334|  1.79k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 353, False: 48.7k]
  ------------------
  335|  2.03k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 242, False: 48.8k]
  ------------------
  336|  2.25k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 225, False: 48.8k]
  ------------------
  337|  2.46k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 207, False: 48.8k]
  ------------------
  338|  2.66k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 205, False: 48.8k]
  ------------------
  339|  3.01k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 345, False: 48.7k]
  ------------------
  340|  3.08k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 68, False: 48.9k]
  ------------------
  341|  3.08k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  3.08k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  3.08k|{                                                               \
  |  |   37|  3.08k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.43k, False: 643]
  |  |  ------------------
  |  |   38|  2.43k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.43k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.43k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.43k|                        "expected '%s'."),                      \
  |  |   41|  2.43k|                        exif_format_get_name (format),          \
  |  |   42|  2.43k|                        exif_format_get_name (target));         \
  |  |   43|  2.43k|                break;                                          \
  |  |   44|  2.43k|        }                                                       \
  |  |   45|  3.08k|}
  ------------------
  342|    643|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    643|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 219, False: 424]
  |  |  ------------------
  ------------------
  343|    643|		break;
  344|    204|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 204, False: 48.8k]
  ------------------
  345|    473|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 269, False: 48.7k]
  ------------------
  346|    870|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 397, False: 48.6k]
  ------------------
  347|    870|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    870|#define CF(format,target,v,maxlen)                              \
  |  |   36|    870|{                                                               \
  |  |   37|    870|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 281, False: 589]
  |  |  ------------------
  |  |   38|    281|                snprintf (v, maxlen,	                        \
  |  |   39|    281|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    281|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    281|                        "expected '%s'."),                      \
  |  |   41|    281|                        exif_format_get_name (format),          \
  |  |   42|    281|                        exif_format_get_name (target));         \
  |  |   43|    281|                break;                                          \
  |  |   44|    281|        }                                                       \
  |  |   45|    870|}
  ------------------
  348|    589|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    589|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    589|{                                                                       \
  |  |   62|    589|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 387, False: 202]
  |  |  ------------------
  |  |   63|    387|                snprintf (v, maxlen,                                    \
  |  |   64|    387|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    387|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    387|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    387|                break;                                                  \
  |  |   67|    387|        }                                                               \
  |  |   68|    589|}
  ------------------
  349|    202|		vl =  exif_get_long (entry->data, entry->order);
  350|    202|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    202|		break;
  352|    524|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 524, False: 48.5k]
  ------------------
  353|  1.07k|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 551, False: 48.5k]
  ------------------
  354|  1.07k|		unsigned char h,m,l;
  355|  1.07k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  1.07k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.07k|{                                                               \
  |  |   37|  1.07k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 268, False: 807]
  |  |  ------------------
  |  |   38|    268|                snprintf (v, maxlen,	                        \
  |  |   39|    268|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    268|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    268|                        "expected '%s'."),                      \
  |  |   41|    268|                        exif_format_get_name (format),          \
  |  |   42|    268|                        exif_format_get_name (target));         \
  |  |   43|    268|                break;                                          \
  |  |   44|    268|        }                                                       \
  |  |   45|  1.07k|}
  ------------------
  356|    807|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    807|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    807|{                                                                       \
  |  |   62|    807|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 312, False: 495]
  |  |  ------------------
  |  |   63|    312|                snprintf (v, maxlen,                                    \
  |  |   64|    312|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    312|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    312|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    312|                break;                                                  \
  |  |   67|    312|        }                                                               \
  |  |   68|    807|}
  ------------------
  357|    495|		vl =  exif_get_long (entry->data, entry->order);
  358|    495|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    495|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 274, False: 221]
  ------------------
  360|    495|		break;
  361|    807|	}
  362|    205|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 205, False: 48.8k]
  ------------------
  363|    726|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 521, False: 48.5k]
  ------------------
  364|    726|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    726|#define CF(format,target,v,maxlen)                              \
  |  |   36|    726|{                                                               \
  |  |   37|    726|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 260, False: 466]
  |  |  ------------------
  |  |   38|    260|                snprintf (v, maxlen,	                        \
  |  |   39|    260|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    260|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    260|                        "expected '%s'."),                      \
  |  |   41|    260|                        exif_format_get_name (format),          \
  |  |   42|    260|                        exif_format_get_name (target));         \
  |  |   43|    260|                break;                                          \
  |  |   44|    260|        }                                                       \
  |  |   45|    726|}
  ------------------
  365|    466|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    466|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    466|{                                                                       \
  |  |   62|    466|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 272, False: 194]
  |  |  ------------------
  |  |   63|    272|                snprintf (v, maxlen,                                    \
  |  |   64|    272|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    272|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    272|                break;                                                  \
  |  |   67|    272|        }                                                               \
  |  |   68|    466|}
  ------------------
  366|    194|		vl =  exif_get_long (entry->data, entry->order);
  367|    194|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    194|		break;
  369|    752|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 752, False: 48.3k]
  ------------------
  370|    873|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 121, False: 48.9k]
  ------------------
  371|  1.07k|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 198, False: 48.8k]
  ------------------
  372|  1.26k|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 197, False: 48.8k]
  ------------------
  373|  1.47k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 209, False: 48.8k]
  ------------------
  374|  1.47k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.47k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.47k|{                                                               \
  |  |   37|  1.47k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 621, False: 856]
  |  |  ------------------
  |  |   38|    621|                snprintf (v, maxlen,	                        \
  |  |   39|    621|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    621|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    621|                        "expected '%s'."),                      \
  |  |   41|    621|                        exif_format_get_name (format),          \
  |  |   42|    621|                        exif_format_get_name (target));         \
  |  |   43|    621|                break;                                          \
  |  |   44|    621|        }                                                       \
  |  |   45|  1.47k|}
  ------------------
  375|    856|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    856|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    856|{                                                                       \
  |  |   62|    856|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 431, False: 425]
  |  |  ------------------
  |  |   63|    431|                snprintf (v, maxlen,                                    \
  |  |   64|    431|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    431|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    431|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    431|                break;                                                  \
  |  |   67|    431|        }                                                               \
  |  |   68|    856|}
  ------------------
  376|    425|		vs = exif_get_short (entry->data, entry->order);
  377|    425|		snprintf (v, maxlen, "%hd", vs);
  378|    425|		break;
  379|  1.19k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.19k, False: 47.8k]
  ------------------
  380|  1.19k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.19k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.19k|{                                                               \
  |  |   37|  1.19k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 235, False: 959]
  |  |  ------------------
  |  |   38|    235|                snprintf (v, maxlen,	                        \
  |  |   39|    235|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    235|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    235|                        "expected '%s'."),                      \
  |  |   41|    235|                        exif_format_get_name (format),          \
  |  |   42|    235|                        exif_format_get_name (target));         \
  |  |   43|    235|                break;                                          \
  |  |   44|    235|        }                                                       \
  |  |   45|  1.19k|}
  ------------------
  381|    959|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    959|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    959|{                                                                       \
  |  |   62|    959|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 241, False: 718]
  |  |  ------------------
  |  |   63|    241|                snprintf (v, maxlen,                                    \
  |  |   64|    241|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    241|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    241|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    241|                break;                                                  \
  |  |   67|    241|        }                                                               \
  |  |   68|    959|}
  ------------------
  382|    718|		vr = exif_get_rational (entry->data, entry->order);
  383|    718|		r = R2D(vr);
  ------------------
  |  |   82|    718|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 486, False: 232]
  |  |  ------------------
  ------------------
  384|    718|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    718|		b = R2D(vr);
  ------------------
  |  |   82|    718|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 369, False: 349]
  |  |  ------------------
  ------------------
  386|    718|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    718|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    718|		break;
  388|  1.07k|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 1.07k, False: 47.9k]
  ------------------
  389|  1.07k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.07k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.07k|{                                                               \
  |  |   37|  1.07k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 276, False: 794]
  |  |  ------------------
  |  |   38|    276|                snprintf (v, maxlen,	                        \
  |  |   39|    276|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    276|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    276|                        "expected '%s'."),                      \
  |  |   41|    276|                        exif_format_get_name (format),          \
  |  |   42|    276|                        exif_format_get_name (target));         \
  |  |   43|    276|                break;                                          \
  |  |   44|    276|        }                                                       \
  |  |   45|  1.07k|}
  ------------------
  390|    794|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    794|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    794|{                                                                       \
  |  |   62|    794|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 226, False: 568]
  |  |  ------------------
  |  |   63|    226|                snprintf (v, maxlen,                                    \
  |  |   64|    226|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    226|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    226|                break;                                                  \
  |  |   67|    226|        }                                                               \
  |  |   68|    794|}
  ------------------
  391|    568|		vr = exif_get_rational (entry->data, entry->order);
  392|    568|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 206, False: 362]
  |  Branch (392:24): [True: 78, False: 284]
  ------------------
  393|    284|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    284|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    284|		} else {
  395|    284|			r = R2D(vr);
  ------------------
  |  |   82|    284|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 284, False: 0]
  |  |  ------------------
  ------------------
  396|    284|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    284|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    284|		}
  398|    568|		break;
  399|  1.46k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 1.46k, False: 47.5k]
  ------------------
  400|  1.46k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.46k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.46k|{                                                               \
  |  |   37|  1.46k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 234, False: 1.23k]
  |  |  ------------------
  |  |   38|    234|                snprintf (v, maxlen,	                        \
  |  |   39|    234|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    234|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    234|                        "expected '%s'."),                      \
  |  |   41|    234|                        exif_format_get_name (format),          \
  |  |   42|    234|                        exif_format_get_name (target));         \
  |  |   43|    234|                break;                                          \
  |  |   44|    234|        }                                                       \
  |  |   45|  1.46k|}
  ------------------
  401|  1.23k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.23k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.23k|{                                                                       \
  |  |   62|  1.23k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 175, False: 1.05k]
  |  |  ------------------
  |  |   63|    175|                snprintf (v, maxlen,                                    \
  |  |   64|    175|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    175|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    175|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    175|                break;                                                  \
  |  |   67|    175|        }                                                               \
  |  |   68|  1.23k|}
  ------------------
  402|  1.05k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.05k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.05k|		r = R2D(vr);
  ------------------
  |  |   82|  1.05k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 819, False: 236]
  |  |  ------------------
  ------------------
  405|  1.05k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.05k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 802, False: 253]
  |  |  ------------------
  ------------------
  406|  1.05k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.05k|		break;
  408|  1.06k|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 1.06k, False: 47.9k]
  ------------------
  409|  1.06k|		CF2 (entry->format, EXIF_FORMAT_BYTE, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   47|  1.06k|#define CF2(format,target1,target2,v,maxlen)                    \
  |  |   48|  1.06k|{                                                               \
  |  |   49|  1.06k|        if ((format != target1) && (format != target2)) {       \
  |  |  ------------------
  |  |  |  Branch (49:13): [True: 604, False: 458]
  |  |  |  Branch (49:36): [True: 272, False: 332]
  |  |  ------------------
  |  |   50|    272|                snprintf (v, maxlen,	                        \
  |  |   51|    272|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    272|                        "expected '%s' or '%s'."),              \
  |  |   53|    272|                        exif_format_get_name (format),          \
  |  |   54|    272|                        exif_format_get_name (target1),         \
  |  |   55|    272|                        exif_format_get_name (target2));        \
  |  |   56|    272|                break;                                          \
  |  |   57|    272|        }                                                       \
  |  |   58|  1.06k|}
  ------------------
  410|    790|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    790|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    790|{                                                                       \
  |  |   62|    790|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 252, False: 538]
  |  |  ------------------
  |  |   63|    252|                snprintf (v, maxlen,                                    \
  |  |   64|    252|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    252|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    252|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    252|                break;                                                  \
  |  |   67|    252|        }                                                               \
  |  |   68|    790|}
  ------------------
  411|    538|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 215, False: 323]
  ------------------
  412|    215|			vs = exif_get_short (entry->data, entry->order);
  413|    323|		} else {
  414|    323|			vs = entry->data[0];
  415|    323|		}
  416|    538|		snprintf (v, maxlen, "%hd", vs);
  417|    538|		break;
  418|  2.86k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.86k, False: 46.1k]
  ------------------
  419|  2.86k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.86k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.86k|{                                                               \
  |  |   37|  2.86k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 246, False: 2.61k]
  |  |  ------------------
  |  |   38|    246|                snprintf (v, maxlen,	                        \
  |  |   39|    246|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    246|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    246|                        "expected '%s'."),                      \
  |  |   41|    246|                        exif_format_get_name (format),          \
  |  |   42|    246|                        exif_format_get_name (target));         \
  |  |   43|    246|                break;                                          \
  |  |   44|    246|        }                                                       \
  |  |   45|  2.86k|}
  ------------------
  420|  2.61k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.61k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.61k|{                                                                       \
  |  |   62|  2.61k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 293, False: 2.32k]
  |  |  ------------------
  |  |   63|    293|                snprintf (v, maxlen,                                    \
  |  |   64|    293|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    293|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    293|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    293|                break;                                                  \
  |  |   67|    293|        }                                                               \
  |  |   68|  2.61k|}
  ------------------
  421|  2.32k|		switch (  *( entry->data+1)  ) {
  422|    216|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 216, False: 2.10k]
  ------------------
  423|    197|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 197, False: 2.12k]
  ------------------
  424|    216|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 216, False: 2.10k]
  ------------------
  425|    194|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 194, False: 2.13k]
  ------------------
  426|    194|		  	case  4: strncpy (v, _("AF position: right"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (426:6): [True: 194, False: 2.13k]
  ------------------
  427|    195|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 195, False: 2.13k]
  ------------------
  428|    151|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    151|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 151, False: 2.17k]
  ------------------
  429|    211|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 211, False: 2.11k]
  ------------------
  430|     66|		  	case  8: strncpy (v, _("AF position: lower-right"), maxlen); break;
  ------------------
  |  |   31|     66|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (430:6): [True: 66, False: 2.25k]
  ------------------
  431|    194|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 194, False: 2.13k]
  ------------------
  432|    194|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 194, False: 2.13k]
  ------------------
  433|    297|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    297|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 297, False: 2.02k]
  ------------------
  434|  2.32k|		}     
  435|  2.32k|		break;
  436|  2.32k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.29k, False: 47.7k]
  ------------------
  437|  1.29k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.29k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.29k|{                                                               \
  |  |   37|  1.29k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 87, False: 1.20k]
  |  |  ------------------
  |  |   38|     87|                snprintf (v, maxlen,	                        \
  |  |   39|     87|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     87|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     87|                        "expected '%s'."),                      \
  |  |   41|     87|                        exif_format_get_name (format),          \
  |  |   42|     87|                        exif_format_get_name (target));         \
  |  |   43|     87|                break;                                          \
  |  |   44|     87|        }                                                       \
  |  |   45|  1.29k|}
  ------------------
  438|  1.20k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.20k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.20k|{                                                                       \
  |  |   62|  1.20k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 210, False: 998]
  |  |  ------------------
  |  |   63|    210|                snprintf (v, maxlen,                                    \
  |  |   64|    210|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    210|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    210|                break;                                                  \
  |  |   67|    210|        }                                                               \
  |  |   68|  1.20k|}
  ------------------
  439|    998|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  13.9k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 13.9k, False: 0]
  |  Branch (441:32): [True: 12.9k, False: 998]
  ------------------
  442|  12.9k|			;
  443|    998|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 998]
  ------------------
  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|    998|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|    998|#define CF(format,target,v,maxlen)                              \
  |  |   36|    998|{                                                               \
  |  |   37|    998|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 998]
  |  |  ------------------
  |  |   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|    998|}
  ------------------
  448|       |		/* find the value */
  449|  2.86k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.55k, False: 313]
  ------------------
  450|  2.55k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.86k, False: 685]
  ------------------
  451|    998|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 320, False: 678]
  ------------------
  452|    320|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    320|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    320|			break;
  454|    320|		}
  455|    678|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    678|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    678|		break;
  457|  1.34k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.34k, False: 47.7k]
  ------------------
  458|  1.34k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 1.08k, False: 265]
  ------------------
  459|  1.08k|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.08k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.08k|{                                                                       \
  |  |   62|  1.08k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 301, False: 781]
  |  |  ------------------
  |  |   63|    301|                snprintf (v, maxlen,                                    \
  |  |   64|    301|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    301|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    301|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    301|                break;                                                  \
  |  |   67|    301|        }                                                               \
  |  |   68|  1.08k|}
  ------------------
  460|    781|			vr = exif_get_rational (entry->data, entry->order);
  461|    781|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 198, False: 583]
  |  Branch (461:25): [True: 222, False: 361]
  ------------------
  462|    420|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    420|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    420|			} else {
  464|    361|				r = R2D(vr);
  ------------------
  |  |   82|    361|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 361, False: 0]
  |  |  ------------------
  ------------------
  465|    361|				snprintf (v, maxlen, "%2.2f", r);
  466|    361|			}
  467|    781|			break;
  468|  1.08k|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    464|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 199, False: 48.8k]
  ------------------
  472|    678|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 214, False: 48.8k]
  ------------------
  473|    890|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 212, False: 48.8k]
  ------------------
  474|  1.04k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 154, False: 48.9k]
  ------------------
  475|  1.25k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 208, False: 48.8k]
  ------------------
  476|  1.44k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 196, False: 48.8k]
  ------------------
  477|  1.67k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 227, False: 48.8k]
  ------------------
  478|  1.87k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 195, False: 48.8k]
  ------------------
  479|  2.07k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 202, False: 48.8k]
  ------------------
  480|  2.30k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 231, False: 48.8k]
  ------------------
  481|  2.53k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 230, False: 48.8k]
  ------------------
  482|  2.74k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 213, False: 48.8k]
  ------------------
  483|  2.96k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 215, False: 48.8k]
  ------------------
  484|  3.16k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 200, False: 48.8k]
  ------------------
  485|  3.49k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 335, False: 48.7k]
  ------------------
  486|  3.70k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 210, False: 48.8k]
  ------------------
  487|  3.97k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 268, False: 48.7k]
  ------------------
  488|  4.31k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 340, False: 48.7k]
  ------------------
  489|  4.51k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 196, False: 48.8k]
  ------------------
  490|  4.71k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 204, False: 48.8k]
  ------------------
  491|  5.20k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 488, False: 48.5k]
  ------------------
  492|  5.43k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 232, False: 48.8k]
  ------------------
  493|  5.80k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 369, False: 48.6k]
  ------------------
  494|  6.00k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 200, False: 48.8k]
  ------------------
  495|  6.20k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 202, False: 48.8k]
  ------------------
  496|  6.41k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 213, False: 48.8k]
  ------------------
  497|  6.67k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 261, False: 48.7k]
  ------------------
  498|  6.67k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  6.67k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  6.67k|{                                                                       \
  |  |   62|  6.67k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.30k, False: 4.37k]
  |  |  ------------------
  |  |   63|  2.30k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.30k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.30k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.30k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.30k|                break;                                                  \
  |  |   67|  2.30k|        }                                                               \
  |  |   68|  6.67k|}
  ------------------
  499|  4.37k|		switch (entry->format) {
  500|    674|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 674, False: 3.69k]
  ------------------
  501|  1.16k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 488, False: 3.88k]
  ------------------
  502|  1.16k|			vs = entry->data[0];
  503|  1.16k|			break;
  504|  2.18k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 2.18k, False: 2.18k]
  ------------------
  505|  2.18k|			vs = exif_get_short(entry->data, entry->order);
  506|  2.18k|			break;
  507|  1.02k|		default:
  ------------------
  |  Branch (507:3): [True: 1.02k, False: 3.34k]
  ------------------
  508|  1.02k|			vs = 0;
  509|  1.02k|			break;
  510|  4.37k|		}
  511|       |		/* search for the tag */
  512|  78.0k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 77.8k, False: 213]
  |  Branch (512:32): [True: 73.6k, False: 4.16k]
  ------------------
  513|  73.6k|			;
  514|  4.37k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 213, False: 4.16k]
  ------------------
  515|    213|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|    213|		  	break;
  517|    213|		}
  518|  4.16k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  4.16k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  4.16k|{                                                               \
  |  |   37|  4.16k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 1.77k, False: 2.38k]
  |  |  ------------------
  |  |   38|  1.77k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.77k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.77k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.77k|                        "expected '%s'."),                      \
  |  |   41|  1.77k|                        exif_format_get_name (format),          \
  |  |   42|  1.77k|                        exif_format_get_name (target));         \
  |  |   43|  1.77k|                break;                                          \
  |  |   44|  1.77k|        }                                                       \
  |  |   45|  4.16k|}
  ------------------
  519|       |		/* find the value */
  520|  8.28k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 7.11k, False: 1.16k]
  ------------------
  521|  7.11k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 5.90k, False: 1.21k]
  ------------------
  522|  2.38k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.20k, False: 1.17k]
  ------------------
  523|  1.20k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.20k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.20k|			break;
  525|  1.20k|		}
  526|  1.17k|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|  1.17k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|  1.17k|		break;
  528|    201|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 201, False: 48.8k]
  ------------------
  529|    415|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 214, False: 48.8k]
  ------------------
  530|    549|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 134, False: 48.9k]
  ------------------
  531|    772|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 223, False: 48.8k]
  ------------------
  532|    850|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 78, False: 48.9k]
  ------------------
  533|  1.09k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 245, False: 48.8k]
  ------------------
  534|  1.34k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 248, False: 48.8k]
  ------------------
  535|  1.55k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 216, False: 48.8k]
  ------------------
  536|  1.91k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 359, False: 48.6k]
  ------------------
  537|  1.91k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.91k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.91k|{                                                               \
  |  |   37|  1.91k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 469, False: 1.44k]
  |  |  ------------------
  |  |   38|    469|                snprintf (v, maxlen,	                        \
  |  |   39|    469|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    469|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    469|                        "expected '%s'."),                      \
  |  |   41|    469|                        exif_format_get_name (format),          \
  |  |   42|    469|                        exif_format_get_name (target));         \
  |  |   43|    469|                break;                                          \
  |  |   44|    469|        }                                                       \
  |  |   45|  1.91k|}
  ------------------
  538|  1.44k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.44k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.44k|{                                                                       \
  |  |   62|  1.44k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 461, False: 988]
  |  |  ------------------
  |  |   63|    461|                snprintf (v, maxlen,                                    \
  |  |   64|    461|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    461|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    461|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    461|                break;                                                  \
  |  |   67|    461|        }                                                               \
  |  |   68|  1.44k|}
  ------------------
  539|    988|		vs = exif_get_short (entry->data, entry->order);
  540|    988|		switch (vs) {
  541|    324|		case 0:
  ------------------
  |  Branch (541:3): [True: 324, False: 664]
  ------------------
  542|    324|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    324|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    324|			break;
  544|    206|		case 1:
  ------------------
  |  Branch (544:3): [True: 206, False: 782]
  ------------------
  545|    206|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|    206|			break;
  547|    458|		default:
  ------------------
  |  Branch (547:3): [True: 458, False: 530]
  ------------------
  548|    458|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    458|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    458|			strncat (v, buf, maxlen - strlen (v));
  550|    458|			break;
  551|    988|		}
  552|    988|		break;
  553|  1.38k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.38k, False: 47.6k]
  ------------------
  554|  1.38k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.38k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.38k|{                                                               \
  |  |   37|  1.38k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 217, False: 1.16k]
  |  |  ------------------
  |  |   38|    217|                snprintf (v, maxlen,	                        \
  |  |   39|    217|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    217|                        "expected '%s'."),                      \
  |  |   41|    217|                        exif_format_get_name (format),          \
  |  |   42|    217|                        exif_format_get_name (target));         \
  |  |   43|    217|                break;                                          \
  |  |   44|    217|        }                                                       \
  |  |   45|  1.38k|}
  ------------------
  555|  1.16k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.16k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.16k|{                                                                       \
  |  |   62|  1.16k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 230, False: 939]
  |  |  ------------------
  |  |   63|    230|                snprintf (v, maxlen,                                    \
  |  |   64|    230|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    230|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    230|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    230|                break;                                                  \
  |  |   67|    230|        }                                                               \
  |  |   68|  1.16k|}
  ------------------
  556|    939|		vs = exif_get_short (entry->data, entry->order);
  557|    939|		switch (vs) {
  558|    256|		case 0:
  ------------------
  |  Branch (558:3): [True: 256, False: 683]
  ------------------
  559|    256|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    256|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    256|			break;
  561|    208|		case 1:
  ------------------
  |  Branch (561:3): [True: 208, False: 731]
  ------------------
  562|    208|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|    208|			break;
  564|    195|		case 2:
  ------------------
  |  Branch (564:3): [True: 195, False: 744]
  ------------------
  565|    195|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|    195|			break;
  567|    280|		default:
  ------------------
  |  Branch (567:3): [True: 280, False: 659]
  ------------------
  568|    280|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    280|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    280|			strncat (v, buf, maxlen - strlen (v));
  570|    280|			break;
  571|    939|		}
  572|    939|		break;
  573|  1.68k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.68k, False: 47.3k]
  ------------------
  574|  1.68k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.68k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.68k|{                                                               \
  |  |   37|  1.68k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 216, False: 1.46k]
  |  |  ------------------
  |  |   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|  1.68k|}
  ------------------
  575|  1.46k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.46k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.46k|{                                                                       \
  |  |   62|  1.46k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 243, False: 1.22k]
  |  |  ------------------
  |  |   63|    243|                snprintf (v, maxlen,                                    \
  |  |   64|    243|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    243|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    243|                break;                                                  \
  |  |   67|    243|        }                                                               \
  |  |   68|  1.46k|}
  ------------------
  576|  1.22k|		{
  577|  1.22k|			double ao,ac;
  578|  1.22k|			unsigned long fs,fl;
  579|  1.22k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.22k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.22k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 943, False: 280]
  |  |  ------------------
  ------------------
  581|  1.22k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.22k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.22k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 953, False: 270]
  |  |  ------------------
  ------------------
  583|  1.22k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.22k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.22k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 918, False: 305]
  |  |  ------------------
  ------------------
  585|  1.22k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.22k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.22k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 788, False: 435]
  |  |  ------------------
  ------------------
  587|  1.22k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.22k|		}
  589|  1.22k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.07k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.07k, False: 46.9k]
  ------------------
  593|  2.07k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.07k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.07k|{                                                               \
  |  |   37|  2.07k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 239, False: 1.83k]
  |  |  ------------------
  |  |   38|    239|                snprintf (v, maxlen,	                        \
  |  |   39|    239|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    239|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    239|                        "expected '%s'."),                      \
  |  |   41|    239|                        exif_format_get_name (format),          \
  |  |   42|    239|                        exif_format_get_name (target));         \
  |  |   43|    239|                break;                                          \
  |  |   44|    239|        }                                                       \
  |  |   45|  2.07k|}
  ------------------
  594|  1.83k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  1.83k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.83k|{                                                                       \
  |  |   62|  1.83k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 273, False: 1.56k]
  |  |  ------------------
  |  |   63|    273|                snprintf (v, maxlen,                                    \
  |  |   64|    273|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    273|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    273|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    273|                break;                                                  \
  |  |   67|    273|        }                                                               \
  |  |   68|  1.83k|}
  ------------------
  595|  1.56k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.56k|		switch (vl) {
  597|    363|		case 0:
  ------------------
  |  Branch (597:3): [True: 363, False: 1.19k]
  ------------------
  598|    363|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    363|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    363|			break;
  600|    194|		case 1:
  ------------------
  |  Branch (600:3): [True: 194, False: 1.36k]
  ------------------
  601|    194|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    194|			break;
  603|    450|		case 2:
  ------------------
  |  Branch (603:3): [True: 450, False: 1.11k]
  ------------------
  604|    450|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    450|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    450|			break;
  606|    300|		case 3:
  ------------------
  |  Branch (606:3): [True: 300, False: 1.26k]
  ------------------
  607|    300|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    300|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    300|			break;
  609|    255|		default:
  ------------------
  |  Branch (609:3): [True: 255, False: 1.30k]
  ------------------
  610|    255|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.56k|		}
  612|  1.56k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.56k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.56k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.56k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.56k|		switch (vl) {
  617|    195|		case 1:
  ------------------
  |  Branch (617:3): [True: 195, False: 1.36k]
  ------------------
  618|    195|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    195|			break;
  620|    202|		case 2:
  ------------------
  |  Branch (620:3): [True: 202, False: 1.36k]
  ------------------
  621|    202|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    202|			break;
  623|    199|		case 3:
  ------------------
  |  Branch (623:3): [True: 199, False: 1.36k]
  ------------------
  624|    199|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    199|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    199|			break;
  626|    322|		case 4:
  ------------------
  |  Branch (626:3): [True: 322, False: 1.24k]
  ------------------
  627|    322|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|    322|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|    322|			break;
  629|    644|		default:
  ------------------
  |  Branch (629:3): [True: 644, False: 918]
  ------------------
  630|    644|			snprintf (buf, sizeof (buf), "%li",
  631|    644|				  (long int) vl);
  632|    644|			strncat (v, buf, maxlen - strlen (v));
  633|  1.56k|		}
  634|  1.56k|		break;
  635|  1.56k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.47k, False: 47.5k]
  ------------------
  636|  1.47k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 272, False: 1.20k]
  ------------------
  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: 206, False: 66]
  |  |  ------------------
  |  |   63|    206|                snprintf (v, maxlen,                                    \
  |  |   64|    206|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    206|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    206|                break;                                                  \
  |  |   67|    206|        }                                                               \
  |  |   68|    272|}
  ------------------
  639|     66|			vs = exif_get_short (entry->data, entry->order);
  640|     66|			sprintf (buf, "%hu", vs);
  641|     66|			strncat (v, buf, maxlen - strlen (v));
  642|  1.20k|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|  1.20k|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.20k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.20k|{                                                                       \
  |  |   62|  1.20k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 256, False: 949]
  |  |  ------------------
  |  |   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|  1.20k|}
  ------------------
  645|    949|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    949|#define CF(format,target,v,maxlen)                              \
  |  |   36|    949|{                                                               \
  |  |   37|    949|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 738]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|    949|}
  ------------------
  646|  5.16k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 4.42k, False: 738]
  ------------------
  647|  4.42k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  4.42k|				sprintf (buf, "%hd ", vss);
  649|  4.42k|				strncat (v, buf, maxlen - strlen (v));
  650|  4.42k|			}
  651|    738|		}
  652|    804|		break;
  653|  1.21k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.21k, False: 47.8k]
  ------------------
  654|  1.21k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.21k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.21k|{                                                               \
  |  |   37|  1.21k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 216, False: 994]
  |  |  ------------------
  |  |   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|  1.21k|}
  ------------------
  655|    994|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|    994|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    994|{                                                                       \
  |  |   62|    994|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 243, False: 751]
  |  |  ------------------
  |  |   63|    243|                snprintf (v, maxlen,                                    \
  |  |   64|    243|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    243|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    243|                break;                                                  \
  |  |   67|    243|        }                                                               \
  |  |   68|    994|}
  ------------------
  656|  5.25k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 4.50k, False: 751]
  ------------------
  657|  4.50k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  4.50k|			sprintf (buf, "%hu ", vs);
  659|  4.50k|			strncat (v, buf, maxlen - strlen (v));
  660|  4.50k|		}
  661|    751|		break;
  662|    709|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 709, False: 48.3k]
  ------------------
  663|    709|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    709|#define CF(format,target,v,maxlen)                              \
  |  |   36|    709|{                                                               \
  |  |   37|    709|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 200, False: 509]
  |  |  ------------------
  |  |   38|    200|                snprintf (v, maxlen,	                        \
  |  |   39|    200|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    200|                        "expected '%s'."),                      \
  |  |   41|    200|                        exif_format_get_name (format),          \
  |  |   42|    200|                        exif_format_get_name (target));         \
  |  |   43|    200|                break;                                          \
  |  |   44|    200|        }                                                       \
  |  |   45|    709|}
  ------------------
  664|    509|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    509|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    509|{                                                                       \
  |  |   72|    509|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 73, False: 436]
  |  |  |  Branch (72:23): [True: 210, False: 226]
  |  |  ------------------
  |  |   73|    283|		snprintf (v, maxlen,                                    \
  |  |   74|    283|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    283|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    283|			"expected %i or %i)."), (int) number,		\
  |  |   76|    283|			(int) t1, (int) t2);  				\
  |  |   77|    283|		break;                                                  \
  |  |   78|    283|	}                                                               \
  |  |   79|    509|}
  ------------------
  665|    226|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    226|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 226]
  |  |  ------------------
  ------------------
  666|    226|		break;
  667|    523|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 523, False: 48.5k]
  ------------------
  668|    523|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    523|#define CF(format,target,v,maxlen)                              \
  |  |   36|    523|{                                                               \
  |  |   37|    523|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 76, False: 447]
  |  |  ------------------
  |  |   38|     76|                snprintf (v, maxlen,	                        \
  |  |   39|     76|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     76|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     76|                        "expected '%s'."),                      \
  |  |   41|     76|                        exif_format_get_name (format),          \
  |  |   42|     76|                        exif_format_get_name (target));         \
  |  |   43|     76|                break;                                          \
  |  |   44|     76|        }                                                       \
  |  |   45|    523|}
  ------------------
  669|    447|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    447|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 224, False: 223]
  |  |  ------------------
  ------------------
  670|    447|		break;
  671|    825|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 825, False: 48.2k]
  ------------------
  672|    825|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    825|#define CF(format,target,v,maxlen)                              \
  |  |   36|    825|{                                                               \
  |  |   37|    825|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 228, False: 597]
  |  |  ------------------
  |  |   38|    228|                snprintf (v, maxlen,	                        \
  |  |   39|    228|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    228|                        "expected '%s'."),                      \
  |  |   41|    228|                        exif_format_get_name (format),          \
  |  |   42|    228|                        exif_format_get_name (target));         \
  |  |   43|    228|                break;                                          \
  |  |   44|    228|        }                                                       \
  |  |   45|    825|}
  ------------------
  673|    597|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    597|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    597|{                                                                       \
  |  |   72|    597|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 140, False: 457]
  |  |  |  Branch (72:23): [True: 248, False: 209]
  |  |  ------------------
  |  |   73|    388|		snprintf (v, maxlen,                                    \
  |  |   74|    388|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    388|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    388|			"expected %i or %i)."), (int) number,		\
  |  |   76|    388|			(int) t1, (int) t2);  				\
  |  |   77|    388|		break;                                                  \
  |  |   78|    388|	}                                                               \
  |  |   79|    597|}
  ------------------
  674|    209|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    209|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 209]
  |  |  ------------------
  ------------------
  675|    209|		break;
  676|    632|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 632, False: 48.4k]
  ------------------
  677|    632|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    632|#define CF(format,target,v,maxlen)                              \
  |  |   36|    632|{                                                               \
  |  |   37|    632|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 93, False: 539]
  |  |  ------------------
  |  |   38|     93|                snprintf (v, maxlen,	                        \
  |  |   39|     93|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     93|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     93|                        "expected '%s'."),                      \
  |  |   41|     93|                        exif_format_get_name (format),          \
  |  |   42|     93|                        exif_format_get_name (target));         \
  |  |   43|     93|                break;                                          \
  |  |   44|     93|        }                                                       \
  |  |   45|    632|}
  ------------------
  678|    539|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    539|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    539|{                                                                       \
  |  |   62|    539|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 223, False: 316]
  |  |  ------------------
  |  |   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|    539|}
  ------------------
  679|    316|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    316|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 316]
  |  |  ------------------
  ------------------
  680|    316|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 49.0k]
  ------------------
  682|      0|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|      0|#define CF(format,target,v,maxlen)                              \
  |  |   36|      0|{                                                               \
  |  |   37|      0|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|                snprintf (v, maxlen,	                        \
  |  |   39|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|      0|                        "expected '%s'."),                      \
  |  |   41|      0|                        exif_format_get_name (format),          \
  |  |   42|      0|                        exif_format_get_name (target));         \
  |  |   43|      0|                break;                                          \
  |  |   44|      0|        }                                                       \
  |  |   45|      0|}
  ------------------
  683|      0|		CC (entry->components, 30, v, maxlen)
  ------------------
  |  |   60|      0|#define CC(number,target,v,maxlen)                                      \
  |  |   61|      0|{                                                                       \
  |  |   62|      0|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   63|      0|                snprintf (v, maxlen,                                    \
  |  |   64|      0|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|      0|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|      0|                break;                                                  \
  |  |   67|      0|        }                                                               \
  |  |   68|      0|}
  ------------------
  684|      0|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (684:13): [True: 0, False: 0]
  ------------------
  685|      0|			vl = exif_get_long (entry->data+4*i, entry->order);
  686|      0|			sprintf (buf, "%lu ", (unsigned long)vl);
  687|      0|			strncat (v, buf, maxlen - strlen (v));
  688|      0|		}
  689|      0|		break;
  690|  1.21k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.21k, False: 47.8k]
  ------------------
  691|  1.21k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.21k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.21k|{                                                               \
  |  |   37|  1.21k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 94, False: 1.11k]
  |  |  ------------------
  |  |   38|     94|                snprintf (v, maxlen,	                        \
  |  |   39|     94|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     94|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     94|                        "expected '%s'."),                      \
  |  |   41|     94|                        exif_format_get_name (format),          \
  |  |   42|     94|                        exif_format_get_name (target));         \
  |  |   43|     94|                break;                                          \
  |  |   44|     94|        }                                                       \
  |  |   45|  1.21k|}
  ------------------
  692|  1.11k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.11k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.11k|{                                                                       \
  |  |   62|  1.11k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 282, False: 837]
  |  |  ------------------
  |  |   63|    282|                snprintf (v, maxlen,                                    \
  |  |   64|    282|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    282|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    282|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    282|                break;                                                  \
  |  |   67|    282|        }                                                               \
  |  |   68|  1.11k|}
  ------------------
  693|    837|		vr = exif_get_rational (entry->data, entry->order);
  694|    837|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 224, False: 613]
  |  Branch (694:24): [True: 232, False: 381]
  ------------------
  695|    456|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    456|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    456|		}
  697|    381|		else {
  698|    381|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    381|			snprintf (v, maxlen, "%li mm", tmp);
  700|    381|		}
  701|    837|		break;
  702|  2.26k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.26k, False: 46.7k]
  ------------------
  703|  2.26k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.26k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.26k|{                                                               \
  |  |   37|  2.26k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 209, False: 2.05k]
  |  |  ------------------
  |  |   38|    209|                snprintf (v, maxlen,	                        \
  |  |   39|    209|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    209|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    209|                        "expected '%s'."),                      \
  |  |   41|    209|                        exif_format_get_name (format),          \
  |  |   42|    209|                        exif_format_get_name (target));         \
  |  |   43|    209|                break;                                          \
  |  |   44|    209|        }                                                       \
  |  |   45|  2.26k|}
  ------------------
  704|  2.05k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  2.05k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.05k|{                                                                       \
  |  |   62|  2.05k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 201, False: 1.85k]
  |  |  ------------------
  |  |   63|    201|                snprintf (v, maxlen,                                    \
  |  |   64|    201|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    201|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    201|                break;                                                  \
  |  |   67|    201|        }                                                               \
  |  |   68|  2.05k|}
  ------------------
  705|  1.85k|		vs = exif_get_short (entry->data, entry->order);
  706|  1.85k|		switch (vs) {
  707|    198|		case 1:
  ------------------
  |  Branch (707:3): [True: 198, False: 1.65k]
  ------------------
  708|    198|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    198|			break;
  710|  1.24k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.24k, False: 615]
  ------------------
  711|  1.24k|			{
  712|  1.24k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.24k|				unsigned long colorTemp = 0;
  714|  1.24k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 1.02k, False: 217]
  ------------------
  715|    194|				case 2:
  ------------------
  |  Branch (715:5): [True: 194, False: 1.04k]
  ------------------
  716|    194|					colorTemp = 3000;
  717|    194|					break;
  718|     67|				case 3:
  ------------------
  |  Branch (718:5): [True: 67, False: 1.17k]
  ------------------
  719|     67|					colorTemp = 3700;
  720|     67|					break;
  721|    216|				case 4:
  ------------------
  |  Branch (721:5): [True: 216, False: 1.02k]
  ------------------
  722|    216|					colorTemp = 4000;
  723|    216|					break;
  724|     66|				case 5:
  ------------------
  |  Branch (724:5): [True: 66, False: 1.17k]
  ------------------
  725|     66|					colorTemp = 4500;
  726|     66|					break;
  727|    196|				case 6:
  ------------------
  |  Branch (727:5): [True: 196, False: 1.04k]
  ------------------
  728|    196|					colorTemp = 5500;
  729|    196|					break;
  730|     92|				case 7:
  ------------------
  |  Branch (730:5): [True: 92, False: 1.15k]
  ------------------
  731|     92|					colorTemp = 6500;
  732|     92|					break;
  733|    194|				case 9:
  ------------------
  |  Branch (733:5): [True: 194, False: 1.04k]
  ------------------
  734|    194|					colorTemp = 7500;
  735|    194|					break;
  736|  1.24k|				}
  737|  1.24k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 1.02k, False: 217]
  ------------------
  738|  1.02k|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|  1.02k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|  1.02k|				}
  740|    217|				else {
  741|    217|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|    217|				}
  743|       |
  744|  1.24k|			}
  745|      0|			break;
  746|    198|		case 3:
  ------------------
  |  Branch (746:3): [True: 198, False: 1.65k]
  ------------------
  747|    198|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    198|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    198|			break;
  749|    219|		default:
  ------------------
  |  Branch (749:3): [True: 219, False: 1.63k]
  ------------------
  750|    219|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    219|			break;
  752|  1.85k|		}
  753|  1.85k|		break;
  754|  1.85k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 403, False: 48.6k]
  ------------------
  755|    827|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 424, False: 48.6k]
  ------------------
  756|    827|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    827|#define CF(format,target,v,maxlen)                              \
  |  |   36|    827|{                                                               \
  |  |   37|    827|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 265, False: 562]
  |  |  ------------------
  |  |   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|    827|}
  ------------------
  757|    562|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    562|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    562|{                                                                       \
  |  |   62|    562|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 235, False: 327]
  |  |  ------------------
  |  |   63|    235|                snprintf (v, maxlen,                                    \
  |  |   64|    235|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    235|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    235|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    235|                break;                                                  \
  |  |   67|    235|        }                                                               \
  |  |   68|    562|}
  ------------------
  758|    327|		vs = exif_get_short (entry->data, entry->order);
  759|    327|		snprintf (v, maxlen, "%hu ", vs);
  760|    327|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    327|		sprintf (buf, "%hu", vs);
  762|    327|		strncat (v, buf, maxlen - strlen (v));
  763|    327|		break;
  764|    197|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 197, False: 48.8k]
  ------------------
  765|    641|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 444, False: 48.6k]
  ------------------
  766|    641|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    641|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    641|{                                                                       \
  |  |   62|    641|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 233, False: 408]
  |  |  ------------------
  |  |   63|    233|                snprintf (v, maxlen,                                    \
  |  |   64|    233|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    233|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    233|                break;                                                  \
  |  |   67|    233|        }                                                               \
  |  |   68|    641|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|  1.22k|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 815, False: 48.2k]
  ------------------
  770|  1.22k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.22k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.22k|{                                                               \
  |  |   37|  1.22k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 251, False: 972]
  |  |  ------------------
  |  |   38|    251|                snprintf (v, maxlen,	                        \
  |  |   39|    251|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    251|                        "expected '%s'."),                      \
  |  |   41|    251|                        exif_format_get_name (format),          \
  |  |   42|    251|                        exif_format_get_name (target));         \
  |  |   43|    251|                break;                                          \
  |  |   44|    251|        }                                                       \
  |  |   45|  1.22k|}
  ------------------
  771|    972|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 591, False: 381]
  ------------------
  772|    591|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    591|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    591|{                                                                       \
  |  |   62|    591|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 339, False: 252]
  |  |  ------------------
  |  |   63|    339|                snprintf (v, maxlen,                                    \
  |  |   64|    339|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    339|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    339|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    339|                break;                                                  \
  |  |   67|    339|        }                                                               \
  |  |   68|    591|}
  ------------------
  773|  4.42k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 3.79k, False: 633]
  ------------------
  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|    633|		break;
  779|    195|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 195, False: 48.8k]
  ------------------
  780|    502|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 307, False: 48.7k]
  ------------------
  781|    708|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 206, False: 48.8k]
  ------------------
  782|  1.23k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 526, False: 48.5k]
  ------------------
  783|  1.23k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.23k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.23k|{                                                               \
  |  |   37|  1.23k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 562, False: 672]
  |  |  ------------------
  |  |   38|    562|                snprintf (v, maxlen,	                        \
  |  |   39|    562|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    562|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    562|                        "expected '%s'."),                      \
  |  |   41|    562|                        exif_format_get_name (format),          \
  |  |   42|    562|                        exif_format_get_name (target));         \
  |  |   43|    562|                break;                                          \
  |  |   44|    562|        }                                                       \
  |  |   45|  1.23k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.48k|	default:
  ------------------
  |  Branch (786:2): [True: 3.80k, False: 45.2k]
  ------------------
  787|  4.48k|		switch (entry->format) {
  788|    479|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 479, False: 4.00k]
  ------------------
  789|    479|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    479|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 224, False: 255]
  |  |  ------------------
  ------------------
  790|    479|			break;
  791|    452|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 452, False: 4.02k]
  ------------------
  792|    452|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    452|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    452|{                                                                       \
  |  |   62|    452|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 241, False: 211]
  |  |  ------------------
  |  |   63|    241|                snprintf (v, maxlen,                                    \
  |  |   64|    241|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    241|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    241|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    241|                break;                                                  \
  |  |   67|    241|        }                                                               \
  |  |   68|    452|}
  ------------------
  793|    211|			vs = exif_get_short (entry->data, entry->order);
  794|    211|			snprintf (v, maxlen, "%hu", vs);
  795|    211|			break;
  796|    394|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 394, False: 4.08k]
  ------------------
  797|    394|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    394|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    394|{                                                                       \
  |  |   62|    394|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 198, False: 196]
  |  |  ------------------
  |  |   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|    394|}
  ------------------
  798|    196|			vss = exif_get_sshort (entry->data, entry->order);
  799|    196|			snprintf (v, maxlen, "%hi", vss);
  800|    196|			break;
  801|    527|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 527, False: 3.95k]
  ------------------
  802|    527|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    527|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    527|{                                                                       \
  |  |   62|    527|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 330, False: 197]
  |  |  ------------------
  |  |   63|    330|                snprintf (v, maxlen,                                    \
  |  |   64|    330|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    330|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    330|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    330|                break;                                                  \
  |  |   67|    330|        }                                                               \
  |  |   68|    527|}
  ------------------
  803|    197|			vl = exif_get_long (entry->data, entry->order);
  804|    197|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    197|			break;
  806|    411|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 411, False: 4.07k]
  ------------------
  807|    411|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    411|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    411|{                                                                       \
  |  |   62|    411|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 214, False: 197]
  |  |  ------------------
  |  |   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|    411|}
  ------------------
  808|    197|			vsl = exif_get_slong (entry->data, entry->order);
  809|    197|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|    197|			break;
  811|    918|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 918, False: 3.56k]
  ------------------
  812|    918|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    918|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    918|{                                                                       \
  |  |   62|    918|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 207, False: 711]
  |  |  ------------------
  |  |   63|    207|                snprintf (v, maxlen,                                    \
  |  |   64|    207|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    207|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    207|                break;                                                  \
  |  |   67|    207|        }                                                               \
  |  |   68|    918|}
  ------------------
  813|    711|			vr = exif_get_rational (entry->data, entry->order);
  814|    711|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 332, False: 379]
  ------------------
  815|    332|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    332|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    379|			} else {
  817|    379|				r = R2D(vr);
  ------------------
  |  |   82|    379|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 379, False: 0]
  |  |  ------------------
  ------------------
  818|    379|				snprintf (v, maxlen, "%2.3f", r);
  819|    379|			}
  820|    711|			break;
  821|    784|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 784, False: 3.69k]
  ------------------
  822|    784|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    784|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    784|{                                                                       \
  |  |   62|    784|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 243, False: 541]
  |  |  ------------------
  |  |   63|    243|                snprintf (v, maxlen,                                    \
  |  |   64|    243|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    243|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    243|                break;                                                  \
  |  |   67|    243|        }                                                               \
  |  |   68|    784|}
  ------------------
  823|    541|			vsr = exif_get_srational (entry->data, entry->order);
  824|    541|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 221, False: 320]
  ------------------
  825|    221|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    221|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  826|    320|			} else {
  827|    320|				r = R2D(vsr);
  ------------------
  |  |   82|    320|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 320, False: 0]
  |  |  ------------------
  ------------------
  828|    320|				snprintf (v, maxlen, "%2.3f", r);
  829|    320|			}
  830|    541|			break;
  831|    100|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 100, False: 4.38k]
  ------------------
  832|    516|		default:
  ------------------
  |  Branch (832:3): [True: 416, False: 4.06k]
  ------------------
  833|    516|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    516|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    516|				  entry->size);
  835|  43.8k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 43.3k, False: 516]
  ------------------
  836|  43.3k|				sprintf (buf, "%02x", entry->data[i]);
  837|  43.3k|				strncat (v, buf, maxlen - strlen (v));
  838|  43.3k|			}
  839|    516|			break;
  840|  4.48k|		}
  841|  4.48k|		break;
  842|  49.0k|	}
  843|       |
  844|  49.0k|	return (v);
  845|  49.0k|}

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

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

mnote_pentax_entry_get_value:
  312|  12.2k|{
  313|  12.2k|	ExifLong vl;
  314|  12.2k|	ExifSLong vsl;
  315|  12.2k|	ExifShort vs, vs2;
  316|  12.2k|	ExifSShort vss;
  317|  12.2k|	int i = 0, j = 0;
  318|       |
  319|  12.2k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 12.2k]
  ------------------
  320|  12.2k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 12.2k]
  ------------------
  321|       |
  322|  12.2k|	memset (val, 0, maxlen);
  323|  12.2k|	maxlen--;
  324|       |
  325|  12.2k|	switch (entry->tag) {
  326|    737|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 737, False: 11.4k]
  ------------------
  327|  1.14k|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 408, False: 11.8k]
  ------------------
  328|  1.36k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 217, False: 12.0k]
  ------------------
  329|  1.68k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 323, False: 11.9k]
  ------------------
  330|  1.90k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 223, False: 12.0k]
  ------------------
  331|  2.13k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 225, False: 12.0k]
  ------------------
  332|  2.36k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 236, False: 11.9k]
  ------------------
  333|  2.57k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 203, False: 12.0k]
  ------------------
  334|  2.64k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 71, False: 12.1k]
  ------------------
  335|  2.85k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 216, False: 12.0k]
  ------------------
  336|  3.11k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 257, False: 11.9k]
  ------------------
  337|  3.36k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 247, False: 11.9k]
  ------------------
  338|  3.51k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 153, False: 12.0k]
  ------------------
  339|  3.75k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 239, False: 11.9k]
  ------------------
  340|  3.96k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 209, False: 12.0k]
  ------------------
  341|  4.28k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 324, False: 11.9k]
  ------------------
  342|  4.64k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 352, False: 11.8k]
  ------------------
  343|  5.18k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 544, False: 11.6k]
  ------------------
  344|  5.88k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 702, False: 11.5k]
  ------------------
  345|  6.10k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 220, False: 12.0k]
  ------------------
  346|  6.10k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  6.10k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  6.10k|{                                                               \
  |  |   39|  6.10k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 2.93k, False: 3.17k]
  |  |  ------------------
  |  |   40|  2.93k|		snprintf (v, maxlen,	                        \
  |  |   41|  2.93k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.93k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  2.93k|			"expected '%s'."),                      \
  |  |   43|  2.93k|			exif_format_get_name (format),          \
  |  |   44|  2.93k|			exif_format_get_name (target));         \
  |  |   45|  2.93k|		break;                                          \
  |  |   46|  2.93k|	}                                                       \
  |  |   47|  6.10k|}
  ------------------
  347|  3.17k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.17k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.17k|{                                                                       \
  |  |   61|  3.17k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.36k, False: 1.80k]
  |  |  |  Branch (61:24): [True: 243, False: 1.12k]
  |  |  ------------------
  |  |   62|    243|		snprintf (v, maxlen,                                    \
  |  |   63|    243|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    243|			"expected %i or %i)."), (int) number,		\
  |  |   65|    243|			(int) t1, (int) t2);  				\
  |  |   66|    243|		break;                                                  \
  |  |   67|    243|	}                                                               \
  |  |   68|  3.17k|}
  ------------------
  348|  2.93k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 1.80k, False: 1.12k]
  ------------------
  349|  1.80k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  22.2k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 22.2k, False: 0]
  |  Branch (352:33): [True: 20.3k, False: 1.80k]
  ------------------
  353|  1.80k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 1.80k]
  ------------------
  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|  9.79k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 8.90k, False: 889]
  ------------------
  361|  8.90k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 7.99k, False: 917]
  ------------------
  362|  1.80k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.12k, False: 680]
  ------------------
  363|  1.12k|				snprintf (val, maxlen,
  364|  1.12k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.12k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.12k|				break;
  366|  1.12k|			}
  367|    680|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    680|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|  1.12k|		} else {
  369|       |			/* Two-component values */
  370|  1.12k|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  1.12k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.12k|{                                                               \
  |  |   39|  1.12k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 1.12k]
  |  |  ------------------
  |  |   40|      0|		snprintf (v, maxlen,	                        \
  |  |   41|      0|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|      0|			"expected '%s'."),                      \
  |  |   43|      0|			exif_format_get_name (format),          \
  |  |   44|      0|			exif_format_get_name (target));         \
  |  |   45|      0|		break;                                          \
  |  |   46|      0|	}                                                       \
  |  |   47|  1.12k|}
  ------------------
  371|  1.12k|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  1.12k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  1.12k|{                                                                       \
  |  |   61|  1.12k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.12k, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 1.12k]
  |  |  ------------------
  |  |   62|      0|		snprintf (v, maxlen,                                    \
  |  |   63|      0|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|      0|			"expected %i or %i)."), (int) number,		\
  |  |   65|      0|			(int) t1, (int) t2);  				\
  |  |   66|      0|		break;                                                  \
  |  |   67|      0|	}                                                               \
  |  |   68|  1.12k|}
  ------------------
  372|  1.12k|			vs = exif_get_short (entry->data, entry->order);
  373|  1.12k|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  2.36k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.87k, False: 494]
  |  Branch (376:34): [True: 1.24k, False: 630]
  ------------------
  377|  1.12k|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 494, False: 630]
  ------------------
  378|    494|				snprintf (val, maxlen,
  379|    494|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    494|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    494|			  	break;
  381|    494|			}
  382|       |
  383|       |			/* find the value */
  384|  2.21k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 2.21k, False: 0]
  |  Branch (384:45): [True: 0, False: 2.21k]
  ------------------
  385|  2.21k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.91k, False: 301]
  |  Branch (385:46): [True: 1.58k, False: 329]
  ------------------
  386|    630|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 317, False: 313]
  |  Branch (386:44): [True: 0, False: 313]
  ------------------
  387|    317|				snprintf (val, maxlen,
  388|    317|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    317|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    317|				break;
  390|    317|			}
  391|    313|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    313|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    313|		}
  393|    993|		break;
  394|       |
  395|    993|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 538, False: 11.6k]
  ------------------
  396|    538|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    538|#define CF(format,target,v,maxlen)                              \
  |  |   38|    538|{                                                               \
  |  |   39|    538|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 251, False: 287]
  |  |  ------------------
  |  |   40|    251|		snprintf (v, maxlen,	                        \
  |  |   41|    251|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    251|			"expected '%s'."),                      \
  |  |   43|    251|			exif_format_get_name (format),          \
  |  |   44|    251|			exif_format_get_name (target));         \
  |  |   45|    251|		break;                                          \
  |  |   46|    251|	}                                                       \
  |  |   47|    538|}
  ------------------
  397|    287|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    287|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    287|{                                                                       \
  |  |   51|    287|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 211, False: 76]
  |  |  ------------------
  |  |   52|    211|		snprintf (v, maxlen,                                    \
  |  |   53|    211|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    211|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    211|		break;                                                  \
  |  |   56|    211|	}                                                               \
  |  |   57|    287|}
  ------------------
  398|     76|		vl = exif_get_long (entry->data, entry->order);
  399|     76|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|     76|		break;
  401|    709|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 709, False: 11.5k]
  ------------------
  402|    709|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    709|#define CF(format,target,v,maxlen)                              \
  |  |   38|    709|{                                                               \
  |  |   39|    709|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 275, False: 434]
  |  |  ------------------
  |  |   40|    275|		snprintf (v, maxlen,	                        \
  |  |   41|    275|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    275|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    275|			"expected '%s'."),                      \
  |  |   43|    275|			exif_format_get_name (format),          \
  |  |   44|    275|			exif_format_get_name (target));         \
  |  |   45|    275|		break;                                          \
  |  |   46|    275|	}                                                       \
  |  |   47|    709|}
  ------------------
  403|    434|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    434|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    434|{                                                                       \
  |  |   51|    434|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 217, False: 217]
  |  |  ------------------
  |  |   52|    217|		snprintf (v, maxlen,                                    \
  |  |   53|    217|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    217|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    217|		break;                                                  \
  |  |   56|    217|	}                                                               \
  |  |   57|    434|}
  ------------------
  404|    217|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|    217|			entry->size);
  406|    217|		break;
  407|    417|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 417, False: 11.8k]
  ------------------
  408|    804|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 387, False: 11.8k]
  ------------------
  409|    804|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    804|#define CF(format,target,v,maxlen)                              \
  |  |   38|    804|{                                                               \
  |  |   39|    804|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 292, False: 512]
  |  |  ------------------
  |  |   40|    292|		snprintf (v, maxlen,	                        \
  |  |   41|    292|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    292|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    292|			"expected '%s'."),                      \
  |  |   43|    292|			exif_format_get_name (format),          \
  |  |   44|    292|			exif_format_get_name (target));         \
  |  |   45|    292|		break;                                          \
  |  |   46|    292|	}                                                       \
  |  |   47|    804|}
  ------------------
  410|    512|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    512|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    512|{                                                                       \
  |  |   51|    512|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 200, False: 312]
  |  |  ------------------
  |  |   52|    200|		snprintf (v, maxlen,                                    \
  |  |   53|    200|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    200|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    200|		break;                                                  \
  |  |   56|    200|	}                                                               \
  |  |   57|    512|}
  ------------------
  411|    312|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    312|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 312]
  |  |  ------------------
  ------------------
  412|    312|		break;
  413|    515|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 515, False: 11.7k]
  ------------------
  414|    515|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    515|#define CF(format,target,v,maxlen)                              \
  |  |   38|    515|{                                                               \
  |  |   39|    515|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 229, False: 286]
  |  |  ------------------
  |  |   40|    229|		snprintf (v, maxlen,	                        \
  |  |   41|    229|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    229|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    229|			"expected '%s'."),                      \
  |  |   43|    229|			exif_format_get_name (format),          \
  |  |   44|    229|			exif_format_get_name (target));         \
  |  |   45|    229|		break;                                          \
  |  |   46|    229|	}                                                       \
  |  |   47|    515|}
  ------------------
  415|    286|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    286|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    286|{                                                                       \
  |  |   51|    286|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 211, False: 75]
  |  |  ------------------
  |  |   52|    211|		snprintf (v, maxlen,                                    \
  |  |   53|    211|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    211|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    211|		break;                                                  \
  |  |   56|    211|	}                                                               \
  |  |   57|    286|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|     75|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|     75|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|     75|		break;
  420|    497|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 497, False: 11.7k]
  ------------------
  421|    497|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    497|#define CF(format,target,v,maxlen)                              \
  |  |   38|    497|{                                                               \
  |  |   39|    497|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 233, False: 264]
  |  |  ------------------
  |  |   40|    233|		snprintf (v, maxlen,	                        \
  |  |   41|    233|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    233|			"expected '%s'."),                      \
  |  |   43|    233|			exif_format_get_name (format),          \
  |  |   44|    233|			exif_format_get_name (target));         \
  |  |   45|    233|		break;                                          \
  |  |   46|    233|	}                                                       \
  |  |   47|    497|}
  ------------------
  422|    264|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    264|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    264|{                                                                       \
  |  |   61|    264|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 158, False: 106]
  |  |  |  Branch (61:24): [True: 92, False: 66]
  |  |  ------------------
  |  |   62|     92|		snprintf (v, maxlen,                                    \
  |  |   63|     92|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     92|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|     92|			"expected %i or %i)."), (int) number,		\
  |  |   65|     92|			(int) t1, (int) t2);  				\
  |  |   66|     92|		break;                                                  \
  |  |   67|     92|	}                                                               \
  |  |   68|    264|}
  ------------------
  423|    172|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    172|		break;
  425|  3.06k|	default:
  ------------------
  |  Branch (425:2): [True: 3.06k, False: 9.16k]
  ------------------
  426|  3.06k|		switch (entry->format) {
  427|    302|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 302, False: 2.75k]
  ------------------
  428|    302|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    302|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 71, False: 231]
  |  |  ------------------
  ------------------
  429|    302|		  break;
  430|    564|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 564, False: 2.49k]
  ------------------
  431|    564|		  {
  432|    564|			const unsigned char *data = entry->data;
  433|    564|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    564|			sizeleft = entry->size;
  436|  77.9k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 77.3k, False: 564]
  ------------------
  437|  77.3k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 77.3k]
  ------------------
  438|      0|					break;
  439|  77.3k|				vs = exif_get_short (data, entry->order);
  440|  77.3k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|  77.3k|				len = strlen(val);
  442|  77.3k|				data += 2;
  443|  77.3k|				sizeleft -= 2;
  444|  77.3k|			}
  445|    564|		  }
  446|    564|		  break;
  447|    542|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 542, False: 2.51k]
  ------------------
  448|    542|		  {
  449|    542|			const unsigned char *data = entry->data;
  450|    542|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    542|			sizeleft = entry->size;
  453|  33.0k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 32.4k, False: 542]
  ------------------
  454|  32.4k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 32.4k]
  ------------------
  455|      0|					break;
  456|  32.4k|				vss = exif_get_sshort (data, entry->order);
  457|  32.4k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  32.4k|				len = strlen(val);
  459|  32.4k|				data += 2;
  460|  32.4k|				sizeleft -= 2;
  461|  32.4k|			}
  462|    542|		  }
  463|    542|		  break;
  464|    573|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 573, False: 2.48k]
  ------------------
  465|    573|		  {
  466|    573|			const unsigned char *data = entry->data;
  467|    573|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    573|			sizeleft = entry->size;
  470|  25.0k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 24.5k, False: 573]
  ------------------
  471|  24.5k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 24.5k]
  ------------------
  472|      0|					break;
  473|  24.5k|				vl = exif_get_long (data, entry->order);
  474|  24.5k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  24.5k|				len = strlen(val);
  476|  24.5k|				data += 4;
  477|  24.5k|				sizeleft -= 4;
  478|  24.5k|			}
  479|    573|		  }
  480|    573|		  break;
  481|    462|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 462, False: 2.59k]
  ------------------
  482|    462|		  {
  483|    462|			const unsigned char *data = entry->data;
  484|    462|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    462|			sizeleft = entry->size;
  487|  26.7k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 26.3k, False: 462]
  ------------------
  488|  26.3k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 26.3k]
  ------------------
  489|      0|					break;
  490|  26.3k|				vsl = exif_get_slong (data, entry->order);
  491|  26.3k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  26.3k|				len = strlen(val);
  493|  26.3k|				data += 4;
  494|  26.3k|				sizeleft -= 4;
  495|  26.3k|			}
  496|    462|		  }
  497|    462|		  break;
  498|      8|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 8, False: 3.05k]
  ------------------
  499|    617|		default:
  ------------------
  |  Branch (499:3): [True: 609, False: 2.45k]
  ------------------
  500|    617|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    617|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    617|			  entry->size);
  502|    617|		  break;
  503|  3.06k|		}
  504|  3.06k|		break;
  505|  12.2k|	}
  506|       |
  507|  12.2k|	return val;
  508|  12.2k|}

mnote_pentax_tag_get_name:
  145|  30.8k|{
  146|  30.8k|	unsigned int i;
  147|       |
  148|  1.36M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (148:14): [True: 1.36M, False: 4.67k]
  ------------------
  149|  1.36M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (149:7): [True: 26.1k, False: 1.33M]
  ------------------
  150|  4.67k|	return NULL;
  151|  30.8k|}
mnote_pentax_tag_get_title:
  155|  12.2k|{
  156|  12.2k|	unsigned int i;
  157|       |
  158|  12.2k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  159|   399k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (159:14): [True: 399k, False: 0]
  ------------------
  160|   399k|		if (table[i].tag == t) {
  ------------------
  |  Branch (160:7): [True: 12.2k, False: 387k]
  ------------------
  161|  12.2k|			if (!table[i].title)
  ------------------
  |  Branch (161:8): [True: 0, False: 12.2k]
  ------------------
  162|      0|				return NULL;
  163|  12.2k|			return _(table[i].title);
  ------------------
  |  |   31|  12.2k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  164|  12.2k|		}
  165|      0|	return NULL;
  166|  12.2k|}
mnote_pentax_tag_get_description:
  170|  12.2k|{
  171|  12.2k|	unsigned int i;
  172|       |
  173|   399k|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (173:14): [True: 399k, False: 0]
  ------------------
  174|   399k|		if (table[i].tag == t) {
  ------------------
  |  Branch (174:7): [True: 12.2k, False: 387k]
  ------------------
  175|  12.2k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (175:8): [True: 538, False: 11.6k]
  |  Branch (175:33): [True: 11.4k, False: 233]
  ------------------
  176|  11.9k|				return "";
  177|    233|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  178|    233|			return _(table[i].description);
  ------------------
  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  179|  12.2k|		}
  180|      0|	return NULL;
  181|  12.2k|}

