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

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

mnote_canon_entry_count_values:
  505|  39.3M|{
  506|  39.3M|	unsigned int  val;
  507|       |
  508|  39.3M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 39.3M]
  ------------------
  509|       |
  510|  39.3M|	switch (entry->tag) {
  511|   196k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 196k, False: 39.1M]
  ------------------
  512|   196k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 606, False: 39.3M]
  ------------------
  513|   196k|		return entry->components;
  514|  1.90M|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 1.90M, False: 37.4M]
  ------------------
  515|  2.91M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 1.01M, False: 38.2M]
  ------------------
  516|  36.4M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 33.5M, False: 5.74M]
  ------------------
  517|  36.5M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 82.1k, False: 39.2M]
  ------------------
  518|  36.5M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 38.3k, False: 36.5M]
  ------------------
  519|       |
  520|  36.5M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|  36.5M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|  36.5M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 36.1M, False: 381k]
  |  |  ------------------
  ------------------
  523|  2.55M|	default:
  ------------------
  |  Branch (523:2): [True: 2.55M, False: 36.7M]
  ------------------
  524|  2.55M|		return 1;
  525|  39.3M|	}
  526|  39.3M|}
mnote_canon_entry_get_value:
  552|   648k|{
  553|   648k|	char buf[128];
  554|   648k|	ExifLong vl;
  555|   648k|	ExifSLong vsl;
  556|   648k|	ExifShort vs, n;
  557|   648k|	ExifSShort vss;
  558|   648k|	unsigned char *data;
  559|   648k|	size_t	size;
  560|   648k|	double d;
  561|       |
  562|   648k|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 648k]
  ------------------
  563|      0|		return NULL;
  564|   648k|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 648k]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|   648k|	data = entry->data;
  568|   648k|	size = entry->size;
  569|       |
  570|   648k|	memset (val, 0, maxlen);
  571|   648k|	maxlen--;
  572|       |
  573|   648k|	switch (entry->tag) {
  574|  3.09k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 3.09k, False: 645k]
  ------------------
  575|  3.09k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.09k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.09k|{                                                               \
  |  |   38|  3.09k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.09k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  3.09k|}
  ------------------
  576|       |
  577|  3.09k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 3.09k]
  ------------------
  578|  3.09k|		n = exif_get_short (data, entry->order) / 2;
  579|  3.09k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 3.09k]
  ------------------
  580|       |
  581|  3.09k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.09k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.09k|{                                                                       \
  |  |   50|  3.09k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 399, False: 2.69k]
  |  |  ------------------
  |  |   51|    399|                snprintf (v, maxlen,                                    \
  |  |   52|    399|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    399|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    399|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    399|                break;                                                  \
  |  |   55|    399|        }                                                               \
  |  |   56|  3.09k|}
  ------------------
  582|       |
  583|  2.69k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.69k]
  ------------------
  584|  2.69k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.69k|		switch (t) {
  586|    546|		case 1:
  ------------------
  |  Branch (586:3): [True: 546, False: 2.15k]
  ------------------
  587|    546|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 207, False: 339]
  ------------------
  588|    207|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    207|				break;
  590|    207|			}
  591|    339|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    339|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    339|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.69k]
  ------------------
  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.69k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.69k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.69k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.69k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.69k]
  ------------------
  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.69k]
  ------------------
  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.69k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.69k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.69k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  2.15k|		default:
  ------------------
  |  Branch (621:3): [True: 2.15k, False: 546]
  ------------------
  622|  2.15k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.69k|		}
  624|  2.69k|		break;
  625|       |
  626|  2.69k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.68k, False: 646k]
  ------------------
  627|  1.68k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.68k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.68k|{                                                               \
  |  |   38|  1.68k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 332, False: 1.34k]
  |  |  ------------------
  |  |   39|    332|                snprintf (v, maxlen,                            \
  |  |   40|    332|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    332|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    332|                        "expected '%s'."),                      \
  |  |   42|    332|                        exif_format_get_name (format),          \
  |  |   43|    332|                        exif_format_get_name (target));         \
  |  |   44|    332|                break;                                          \
  |  |   45|    332|        }                                                       \
  |  |   46|  1.68k|}
  ------------------
  628|  1.34k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.34k]
  ------------------
  629|  1.34k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.34k|		switch (t) {
  631|    336|		case 1:
  ------------------
  |  Branch (631:3): [True: 336, False: 1.01k]
  ------------------
  632|    336|			snprintf (val, maxlen, "%u", vs);
  633|    336|			break;
  634|    333|		case 2:
  ------------------
  |  Branch (634:3): [True: 333, False: 1.01k]
  ------------------
  635|    663|		case 3:
  ------------------
  |  Branch (635:3): [True: 330, False: 1.01k]
  ------------------
  636|    663|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    663|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    663|			break;
  638|    350|		default:
  ------------------
  |  Branch (638:3): [True: 350, False: 999]
  ------------------
  639|    350|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.34k|		}
  641|  1.34k|		break;
  642|       |
  643|  6.24k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 6.24k, False: 642k]
  ------------------
  644|  6.24k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  6.24k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  6.24k|{                                                               \
  |  |   38|  6.24k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 6.24k]
  |  |  ------------------
  |  |   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.24k|}
  ------------------
  645|  6.24k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 6.24k]
  ------------------
  646|  6.24k|		n = exif_get_short (data, entry->order) / 2;
  647|  6.24k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 6.24k]
  ------------------
  648|  6.24k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  6.24k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  6.24k|{                                                                       \
  |  |   50|  6.24k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.03k, False: 5.20k]
  |  |  ------------------
  |  |   51|  1.03k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.03k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.03k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.03k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.03k|                break;                                                  \
  |  |   55|  1.03k|        }                                                               \
  |  |   56|  6.24k|}
  ------------------
  649|  5.20k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 5.20k]
  ------------------
  650|  5.20k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  5.20k|		switch (t) {
  652|    614|		case 0:
  ------------------
  |  Branch (652:3): [True: 614, False: 4.59k]
  ------------------
  653|    614|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    614|			break;
  655|    614|		case 1:
  ------------------
  |  Branch (655:3): [True: 614, False: 4.59k]
  ------------------
  656|    614|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    614|			break;
  658|    614|		case 2:
  ------------------
  |  Branch (658:3): [True: 614, False: 4.59k]
  ------------------
  659|  1.14k|		case 5:
  ------------------
  |  Branch (659:3): [True: 533, False: 4.67k]
  ------------------
  660|  1.14k|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 5.20k]
  ------------------
  661|  1.14k|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 5.20k]
  ------------------
  662|  1.14k|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|  1.14k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|  1.14k|			break;
  664|    613|		case 3:
  ------------------
  |  Branch (664:3): [True: 613, False: 4.59k]
  ------------------
  665|    613|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 5.20k]
  ------------------
  666|    613|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    613|			break;
  668|    613|		case 4:
  ------------------
  |  Branch (668:3): [True: 613, False: 4.59k]
  ------------------
  669|    613|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 5.20k]
  ------------------
  670|    613|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    613|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 272, False: 341]
  ------------------
  672|    272|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    341|			else
  674|    341|				snprintf (val, maxlen, "%.0f", d);
  675|    613|			break;
  676|    532|		case 8:
  ------------------
  |  Branch (676:3): [True: 532, False: 4.67k]
  ------------------
  677|    532|			snprintf (val, maxlen, "%u", vss);
  678|    532|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 5.20k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 5.20k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 5.20k]
  ------------------
  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.20k]
  ------------------
  687|      0|			if (vss <= 0) {
  ------------------
  |  Branch (687:8): [True: 0, False: 0]
  ------------------
  688|      0|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  689|      0|				break;
  690|      0|			}
  691|      0|			snprintf (val, maxlen, _("%i (ms)"), vss * 100);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  692|      0|			break;
  693|  1.07k|		default:
  ------------------
  |  Branch (693:3): [True: 1.07k, False: 4.13k]
  ------------------
  694|  1.07k|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  5.20k|		}
  696|  5.20k|		break;
  697|       |
  698|  5.20k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 648k]
  ------------------
  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|    305|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 305, False: 648k]
  ------------------
  706|    305|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    305|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    305|{                                                                       \
  |  |   50|    305|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 105, False: 200]
  |  |  ------------------
  |  |   51|    105|                snprintf (v, maxlen,                                    \
  |  |   52|    105|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    105|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    105|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    105|                break;                                                  \
  |  |   55|    105|        }                                                               \
  |  |   56|    305|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    752|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 552, False: 648k]
  ------------------
  710|    752|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    752|#define CF(format,target,v,maxlen)                              \
  |  |   37|    752|{                                                               \
  |  |   38|    752|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 372, False: 380]
  |  |  ------------------
  |  |   39|    372|                snprintf (v, maxlen,                            \
  |  |   40|    372|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    372|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    372|                        "expected '%s'."),                      \
  |  |   42|    372|                        exif_format_get_name (format),          \
  |  |   43|    372|                        exif_format_get_name (target));         \
  |  |   44|    372|                break;                                          \
  |  |   45|    372|        }                                                       \
  |  |   46|    752|}
  ------------------
  711|    380|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    380|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 99, False: 281]
  |  |  ------------------
  ------------------
  712|    380|		break;
  713|       |
  714|    741|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 741, False: 647k]
  ------------------
  715|    741|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    741|#define CF(format,target,v,maxlen)                              \
  |  |   37|    741|{                                                               \
  |  |   38|    741|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 250, False: 491]
  |  |  ------------------
  |  |   39|    250|                snprintf (v, maxlen,                            \
  |  |   40|    250|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    250|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    250|                        "expected '%s'."),                      \
  |  |   42|    250|                        exif_format_get_name (format),          \
  |  |   43|    250|                        exif_format_get_name (target));         \
  |  |   44|    250|                break;                                          \
  |  |   45|    250|        }                                                       \
  |  |   46|    741|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    491|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    491|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 79, False: 412]
  |  |  ------------------
  ------------------
  718|    491|		break;
  719|       |
  720|    757|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 757, False: 647k]
  ------------------
  721|    757|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    757|#define CF(format,target,v,maxlen)                              \
  |  |   37|    757|{                                                               \
  |  |   38|    757|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 302, False: 455]
  |  |  ------------------
  |  |   39|    302|                snprintf (v, maxlen,                            \
  |  |   40|    302|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    302|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    302|                        "expected '%s'."),                      \
  |  |   42|    302|                        exif_format_get_name (format),          \
  |  |   43|    302|                        exif_format_get_name (target));         \
  |  |   44|    302|                break;                                          \
  |  |   45|    302|        }                                                       \
  |  |   46|    757|}
  ------------------
  722|    455|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    455|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    455|{                                                                       \
  |  |   50|    455|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 383, False: 72]
  |  |  ------------------
  |  |   51|    383|                snprintf (v, maxlen,                                    \
  |  |   52|    383|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    383|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    383|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    383|                break;                                                  \
  |  |   55|    383|        }                                                               \
  |  |   56|    455|}
  ------------------
  723|     72|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 72]
  ------------------
  724|     72|		vl = exif_get_long (data, entry->order);
  725|     72|		snprintf (val, maxlen, "%03lu-%04lu",
  726|     72|				(unsigned long) vl/10000,
  727|     72|				(unsigned long) vl%10000);
  728|     72|		break;
  729|       |
  730|    767|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 767, False: 647k]
  ------------------
  731|    767|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    767|#define CF(format,target,v,maxlen)                              \
  |  |   37|    767|{                                                               \
  |  |   38|    767|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 338, False: 429]
  |  |  ------------------
  |  |   39|    338|                snprintf (v, maxlen,                            \
  |  |   40|    338|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    338|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    338|                        "expected '%s'."),                      \
  |  |   42|    338|                        exif_format_get_name (format),          \
  |  |   43|    338|                        exif_format_get_name (target));         \
  |  |   44|    338|                break;                                          \
  |  |   45|    338|        }                                                       \
  |  |   46|    767|}
  ------------------
  732|    429|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    429|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    429|{                                                                       \
  |  |   50|    429|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 196, False: 233]
  |  |  ------------------
  |  |   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|    429|}
  ------------------
  733|    233|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 233]
  ------------------
  734|    233|		vl = exif_get_long (data, entry->order);
  735|    233|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|    233|		break;
  737|       |
  738|   629k|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 629k, False: 18.8k]
  ------------------
  739|   629k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|   629k|#define CF(format,target,v,maxlen)                              \
  |  |   37|   629k|{                                                               \
  |  |   38|   629k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 629k]
  |  |  ------------------
  |  |   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|   629k|}
  ------------------
  740|   629k|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 629k]
  ------------------
  741|   629k|		n = exif_get_short (data, entry->order) / 2;
  742|   629k|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 629k]
  ------------------
  743|   629k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|   629k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|   629k|{                                                                       \
  |  |   50|   629k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 614k, False: 15.1k]
  |  |  ------------------
  |  |   51|   614k|                snprintf (v, maxlen,                                    \
  |  |   52|   614k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|   614k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|   614k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|   614k|                break;                                                  \
  |  |   55|   614k|        }                                                               \
  |  |   56|   629k|}
  ------------------
  744|  15.1k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 15.1k]
  ------------------
  745|  15.1k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  15.1k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  15.1k|		strncat (val, buf, maxlen - strlen (val));
  748|  15.1k|		break;
  749|       |
  750|  2.61k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.61k, False: 646k]
  ------------------
  751|  2.61k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.61k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.61k|{                                                               \
  |  |   38|  2.61k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.61k]
  |  |  ------------------
  |  |   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.61k|}
  ------------------
  752|  2.61k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.61k]
  ------------------
  753|  2.61k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.61k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.61k]
  ------------------
  755|  2.61k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.61k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.61k|{                                                                       \
  |  |   50|  2.61k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 541, False: 2.07k]
  |  |  ------------------
  |  |   51|    541|                snprintf (v, maxlen,                                    \
  |  |   52|    541|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    541|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    541|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    541|                break;                                                  \
  |  |   55|    541|        }                                                               \
  |  |   56|  2.61k|}
  ------------------
  756|  2.07k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 2.07k]
  ------------------
  757|  2.07k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  2.07k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  2.07k|		break;
  760|       |
  761|  2.10k|	default:
  ------------------
  |  Branch (761:2): [True: 2.10k, False: 646k]
  ------------------
  762|  2.10k|		switch (entry->format) {
  763|    275|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 275, False: 1.83k]
  ------------------
  764|    275|		  {
  765|    275|			size_t i, len = strlen(val);
  766|   117k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 116k, False: 275]
  ------------------
  767|   116k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 116k]
  ------------------
  768|      0|					break;
  769|   116k|				vs = exif_get_short (data, entry->order);
  770|   116k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|   116k|				len = strlen(val);
  772|   116k|				data += 2;
  773|   116k|				size -= 2;
  774|   116k|			}
  775|    275|		  }
  776|    275|		  break;
  777|    240|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 240, False: 1.86k]
  ------------------
  778|    240|		  {
  779|    240|			size_t i, len = strlen(val);
  780|  24.2k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 24.0k, False: 240]
  ------------------
  781|  24.0k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 24.0k]
  ------------------
  782|      0|					break;
  783|  24.0k|				vss = exif_get_sshort (data, entry->order);
  784|  24.0k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  24.0k|				data += 2;
  786|  24.0k|				size -= 2;
  787|  24.0k|			}
  788|    240|		  }
  789|    240|		  break;
  790|    302|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 302, False: 1.80k]
  ------------------
  791|    302|		  {
  792|    302|			size_t i, len = strlen(val);
  793|  37.9k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 37.6k, False: 302]
  ------------------
  794|  37.6k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 37.6k]
  ------------------
  795|      0|					break;
  796|  37.6k|				vl = exif_get_long (data, entry->order);
  797|  37.6k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  37.6k|				data += 4;
  799|  37.6k|				size -= 4;
  800|  37.6k|			}
  801|    302|		  }
  802|    302|		  break;
  803|    269|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 269, False: 1.83k]
  ------------------
  804|    269|		  {
  805|    269|			size_t i, len = strlen(val);
  806|  36.4k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 36.2k, False: 269]
  ------------------
  807|  36.2k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 36.2k]
  ------------------
  808|      0|					break;
  809|  36.2k|				vsl = exif_get_slong (data, entry->order);
  810|  36.2k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  36.2k|				data += 4;
  812|  36.2k|				size -= 4;
  813|  36.2k|			}
  814|    269|		  }
  815|    269|		  break;
  816|    734|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 734, False: 1.37k]
  ------------------
  817|    734|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    734|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 73, False: 661]
  |  |  ------------------
  ------------------
  818|    734|			break;
  819|    285|		default:
  ------------------
  |  Branch (819:3): [True: 285, False: 1.82k]
  ------------------
  820|    285|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    285|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    285|			  entry->size);
  822|    285|		  break;
  823|  2.10k|		}
  824|  2.10k|		break;
  825|   648k|	}
  826|   648k|	return val;
  827|   648k|}
mnote-canon-entry.c:canon_search_table_value:
  444|  5.64k|{
  445|  5.64k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  79.7k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 78.8k, False: 905]
  |  Branch (448:32): [True: 58.4k, False: 20.3k]
  ------------------
  449|  75.2k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 17.7k, False: 2.63k]
  |  Branch (449:31): [True: 16.7k, False: 917]
  ------------------
  450|  75.2k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 16.7k, False: 58.4k]
  |  Branch (450:33): [True: 1.18k, False: 15.6k]
  ------------------
  451|  1.18k|			break;
  452|  1.18k|		}
  453|  75.2k|	}
  454|  5.64k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 2.44k, False: 3.19k]
  |  Branch (454:32): [True: 1.18k, False: 1.26k]
  |  Branch (454:58): [True: 1.18k, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|  1.18k|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|  1.18k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.45k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.45k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.45k|	}
  461|  5.64k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    613|{
  535|    613|	return pow (2, x / 2.);
  536|    613|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    614|{
  547|    614|	return 3.125 * pow (2, x);
  548|    614|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    613|{
  541|    613|	return 1.0 / pow (2, x);
  542|    613|}

mnote_canon_tag_get_name:
  212|   679k|{
  213|   679k|	unsigned int i;
  214|       |
  215|  10.7M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (215:14): [True: 10.6M, False: 21.8k]
  ------------------
  216|  10.6M|		if (table[i].tag == t) return table[i].name; /* do not translate */
  ------------------
  |  Branch (216:7): [True: 658k, False: 10.0M]
  ------------------
  217|  21.8k|	return NULL;
  218|   679k|}
mnote_canon_tag_get_name_sub:
  222|   648k|{
  223|   648k|	unsigned int i;
  224|   648k|	int tag_found = 0;
  225|       |
  226|  55.1M|	for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
  ------------------
  |  Branch (226:14): [True: 54.5M, False: 635k]
  ------------------
  227|  54.5M|		if (table_sub[i].tag == t) {
  ------------------
  |  Branch (227:7): [True: 61.9k, False: 54.5M]
  ------------------
  228|  61.9k|			if (table_sub[i].subtag == s)
  ------------------
  |  Branch (228:8): [True: 13.6k, False: 48.2k]
  ------------------
  229|  13.6k|				return table_sub[i].name;
  230|  48.2k|			tag_found = 1;
  231|  48.2k|		}
  232|  54.5M|	}
  233|   635k|	if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
  ------------------
  |  Branch (233:6): [True: 635k, False: 79]
  |  Branch (233:20): [True: 0, False: 79]
  ------------------
  234|   635k|		return mnote_canon_tag_get_name (t);
  235|     79|	else
  236|     79|		return NULL;
  237|   635k|}
mnote_canon_tag_get_title:
  241|   635k|{
  242|   635k|	unsigned int i;
  243|       |
  244|   635k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  245|  8.25M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (245:14): [True: 8.25M, False: 0]
  ------------------
  246|  8.25M|		if (table[i].tag == t) {
  ------------------
  |  Branch (246:7): [True: 635k, False: 7.62M]
  ------------------
  247|   635k|			if (!table[i].title)
  ------------------
  |  Branch (247:8): [True: 0, False: 635k]
  ------------------
  248|      0|				return NULL;
  249|   635k|			return _(table[i].title);
  ------------------
  |  |   31|   635k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|   635k|		}
  251|      0|	return NULL;
  252|   635k|}
mnote_canon_tag_get_title_sub:
  256|   648k|{
  257|   648k|	unsigned int i;
  258|   648k|	int tag_found = 0;
  259|       |
  260|  55.1M|	for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
  ------------------
  |  Branch (260:14): [True: 54.5M, False: 635k]
  ------------------
  261|  54.5M|		if (table_sub[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 61.0k, False: 54.4M]
  ------------------
  262|  61.0k|			if (table_sub[i].subtag == s) {
  ------------------
  |  Branch (262:8): [True: 13.6k, False: 47.4k]
  ------------------
  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|  47.4k|			tag_found = 1;
  268|  47.4k|		}
  269|  54.5M|	}
  270|   635k|	if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
  ------------------
  |  Branch (270:6): [True: 635k, False: 0]
  |  Branch (270:20): [True: 0, False: 0]
  ------------------
  271|   635k|		return mnote_canon_tag_get_title (t);
  272|      0|	else
  273|      0|		return NULL;
  274|   635k|}
mnote_canon_tag_get_description:
  278|   648k|{
  279|   648k|	unsigned int i;
  280|       |
  281|  8.30M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (281:14): [True: 8.30M, False: 0]
  ------------------
  282|  8.30M|		if (table[i].tag == t) {
  ------------------
  |  Branch (282:7): [True: 648k, False: 7.65M]
  ------------------
  283|   648k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (283:8): [True: 0, False: 648k]
  |  Branch (283:33): [True: 648k, False: 0]
  ------------------
  284|   648k|				return "";
  285|      0|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  286|      0|			return _(table[i].description);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  287|   648k|		}
  288|      0|	return NULL;
  289|   648k|}

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

exif_data_get_mnote_data:
   93|  9.94k|{
   94|  9.94k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 9.94k, False: 0]
  |  Branch (94:15): [True: 9.94k, False: 0]
  ------------------
   95|  9.94k|}
exif_data_new_mem:
  110|  9.94k|{
  111|  9.94k|	ExifData *data;
  112|  9.94k|	unsigned int i;
  113|       |
  114|  9.94k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 9.94k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  9.94k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  9.94k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 9.94k]
  ------------------
  119|      0|		return (NULL);
  120|  9.94k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  9.94k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 9.94k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  9.94k|	data->priv->ref_count = 1;
  126|       |
  127|  9.94k|	data->priv->mem = mem;
  128|  9.94k|	exif_mem_ref (mem);
  129|       |
  130|  59.6k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 49.7k, False: 9.94k]
  ------------------
  131|  49.7k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  49.7k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 49.7k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  49.7k|		data->ifd[i]->parent = data;
  137|  49.7k|	}
  138|       |
  139|       |	/* Default options */
  140|  9.94k|#ifndef NO_VERBOSE_TAG_STRINGS
  141|       |	/*
  142|       |	 * When the tag list is compiled away, setting this option prevents
  143|       |	 * any tags from being loaded
  144|       |	 */
  145|  9.94k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  9.94k|#endif
  147|  9.94k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  9.94k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  9.94k|	return (data);
  153|  9.94k|}
exif_data_load_data:
  858|  9.94k|{
  859|  9.94k|	unsigned int l;
  860|  9.94k|	ExifLong offset;
  861|  9.94k|	ExifShort n;
  862|  9.94k|	const unsigned char *d = d_orig;
  863|  9.94k|	unsigned int len, fullds;
  864|       |
  865|  9.94k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (865:6): [True: 0, False: 9.94k]
  |  Branch (865:15): [True: 0, False: 9.94k]
  |  Branch (865:30): [True: 0, False: 9.94k]
  |  Branch (865:36): [True: 0, False: 9.94k]
  ------------------
  866|      0|		return;
  867|       |
  868|  9.94k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  869|  9.94k|		  "Parsing %i byte(s) EXIF data...\n", ds);
  870|       |
  871|       |	/*
  872|       |	 * It can be that the data starts with the EXIF header. If it does
  873|       |	 * not, search the EXIF marker.
  874|       |	 */
  875|  9.94k|	if (ds < 6) {
  ------------------
  |  Branch (875:6): [True: 21, False: 9.92k]
  ------------------
  876|     21|		LOG_TOO_SMALL;
  ------------------
  |  |  851|     21|#define LOG_TOO_SMALL \
  |  |  852|     21|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     21|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     21|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  877|     21|		return;
  878|     21|	}
  879|  9.92k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (879:6): [True: 9.75k, False: 167]
  ------------------
  880|  9.75k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  881|  9.75k|			  "Found EXIF header at start.");
  882|  9.75k|	} else {
  883|    923|		while (ds >= 3) {
  ------------------
  |  Branch (883:10): [True: 909, False: 14]
  ------------------
  884|  1.19k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (884:11): [True: 1.19k, False: 6]
  |  Branch (884:17): [True: 290, False: 903]
  ------------------
  885|    290|				d++;
  886|    290|				ds--;
  887|    290|			}
  888|       |
  889|       |			/* JPEG_MARKER_SOI */
  890|    909|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|    903|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (890:8): [True: 903, False: 6]
  |  Branch (890:14): [True: 323, False: 580]
  ------------------
  891|    323|				d++;
  892|    323|				ds--;
  893|    323|				continue;
  894|    323|			}
  895|       |
  896|       |			/* JPEG_MARKER_APP1 */
  897|    586|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    580|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (897:8): [True: 580, False: 6]
  |  Branch (897:14): [True: 283, False: 297]
  ------------------
  898|       |				/*
  899|       |				 * Verify the exif header
  900|       |				 * (offset 3, length 6).
  901|       |				 * FF E1 NN NN EXIFHEADER
  902|       |				 *    ^^ d points here currently
  903|       |				 */
  904|    283|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (904:9): [True: 256, False: 27]
  |  Branch (904:22): [True: 49, False: 207]
  ------------------
  905|     49|					break;
  906|       |				/* fallthrough */
  907|    283|			}
  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|    537|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (913:8): [True: 527, False: 10]
  |  Branch (913:19): [True: 474, False: 53]
  |  Branch (913:35): [True: 467, False: 7]
  ------------------
  914|    467|				d++;
  915|    467|				ds--;
  916|    467|				l = (((unsigned int)d[0]) << 8) | d[1];
  917|    467|				if (l > ds)
  ------------------
  |  Branch (917:9): [True: 34, False: 433]
  ------------------
  918|     34|					return;
  919|    433|				d += l;
  920|    433|				ds -= l;
  921|    433|				continue;
  922|    467|			}
  923|       |
  924|       |			/* Unknown marker or data. Give up. */
  925|     70|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  926|     70|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     70|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  927|     70|			return;
  928|    537|		}
  929|     63|		if (ds < 3) {
  ------------------
  |  Branch (929:7): [True: 14, False: 49]
  ------------------
  930|     14|			LOG_TOO_SMALL;
  ------------------
  |  |  851|     14|#define LOG_TOO_SMALL \
  |  |  852|     14|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|     14|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     14|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  931|     14|			return;
  932|     14|		}
  933|     49|		d++;
  934|     49|		ds--;
  935|     49|		len = (((unsigned int)d[0]) << 8) | d[1];
  936|     49|		if (len > ds) {
  ------------------
  |  Branch (936:7): [True: 30, False: 19]
  ------------------
  937|     30|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  938|     30|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     30|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  939|     30|			return;
  940|     30|		}
  941|     19|		if (len < 2) {
  ------------------
  |  Branch (941:7): [True: 1, False: 18]
  ------------------
  942|      1|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  943|      1|				  "ExifData", _("APP Tag too short."));
  ------------------
  |  |   31|      1|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  944|      1|			return;
  945|      1|		}
  946|     18|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  947|     18|			  "We have to deal with %i byte(s) of EXIF data.",
  948|     18|			  len);
  949|     18|		d += 2;
  950|     18|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  951|     18|	}
  952|       |
  953|       |	/*
  954|       |	 * Verify the exif header
  955|       |	 * (offset 2, length 6).
  956|       |	 */
  957|  9.77k|	if (ds < 6) {
  ------------------
  |  Branch (957:6): [True: 5, False: 9.77k]
  ------------------
  958|      5|		LOG_TOO_SMALL;
  ------------------
  |  |  851|      5|#define LOG_TOO_SMALL \
  |  |  852|      5|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  853|      5|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      5|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  959|      5|		return;
  960|      5|	}
  961|  9.77k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (961:6): [True: 0, False: 9.77k]
  ------------------
  962|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  963|      0|			  "ExifData", _("EXIF header not found."));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  964|      0|		return;
  965|      0|	}
  966|       |
  967|  9.77k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  968|  9.77k|		  "Found EXIF header.");
  969|       |
  970|       |	/* Sanity check the data length */
  971|  9.77k|	if (ds < 14)
  ------------------
  |  Branch (971:6): [True: 40, False: 9.73k]
  ------------------
  972|     40|		return;
  973|       |
  974|       |	/* The JPEG APP1 section can be no longer than 64 KiB (including a
  975|       |	   16-bit length), so cap the data length to protect against overflow
  976|       |	   in future offset calculations */
  977|  9.73k|	fullds = ds;
  978|  9.73k|	if (ds > 0xfffe)
  ------------------
  |  Branch (978:6): [True: 9, False: 9.72k]
  ------------------
  979|      9|		ds = 0xfffe;
  980|       |
  981|       |	/* Byte order (offset 6, length 2) */
  982|  9.73k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (982:6): [True: 7.43k, False: 2.29k]
  ------------------
  983|  7.43k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
  984|  2.29k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (984:11): [True: 2.24k, False: 54]
  ------------------
  985|  2.24k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
  986|     54|	else {
  987|     54|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  988|     54|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     54|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  989|     54|		return;
  990|     54|	}
  991|       |
  992|       |	/* Fixed value */
  993|  9.67k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (993:6): [True: 18, False: 9.65k]
  ------------------
  994|     18|		return;
  995|       |
  996|       |	/* IFD 0 offset */
  997|  9.65k|	offset = exif_get_long (d + 10, data->priv->order);
  998|  9.65k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
  999|  9.65k|		  "IFD 0 at %i.", (int) offset);
 1000|       |
 1001|       |	/* ds is restricted to 16 bit above, so offset is restricted too, and offset+8 should not overflow. */
 1002|  9.65k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1002:6): [True: 49, False: 9.60k]
  |  Branch (1002:21): [True: 8, False: 9.60k]
  ------------------
 1003|     57|		return;
 1004|       |
 1005|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1006|  9.60k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1007|       |
 1008|       |	/* IFD 1 offset */
 1009|  9.60k|	n = exif_get_short (d + 6 + offset, data->priv->order);
 1010|       |	/* offset < 2<<16, n is 16 bit at most, so this op will not overflow */
 1011|  9.60k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1011:6): [True: 1.87k, False: 7.72k]
  ------------------
 1012|  1.87k|		return;
 1013|       |
 1014|  7.72k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1015|  7.72k|	if (offset) {
  ------------------
  |  Branch (1015:6): [True: 7.56k, False: 163]
  ------------------
 1016|  7.56k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1017|  7.56k|			  "IFD 1 at %i.", (int) offset);
 1018|       |
 1019|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1020|  7.56k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1020:7): [True: 1.65k, False: 5.91k]
  ------------------
 1021|  1.65k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1022|  1.65k|				  "ExifData", "Bogus offset of IFD1.");
 1023|  5.91k|		} else {
 1024|  5.91k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1025|  5.91k|		}
 1026|  7.56k|	}
 1027|       |
 1028|       |	/*
 1029|       |	 * If we got an EXIF_TAG_MAKER_NOTE, try to interpret it. Some
 1030|       |	 * cameras use pointers in the maker note tag that point to the
 1031|       |	 * space between IFDs. Here is the only place where we have access
 1032|       |	 * to that data.
 1033|       |	 */
 1034|  7.72k|	interpret_maker_note(data, d, fullds);
 1035|       |
 1036|       |	/* Fixup tags if requested */
 1037|  7.72k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1037:6): [True: 7.72k, False: 0]
  ------------------
 1038|  7.72k|		exif_data_fix (data);
 1039|  7.72k|}
exif_data_unref:
 1111|  9.94k|{
 1112|  9.94k|	if (!data) 
  ------------------
  |  Branch (1112:6): [True: 0, False: 9.94k]
  ------------------
 1113|      0|		return;
 1114|       |
 1115|  9.94k|	data->priv->ref_count--;
 1116|  9.94k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1116:6): [True: 9.94k, False: 0]
  ------------------
 1117|  9.94k|		exif_data_free (data);
 1118|  9.94k|}
exif_data_free:
 1122|  9.94k|{
 1123|  9.94k|	unsigned int i;
 1124|  9.94k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1124:18): [True: 9.94k, False: 0]
  |  Branch (1124:26): [True: 9.94k, False: 0]
  ------------------
 1125|       |
 1126|  9.94k|	if (!data) 
  ------------------
  |  Branch (1126:6): [True: 0, False: 9.94k]
  ------------------
 1127|      0|		return;
 1128|       |
 1129|  59.6k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1129:14): [True: 49.7k, False: 9.94k]
  ------------------
 1130|  49.7k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1130:7): [True: 49.7k, False: 0]
  ------------------
 1131|  49.7k|			exif_content_unref (data->ifd[i]);
 1132|  49.7k|			data->ifd[i] = NULL;
 1133|  49.7k|		}
 1134|  49.7k|	}
 1135|       |
 1136|  9.94k|	if (data->data) {
  ------------------
  |  Branch (1136:6): [True: 203, False: 9.74k]
  ------------------
 1137|    203|		exif_mem_free (mem, data->data);
 1138|    203|		data->data = NULL;
 1139|    203|	}
 1140|       |
 1141|  9.94k|	if (data->priv) {
  ------------------
  |  Branch (1141:6): [True: 9.94k, False: 0]
  ------------------
 1142|  9.94k|		if (data->priv->log) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 9.94k]
  ------------------
 1143|      0|			exif_log_unref (data->priv->log);
 1144|      0|			data->priv->log = NULL;
 1145|      0|		}
 1146|  9.94k|		if (data->priv->md) {
  ------------------
  |  Branch (1146:7): [True: 6.61k, False: 3.33k]
  ------------------
 1147|  6.61k|			exif_mnote_data_unref (data->priv->md);
 1148|  6.61k|			data->priv->md = NULL;
 1149|  6.61k|		}
 1150|  9.94k|		exif_mem_free (mem, data->priv);
 1151|  9.94k|		exif_mem_free (mem, data);
 1152|  9.94k|	}
 1153|       |
 1154|  9.94k|	exif_mem_unref (mem);
 1155|  9.94k|}
exif_data_get_byte_order:
 1186|   148k|{
 1187|   148k|	if (!data)
  ------------------
  |  Branch (1187:6): [True: 0, False: 148k]
  ------------------
 1188|      0|		return (0);
 1189|       |
 1190|   148k|	return (data->priv->order);
 1191|   148k|}
exif_data_foreach_content:
 1196|  17.6k|{
 1197|  17.6k|	unsigned int i;
 1198|       |
 1199|  17.6k|	if (!data || !func)
  ------------------
  |  Branch (1199:6): [True: 0, False: 17.6k]
  |  Branch (1199:15): [True: 0, False: 17.6k]
  ------------------
 1200|      0|		return;
 1201|       |
 1202|   106k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1202:14): [True: 88.3k, False: 17.6k]
  ------------------
 1203|  88.3k|		func (data->ifd[i], user_data);
 1204|  17.6k|}
exif_data_log:
 1246|  9.94k|{
 1247|  9.94k|	unsigned int i;
 1248|       |
 1249|  9.94k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1249:6): [True: 0, False: 9.94k]
  |  Branch (1249:15): [True: 0, False: 9.94k]
  ------------------
 1250|      0|		return;
 1251|  9.94k|	exif_log_unref (data->priv->log);
 1252|  9.94k|	data->priv->log = log;
 1253|  9.94k|	exif_log_ref (log);
 1254|       |
 1255|  59.6k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1255:14): [True: 49.7k, False: 9.94k]
  ------------------
 1256|  49.7k|		exif_content_log (data->ifd[i], log);
 1257|  9.94k|}
exif_data_get_log:
 1263|  61.2k|{
 1264|  61.2k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1264:6): [True: 0, False: 61.2k]
  |  Branch (1264:15): [True: 0, False: 61.2k]
  ------------------
 1265|      0|		return NULL;
 1266|  61.2k|	return data->priv->log;
 1267|  61.2k|}
exif_data_set_option:
 1309|  19.8k|{
 1310|  19.8k|	if (!d) 
  ------------------
  |  Branch (1310:6): [True: 0, False: 19.8k]
  ------------------
 1311|      0|		return;
 1312|       |
 1313|  19.8k|	d->priv->options |= o;
 1314|  19.8k|}
exif_data_fix:
 1355|  7.72k|{
 1356|       |	exif_data_foreach_content (d, fix_func, NULL);
 1357|  7.72k|}
exif_data_set_data_type:
 1361|  9.94k|{
 1362|  9.94k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1362:6): [True: 0, False: 9.94k]
  |  Branch (1362:12): [True: 0, False: 9.94k]
  ------------------
 1363|      0|		return;
 1364|       |
 1365|  9.94k|	d->priv->data_type = dt;
 1366|  9.94k|}
exif_data_get_data_type:
 1370|  47.7k|{
 1371|  47.7k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1371:10): [True: 47.7k, False: 0]
  |  Branch (1371:15): [True: 47.7k, False: 0]
  ------------------
 1372|  47.7k|}
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.61M]
  ------------------
  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.61M|	if (CHECKOVERFLOW(offset, ds, 2)) {
  ------------------
  |  |   53|  2.61M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 1, False: 2.61M]
  |  |  |  Branch (53:81): [True: 0, False: 2.61M]
  |  |  |  Branch (53:112): [True: 2.35k, False: 2.61M]
  |  |  ------------------
  ------------------
  434|  2.35k|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  435|  2.35k|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  436|  2.35k|		return;
  437|  2.35k|	}
  438|  2.61M|	n = exif_get_short (d + offset, data->priv->order);
  439|  2.61M|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  440|  2.61M|	          "Loading %hu entries...", n);
  441|  2.61M|	offset += 2;
  442|       |
  443|       |	/* Check if we have enough data. */
  444|  2.61M|	if (CHECKOVERFLOW(offset, ds, 12*n)) {
  ------------------
  |  |   53|  2.61M|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 323, False: 2.61M]
  |  |  |  Branch (53:81): [True: 2.60M, False: 16.0k]
  |  |  |  Branch (53:112): [True: 408, False: 15.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.61M]
  ------------------
  451|       |
  452|   110M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  453|   110M|		switch (tag) {
  454|  1.20M|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (454:3): [True: 1.20M, 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: 6.17k, False: 110M]
  ------------------
  458|  71.6M|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (458:3): [True: 6.97k, False: 110M]
  ------------------
  459|  71.6M|			o = exif_get_long (d + offset + 12 * i + 8,
  460|  71.6M|					   data->priv->order);
  461|  71.6M|			if (o >= ds) {
  ------------------
  |  Branch (461:8): [True: 3.71k, False: 71.6M]
  ------------------
  462|  3.71k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  463|  3.71k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  464|  3.71k|				if (recursion_cost > 0)
  ------------------
  |  Branch (464:9): [True: 2.19k, False: 1.52k]
  ------------------
  465|  2.19k|					return;
  466|  1.52k|				break;
  467|  3.71k|			}
  468|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  469|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  470|       |			 */
  471|  71.6M|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  472|  71.6M|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  473|  71.6M|				  exif_tag_get_name(tag), o);
  474|  71.6M|			switch (tag) {
  475|  1.19M|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (475:4): [True: 1.19M, False: 70.4M]
  ------------------
  476|  1.19M|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  356|  1.19M|#define CHECK_REC(i) 					\
  |  |  357|  1.19M|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (357:5): [True: 4.10k, False: 1.19M]
  |  |  ------------------
  |  |  358|  4.10k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  359|  4.10k|		"ExifData", "Recursive entry in IFD "	\
  |  |  360|  4.10k|		"'%s' detected. Skipping...",		\
  |  |  361|  4.10k|		exif_ifd_get_name (i));			\
  |  |  362|  4.10k|	break;						\
  |  |  363|  1.19M|}							\
  |  |  364|  1.19M|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (364:5): [True: 3.69k, False: 1.19M]
  |  |  ------------------
  |  |  365|  3.69k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|  3.69k|		"ExifData", "Attempt to load IFD "	\
  |  |  367|  3.69k|		"'%s' multiple times detected. "	\
  |  |  368|  3.69k|		"Skipping...",				\
  |  |  369|  3.69k|		exif_ifd_get_name (i));			\
  |  |  370|  3.69k|	break;						\
  |  |  371|  3.69k|}
  ------------------
  477|  1.19M|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  478|  1.19M|					recursion_cost + level_cost(n));
  479|  1.19M|				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: 908, False: 17.9M]
  |  |  ------------------
  |  |  365|    908|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    908|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    908|		"'%s' multiple times detected. "	\
  |  |  368|    908|		"Skipping...",				\
  |  |  369|    908|		exif_ifd_get_name (i));			\
  |  |  370|    908|	break;						\
  |  |  371|    908|}
  ------------------
  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: 911, False: 18.1M]
  |  |  ------------------
  |  |  365|    911|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  366|    911|		"ExifData", "Attempt to load IFD "	\
  |  |  367|    911|		"'%s' multiple times detected. "	\
  |  |  368|    911|		"Skipping...",				\
  |  |  369|    911|		exif_ifd_get_name (i));			\
  |  |  370|    911|	break;						\
  |  |  371|    911|}
  ------------------
  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|  6.24k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (490:4): [True: 6.24k, False: 71.6M]
  ------------------
  491|  6.24k|				thumbnail_offset = o;
  492|  6.24k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (492:9): [True: 5.56k, False: 680]
  |  Branch (492:29): [True: 1.85k, False: 3.71k]
  ------------------
  493|  1.85k|					exif_data_load_data_thumbnail (data, d,
  494|  1.85k|								       ds, thumbnail_offset,
  495|  1.85k|								       thumbnail_length);
  496|  6.24k|				break;
  497|  5.48k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (497:4): [True: 5.48k, False: 71.6M]
  ------------------
  498|  5.48k|				thumbnail_length = o;
  499|  5.48k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (499:9): [True: 3.24k, False: 2.24k]
  |  Branch (499:29): [True: 2.53k, False: 709]
  ------------------
  500|  2.53k|					exif_data_load_data_thumbnail (data, d,
  501|  2.53k|								       ds, thumbnail_offset,
  502|  2.53k|								       thumbnail_length);
  503|  5.48k|				break;
  504|      0|			default:
  ------------------
  |  Branch (504:4): [True: 0, False: 71.6M]
  ------------------
  505|      0|				return;
  506|  71.6M|			}
  507|  71.6M|			break;
  508|  71.6M|		default:
  ------------------
  |  Branch (508:3): [True: 38.3M, False: 71.6M]
  ------------------
  509|       |
  510|       |			/*
  511|       |			 * If we don't know the tag, don't fail. It could be that new 
  512|       |			 * versions of the standard have defined additional tags. Note that
  513|       |			 * 0 is a valid tag in the GPS IFD.
  514|       |			 */
  515|  38.3M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (515:8): [True: 38.1M, False: 245k]
  ------------------
  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: 222k, False: 37.9M]
  ------------------
  522|   222k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  523|   222k|						  "Skipping empty entry at position %u in '%s'.", i, 
  524|   222k|						  exif_ifd_get_name (ifd));
  525|   222k|					break;
  526|   222k|				}
  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|   245k|			entry = exif_entry_new_mem (data->priv->mem);
  535|   245k|			if (!entry) {
  ------------------
  |  Branch (535:8): [True: 0, False: 245k]
  ------------------
  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|   245k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (540:8): [True: 30.0k, False: 215k]
  ------------------
  541|   245k|						   offset + 12 * i))
  542|  30.0k|				exif_content_add_entry (data->ifd[ifd], entry);
  543|   245k|			exif_entry_unref (entry);
  544|   245k|			break;
  545|   110M|		}
  546|   110M|	}
  547|  2.61M|}
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|  4.38k|{
  335|       |	/* Sanity checks */
  336|  4.38k|	if (o >= ds) {
  ------------------
  |  Branch (336:6): [True: 0, False: 4.38k]
  ------------------
  337|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  338|      0|		return;
  339|      0|	}
  340|  4.38k|	if (CHECKOVERFLOW(o,ds,s)) {
  ------------------
  |  |   53|  4.38k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (53:52): [True: 0, False: 4.38k]
  |  |  |  Branch (53:81): [True: 0, False: 4.38k]
  |  |  |  Branch (53:112): [True: 1.68k, False: 2.69k]
  |  |  ------------------
  ------------------
  341|  1.68k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  342|  1.68k|		return;
  343|  1.68k|	}
  344|  2.69k|	if (data->data) 
  ------------------
  |  Branch (344:6): [True: 2.49k, False: 203]
  ------------------
  345|  2.49k|		exif_mem_free (data->priv->mem, data->data);
  346|  2.69k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (346:6): [True: 0, False: 2.69k]
  ------------------
  347|      0|		EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  348|      0|		data->size = 0;
  349|      0|		return;
  350|      0|	}
  351|  2.69k|	data->size = s;
  352|  2.69k|	memcpy (data->data, d + o, s);
  353|  2.69k|}
exif-data.c:exif_data_load_data_entry:
  169|   245k|{
  170|   245k|	unsigned int s, doff;
  171|       |
  172|   245k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  173|   245k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  174|   245k|	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|   245k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  180|   245k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  181|   245k|		  exif_tag_get_name (entry->tag));
  182|       |
  183|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  184|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  185|   245k|	s = exif_format_get_size(entry->format) * entry->components;
  186|   245k|	if ((s < entry->components) || (s == 0)){
  ------------------
  |  Branch (186:6): [True: 157k, False: 87.8k]
  |  Branch (186:33): [True: 34.9k, False: 52.9k]
  ------------------
  187|   192k|		return 0;
  188|   192k|	}
  189|       |
  190|       |	/*
  191|       |	 * Size? If bigger than 4 bytes, the actual data is not
  192|       |	 * in the entry but somewhere else (offset).
  193|       |	 */
  194|  52.9k|	if (s > 4)
  ------------------
  |  Branch (194:6): [True: 41.9k, False: 11.0k]
  ------------------
  195|  41.9k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  196|  11.0k|	else
  197|  11.0k|		doff = offset + 8;
  198|       |
  199|       |	/* Sanity checks */
  200|  52.9k|	if (doff >= size) {
  ------------------
  |  Branch (200:6): [True: 18.1k, False: 34.8k]
  ------------------
  201|  18.1k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  202|  18.1k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  203|  18.1k|		return 0;
  204|  18.1k|	}
  205|       |
  206|  34.8k|	if (s > size - doff) {
  ------------------
  |  Branch (206:6): [True: 4.80k, False: 30.0k]
  ------------------
  207|  4.80k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  4.80k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  209|  4.80k|		return 0;
  210|  4.80k|	}
  211|       |
  212|  30.0k|	entry->data = exif_data_alloc (data, s);
  213|  30.0k|	if (entry->data) {
  ------------------
  |  Branch (213:6): [True: 30.0k, False: 0]
  ------------------
  214|  30.0k|		entry->size = s;
  215|  30.0k|		memcpy (entry->data, d + doff, s);
  216|  30.0k|	} else {
  217|      0|		EXIF_LOG_NO_MEMORY(data->priv->log, "ExifData", s);
  ------------------
  |  |  112|      0|#define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
  ------------------
  218|      0|		return 0;
  219|      0|	}
  220|       |
  221|       |	/* If this is the MakerNote, remember the offset */
  222|  30.0k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (222:6): [True: 8.18k, False: 21.8k]
  ------------------
  223|  8.18k|		if (!entry->data) {
  ------------------
  |  Branch (223:7): [True: 0, False: 8.18k]
  ------------------
  224|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  225|      0|					  "MakerNote found with empty data");	
  226|  8.18k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (226:14): [True: 7.32k, False: 854]
  ------------------
  227|  7.32k|			exif_log (data->priv->log,
  228|  7.32k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  229|  7.32k|					       "MakerNote found (%02x %02x %02x %02x "
  230|  7.32k|					       "%02x %02x %02x...).",
  231|  7.32k|					       entry->data[0], entry->data[1], entry->data[2],
  232|  7.32k|					       entry->data[3], entry->data[4], entry->data[5],
  233|  7.32k|					       entry->data[6]);
  234|  7.32k|		}
  235|  8.18k|		data->priv->offset_mnote = doff;
  236|  8.18k|	}
  237|  30.0k|	return 1;
  238|  30.0k|}
exif-data.c:interpret_maker_note:
  802|  7.72k|{
  803|  7.72k|	int mnoteid;
  804|  7.72k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  7.72k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 7.72k]
  |  |  ------------------
  |  |  254|  7.72k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  7.72k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 7.72k]
  |  |  ------------------
  |  |  256|  7.72k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  7.72k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 6.80k, False: 918]
  |  |  ------------------
  |  |  258|  7.72k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  7.72k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 918]
  |  |  ------------------
  |  |  260|    918|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    918|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 918]
  |  |  ------------------
  |  |  262|    918|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  805|  7.72k|	if (!e)
  ------------------
  |  Branch (805:6): [True: 918, False: 6.80k]
  ------------------
  806|    918|		return;
  807|       |	
  808|  6.80k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (808:6): [True: 3.76k, False: 3.04k]
  ------------------
  809|  3.76k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  810|  3.76k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  811|  3.76k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  812|       |
  813|  3.76k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (813:13): [True: 868, False: 2.17k]
  ------------------
  814|    868|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  815|    868|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  816|    868|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  817|       |
  818|  2.17k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (818:13): [True: 972, False: 1.20k]
  ------------------
  819|    972|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  820|    972|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  821|    972|		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.20k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (825:13): [True: 1.01k, False: 196]
  ------------------
  826|  1.01k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  827|  1.01k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  828|  1.01k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  829|  1.01k|	}
  830|       |/* Marcus: disabled until apple makernote can also be saved
  831|       |	else if ((mnoteid = exif_mnote_data_apple_identify (data, e)) != 0) {
  832|       |		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  833|       |			"ExifData", "Apple MakerNote variant type %d", mnoteid);
  834|       |		data->priv->md = exif_mnote_data_apple_new (data->priv->mem);
  835|       |	}
  836|       |*/
  837|       |
  838|       |	/* 
  839|       |	 * If we are able to interpret the maker note, do so.
  840|       |	 */
  841|  6.80k|	if (data->priv->md) {
  ------------------
  |  Branch (841:6): [True: 6.61k, False: 196]
  ------------------
  842|  6.61k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  843|  6.61k|		exif_mnote_data_set_byte_order (data->priv->md,
  844|  6.61k|						data->priv->order);
  845|  6.61k|		exif_mnote_data_set_offset (data->priv->md,
  846|  6.61k|					    data->priv->offset_mnote);
  847|  6.61k|		exif_mnote_data_load (data->priv->md, d, ds);
  848|  6.61k|	}
  849|  6.80k|}
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|  38.6k|{
 1328|  38.6k|	switch (exif_content_get_ifd (c)) {
 1329|  7.72k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1329:2): [True: 7.72k, False: 30.9k]
  ------------------
 1330|  7.72k|		if (c->parent->data)
  ------------------
  |  Branch (1330:7): [True: 178, False: 7.54k]
  ------------------
 1331|    178|			exif_content_fix (c);
 1332|  7.54k|		else if (c->count) {
  ------------------
  |  Branch (1332:12): [True: 470, False: 7.07k]
  ------------------
 1333|    470|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1334|    470|				  "No thumbnail but entries on thumbnail. These entries have been "
 1335|    470|				  "removed.");
 1336|  1.74k|			while (c->count) {
  ------------------
  |  Branch (1336:11): [True: 1.27k, False: 470]
  ------------------
 1337|  1.27k|				unsigned int cnt = c->count;
 1338|  1.27k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1339|  1.27k|				if (cnt == c->count) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 1.27k]
  ------------------
 1340|       |					/* safety net */
 1341|      0|					exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1342|      0|					"failed to remove last entry from entries.");
 1343|      0|					c->count--;
 1344|      0|				}
 1345|  1.27k|			}
 1346|    470|		}
 1347|  7.72k|		break;
 1348|  30.9k|	default:
  ------------------
  |  Branch (1348:2): [True: 30.9k, False: 7.72k]
  ------------------
 1349|  30.9k|		exif_content_fix (c);
 1350|  38.6k|	}
 1351|  38.6k|}

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

exif_format_get_name:
   56|  43.2k|{
   57|  43.2k|	unsigned int i;
   58|       |
   59|  43.2k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   266k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 255k, False: 11.5k]
  ------------------
   62|   255k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 31.7k, False: 223k]
  ------------------
   63|  31.7k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  31.7k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  11.5k|	return NULL;
   65|  43.2k|}
exif_format_get_size:
   69|  1.42M|{
   70|  1.42M|	unsigned int i;
   71|       |
   72|  9.51M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 9.13M, False: 383k]
  ------------------
   73|  9.13M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 1.04M, False: 8.09M]
  ------------------
   74|  1.04M|			return ExifFormatTable[i].size;
   75|   383k|	return 0;
   76|  1.42M|}

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

exif_log_ref:
  100|  16.5k|{
  101|  16.5k|	if (!log) return;
  ------------------
  |  Branch (101:6): [True: 16.5k, False: 0]
  ------------------
  102|      0|	log->ref_count++;
  103|      0|}
exif_log_unref:
  107|  83.1k|{
  108|  83.1k|	if (!log) return;
  ------------------
  |  Branch (108:6): [True: 83.1k, False: 0]
  ------------------
  109|      0|	if (log->ref_count > 0) log->ref_count--;
  ------------------
  |  Branch (109:6): [True: 0, False: 0]
  ------------------
  110|      0|	if (!log->ref_count) exif_log_free (log);
  ------------------
  |  Branch (110:6): [True: 0, False: 0]
  ------------------
  111|      0|}
exif_log:
  139|   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|  57.0k|{
   59|  57.0k|	ExifMem *mem;
   60|       |
   61|  57.0k|	if (!alloc_func && !realloc_func) 
  ------------------
  |  Branch (61:6): [True: 0, False: 57.0k]
  |  Branch (61:21): [True: 0, False: 0]
  ------------------
   62|      0|		return NULL;
   63|  57.0k|	mem = alloc_func ? alloc_func (sizeof (ExifMem)) :
  ------------------
  |  Branch (63:8): [True: 57.0k, False: 0]
  ------------------
   64|  57.0k|		           realloc_func (NULL, sizeof (ExifMem));
   65|  57.0k|	if (!mem) return NULL;
  ------------------
  |  Branch (65:6): [True: 0, False: 57.0k]
  ------------------
   66|  57.0k|	mem->ref_count = 1;
   67|       |
   68|  57.0k|	mem->alloc_func   = alloc_func;
   69|  57.0k|	mem->realloc_func = realloc_func;
   70|  57.0k|	mem->free_func    = free_func;
   71|       |
   72|  57.0k|	return mem;
   73|  57.0k|}
exif_mem_ref:
   77|   368k|{
   78|   368k|	if (!mem) return;
  ------------------
  |  Branch (78:6): [True: 0, False: 368k]
  ------------------
   79|   368k|	mem->ref_count++;
   80|   368k|}
exif_mem_unref:
   84|   425k|{
   85|   425k|	if (!mem) return;
  ------------------
  |  Branch (85:6): [True: 0, False: 425k]
  ------------------
   86|   425k|	if (!--mem->ref_count)
  ------------------
  |  Branch (86:6): [True: 57.0k, False: 368k]
  ------------------
   87|  57.0k|		exif_mem_free (mem, mem);
   88|   425k|}
exif_mem_free:
   92|   987k|{
   93|   987k|	if (!mem) return;
  ------------------
  |  Branch (93:6): [True: 0, False: 987k]
  ------------------
   94|   987k|	if (mem->free_func) {
  ------------------
  |  Branch (94:6): [True: 987k, False: 0]
  ------------------
   95|   987k|		mem->free_func (d);
   96|   987k|		return;
   97|   987k|	}
   98|   987k|}
exif_mem_alloc:
  102|   879k|{
  103|   879k|	if (!mem) return NULL;
  ------------------
  |  Branch (103:6): [True: 0, False: 879k]
  ------------------
  104|   879k|	if (mem->alloc_func || mem->realloc_func)
  ------------------
  |  Branch (104:6): [True: 879k, False: 0]
  |  Branch (104:25): [True: 0, False: 0]
  ------------------
  105|   879k|		return mem->alloc_func ? mem->alloc_func (ds) :
  ------------------
  |  Branch (105:10): [True: 879k, False: 0]
  ------------------
  106|   879k|					 mem->realloc_func (NULL, ds);
  107|      0|	return NULL;
  108|   879k|}
exif_mem_realloc:
  112|  68.7k|{
  113|  68.7k|	return (mem && mem->realloc_func) ? mem->realloc_func (d, ds) : NULL;
  ------------------
  |  Branch (113:10): [True: 68.7k, False: 0]
  |  Branch (113:17): [True: 68.7k, False: 0]
  ------------------
  114|  68.7k|}
exif_mem_new_default:
  118|  57.0k|{
  119|  57.0k|	return exif_mem_new (exif_mem_alloc_func, exif_mem_realloc_func,
  120|  57.0k|			     exif_mem_free_func);
  121|  57.0k|}
exif-mem.c:exif_mem_alloc_func:
   37|   936k|{
   38|   936k|	return calloc ((size_t) ds, 1);
   39|   936k|}
exif-mem.c:exif_mem_realloc_func:
   44|  68.7k|{
   45|  68.7k|	return realloc (d, (size_t) ds);
   46|  68.7k|}
exif-mem.c:exif_mem_free_func:
   51|   987k|{
   52|   987k|	free (d);
   53|   987k|}

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

exif_tag_table_count:
  978|   408M|{
  979|   408M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|   408M|}
exif_tag_table_get_tag:
  985|  5.25M|{
  986|  5.25M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.25M, False: 0]
  ------------------
  987|  5.25M|}
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.15k]
  ------------------
 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: 545k, 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.45k, False: 360M]
  |  |  ------------------
  |  | 1039|   361M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 12.2k, False: 360M]
  |  |  ------------------
  ------------------
 1056|   559k|			   break;
 1057|   361M|		} else
 1058|   360M|			return NULL; /* Recorded tag not found in the table */
 1059|   721M|	}
 1060|   560k|	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.26M|{
 1262|  5.26M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 5.26M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  5.26M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 5.26M, False: 0]
  ------------------
 1266|  5.26M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  5.26M|}
exif-tag.c:exif_tag_table_first:
 1016|   402M|{
 1017|   402M|	int i;
 1018|   402M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|   402M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|   402M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 36.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.08M]
  |  Branch (1029:20): [True: 357k, False: 365M]
  ------------------
 1030|   357k|		--i;
 1031|   357k|	}
 1032|   366M|	return i;
 1033|   402M|}
exif-tag.c:match_tag:
 1003|  2.84G|{
 1004|  2.84G|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  2.84G|}
exif-tag.c:exif_tag_get_stuff:
 1130|  71.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|   430M|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 359M, False: 71.6M]
  ------------------
 1141|   359M|		const char *result = func(tag, ifds[i]);
 1142|   359M|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 266k, False: 358M]
  ------------------
 1143|   266k|			return result;
 1144|   266k|		}
 1145|   359M|	}
 1146|  71.6M|	return (const char *) NULL;
 1147|  71.9M|}
exif-tag.c:get_support_level_any_type:
 1227|  5.26M|{
 1228|  5.26M|	unsigned int i;
 1229|  5.26M|	int first = exif_tag_table_first(tag);
 1230|  5.26M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 5.26M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  8.97M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 8.95M, False: 15.6k]
  ------------------
 1234|  8.95M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 5.36M, False: 3.59M]
  ------------------
 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.36M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  5.36M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.73M, False: 3.62M]
  ------------------
 1242|  1.73M|				unsigned int dt;
 1243|  8.60M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 6.94M, False: 1.66M]
  ------------------
 1244|  6.94M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 79.1k, False: 6.86M]
  ------------------
 1245|  79.1k|						break;
 1246|  6.94M|				}
 1247|  1.73M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.66M, False: 79.1k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.66M|					return supp;
 1250|  1.73M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  5.36M|		} else {
 1253|  3.59M|			break; /* We've reached the end of the matching tags */
 1254|  3.59M|		}
 1255|  8.95M|	}
 1256|  3.60M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  5.26M|}

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

exif_mnote_data_fuji_identify:
  346|  2.17k|{
  347|  2.17k|	(void) ed;  /* unused */
  348|  2.17k|	return ((e->size >= 12) && !memcmp (e->data, "FUJIFILM", 8));
  ------------------
  |  Branch (348:10): [True: 1.87k, False: 301]
  |  Branch (348:29): [True: 972, False: 905]
  ------------------
  349|  2.17k|}
exif_mnote_data_fuji_new:
  353|    972|{
  354|    972|	ExifMnoteData *d;
  355|       |
  356|    972|	if (!mem) return NULL;
  ------------------
  |  Branch (356:6): [True: 0, False: 972]
  ------------------
  357|       |
  358|    972|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataFuji));
  359|    972|	if (!d) return NULL;
  ------------------
  |  Branch (359:6): [True: 0, False: 972]
  ------------------
  360|       |
  361|    972|	exif_mnote_data_construct (d, mem);
  362|       |
  363|       |	/* Set up function pointers */
  364|    972|	d->methods.free            = exif_mnote_data_fuji_free;
  365|    972|	d->methods.set_byte_order  = exif_mnote_data_fuji_set_byte_order;
  366|    972|	d->methods.set_offset      = exif_mnote_data_fuji_set_offset;
  367|    972|	d->methods.load            = exif_mnote_data_fuji_load;
  368|    972|	d->methods.save            = exif_mnote_data_fuji_save;
  369|    972|	d->methods.count           = exif_mnote_data_fuji_count;
  370|    972|	d->methods.get_id          = exif_mnote_data_fuji_get_id;
  371|    972|	d->methods.get_name        = exif_mnote_data_fuji_get_name;
  372|    972|	d->methods.get_title       = exif_mnote_data_fuji_get_title;
  373|    972|	d->methods.get_description = exif_mnote_data_fuji_get_description;
  374|    972|	d->methods.get_value       = exif_mnote_data_fuji_get_value;
  375|       |
  376|    972|	return d;
  377|    972|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_free:
   61|    972|{
   62|    972|	if (!n) return;
  ------------------
  |  Branch (62:6): [True: 0, False: 972]
  ------------------
   63|       |
   64|    972|	exif_mnote_data_fuji_clear ((ExifMnoteDataFuji *) n);
   65|    972|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_clear:
   41|  1.87k|{
   42|  1.87k|	ExifMnoteData *d = (ExifMnoteData *) n;
   43|  1.87k|	unsigned int i;
   44|       |
   45|  1.87k|	if (!n) return;
  ------------------
  |  Branch (45:6): [True: 0, False: 1.87k]
  ------------------
   46|       |
   47|  1.87k|	if (n->entries) {
  ------------------
  |  Branch (47:6): [True: 903, False: 972]
  ------------------
   48|  18.4k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (48:15): [True: 17.5k, False: 903]
  ------------------
   49|  17.5k|			if (n->entries[i].data) {
  ------------------
  |  Branch (49:8): [True: 4.47k, False: 13.0k]
  ------------------
   50|  4.47k|				exif_mem_free (d->mem, n->entries[i].data);
   51|  4.47k|				n->entries[i].data = NULL;
   52|  4.47k|			}
   53|    903|		exif_mem_free (d->mem, n->entries);
   54|       |		n->entries = NULL;
   55|    903|		n->count = 0;
   56|    903|	}
   57|  1.87k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_set_byte_order:
  320|    972|{
  321|    972|	ExifByteOrder o_orig;
  322|    972|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  323|    972|	unsigned int i;
  324|       |
  325|    972|	if (!n) return;
  ------------------
  |  Branch (325:6): [True: 0, False: 972]
  ------------------
  326|       |
  327|    972|	o_orig = n->order;
  328|    972|	n->order = o;
  329|    972|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (329:14): [True: 0, False: 972]
  ------------------
  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|    972|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_set_offset:
  340|    972|{
  341|    972|	if (n) ((ExifMnoteDataFuji *) n)->offset = o;
  ------------------
  |  Branch (341:6): [True: 972, False: 0]
  ------------------
  342|    972|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_load:
  158|    972|{
  159|    972|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji*) en;
  160|    972|	ExifLong c;
  161|    972|	size_t i, tcount, o, datao;
  162|       |
  163|    972|	if (!n) return;
  ------------------
  |  Branch (163:6): [True: 0, False: 972]
  ------------------
  164|       |
  165|    972|	if (!buf || !buf_size) {
  ------------------
  |  Branch (165:6): [True: 0, False: 972]
  |  Branch (165:14): [True: 0, False: 972]
  ------------------
  166|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  167|      0|			  "ExifMnoteDataFuji", "Short MakerNote");
  168|      0|		return;
  169|      0|	}
  170|    972|	if (CHECKOVERFLOW(n->offset, buf_size, 6+8+4)) {
  ------------------
  |  |   33|    972|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 0, False: 972]
  |  |  |  Branch (33:81): [True: 0, False: 972]
  |  |  |  Branch (33:112): [True: 3, False: 969]
  |  |  ------------------
  ------------------
  171|      3|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  172|      3|			  "ExifMnoteDataFuji", "Short MakerNote");
  173|      3|		return;
  174|      3|	}
  175|    969|	datao = 6 + n->offset;
  176|       |
  177|    969|	n->order = EXIF_BYTE_ORDER_INTEL;
  178|       |
  179|    969|	datao += exif_get_long (buf + datao + 8, EXIF_BYTE_ORDER_INTEL);
  180|    969|	if (CHECKOVERFLOW(datao, buf_size, 2)) {
  ------------------
  |  |   33|    969|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 42, False: 927]
  |  |  |  Branch (33:81): [True: 0, False: 927]
  |  |  |  Branch (33:112): [True: 2, False: 925]
  |  |  ------------------
  ------------------
  181|     44|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  182|     44|			  "ExifMnoteDataFuji", "Short MakerNote");
  183|     44|		return;
  184|     44|	}
  185|       |
  186|       |	/* Read the number of tags */
  187|    925|	c = exif_get_short (buf + datao, EXIF_BYTE_ORDER_INTEL);
  188|    925|	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|    925|	if (c > 150) {
  ------------------
  |  Branch (193:6): [True: 22, False: 903]
  ------------------
  194|     22|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataFuji", "Too much tags (%d) in Fuji MakerNote", c);
  195|     22|		return;
  196|     22|	}
  197|       |
  198|       |	/* Remove any old entries */
  199|    903|	exif_mnote_data_fuji_clear (n);
  200|       |
  201|       |	/* Reserve enough space for all the possible MakerNote tags */
  202|    903|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteFujiEntry) * c);
  203|    903|	if (!n->entries) {
  ------------------
  |  Branch (203:6): [True: 0, False: 903]
  ------------------
  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|    903|	tcount = 0;
  210|  20.3k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (210:25): [True: 20.2k, False: 74]
  ------------------
  211|  20.2k|		size_t s;
  212|       |
  213|  20.2k|		memset(&n->entries[tcount], 0, sizeof(MnoteFujiEntry));
  214|  20.2k|		if (CHECKOVERFLOW(o, buf_size, 12)) {
  ------------------
  |  |   33|  20.2k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 282, False: 19.9k]
  |  |  |  Branch (33:81): [True: 0, False: 19.9k]
  |  |  |  Branch (33:112): [True: 547, False: 19.4k]
  |  |  ------------------
  ------------------
  215|    829|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  216|    829|				  "ExifMnoteDataFuji", "Short MakerNote");
  217|    829|			break;
  218|    829|		}
  219|       |
  220|  19.4k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  221|  19.4k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  222|  19.4k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  223|  19.4k|		n->entries[tcount].order      = n->order;
  224|       |
  225|  19.4k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataFuji",
  226|  19.4k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  227|  19.4k|			  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|  19.4k|		if (	exif_format_get_size (n->entries[tcount].format) &&
  ------------------
  |  Branch (231:8): [True: 7.95k, False: 11.4k]
  ------------------
  232|  7.95k|			buf_size / exif_format_get_size (n->entries[tcount].format) < n->entries[tcount].components
  ------------------
  |  Branch (232:4): [True: 1.03k, False: 6.91k]
  ------------------
  233|  19.4k|		) {
  234|  1.03k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  235|  1.03k|					  "ExifMnoteDataFuji", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  236|  1.03k|			continue;
  237|  1.03k|		}
  238|       |		/*
  239|       |		 * Size? If bigger than 4 bytes, the actual data is not
  240|       |		 * in the entry but somewhere else (offset).
  241|       |		 */
  242|  18.3k|		s = exif_format_get_size (n->entries[tcount].format) * n->entries[tcount].components;
  243|  18.3k|		n->entries[tcount].size = s;
  244|  18.3k|		if (s) {
  ------------------
  |  Branch (244:7): [True: 5.28k, False: 13.0k]
  ------------------
  245|  5.28k|			size_t dataofs = o + 8;
  246|  5.28k|			if (s > 4)
  ------------------
  |  Branch (246:8): [True: 3.13k, False: 2.15k]
  ------------------
  247|       |				/* The data in this case is merely a pointer */
  248|  3.13k|				dataofs = exif_get_long (buf + dataofs, n->order) + 6 + n->offset;
  249|       |
  250|  5.28k|			if (CHECKOVERFLOW(dataofs, buf_size, s)) {
  ------------------
  |  |   33|  5.28k|#define CHECKOVERFLOW(offset,datasize,structsize) (( (offset) >= (datasize)) || ((structsize) > (datasize)) || ((offset) > (datasize) - (structsize) ))
  |  |  ------------------
  |  |  |  Branch (33:52): [True: 416, False: 4.87k]
  |  |  |  Branch (33:81): [True: 0, False: 4.87k]
  |  |  |  Branch (33:112): [True: 397, False: 4.47k]
  |  |  ------------------
  ------------------
  251|    813|				exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  252|    813|						  "ExifMnoteDataFuji", "Tag data past end of "
  253|    813|					  "buffer (%u >= %u)", (unsigned)(dataofs + s), buf_size);
  254|    813|				continue;
  255|    813|			}
  256|       |
  257|  4.47k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  258|  4.47k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (258:8): [True: 0, False: 4.47k]
  ------------------
  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.47k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  263|  4.47k|		}
  264|       |
  265|       |		/* Tag was successfully parsed */
  266|  17.5k|		++tcount;
  267|  17.5k|	}
  268|       |	/* Store the count of successfully parsed tags */
  269|    903|	n->count = tcount;
  270|    903|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_count:
  274|    972|{
  275|    972|	return n ? ((ExifMnoteDataFuji *) n)->count : 0;
  ------------------
  |  Branch (275:9): [True: 972, False: 0]
  ------------------
  276|    972|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_name:
  290|  9.18k|{
  291|  9.18k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  292|       |
  293|  9.18k|	if (!n) return NULL;
  ------------------
  |  Branch (293:6): [True: 0, False: 9.18k]
  ------------------
  294|  9.18k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (294:6): [True: 0, False: 9.18k]
  ------------------
  295|  9.18k|	return mnote_fuji_tag_get_name (n->entries[i].tag);
  296|  9.18k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_title:
  300|  8.68k|{
  301|  8.68k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  302|       |	
  303|  8.68k|	if (!n) return NULL;
  ------------------
  |  Branch (303:6): [True: 0, False: 8.68k]
  ------------------
  304|  8.68k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (304:6): [True: 0, False: 8.68k]
  ------------------
  305|  8.68k|        return mnote_fuji_tag_get_title (n->entries[i].tag);
  306|  8.68k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_description:
  310|  8.68k|{
  311|  8.68k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
  312|       |	
  313|  8.68k|	if (!n) return NULL;
  ------------------
  |  Branch (313:6): [True: 0, False: 8.68k]
  ------------------
  314|  8.68k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (314:6): [True: 0, False: 8.68k]
  ------------------
  315|  8.68k|        return mnote_fuji_tag_get_description (n->entries[i].tag);
  316|  8.68k|}
exif-mnote-data-fuji.c:exif_mnote_data_fuji_get_value:
   69|  8.68k|{
   70|  8.68k|	ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) d;
   71|       |
   72|  8.68k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (72:6): [True: 0, False: 8.68k]
  |  Branch (72:12): [True: 0, False: 8.68k]
  ------------------
   73|  8.68k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (73:6): [True: 0, False: 8.68k]
  ------------------
   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.68k|	return mnote_fuji_entry_get_value (&n->entries[i], val, maxlen);
   80|  8.68k|}

mnote_fuji_entry_get_value:
  194|  8.68k|{
  195|  8.68k|	ExifLong  vl;
  196|  8.68k|	ExifSLong vsl;
  197|  8.68k|	ExifShort vs, vs2;
  198|  8.68k|	ExifSShort vss;
  199|  8.68k|	ExifRational vr;
  200|  8.68k|	ExifSRational vsr;
  201|  8.68k|	int i, j;
  202|       |
  203|  8.68k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 8.68k]
  ------------------
  204|  8.68k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 8.68k]
  ------------------
  205|       |
  206|  8.68k|	memset (val, 0, maxlen);
  207|  8.68k|	maxlen--;
  208|       |
  209|  8.68k|	switch (entry->tag) {
  210|  1.02k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.02k, False: 7.65k]
  ------------------
  211|  1.02k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.02k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.02k|{                                                               \
  |  |   35|  1.02k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 601, False: 426]
  |  |  ------------------
  |  |   36|    601|                snprintf (v, maxlen,	                        \
  |  |   37|    601|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    601|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    601|                        "expected '%s'."),                      \
  |  |   39|    601|                        exif_format_get_name (format),          \
  |  |   40|    601|                        exif_format_get_name (target));         \
  |  |   41|    601|                break;                                          \
  |  |   42|    601|        }                                                       \
  |  |   43|  1.02k|}
  ------------------
  212|    426|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    426|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    426|{                                                                       \
  |  |   47|    426|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 205, False: 221]
  |  |  ------------------
  |  |   48|    205|                snprintf (v, maxlen,                                    \
  |  |   49|    205|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    205|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    205|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    205|                break;                                                  \
  |  |   52|    205|        }                                                               \
  |  |   53|    426|}
  ------------------
  213|    221|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    221|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 221]
  |  |  ------------------
  ------------------
  214|    221|		break;
  215|    224|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 224, False: 8.46k]
  ------------------
  216|    474|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 250, False: 8.43k]
  ------------------
  217|    682|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 208, False: 8.47k]
  ------------------
  218|    997|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 315, False: 8.36k]
  ------------------
  219|  1.21k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 218, False: 8.46k]
  ------------------
  220|  1.44k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 232, False: 8.45k]
  ------------------
  221|  1.70k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 259, False: 8.42k]
  ------------------
  222|  1.91k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 207, False: 8.47k]
  ------------------
  223|  2.15k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 241, False: 8.44k]
  ------------------
  224|  2.22k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 74, False: 8.61k]
  ------------------
  225|  2.29k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 69, False: 8.61k]
  ------------------
  226|  2.36k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 72, False: 8.61k]
  ------------------
  227|  2.56k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 198, False: 8.48k]
  ------------------
  228|  2.76k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 199, False: 8.48k]
  ------------------
  229|  3.07k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 308, False: 8.37k]
  ------------------
  230|  3.30k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 235, False: 8.44k]
  ------------------
  231|  3.51k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 202, False: 8.48k]
  ------------------
  232|  3.51k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  3.51k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  3.51k|{                                                               \
  |  |   35|  3.51k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 1.79k, False: 1.71k]
  |  |  ------------------
  |  |   36|  1.79k|                snprintf (v, maxlen,	                        \
  |  |   37|  1.79k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.79k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  1.79k|                        "expected '%s'."),                      \
  |  |   39|  1.79k|                        exif_format_get_name (format),          \
  |  |   40|  1.79k|                        exif_format_get_name (target));         \
  |  |   41|  1.79k|                break;                                          \
  |  |   42|  1.79k|        }                                                       \
  |  |   43|  3.51k|}
  ------------------
  233|  1.71k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  1.71k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  1.71k|{                                                                       \
  |  |   47|  1.71k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 303, False: 1.40k]
  |  |  ------------------
  |  |   48|    303|                snprintf (v, maxlen,                                    \
  |  |   49|    303|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    303|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    303|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    303|                break;                                                  \
  |  |   52|    303|        }                                                               \
  |  |   53|  1.71k|}
  ------------------
  234|  1.40k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  10.3k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 10.3k, False: 0]
  |  Branch (237:32): [True: 8.93k, False: 1.40k]
  ------------------
  238|  1.40k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.40k]
  ------------------
  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|  7.90k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 7.35k, False: 554]
  ------------------
  246|  7.35k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 6.49k, False: 855]
  ------------------
  247|  1.40k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 782, False: 627]
  ------------------
  248|    782|			snprintf (val, maxlen,
  249|    782|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|    782|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|    782|			break;
  251|    782|		}
  252|    627|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    627|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    627|		break;
  254|    486|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 486, False: 8.19k]
  ------------------
  255|    486|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    486|#define CF(format,target,v,maxlen)                              \
  |  |   34|    486|{                                                               \
  |  |   35|    486|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 211, False: 275]
  |  |  ------------------
  |  |   36|    211|                snprintf (v, maxlen,	                        \
  |  |   37|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    211|                        "expected '%s'."),                      \
  |  |   39|    211|                        exif_format_get_name (format),          \
  |  |   40|    211|                        exif_format_get_name (target));         \
  |  |   41|    211|                break;                                          \
  |  |   42|    211|        }                                                       \
  |  |   43|    486|}
  ------------------
  256|    275|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    275|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    275|{                                                                       \
  |  |   47|    275|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 71, False: 204]
  |  |  ------------------
  |  |   48|     71|                snprintf (v, maxlen,                                    \
  |  |   49|     71|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     71|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     71|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     71|                break;                                                  \
  |  |   52|     71|        }                                                               \
  |  |   53|    275|}
  ------------------
  257|    204|		vs = exif_get_short (entry->data, entry->order);
  258|    204|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    204|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    204|		break;
  261|    201|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 201, False: 8.48k]
  ------------------
  262|  1.05k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 851, False: 7.83k]
  ------------------
  263|  1.05k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.05k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.05k|{                                                               \
  |  |   35|  1.05k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 290, False: 762]
  |  |  ------------------
  |  |   36|    290|                snprintf (v, maxlen,	                        \
  |  |   37|    290|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    290|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    290|                        "expected '%s'."),                      \
  |  |   39|    290|                        exif_format_get_name (format),          \
  |  |   40|    290|                        exif_format_get_name (target));         \
  |  |   41|    290|                break;                                          \
  |  |   42|    290|        }                                                       \
  |  |   43|  1.05k|}
  ------------------
  264|    762|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    762|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    762|{                                                                       \
  |  |   47|    762|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 72, False: 690]
  |  |  ------------------
  |  |   48|     72|                snprintf (v, maxlen,                                    \
  |  |   49|     72|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     72|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|     72|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|     72|                break;                                                  \
  |  |   52|     72|        }                                                               \
  |  |   53|    762|}
  ------------------
  265|    690|		vr = exif_get_rational (entry->data, entry->order);
  266|    690|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 230, False: 460]
  ------------------
  267|    460|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    460|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    460|			  vr.denominator);
  269|    460|		break;
  270|       |
  271|  2.60k|	default:
  ------------------
  |  Branch (271:2): [True: 2.60k, False: 6.07k]
  ------------------
  272|  2.60k|		switch (entry->format) {
  273|    288|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 288, False: 2.32k]
  ------------------
  274|    288|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    288|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 139, False: 149]
  |  |  ------------------
  ------------------
  275|    288|		  break;
  276|    201|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 201, False: 2.40k]
  ------------------
  277|    201|		  vs = exif_get_short (entry->data, entry->order);
  278|    201|		  snprintf (val, maxlen, "%hu", vs);
  279|    201|		  break;
  280|    237|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 237, False: 2.37k]
  ------------------
  281|    237|		  vss = exif_get_sshort (entry->data, entry->order);
  282|    237|		  snprintf (val, maxlen, "%hi", vss);
  283|    237|		  break;
  284|    197|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 197, False: 2.41k]
  ------------------
  285|    197|		  vl = exif_get_long (entry->data, entry->order);
  286|    197|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    197|		  break;
  288|    207|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 207, False: 2.40k]
  ------------------
  289|    207|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    207|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    207|		  break;
  292|    527|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 527, False: 2.08k]
  ------------------
  293|    527|		  vr = exif_get_rational (entry->data, entry->order);
  294|    527|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 107, False: 420]
  ------------------
  295|    420|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    420|						    vr.denominator);
  297|    420|		  break;
  298|    616|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 616, False: 1.99k]
  ------------------
  299|    616|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    616|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 225, False: 391]
  ------------------
  301|    391|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    391|			  vsr.denominator);
  303|    391|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.60k]
  ------------------
  305|    335|		default:
  ------------------
  |  Branch (305:3): [True: 335, False: 2.27k]
  ------------------
  306|    335|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    335|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    335| 			  entry->size);
  308|    335|		  break;
  309|  2.60k|		}
  310|  2.60k|		break;
  311|  8.68k|	}
  312|       |
  313|  8.68k|	return (val);
  314|  8.68k|}

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

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

mnote_olympus_entry_get_value:
  276|  52.0k|{
  277|  52.0k|	char         buf[30];
  278|  52.0k|	ExifLong     vl;
  279|  52.0k|	ExifSLong    vsl;
  280|  52.0k|	ExifShort    vs = 0;
  281|  52.0k|	ExifSShort   vss = 0;
  282|  52.0k|	ExifRational vr, vr2;
  283|  52.0k|	ExifSRational vsr;
  284|  52.0k|	int          i, j;
  285|  52.0k|	double       r, b;
  286|       |
  287|  52.0k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 52.0k]
  ------------------
  288|      0|		return (NULL);
  289|  52.0k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 52.0k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  52.0k|	memset (v, 0, maxlen);
  293|  52.0k|	maxlen--;
  294|       |
  295|  52.0k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 17.6k, False: 34.4k]
  |  Branch (295:24): [True: 3.29k, False: 14.3k]
  ------------------
  296|  3.29k|		return (v);
  297|       |
  298|  48.7k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 14.3k, False: 34.4k]
  |  Branch (298:24): [True: 0, False: 14.3k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  48.7k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    836|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 836, False: 47.8k]
  ------------------
  305|    836|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    836|#define CF(format,target,v,maxlen)                              \
  |  |   36|    836|{                                                               \
  |  |   37|    836|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 271, False: 565]
  |  |  ------------------
  |  |   38|    271|                snprintf (v, maxlen,	                        \
  |  |   39|    271|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    271|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    271|                        "expected '%s'."),                      \
  |  |   41|    271|                        exif_format_get_name (format),          \
  |  |   42|    271|                        exif_format_get_name (target));         \
  |  |   43|    271|                break;                                          \
  |  |   44|    271|        }                                                       \
  |  |   45|    836|}
  ------------------
  306|    565|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    565|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    565|{                                                                       \
  |  |   62|    565|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 213, False: 352]
  |  |  ------------------
  |  |   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|    565|}
  ------------------
  307|    352|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    352|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 86, False: 266]
  ------------------
  309|     86|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|     86|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 86]
  |  |  ------------------
  ------------------
  310|    266|		} else {
  311|    266|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    266|		}
  313|    352|		break;
  314|    539|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 539, False: 48.1k]
  ------------------
  315|    539|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    539|#define CF(format,target,v,maxlen)                              \
  |  |   36|    539|{                                                               \
  |  |   37|    539|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 267, False: 272]
  |  |  ------------------
  |  |   38|    267|                snprintf (v, maxlen,	                        \
  |  |   39|    267|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    267|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    267|                        "expected '%s'."),                      \
  |  |   41|    267|                        exif_format_get_name (format),          \
  |  |   42|    267|                        exif_format_get_name (target));         \
  |  |   43|    267|                break;                                          \
  |  |   44|    267|        }                                                       \
  |  |   45|    539|}
  ------------------
  316|    272|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    272|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    272|{                                                                       \
  |  |   62|    272|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 205, False: 67]
  |  |  ------------------
  |  |   63|    205|                snprintf (v, maxlen,                                    \
  |  |   64|    205|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    205|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    205|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    205|                break;                                                  \
  |  |   67|    205|        }                                                               \
  |  |   68|    272|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|     67|                vs = exif_get_short (entry->data + 2, entry->order);
  319|     67|                snprintf (v, maxlen, "ISO %hd", vs);
  320|     67|                break;
  321|    610|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 610, False: 48.1k]
  ------------------
  322|    610|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    610|#define CF(format,target,v,maxlen)                              \
  |  |   36|    610|{                                                               \
  |  |   37|    610|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 210, False: 400]
  |  |  ------------------
  |  |   38|    210|                snprintf (v, maxlen,	                        \
  |  |   39|    210|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    210|                        "expected '%s'."),                      \
  |  |   41|    210|                        exif_format_get_name (format),          \
  |  |   42|    210|                        exif_format_get_name (target));         \
  |  |   43|    210|                break;                                          \
  |  |   44|    210|        }                                                       \
  |  |   45|    610|}
  ------------------
  323|    400|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    400|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    400|{                                                                       \
  |  |   62|    400|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 204, False: 196]
  |  |  ------------------
  |  |   63|    204|                snprintf (v, maxlen,                                    \
  |  |   64|    204|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    204|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    204|                break;                                                  \
  |  |   67|    204|        }                                                               \
  |  |   68|    400|}
  ------------------
  324|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  325|    196|                vs = exif_get_short (entry->data + 2, entry->order);
  326|    196|                snprintf (v, maxlen, "ISO2 %hd", vs);
  327|    196|                break;
  328|    217|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 217, False: 48.4k]
  ------------------
  329|    449|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 232, False: 48.4k]
  ------------------
  330|    834|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 385, False: 48.3k]
  ------------------
  331|  1.07k|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 242, False: 48.4k]
  ------------------
  332|  1.36k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 284, False: 48.4k]
  ------------------
  333|  1.61k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 257, False: 48.4k]
  ------------------
  334|  1.96k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 349, False: 48.3k]
  ------------------
  335|  2.19k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 231, False: 48.4k]
  ------------------
  336|  2.42k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 227, False: 48.4k]
  ------------------
  337|  2.62k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 198, False: 48.5k]
  ------------------
  338|  2.83k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 208, False: 48.5k]
  ------------------
  339|  3.02k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 197, False: 48.5k]
  ------------------
  340|  3.09k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 66, False: 48.6k]
  ------------------
  341|  3.09k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  3.09k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  3.09k|{                                                               \
  |  |   37|  3.09k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.52k, False: 570]
  |  |  ------------------
  |  |   38|  2.52k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.52k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.52k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.52k|                        "expected '%s'."),                      \
  |  |   41|  2.52k|                        exif_format_get_name (format),          \
  |  |   42|  2.52k|                        exif_format_get_name (target));         \
  |  |   43|  2.52k|                break;                                          \
  |  |   44|  2.52k|        }                                                       \
  |  |   45|  3.09k|}
  ------------------
  342|    570|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    570|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 201, False: 369]
  |  |  ------------------
  ------------------
  343|    570|		break;
  344|    198|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 198, False: 48.5k]
  ------------------
  345|    454|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 256, False: 48.4k]
  ------------------
  346|    801|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 347, False: 48.3k]
  ------------------
  347|    801|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    801|#define CF(format,target,v,maxlen)                              \
  |  |   36|    801|{                                                               \
  |  |   37|    801|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 220, False: 581]
  |  |  ------------------
  |  |   38|    220|                snprintf (v, maxlen,	                        \
  |  |   39|    220|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    220|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    220|                        "expected '%s'."),                      \
  |  |   41|    220|                        exif_format_get_name (format),          \
  |  |   42|    220|                        exif_format_get_name (target));         \
  |  |   43|    220|                break;                                          \
  |  |   44|    220|        }                                                       \
  |  |   45|    801|}
  ------------------
  348|    581|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    581|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    581|{                                                                       \
  |  |   62|    581|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 377, False: 204]
  |  |  ------------------
  |  |   63|    377|                snprintf (v, maxlen,                                    \
  |  |   64|    377|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    377|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    377|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    377|                break;                                                  \
  |  |   67|    377|        }                                                               \
  |  |   68|    581|}
  ------------------
  349|    204|		vl =  exif_get_long (entry->data, entry->order);
  350|    204|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    204|		break;
  352|    531|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 531, False: 48.1k]
  ------------------
  353|  1.01k|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 483, False: 48.2k]
  ------------------
  354|  1.01k|		unsigned char h,m,l;
  355|  1.01k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  1.01k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.01k|{                                                               \
  |  |   37|  1.01k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 219, False: 795]
  |  |  ------------------
  |  |   38|    219|                snprintf (v, maxlen,	                        \
  |  |   39|    219|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    219|                        "expected '%s'."),                      \
  |  |   41|    219|                        exif_format_get_name (format),          \
  |  |   42|    219|                        exif_format_get_name (target));         \
  |  |   43|    219|                break;                                          \
  |  |   44|    219|        }                                                       \
  |  |   45|  1.01k|}
  ------------------
  356|    795|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    795|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    795|{                                                                       \
  |  |   62|    795|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 289, False: 506]
  |  |  ------------------
  |  |   63|    289|                snprintf (v, maxlen,                                    \
  |  |   64|    289|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    289|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    289|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    289|                break;                                                  \
  |  |   67|    289|        }                                                               \
  |  |   68|    795|}
  ------------------
  357|    506|		vl =  exif_get_long (entry->data, entry->order);
  358|    506|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    506|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 277, False: 229]
  ------------------
  360|    506|		break;
  361|    795|	}
  362|    346|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 346, False: 48.3k]
  ------------------
  363|    785|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 439, False: 48.2k]
  ------------------
  364|    785|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    785|#define CF(format,target,v,maxlen)                              \
  |  |   36|    785|{                                                               \
  |  |   37|    785|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 212, False: 573]
  |  |  ------------------
  |  |   38|    212|                snprintf (v, maxlen,	                        \
  |  |   39|    212|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    212|                        "expected '%s'."),                      \
  |  |   41|    212|                        exif_format_get_name (format),          \
  |  |   42|    212|                        exif_format_get_name (target));         \
  |  |   43|    212|                break;                                          \
  |  |   44|    212|        }                                                       \
  |  |   45|    785|}
  ------------------
  365|    573|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    573|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    573|{                                                                       \
  |  |   62|    573|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 243, False: 330]
  |  |  ------------------
  |  |   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|    573|}
  ------------------
  366|    330|		vl =  exif_get_long (entry->data, entry->order);
  367|    330|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    330|		break;
  369|    730|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 730, False: 47.9k]
  ------------------
  370|    959|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 229, False: 48.4k]
  ------------------
  371|  1.03k|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 73, False: 48.6k]
  ------------------
  372|  1.23k|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 204, False: 48.5k]
  ------------------
  373|  1.44k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 210, False: 48.5k]
  ------------------
  374|  1.44k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.44k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.44k|{                                                               \
  |  |   37|  1.44k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 612, False: 834]
  |  |  ------------------
  |  |   38|    612|                snprintf (v, maxlen,	                        \
  |  |   39|    612|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    612|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    612|                        "expected '%s'."),                      \
  |  |   41|    612|                        exif_format_get_name (format),          \
  |  |   42|    612|                        exif_format_get_name (target));         \
  |  |   43|    612|                break;                                          \
  |  |   44|    612|        }                                                       \
  |  |   45|  1.44k|}
  ------------------
  375|    834|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    834|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    834|{                                                                       \
  |  |   62|    834|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 410, False: 424]
  |  |  ------------------
  |  |   63|    410|                snprintf (v, maxlen,                                    \
  |  |   64|    410|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    410|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    410|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    410|                break;                                                  \
  |  |   67|    410|        }                                                               \
  |  |   68|    834|}
  ------------------
  376|    424|		vs = exif_get_short (entry->data, entry->order);
  377|    424|		snprintf (v, maxlen, "%hd", vs);
  378|    424|		break;
  379|  1.13k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.13k, False: 47.5k]
  ------------------
  380|  1.13k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.13k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.13k|{                                                               \
  |  |   37|  1.13k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 267, False: 863]
  |  |  ------------------
  |  |   38|    267|                snprintf (v, maxlen,	                        \
  |  |   39|    267|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    267|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    267|                        "expected '%s'."),                      \
  |  |   41|    267|                        exif_format_get_name (format),          \
  |  |   42|    267|                        exif_format_get_name (target));         \
  |  |   43|    267|                break;                                          \
  |  |   44|    267|        }                                                       \
  |  |   45|  1.13k|}
  ------------------
  381|    863|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    863|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    863|{                                                                       \
  |  |   62|    863|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 232, False: 631]
  |  |  ------------------
  |  |   63|    232|                snprintf (v, maxlen,                                    \
  |  |   64|    232|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    232|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    232|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    232|                break;                                                  \
  |  |   67|    232|        }                                                               \
  |  |   68|    863|}
  ------------------
  382|    631|		vr = exif_get_rational (entry->data, entry->order);
  383|    631|		r = R2D(vr);
  ------------------
  |  |   82|    631|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 399, False: 232]
  |  |  ------------------
  ------------------
  384|    631|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    631|		b = R2D(vr);
  ------------------
  |  |   82|    631|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 414, False: 217]
  |  |  ------------------
  ------------------
  386|    631|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    631|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    631|		break;
  388|  1.10k|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 1.10k, False: 47.6k]
  ------------------
  389|  1.10k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.10k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.10k|{                                                               \
  |  |   37|  1.10k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 301, False: 799]
  |  |  ------------------
  |  |   38|    301|                snprintf (v, maxlen,	                        \
  |  |   39|    301|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    301|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    301|                        "expected '%s'."),                      \
  |  |   41|    301|                        exif_format_get_name (format),          \
  |  |   42|    301|                        exif_format_get_name (target));         \
  |  |   43|    301|                break;                                          \
  |  |   44|    301|        }                                                       \
  |  |   45|  1.10k|}
  ------------------
  390|    799|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    799|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    799|{                                                                       \
  |  |   62|    799|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 228, False: 571]
  |  |  ------------------
  |  |   63|    228|                snprintf (v, maxlen,                                    \
  |  |   64|    228|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    228|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    228|                break;                                                  \
  |  |   67|    228|        }                                                               \
  |  |   68|    799|}
  ------------------
  391|    571|		vr = exif_get_rational (entry->data, entry->order);
  392|    571|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 196, False: 375]
  |  Branch (392:24): [True: 79, False: 296]
  ------------------
  393|    275|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    275|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    296|		} else {
  395|    296|			r = R2D(vr);
  ------------------
  |  |   82|    296|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 296, False: 0]
  |  |  ------------------
  ------------------
  396|    296|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    296|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    296|		}
  398|    571|		break;
  399|  1.71k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 1.71k, False: 46.9k]
  ------------------
  400|  1.71k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.71k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.71k|{                                                               \
  |  |   37|  1.71k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 222, False: 1.49k]
  |  |  ------------------
  |  |   38|    222|                snprintf (v, maxlen,	                        \
  |  |   39|    222|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    222|                        "expected '%s'."),                      \
  |  |   41|    222|                        exif_format_get_name (format),          \
  |  |   42|    222|                        exif_format_get_name (target));         \
  |  |   43|    222|                break;                                          \
  |  |   44|    222|        }                                                       \
  |  |   45|  1.71k|}
  ------------------
  401|  1.49k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.49k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.49k|{                                                                       \
  |  |   62|  1.49k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 341, False: 1.14k]
  |  |  ------------------
  |  |   63|    341|                snprintf (v, maxlen,                                    \
  |  |   64|    341|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    341|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    341|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    341|                break;                                                  \
  |  |   67|    341|        }                                                               \
  |  |   68|  1.49k|}
  ------------------
  402|  1.14k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.14k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.14k|		r = R2D(vr);
  ------------------
  |  |   82|  1.14k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 899, False: 250]
  |  |  ------------------
  ------------------
  405|  1.14k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.14k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 885, False: 264]
  |  |  ------------------
  ------------------
  406|  1.14k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.14k|		break;
  408|  1.06k|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 1.06k, False: 47.6k]
  ------------------
  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: 579, False: 489]
  |  |  |  Branch (49:36): [True: 259, False: 320]
  |  |  ------------------
  |  |   50|    259|                snprintf (v, maxlen,	                        \
  |  |   51|    259|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    259|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    259|                        "expected '%s' or '%s'."),              \
  |  |   53|    259|                        exif_format_get_name (format),          \
  |  |   54|    259|                        exif_format_get_name (target1),         \
  |  |   55|    259|                        exif_format_get_name (target2));        \
  |  |   56|    259|                break;                                          \
  |  |   57|    259|        }                                                       \
  |  |   58|  1.06k|}
  ------------------
  410|    809|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    809|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    809|{                                                                       \
  |  |   62|    809|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 242, False: 567]
  |  |  ------------------
  |  |   63|    242|                snprintf (v, maxlen,                                    \
  |  |   64|    242|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    242|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    242|                break;                                                  \
  |  |   67|    242|        }                                                               \
  |  |   68|    809|}
  ------------------
  411|    567|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 215, False: 352]
  ------------------
  412|    215|			vs = exif_get_short (entry->data, entry->order);
  413|    352|		} else {
  414|    352|			vs = entry->data[0];
  415|    352|		}
  416|    567|		snprintf (v, maxlen, "%hd", vs);
  417|    567|		break;
  418|  2.80k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.80k, False: 45.9k]
  ------------------
  419|  2.80k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.80k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.80k|{                                                               \
  |  |   37|  2.80k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 105, False: 2.69k]
  |  |  ------------------
  |  |   38|    105|                snprintf (v, maxlen,	                        \
  |  |   39|    105|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    105|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    105|                        "expected '%s'."),                      \
  |  |   41|    105|                        exif_format_get_name (format),          \
  |  |   42|    105|                        exif_format_get_name (target));         \
  |  |   43|    105|                break;                                          \
  |  |   44|    105|        }                                                       \
  |  |   45|  2.80k|}
  ------------------
  420|  2.69k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.69k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.69k|{                                                                       \
  |  |   62|  2.69k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 297, False: 2.40k]
  |  |  ------------------
  |  |   63|    297|                snprintf (v, maxlen,                                    \
  |  |   64|    297|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    297|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    297|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    297|                break;                                                  \
  |  |   67|    297|        }                                                               \
  |  |   68|  2.69k|}
  ------------------
  421|  2.40k|		switch (  *( entry->data+1)  ) {
  422|    215|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    215|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 215, False: 2.18k]
  ------------------
  423|    196|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 196, False: 2.20k]
  ------------------
  424|    221|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|    221|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 221, False: 2.18k]
  ------------------
  425|    195|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 195, False: 2.20k]
  ------------------
  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.20k]
  ------------------
  427|    196|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 196, False: 2.20k]
  ------------------
  428|    156|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    156|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 156, False: 2.24k]
  ------------------
  429|    195|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 195, False: 2.20k]
  ------------------
  430|    197|		  	case  8: strncpy (v, _("AF position: lower-right"), maxlen); break;
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (430:6): [True: 197, False: 2.20k]
  ------------------
  431|    204|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 204, False: 2.19k]
  ------------------
  432|    197|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 197, False: 2.20k]
  ------------------
  433|    236|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 236, False: 2.16k]
  ------------------
  434|  2.40k|		}     
  435|  2.40k|		break;
  436|  2.40k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.34k, False: 47.3k]
  ------------------
  437|  1.34k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.34k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.34k|{                                                               \
  |  |   37|  1.34k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 214, False: 1.13k]
  |  |  ------------------
  |  |   38|    214|                snprintf (v, maxlen,	                        \
  |  |   39|    214|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    214|                        "expected '%s'."),                      \
  |  |   41|    214|                        exif_format_get_name (format),          \
  |  |   42|    214|                        exif_format_get_name (target));         \
  |  |   43|    214|                break;                                          \
  |  |   44|    214|        }                                                       \
  |  |   45|  1.34k|}
  ------------------
  438|  1.13k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.13k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.13k|{                                                                       \
  |  |   62|  1.13k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 195, False: 938]
  |  |  ------------------
  |  |   63|    195|                snprintf (v, maxlen,                                    \
  |  |   64|    195|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    195|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    195|                break;                                                  \
  |  |   67|    195|        }                                                               \
  |  |   68|  1.13k|}
  ------------------
  439|    938|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  13.1k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 13.1k, False: 0]
  |  Branch (441:32): [True: 12.1k, False: 938]
  ------------------
  442|  12.1k|			;
  443|    938|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 938]
  ------------------
  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|    938|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|    938|#define CF(format,target,v,maxlen)                              \
  |  |   36|    938|{                                                               \
  |  |   37|    938|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 938]
  |  |  ------------------
  |  |   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|    938|}
  ------------------
  448|       |		/* find the value */
  449|  2.62k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.34k, False: 271]
  ------------------
  450|  2.34k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.68k, False: 667]
  ------------------
  451|    938|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 275, False: 663]
  ------------------
  452|    275|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    275|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    275|			break;
  454|    275|		}
  455|    663|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    663|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    663|		break;
  457|  1.39k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.39k, False: 47.3k]
  ------------------
  458|  1.39k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 1.08k, False: 311]
  ------------------
  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: 280, False: 806]
  |  |  ------------------
  |  |   63|    280|                snprintf (v, maxlen,                                    \
  |  |   64|    280|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    280|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    280|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    280|                break;                                                  \
  |  |   67|    280|        }                                                               \
  |  |   68|  1.08k|}
  ------------------
  460|    806|			vr = exif_get_rational (entry->data, entry->order);
  461|    806|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 225, False: 581]
  |  Branch (461:25): [True: 224, False: 357]
  ------------------
  462|    449|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    449|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    449|			} else {
  464|    357|				r = R2D(vr);
  ------------------
  |  |   82|    357|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 357, False: 0]
  |  |  ------------------
  ------------------
  465|    357|				snprintf (v, maxlen, "%2.2f", r);
  466|    357|			}
  467|    806|			break;
  468|  1.08k|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    593|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 282, False: 48.4k]
  ------------------
  472|    810|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 217, False: 48.4k]
  ------------------
  473|  1.02k|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 210, False: 48.5k]
  ------------------
  474|  1.17k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 151, False: 48.5k]
  ------------------
  475|  1.37k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 208, False: 48.5k]
  ------------------
  476|  1.58k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 205, False: 48.5k]
  ------------------
  477|  1.81k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 227, False: 48.4k]
  ------------------
  478|  2.00k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 198, False: 48.5k]
  ------------------
  479|  2.24k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 238, False: 48.4k]
  ------------------
  480|  2.50k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 260, False: 48.4k]
  ------------------
  481|  2.74k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 235, False: 48.4k]
  ------------------
  482|  2.94k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 200, False: 48.5k]
  ------------------
  483|  3.22k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 279, False: 48.4k]
  ------------------
  484|  3.41k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 197, False: 48.5k]
  ------------------
  485|  3.63k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 212, False: 48.4k]
  ------------------
  486|  3.83k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 206, False: 48.5k]
  ------------------
  487|  4.16k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 324, False: 48.3k]
  ------------------
  488|  4.49k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 330, False: 48.3k]
  ------------------
  489|  4.68k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 195, False: 48.5k]
  ------------------
  490|  4.88k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 200, False: 48.5k]
  ------------------
  491|  5.33k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 449, False: 48.2k]
  ------------------
  492|  5.54k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 206, False: 48.5k]
  ------------------
  493|  5.89k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 358, False: 48.3k]
  ------------------
  494|  6.09k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 200, False: 48.5k]
  ------------------
  495|  6.30k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 210, False: 48.5k]
  ------------------
  496|  6.51k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 206, False: 48.5k]
  ------------------
  497|  6.77k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 265, False: 48.4k]
  ------------------
  498|  6.77k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  6.77k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  6.77k|{                                                                       \
  |  |   62|  6.77k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.35k, False: 4.42k]
  |  |  ------------------
  |  |   63|  2.35k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.35k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.35k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.35k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.35k|                break;                                                  \
  |  |   67|  2.35k|        }                                                               \
  |  |   68|  6.77k|}
  ------------------
  499|  4.42k|		switch (entry->format) {
  500|    724|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 724, False: 3.70k]
  ------------------
  501|  1.20k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 484, False: 3.94k]
  ------------------
  502|  1.20k|			vs = entry->data[0];
  503|  1.20k|			break;
  504|  2.08k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 2.08k, False: 2.33k]
  ------------------
  505|  2.08k|			vs = exif_get_short(entry->data, entry->order);
  506|  2.08k|			break;
  507|  1.12k|		default:
  ------------------
  |  Branch (507:3): [True: 1.12k, False: 3.29k]
  ------------------
  508|  1.12k|			vs = 0;
  509|  1.12k|			break;
  510|  4.42k|		}
  511|       |		/* search for the tag */
  512|  77.5k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 77.2k, False: 263]
  |  Branch (512:32): [True: 73.0k, False: 4.16k]
  ------------------
  513|  73.0k|			;
  514|  4.42k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 263, False: 4.16k]
  ------------------
  515|    263|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|    263|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|    263|		  	break;
  517|    263|		}
  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.84k, False: 2.32k]
  |  |  ------------------
  |  |   38|  1.84k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.84k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.84k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.84k|                        "expected '%s'."),                      \
  |  |   41|  1.84k|                        exif_format_get_name (format),          \
  |  |   42|  1.84k|                        exif_format_get_name (target));         \
  |  |   43|  1.84k|                break;                                          \
  |  |   44|  1.84k|        }                                                       \
  |  |   45|  4.16k|}
  ------------------
  519|       |		/* find the value */
  520|  8.27k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 7.10k, False: 1.17k]
  ------------------
  521|  7.10k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 5.95k, False: 1.15k]
  ------------------
  522|  2.32k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.21k, False: 1.11k]
  ------------------
  523|  1.21k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.21k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.21k|			break;
  525|  1.21k|		}
  526|  1.11k|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|  1.11k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|  1.11k|		break;
  528|    203|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 203, False: 48.5k]
  ------------------
  529|    412|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 209, False: 48.5k]
  ------------------
  530|    651|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 239, False: 48.4k]
  ------------------
  531|    735|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 84, False: 48.6k]
  ------------------
  532|    940|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 205, False: 48.5k]
  ------------------
  533|  1.16k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 224, False: 48.4k]
  ------------------
  534|  1.49k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 334, False: 48.3k]
  ------------------
  535|  1.74k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 242, False: 48.4k]
  ------------------
  536|  2.12k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 382, False: 48.3k]
  ------------------
  537|  2.12k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.12k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.12k|{                                                               \
  |  |   37|  2.12k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 637, False: 1.48k]
  |  |  ------------------
  |  |   38|    637|                snprintf (v, maxlen,	                        \
  |  |   39|    637|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    637|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    637|                        "expected '%s'."),                      \
  |  |   41|    637|                        exif_format_get_name (format),          \
  |  |   42|    637|                        exif_format_get_name (target));         \
  |  |   43|    637|                break;                                          \
  |  |   44|    637|        }                                                       \
  |  |   45|  2.12k|}
  ------------------
  538|  1.48k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.48k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.48k|{                                                                       \
  |  |   62|  1.48k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 573, False: 912]
  |  |  ------------------
  |  |   63|    573|                snprintf (v, maxlen,                                    \
  |  |   64|    573|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    573|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    573|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    573|                break;                                                  \
  |  |   67|    573|        }                                                               \
  |  |   68|  1.48k|}
  ------------------
  539|    912|		vs = exif_get_short (entry->data, entry->order);
  540|    912|		switch (vs) {
  541|    346|		case 0:
  ------------------
  |  Branch (541:3): [True: 346, False: 566]
  ------------------
  542|    346|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    346|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    346|			break;
  544|     77|		case 1:
  ------------------
  |  Branch (544:3): [True: 77, False: 835]
  ------------------
  545|     77|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|     77|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|     77|			break;
  547|    489|		default:
  ------------------
  |  Branch (547:3): [True: 489, False: 423]
  ------------------
  548|    489|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    489|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    489|			strncat (v, buf, maxlen - strlen (v));
  550|    489|			break;
  551|    912|		}
  552|    912|		break;
  553|  1.30k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.30k, False: 47.4k]
  ------------------
  554|  1.30k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.30k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.30k|{                                                               \
  |  |   37|  1.30k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 216, False: 1.09k]
  |  |  ------------------
  |  |   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.30k|}
  ------------------
  555|  1.09k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.09k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.09k|{                                                                       \
  |  |   62|  1.09k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 231, False: 862]
  |  |  ------------------
  |  |   63|    231|                snprintf (v, maxlen,                                    \
  |  |   64|    231|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    231|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    231|                break;                                                  \
  |  |   67|    231|        }                                                               \
  |  |   68|  1.09k|}
  ------------------
  556|    862|		vs = exif_get_short (entry->data, entry->order);
  557|    862|		switch (vs) {
  558|    320|		case 0:
  ------------------
  |  Branch (558:3): [True: 320, False: 542]
  ------------------
  559|    320|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    320|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    320|			break;
  561|    201|		case 1:
  ------------------
  |  Branch (561:3): [True: 201, False: 661]
  ------------------
  562|    201|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|    201|			break;
  564|     66|		case 2:
  ------------------
  |  Branch (564:3): [True: 66, False: 796]
  ------------------
  565|     66|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|     66|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|     66|			break;
  567|    275|		default:
  ------------------
  |  Branch (567:3): [True: 275, False: 587]
  ------------------
  568|    275|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    275|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    275|			strncat (v, buf, maxlen - strlen (v));
  570|    275|			break;
  571|    862|		}
  572|    862|		break;
  573|  1.60k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.60k, False: 47.1k]
  ------------------
  574|  1.60k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.60k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.60k|{                                                               \
  |  |   37|  1.60k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 219, False: 1.38k]
  |  |  ------------------
  |  |   38|    219|                snprintf (v, maxlen,	                        \
  |  |   39|    219|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    219|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    219|                        "expected '%s'."),                      \
  |  |   41|    219|                        exif_format_get_name (format),          \
  |  |   42|    219|                        exif_format_get_name (target));         \
  |  |   43|    219|                break;                                          \
  |  |   44|    219|        }                                                       \
  |  |   45|  1.60k|}
  ------------------
  575|  1.38k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.38k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.38k|{                                                                       \
  |  |   62|  1.38k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 233, False: 1.14k]
  |  |  ------------------
  |  |   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|  1.38k|}
  ------------------
  576|  1.14k|		{
  577|  1.14k|			double ao,ac;
  578|  1.14k|			unsigned long fs,fl;
  579|  1.14k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.14k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.14k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 879, False: 269]
  |  |  ------------------
  ------------------
  581|  1.14k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.14k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.14k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 839, False: 309]
  |  |  ------------------
  ------------------
  583|  1.14k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.14k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.14k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 904, False: 244]
  |  |  ------------------
  ------------------
  585|  1.14k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.14k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.14k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 796, False: 352]
  |  |  ------------------
  ------------------
  587|  1.14k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.14k|		}
  589|  1.14k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.00k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.00k, False: 46.7k]
  ------------------
  593|  2.00k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.00k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.00k|{                                                               \
  |  |   37|  2.00k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 224, False: 1.77k]
  |  |  ------------------
  |  |   38|    224|                snprintf (v, maxlen,	                        \
  |  |   39|    224|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    224|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    224|                        "expected '%s'."),                      \
  |  |   41|    224|                        exif_format_get_name (format),          \
  |  |   42|    224|                        exif_format_get_name (target));         \
  |  |   43|    224|                break;                                          \
  |  |   44|    224|        }                                                       \
  |  |   45|  2.00k|}
  ------------------
  594|  1.77k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  1.77k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.77k|{                                                                       \
  |  |   62|  1.77k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 242, False: 1.53k]
  |  |  ------------------
  |  |   63|    242|                snprintf (v, maxlen,                                    \
  |  |   64|    242|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    242|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    242|                break;                                                  \
  |  |   67|    242|        }                                                               \
  |  |   68|  1.77k|}
  ------------------
  595|  1.53k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.53k|		switch (vl) {
  597|    330|		case 0:
  ------------------
  |  Branch (597:3): [True: 330, False: 1.20k]
  ------------------
  598|    330|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    330|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    330|			break;
  600|    196|		case 1:
  ------------------
  |  Branch (600:3): [True: 196, False: 1.34k]
  ------------------
  601|    196|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    196|			break;
  603|    453|		case 2:
  ------------------
  |  Branch (603:3): [True: 453, False: 1.08k]
  ------------------
  604|    453|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    453|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    453|			break;
  606|    313|		case 3:
  ------------------
  |  Branch (606:3): [True: 313, False: 1.22k]
  ------------------
  607|    313|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    313|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    313|			break;
  609|    244|		default:
  ------------------
  |  Branch (609:3): [True: 244, False: 1.29k]
  ------------------
  610|    244|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.53k|		}
  612|  1.53k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.53k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.53k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.53k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.53k|		switch (vl) {
  617|    189|		case 1:
  ------------------
  |  Branch (617:3): [True: 189, False: 1.34k]
  ------------------
  618|    189|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    189|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    189|			break;
  620|    178|		case 2:
  ------------------
  |  Branch (620:3): [True: 178, False: 1.35k]
  ------------------
  621|    178|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    178|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    178|			break;
  623|    197|		case 3:
  ------------------
  |  Branch (623:3): [True: 197, False: 1.33k]
  ------------------
  624|    197|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    197|			break;
  626|    194|		case 4:
  ------------------
  |  Branch (626:3): [True: 194, False: 1.34k]
  ------------------
  627|    194|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|    194|			break;
  629|    778|		default:
  ------------------
  |  Branch (629:3): [True: 778, False: 758]
  ------------------
  630|    778|			snprintf (buf, sizeof (buf), "%li",
  631|    778|				  (long int) vl);
  632|    778|			strncat (v, buf, maxlen - strlen (v));
  633|  1.53k|		}
  634|  1.53k|		break;
  635|  1.53k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.48k, False: 47.2k]
  ------------------
  636|  1.48k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 337, False: 1.14k]
  ------------------
  637|       |			/* Epson uses a single SHORT here */
  638|    337|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    337|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    337|{                                                                       \
  |  |   62|    337|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 202, False: 135]
  |  |  ------------------
  |  |   63|    202|                snprintf (v, maxlen,                                    \
  |  |   64|    202|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    202|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    202|                break;                                                  \
  |  |   67|    202|        }                                                               \
  |  |   68|    337|}
  ------------------
  639|    135|			vs = exif_get_short (entry->data, entry->order);
  640|    135|			sprintf (buf, "%hu", vs);
  641|    135|			strncat (v, buf, maxlen - strlen (v));
  642|  1.14k|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|  1.14k|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.14k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.14k|{                                                                       \
  |  |   62|  1.14k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 246, False: 901]
  |  |  ------------------
  |  |   63|    246|                snprintf (v, maxlen,                                    \
  |  |   64|    246|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    246|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    246|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    246|                break;                                                  \
  |  |   67|    246|        }                                                               \
  |  |   68|  1.14k|}
  ------------------
  645|    901|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    901|#define CF(format,target,v,maxlen)                              \
  |  |   36|    901|{                                                               \
  |  |   37|    901|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 197, False: 704]
  |  |  ------------------
  |  |   38|    197|                snprintf (v, maxlen,	                        \
  |  |   39|    197|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    197|                        "expected '%s'."),                      \
  |  |   41|    197|                        exif_format_get_name (format),          \
  |  |   42|    197|                        exif_format_get_name (target));         \
  |  |   43|    197|                break;                                          \
  |  |   44|    197|        }                                                       \
  |  |   45|    901|}
  ------------------
  646|  4.92k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 4.22k, False: 704]
  ------------------
  647|  4.22k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  4.22k|				sprintf (buf, "%hd ", vss);
  649|  4.22k|				strncat (v, buf, maxlen - strlen (v));
  650|  4.22k|			}
  651|    704|		}
  652|    839|		break;
  653|  1.02k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.02k, False: 47.6k]
  ------------------
  654|  1.02k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.02k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.02k|{                                                               \
  |  |   37|  1.02k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 202, False: 818]
  |  |  ------------------
  |  |   38|    202|                snprintf (v, maxlen,	                        \
  |  |   39|    202|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    202|                        "expected '%s'."),                      \
  |  |   41|    202|                        exif_format_get_name (format),          \
  |  |   42|    202|                        exif_format_get_name (target));         \
  |  |   43|    202|                break;                                          \
  |  |   44|    202|        }                                                       \
  |  |   45|  1.02k|}
  ------------------
  655|    818|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|    818|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    818|{                                                                       \
  |  |   62|    818|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 93, False: 725]
  |  |  ------------------
  |  |   63|     93|                snprintf (v, maxlen,                                    \
  |  |   64|     93|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     93|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|     93|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|     93|                break;                                                  \
  |  |   67|     93|        }                                                               \
  |  |   68|    818|}
  ------------------
  656|  5.07k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 4.35k, False: 725]
  ------------------
  657|  4.35k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  4.35k|			sprintf (buf, "%hu ", vs);
  659|  4.35k|			strncat (v, buf, maxlen - strlen (v));
  660|  4.35k|		}
  661|    725|		break;
  662|    787|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 787, False: 47.9k]
  ------------------
  663|    787|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    787|#define CF(format,target,v,maxlen)                              \
  |  |   36|    787|{                                                               \
  |  |   37|    787|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 209, False: 578]
  |  |  ------------------
  |  |   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|    787|}
  ------------------
  664|    578|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    578|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    578|{                                                                       \
  |  |   72|    578|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 71, False: 507]
  |  |  |  Branch (72:23): [True: 236, False: 271]
  |  |  ------------------
  |  |   73|    307|		snprintf (v, maxlen,                                    \
  |  |   74|    307|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    307|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    307|			"expected %i or %i)."), (int) number,		\
  |  |   76|    307|			(int) t1, (int) t2);  				\
  |  |   77|    307|		break;                                                  \
  |  |   78|    307|	}                                                               \
  |  |   79|    578|}
  ------------------
  665|    271|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    271|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 271]
  |  |  ------------------
  ------------------
  666|    271|		break;
  667|    664|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 664, False: 48.0k]
  ------------------
  668|    664|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    664|#define CF(format,target,v,maxlen)                              \
  |  |   36|    664|{                                                               \
  |  |   37|    664|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 210, False: 454]
  |  |  ------------------
  |  |   38|    210|                snprintf (v, maxlen,	                        \
  |  |   39|    210|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    210|                        "expected '%s'."),                      \
  |  |   41|    210|                        exif_format_get_name (format),          \
  |  |   42|    210|                        exif_format_get_name (target));         \
  |  |   43|    210|                break;                                          \
  |  |   44|    210|        }                                                       \
  |  |   45|    664|}
  ------------------
  669|    454|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    454|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 236, False: 218]
  |  |  ------------------
  ------------------
  670|    454|		break;
  671|    575|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 575, False: 48.1k]
  ------------------
  672|    575|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    575|#define CF(format,target,v,maxlen)                              \
  |  |   36|    575|{                                                               \
  |  |   37|    575|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 231, False: 344]
  |  |  ------------------
  |  |   38|    231|                snprintf (v, maxlen,	                        \
  |  |   39|    231|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    231|                        "expected '%s'."),                      \
  |  |   41|    231|                        exif_format_get_name (format),          \
  |  |   42|    231|                        exif_format_get_name (target));         \
  |  |   43|    231|                break;                                          \
  |  |   44|    231|        }                                                       \
  |  |   45|    575|}
  ------------------
  673|    344|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    344|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    344|{                                                                       \
  |  |   72|    344|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 145, False: 199]
  |  |  |  Branch (72:23): [True: 116, False: 83]
  |  |  ------------------
  |  |   73|    261|		snprintf (v, maxlen,                                    \
  |  |   74|    261|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    261|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    261|			"expected %i or %i)."), (int) number,		\
  |  |   76|    261|			(int) t1, (int) t2);  				\
  |  |   77|    261|		break;                                                  \
  |  |   78|    261|	}                                                               \
  |  |   79|    344|}
  ------------------
  674|     83|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|     83|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 83]
  |  |  ------------------
  ------------------
  675|     83|		break;
  676|    623|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 623, False: 48.0k]
  ------------------
  677|    623|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    623|#define CF(format,target,v,maxlen)                              \
  |  |   36|    623|{                                                               \
  |  |   37|    623|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 209, False: 414]
  |  |  ------------------
  |  |   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|    623|}
  ------------------
  678|    414|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    414|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    414|{                                                                       \
  |  |   62|    414|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 218, False: 196]
  |  |  ------------------
  |  |   63|    218|                snprintf (v, maxlen,                                    \
  |  |   64|    218|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    218|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    218|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    218|                break;                                                  \
  |  |   67|    218|        }                                                               \
  |  |   68|    414|}
  ------------------
  679|    196|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    196|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 196]
  |  |  ------------------
  ------------------
  680|    196|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 48.7k]
  ------------------
  682|      0|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|      0|#define CF(format,target,v,maxlen)                              \
  |  |   36|      0|{                                                               \
  |  |   37|      0|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|                snprintf (v, maxlen,	                        \
  |  |   39|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|      0|                        "expected '%s'."),                      \
  |  |   41|      0|                        exif_format_get_name (format),          \
  |  |   42|      0|                        exif_format_get_name (target));         \
  |  |   43|      0|                break;                                          \
  |  |   44|      0|        }                                                       \
  |  |   45|      0|}
  ------------------
  683|      0|		CC (entry->components, 30, v, maxlen)
  ------------------
  |  |   60|      0|#define CC(number,target,v,maxlen)                                      \
  |  |   61|      0|{                                                                       \
  |  |   62|      0|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   63|      0|                snprintf (v, maxlen,                                    \
  |  |   64|      0|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|      0|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|      0|                break;                                                  \
  |  |   67|      0|        }                                                               \
  |  |   68|      0|}
  ------------------
  684|      0|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (684:13): [True: 0, False: 0]
  ------------------
  685|      0|			vl = exif_get_long (entry->data+4*i, entry->order);
  686|      0|			sprintf (buf, "%lu ", (unsigned long)vl);
  687|      0|			strncat (v, buf, maxlen - strlen (v));
  688|      0|		}
  689|      0|		break;
  690|  1.19k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.19k, False: 47.5k]
  ------------------
  691|  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: 86, False: 1.11k]
  |  |  ------------------
  |  |   38|     86|                snprintf (v, maxlen,	                        \
  |  |   39|     86|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     86|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     86|                        "expected '%s'."),                      \
  |  |   41|     86|                        exif_format_get_name (format),          \
  |  |   42|     86|                        exif_format_get_name (target));         \
  |  |   43|     86|                break;                                          \
  |  |   44|     86|        }                                                       \
  |  |   45|  1.19k|}
  ------------------
  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: 240, False: 873]
  |  |  ------------------
  |  |   63|    240|                snprintf (v, maxlen,                                    \
  |  |   64|    240|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    240|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    240|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    240|                break;                                                  \
  |  |   67|    240|        }                                                               \
  |  |   68|  1.11k|}
  ------------------
  693|    873|		vr = exif_get_rational (entry->data, entry->order);
  694|    873|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 221, False: 652]
  |  Branch (694:24): [True: 239, False: 413]
  ------------------
  695|    460|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    460|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    460|		}
  697|    413|		else {
  698|    413|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    413|			snprintf (v, maxlen, "%li mm", tmp);
  700|    413|		}
  701|    873|		break;
  702|  2.20k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.20k, False: 46.5k]
  ------------------
  703|  2.20k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.20k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.20k|{                                                               \
  |  |   37|  2.20k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 213, False: 1.98k]
  |  |  ------------------
  |  |   38|    213|                snprintf (v, maxlen,	                        \
  |  |   39|    213|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    213|                        "expected '%s'."),                      \
  |  |   41|    213|                        exif_format_get_name (format),          \
  |  |   42|    213|                        exif_format_get_name (target));         \
  |  |   43|    213|                break;                                          \
  |  |   44|    213|        }                                                       \
  |  |   45|  2.20k|}
  ------------------
  704|  1.98k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.98k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.98k|{                                                                       \
  |  |   62|  1.98k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 205, False: 1.78k]
  |  |  ------------------
  |  |   63|    205|                snprintf (v, maxlen,                                    \
  |  |   64|    205|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    205|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    205|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    205|                break;                                                  \
  |  |   67|    205|        }                                                               \
  |  |   68|  1.98k|}
  ------------------
  705|  1.78k|		vs = exif_get_short (entry->data, entry->order);
  706|  1.78k|		switch (vs) {
  707|    202|		case 1:
  ------------------
  |  Branch (707:3): [True: 202, False: 1.58k]
  ------------------
  708|    202|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    202|			break;
  710|  1.17k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.17k, False: 612]
  ------------------
  711|  1.17k|			{
  712|  1.17k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.17k|				unsigned long colorTemp = 0;
  714|  1.17k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 1.04k, False: 129]
  ------------------
  715|    198|				case 2:
  ------------------
  |  Branch (715:5): [True: 198, False: 973]
  ------------------
  716|    198|					colorTemp = 3000;
  717|    198|					break;
  718|     66|				case 3:
  ------------------
  |  Branch (718:5): [True: 66, False: 1.10k]
  ------------------
  719|     66|					colorTemp = 3700;
  720|     66|					break;
  721|    227|				case 4:
  ------------------
  |  Branch (721:5): [True: 227, False: 944]
  ------------------
  722|    227|					colorTemp = 4000;
  723|    227|					break;
  724|     67|				case 5:
  ------------------
  |  Branch (724:5): [True: 67, False: 1.10k]
  ------------------
  725|     67|					colorTemp = 4500;
  726|     67|					break;
  727|    195|				case 6:
  ------------------
  |  Branch (727:5): [True: 195, False: 976]
  ------------------
  728|    195|					colorTemp = 5500;
  729|    195|					break;
  730|     92|				case 7:
  ------------------
  |  Branch (730:5): [True: 92, False: 1.07k]
  ------------------
  731|     92|					colorTemp = 6500;
  732|     92|					break;
  733|    197|				case 9:
  ------------------
  |  Branch (733:5): [True: 197, False: 974]
  ------------------
  734|    197|					colorTemp = 7500;
  735|    197|					break;
  736|  1.17k|				}
  737|  1.17k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 1.04k, False: 129]
  ------------------
  738|  1.04k|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|  1.04k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|  1.04k|				}
  740|    129|				else {
  741|    129|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|    129|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|    129|				}
  743|       |
  744|  1.17k|			}
  745|      0|			break;
  746|    197|		case 3:
  ------------------
  |  Branch (746:3): [True: 197, False: 1.58k]
  ------------------
  747|    197|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    197|			break;
  749|    213|		default:
  ------------------
  |  Branch (749:3): [True: 213, False: 1.57k]
  ------------------
  750|    213|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    213|			break;
  752|  1.78k|		}
  753|  1.78k|		break;
  754|  1.78k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 274, False: 48.4k]
  ------------------
  755|    730|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 456, False: 48.2k]
  ------------------
  756|    730|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    730|#define CF(format,target,v,maxlen)                              \
  |  |   36|    730|{                                                               \
  |  |   37|    730|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 265, False: 465]
  |  |  ------------------
  |  |   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|    730|}
  ------------------
  757|    465|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    465|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    465|{                                                                       \
  |  |   62|    465|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 261, False: 204]
  |  |  ------------------
  |  |   63|    261|                snprintf (v, maxlen,                                    \
  |  |   64|    261|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    261|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    261|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    261|                break;                                                  \
  |  |   67|    261|        }                                                               \
  |  |   68|    465|}
  ------------------
  758|    204|		vs = exif_get_short (entry->data, entry->order);
  759|    204|		snprintf (v, maxlen, "%hu ", vs);
  760|    204|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    204|		sprintf (buf, "%hu", vs);
  762|    204|		strncat (v, buf, maxlen - strlen (v));
  763|    204|		break;
  764|    204|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 204, False: 48.5k]
  ------------------
  765|    648|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 444, False: 48.2k]
  ------------------
  766|    648|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    648|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    648|{                                                                       \
  |  |   62|    648|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 362, False: 286]
  |  |  ------------------
  |  |   63|    362|                snprintf (v, maxlen,                                    \
  |  |   64|    362|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    362|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    362|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    362|                break;                                                  \
  |  |   67|    362|        }                                                               \
  |  |   68|    648|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|    976|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 690, False: 48.0k]
  ------------------
  770|    976|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    976|#define CF(format,target,v,maxlen)                              \
  |  |   36|    976|{                                                               \
  |  |   37|    976|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 216, False: 760]
  |  |  ------------------
  |  |   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|    976|}
  ------------------
  771|    760|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 489, False: 271]
  ------------------
  772|    489|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    489|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    489|{                                                                       \
  |  |   62|    489|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 216, False: 273]
  |  |  ------------------
  |  |   63|    216|                snprintf (v, maxlen,                                    \
  |  |   64|    216|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    216|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    216|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    216|                break;                                                  \
  |  |   67|    216|        }                                                               \
  |  |   68|    489|}
  ------------------
  773|  4.08k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 3.54k, False: 544]
  ------------------
  774|  3.54k|			vs = exif_get_short (entry->data+2*i, entry->order);
  775|  3.54k|			sprintf (buf, "%hu ", vs);
  776|  3.54k|			strncat (v, buf, maxlen - strlen (v));
  777|  3.54k|		}
  778|    544|		break;
  779|    252|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 252, False: 48.4k]
  ------------------
  780|    499|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 247, False: 48.4k]
  ------------------
  781|    702|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 203, False: 48.5k]
  ------------------
  782|  1.18k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 486, False: 48.2k]
  ------------------
  783|  1.18k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.18k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.18k|{                                                               \
  |  |   37|  1.18k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 584, False: 604]
  |  |  ------------------
  |  |   38|    584|                snprintf (v, maxlen,	                        \
  |  |   39|    584|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    584|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    584|                        "expected '%s'."),                      \
  |  |   41|    584|                        exif_format_get_name (format),          \
  |  |   42|    584|                        exif_format_get_name (target));         \
  |  |   43|    584|                break;                                          \
  |  |   44|    584|        }                                                       \
  |  |   45|  1.18k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.32k|	default:
  ------------------
  |  Branch (786:2): [True: 3.71k, False: 44.9k]
  ------------------
  787|  4.32k|		switch (entry->format) {
  788|    353|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 353, False: 3.97k]
  ------------------
  789|    353|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    353|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 252, False: 101]
  |  |  ------------------
  ------------------
  790|    353|			break;
  791|    492|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 492, False: 3.83k]
  ------------------
  792|    492|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    492|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    492|{                                                                       \
  |  |   62|    492|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 291, False: 201]
  |  |  ------------------
  |  |   63|    291|                snprintf (v, maxlen,                                    \
  |  |   64|    291|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    291|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    291|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    291|                break;                                                  \
  |  |   67|    291|        }                                                               \
  |  |   68|    492|}
  ------------------
  793|    201|			vs = exif_get_short (entry->data, entry->order);
  794|    201|			snprintf (v, maxlen, "%hu", vs);
  795|    201|			break;
  796|    301|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 301, False: 4.02k]
  ------------------
  797|    301|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    301|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    301|{                                                                       \
  |  |   62|    301|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 105, False: 196]
  |  |  ------------------
  |  |   63|    105|                snprintf (v, maxlen,                                    \
  |  |   64|    105|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    105|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    105|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    105|                break;                                                  \
  |  |   67|    105|        }                                                               \
  |  |   68|    301|}
  ------------------
  798|    196|			vss = exif_get_sshort (entry->data, entry->order);
  799|    196|			snprintf (v, maxlen, "%hi", vss);
  800|    196|			break;
  801|    412|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 412, False: 3.91k]
  ------------------
  802|    412|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    412|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    412|{                                                                       \
  |  |   62|    412|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 212, False: 200]
  |  |  ------------------
  |  |   63|    212|                snprintf (v, maxlen,                                    \
  |  |   64|    212|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    212|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    212|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    212|                break;                                                  \
  |  |   67|    212|        }                                                               \
  |  |   68|    412|}
  ------------------
  803|    200|			vl = exif_get_long (entry->data, entry->order);
  804|    200|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    200|			break;
  806|    414|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 414, False: 3.90k]
  ------------------
  807|    414|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    414|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    414|{                                                                       \
  |  |   62|    414|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 220, False: 194]
  |  |  ------------------
  |  |   63|    220|                snprintf (v, maxlen,                                    \
  |  |   64|    220|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    220|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    220|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    220|                break;                                                  \
  |  |   67|    220|        }                                                               \
  |  |   68|    414|}
  ------------------
  808|    194|			vsl = exif_get_slong (entry->data, entry->order);
  809|    194|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|    194|			break;
  811|    840|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 840, False: 3.48k]
  ------------------
  812|    840|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    840|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    840|{                                                                       \
  |  |   62|    840|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 164, False: 676]
  |  |  ------------------
  |  |   63|    164|                snprintf (v, maxlen,                                    \
  |  |   64|    164|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    164|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    164|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    164|                break;                                                  \
  |  |   67|    164|        }                                                               \
  |  |   68|    840|}
  ------------------
  813|    676|			vr = exif_get_rational (entry->data, entry->order);
  814|    676|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 332, False: 344]
  ------------------
  815|    332|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    332|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    344|			} else {
  817|    344|				r = R2D(vr);
  ------------------
  |  |   82|    344|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 344, False: 0]
  |  |  ------------------
  ------------------
  818|    344|				snprintf (v, maxlen, "%2.3f", r);
  819|    344|			}
  820|    676|			break;
  821|    832|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 832, False: 3.49k]
  ------------------
  822|    832|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    832|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    832|{                                                                       \
  |  |   62|    832|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 269, False: 563]
  |  |  ------------------
  |  |   63|    269|                snprintf (v, maxlen,                                    \
  |  |   64|    269|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    269|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    269|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    269|                break;                                                  \
  |  |   67|    269|        }                                                               \
  |  |   68|    832|}
  ------------------
  823|    563|			vsr = exif_get_srational (entry->data, entry->order);
  824|    563|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 231, False: 332]
  ------------------
  825|    231|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  826|    332|			} else {
  827|    332|				r = R2D(vsr);
  ------------------
  |  |   82|    332|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 332, False: 0]
  |  |  ------------------
  ------------------
  828|    332|				snprintf (v, maxlen, "%2.3f", r);
  829|    332|			}
  830|    563|			break;
  831|    224|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 224, False: 4.09k]
  ------------------
  832|    679|		default:
  ------------------
  |  Branch (832:3): [True: 455, False: 3.86k]
  ------------------
  833|    679|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    679|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    679|				  entry->size);
  835|  78.0k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 77.3k, False: 679]
  ------------------
  836|  77.3k|				sprintf (buf, "%02x", entry->data[i]);
  837|  77.3k|				strncat (v, buf, maxlen - strlen (v));
  838|  77.3k|			}
  839|    679|			break;
  840|  4.32k|		}
  841|  4.32k|		break;
  842|  48.7k|	}
  843|       |
  844|  48.7k|	return (v);
  845|  48.7k|}

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

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

mnote_pentax_entry_get_value:
  312|  12.7k|{
  313|  12.7k|	ExifLong vl;
  314|  12.7k|	ExifSLong vsl;
  315|  12.7k|	ExifShort vs, vs2;
  316|  12.7k|	ExifSShort vss;
  317|  12.7k|	int i = 0, j = 0;
  318|       |
  319|  12.7k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 12.7k]
  ------------------
  320|  12.7k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 12.7k]
  ------------------
  321|       |
  322|  12.7k|	memset (val, 0, maxlen);
  323|  12.7k|	maxlen--;
  324|       |
  325|  12.7k|	switch (entry->tag) {
  326|    603|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 603, False: 12.1k]
  ------------------
  327|    880|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 277, False: 12.5k]
  ------------------
  328|  1.12k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 248, False: 12.5k]
  ------------------
  329|  1.35k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 230, False: 12.5k]
  ------------------
  330|  1.43k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 80, False: 12.7k]
  ------------------
  331|  1.66k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 230, False: 12.5k]
  ------------------
  332|  2.05k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 385, False: 12.4k]
  ------------------
  333|  2.25k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 200, False: 12.5k]
  ------------------
  334|  2.45k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 199, False: 12.5k]
  ------------------
  335|  2.70k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 251, False: 12.5k]
  ------------------
  336|  3.01k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 314, False: 12.4k]
  ------------------
  337|  3.36k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 348, False: 12.4k]
  ------------------
  338|  3.60k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 236, False: 12.5k]
  ------------------
  339|  3.86k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 260, False: 12.5k]
  ------------------
  340|  4.06k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 208, False: 12.5k]
  ------------------
  341|  4.36k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 300, False: 12.4k]
  ------------------
  342|  4.79k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 424, False: 12.3k]
  ------------------
  343|  5.30k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 516, False: 12.2k]
  ------------------
  344|  6.16k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 855, False: 11.9k]
  ------------------
  345|  6.40k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 244, False: 12.5k]
  ------------------
  346|  6.40k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  6.40k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  6.40k|{                                                               \
  |  |   39|  6.40k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 2.83k, False: 3.57k]
  |  |  ------------------
  |  |   40|  2.83k|		snprintf (v, maxlen,	                        \
  |  |   41|  2.83k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.83k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  2.83k|			"expected '%s'."),                      \
  |  |   43|  2.83k|			exif_format_get_name (format),          \
  |  |   44|  2.83k|			exif_format_get_name (target));         \
  |  |   45|  2.83k|		break;                                          \
  |  |   46|  2.83k|	}                                                       \
  |  |   47|  6.40k|}
  ------------------
  347|  3.57k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.57k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.57k|{                                                                       \
  |  |   61|  3.57k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.36k, False: 2.20k]
  |  |  |  Branch (61:24): [True: 257, False: 1.11k]
  |  |  ------------------
  |  |   62|    257|		snprintf (v, maxlen,                                    \
  |  |   63|    257|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    257|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    257|			"expected %i or %i)."), (int) number,		\
  |  |   65|    257|			(int) t1, (int) t2);  				\
  |  |   66|    257|		break;                                                  \
  |  |   67|    257|	}                                                               \
  |  |   68|  3.57k|}
  ------------------
  348|  3.31k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 2.20k, False: 1.11k]
  ------------------
  349|  2.20k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  27.8k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 27.8k, False: 0]
  |  Branch (352:33): [True: 25.6k, False: 2.20k]
  ------------------
  353|  2.20k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 2.20k]
  ------------------
  354|      0|				snprintf (val, maxlen,
  355|      0|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  356|      0|			  	break;
  357|      0|			}
  358|       |
  359|       |			/* find the value */
  360|  12.2k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 11.1k, False: 1.08k]
  ------------------
  361|  11.1k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 10.0k, False: 1.12k]
  ------------------
  362|  2.20k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.35k, False: 847]
  ------------------
  363|  1.35k|				snprintf (val, maxlen,
  364|  1.35k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.35k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.35k|				break;
  366|  1.35k|			}
  367|    847|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    847|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|  1.11k|		} else {
  369|       |			/* Two-component values */
  370|  1.11k|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  1.11k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.11k|{                                                               \
  |  |   39|  1.11k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 1.11k]
  |  |  ------------------
  |  |   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.11k|}
  ------------------
  371|  1.11k|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  1.11k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  1.11k|{                                                                       \
  |  |   61|  1.11k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.11k, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 1.11k]
  |  |  ------------------
  |  |   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.11k|}
  ------------------
  372|  1.11k|			vs = exif_get_short (entry->data, entry->order);
  373|  1.11k|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  2.13k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.74k, False: 392]
  |  Branch (376:34): [True: 1.02k, False: 720]
  ------------------
  377|  1.11k|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 392, False: 720]
  ------------------
  378|    392|				snprintf (val, maxlen,
  379|    392|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    392|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    392|			  	break;
  381|    392|			}
  382|       |
  383|       |			/* find the value */
  384|  2.10k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 2.10k, False: 0]
  |  Branch (384:45): [True: 0, False: 2.10k]
  ------------------
  385|  2.10k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.84k, False: 260]
  |  Branch (385:46): [True: 1.38k, False: 460]
  ------------------
  386|    720|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 274, False: 446]
  |  Branch (386:44): [True: 0, False: 446]
  ------------------
  387|    274|				snprintf (val, maxlen,
  388|    274|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    274|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    274|				break;
  390|    274|			}
  391|    446|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    446|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    446|		}
  393|  1.29k|		break;
  394|       |
  395|  1.29k|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 663, False: 12.1k]
  ------------------
  396|    663|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    663|#define CF(format,target,v,maxlen)                              \
  |  |   38|    663|{                                                               \
  |  |   39|    663|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 248, False: 415]
  |  |  ------------------
  |  |   40|    248|		snprintf (v, maxlen,	                        \
  |  |   41|    248|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    248|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    248|			"expected '%s'."),                      \
  |  |   43|    248|			exif_format_get_name (format),          \
  |  |   44|    248|			exif_format_get_name (target));         \
  |  |   45|    248|		break;                                          \
  |  |   46|    248|	}                                                       \
  |  |   47|    663|}
  ------------------
  397|    415|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    415|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    415|{                                                                       \
  |  |   51|    415|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 207, False: 208]
  |  |  ------------------
  |  |   52|    207|		snprintf (v, maxlen,                                    \
  |  |   53|    207|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    207|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    207|		break;                                                  \
  |  |   56|    207|	}                                                               \
  |  |   57|    415|}
  ------------------
  398|    208|		vl = exif_get_long (entry->data, entry->order);
  399|    208|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|    208|		break;
  401|    526|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 526, False: 12.2k]
  ------------------
  402|    526|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    526|#define CF(format,target,v,maxlen)                              \
  |  |   38|    526|{                                                               \
  |  |   39|    526|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 241, False: 285]
  |  |  ------------------
  |  |   40|    241|		snprintf (v, maxlen,	                        \
  |  |   41|    241|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    241|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    241|			"expected '%s'."),                      \
  |  |   43|    241|			exif_format_get_name (format),          \
  |  |   44|    241|			exif_format_get_name (target));         \
  |  |   45|    241|		break;                                          \
  |  |   46|    241|	}                                                       \
  |  |   47|    526|}
  ------------------
  403|    285|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    285|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    285|{                                                                       \
  |  |   51|    285|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 202, False: 83]
  |  |  ------------------
  |  |   52|    202|		snprintf (v, maxlen,                                    \
  |  |   53|    202|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    202|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    202|		break;                                                  \
  |  |   56|    202|	}                                                               \
  |  |   57|    285|}
  ------------------
  404|     83|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|     83|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|     83|			entry->size);
  406|     83|		break;
  407|    402|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 402, False: 12.3k]
  ------------------
  408|    927|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 525, False: 12.2k]
  ------------------
  409|    927|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    927|#define CF(format,target,v,maxlen)                              \
  |  |   38|    927|{                                                               \
  |  |   39|    927|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 259, False: 668]
  |  |  ------------------
  |  |   40|    259|		snprintf (v, maxlen,	                        \
  |  |   41|    259|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    259|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    259|			"expected '%s'."),                      \
  |  |   43|    259|			exif_format_get_name (format),          \
  |  |   44|    259|			exif_format_get_name (target));         \
  |  |   45|    259|		break;                                          \
  |  |   46|    259|	}                                                       \
  |  |   47|    927|}
  ------------------
  410|    668|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    668|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    668|{                                                                       \
  |  |   51|    668|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 253, False: 415]
  |  |  ------------------
  |  |   52|    253|		snprintf (v, maxlen,                                    \
  |  |   53|    253|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    253|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    253|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    253|		break;                                                  \
  |  |   56|    253|	}                                                               \
  |  |   57|    668|}
  ------------------
  411|    415|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    415|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 415]
  |  |  ------------------
  ------------------
  412|    415|		break;
  413|    672|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 672, False: 12.1k]
  ------------------
  414|    672|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    672|#define CF(format,target,v,maxlen)                              \
  |  |   38|    672|{                                                               \
  |  |   39|    672|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 272, False: 400]
  |  |  ------------------
  |  |   40|    272|		snprintf (v, maxlen,	                        \
  |  |   41|    272|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    272|			"expected '%s'."),                      \
  |  |   43|    272|			exif_format_get_name (format),          \
  |  |   44|    272|			exif_format_get_name (target));         \
  |  |   45|    272|		break;                                          \
  |  |   46|    272|	}                                                       \
  |  |   47|    672|}
  ------------------
  415|    400|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    400|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    400|{                                                                       \
  |  |   51|    400|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 194, False: 206]
  |  |  ------------------
  |  |   52|    194|		snprintf (v, maxlen,                                    \
  |  |   53|    194|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    194|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    194|		break;                                                  \
  |  |   56|    194|	}                                                               \
  |  |   57|    400|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|    206|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|    206|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|    206|		break;
  420|    471|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 471, False: 12.3k]
  ------------------
  421|    471|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    471|#define CF(format,target,v,maxlen)                              \
  |  |   38|    471|{                                                               \
  |  |   39|    471|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 228, False: 243]
  |  |  ------------------
  |  |   40|    228|		snprintf (v, maxlen,	                        \
  |  |   41|    228|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    228|			"expected '%s'."),                      \
  |  |   43|    228|			exif_format_get_name (format),          \
  |  |   44|    228|			exif_format_get_name (target));         \
  |  |   45|    228|		break;                                          \
  |  |   46|    228|	}                                                       \
  |  |   47|    471|}
  ------------------
  422|    243|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    243|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    243|{                                                                       \
  |  |   61|    243|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 152, False: 91]
  |  |  |  Branch (61:24): [True: 86, False: 66]
  |  |  ------------------
  |  |   62|     86|		snprintf (v, maxlen,                                    \
  |  |   63|     86|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     86|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|     86|			"expected %i or %i)."), (int) number,		\
  |  |   65|     86|			(int) t1, (int) t2);  				\
  |  |   66|     86|		break;                                                  \
  |  |   67|     86|	}                                                               \
  |  |   68|    243|}
  ------------------
  423|    157|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    157|		break;
  425|  3.12k|	default:
  ------------------
  |  Branch (425:2): [True: 3.12k, False: 9.66k]
  ------------------
  426|  3.12k|		switch (entry->format) {
  427|    307|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 307, False: 2.81k]
  ------------------
  428|    307|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    307|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 76, False: 231]
  |  |  ------------------
  ------------------
  429|    307|		  break;
  430|    595|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 595, False: 2.52k]
  ------------------
  431|    595|		  {
  432|    595|			const unsigned char *data = entry->data;
  433|    595|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    595|			sizeleft = entry->size;
  436|  90.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 89.7k, False: 595]
  ------------------
  437|  89.7k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 89.7k]
  ------------------
  438|      0|					break;
  439|  89.7k|				vs = exif_get_short (data, entry->order);
  440|  89.7k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|  89.7k|				len = strlen(val);
  442|  89.7k|				data += 2;
  443|  89.7k|				sizeleft -= 2;
  444|  89.7k|			}
  445|    595|		  }
  446|    595|		  break;
  447|    536|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 536, False: 2.58k]
  ------------------
  448|    536|		  {
  449|    536|			const unsigned char *data = entry->data;
  450|    536|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    536|			sizeleft = entry->size;
  453|  43.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 42.7k, False: 536]
  ------------------
  454|  42.7k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 42.7k]
  ------------------
  455|      0|					break;
  456|  42.7k|				vss = exif_get_sshort (data, entry->order);
  457|  42.7k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  42.7k|				len = strlen(val);
  459|  42.7k|				data += 2;
  460|  42.7k|				sizeleft -= 2;
  461|  42.7k|			}
  462|    536|		  }
  463|    536|		  break;
  464|    558|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 558, False: 2.56k]
  ------------------
  465|    558|		  {
  466|    558|			const unsigned char *data = entry->data;
  467|    558|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    558|			sizeleft = entry->size;
  470|  32.8k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 32.3k, False: 558]
  ------------------
  471|  32.3k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 32.3k]
  ------------------
  472|      0|					break;
  473|  32.3k|				vl = exif_get_long (data, entry->order);
  474|  32.3k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  32.3k|				len = strlen(val);
  476|  32.3k|				data += 4;
  477|  32.3k|				sizeleft -= 4;
  478|  32.3k|			}
  479|    558|		  }
  480|    558|		  break;
  481|    474|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 474, False: 2.64k]
  ------------------
  482|    474|		  {
  483|    474|			const unsigned char *data = entry->data;
  484|    474|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    474|			sizeleft = entry->size;
  487|  30.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 29.9k, False: 474]
  ------------------
  488|  29.9k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 29.9k]
  ------------------
  489|      0|					break;
  490|  29.9k|				vsl = exif_get_slong (data, entry->order);
  491|  29.9k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  29.9k|				len = strlen(val);
  493|  29.9k|				data += 4;
  494|  29.9k|				sizeleft -= 4;
  495|  29.9k|			}
  496|    474|		  }
  497|    474|		  break;
  498|     10|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 10, False: 3.11k]
  ------------------
  499|    653|		default:
  ------------------
  |  Branch (499:3): [True: 643, False: 2.48k]
  ------------------
  500|    653|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    653|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    653|			  entry->size);
  502|    653|		  break;
  503|  3.12k|		}
  504|  3.12k|		break;
  505|  12.7k|	}
  506|       |
  507|  12.7k|	return val;
  508|  12.7k|}

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

