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

exif_mnote_data_canon_identify:
  396|  3.37k|{
  397|  3.37k|	char value[8];
  398|       |
  399|  3.37k|	ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|  3.37k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 859, False: 2.52k]
  |  |  ------------------
  |  |  254|  3.37k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  3.37k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 228, False: 2.29k]
  |  |  ------------------
  |  |  256|  2.52k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  2.52k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 2.29k]
  |  |  ------------------
  |  |  258|  2.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  2.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 2.29k]
  |  |  ------------------
  |  |  260|  2.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  2.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 2.29k]
  |  |  ------------------
  |  |  262|  2.29k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  400|  3.37k|	if (!em) 
  ------------------
  |  Branch (400:6): [True: 2.29k, False: 1.08k]
  ------------------
  401|  2.29k|		return 0;
  402|       |
  403|  1.08k|	(void) e;  /* unused */
  404|  1.08k|	return !strcmp (exif_entry_get_value (em, value, sizeof (value)), "Canon");
  405|  3.37k|}
exif_mnote_data_canon_new:
  409|    948|{
  410|    948|	ExifMnoteData *d;
  411|    948|	ExifMnoteDataCanon *dc;
  412|       |
  413|    948|	if (!mem) return NULL;
  ------------------
  |  Branch (413:6): [True: 0, False: 948]
  ------------------
  414|       |
  415|    948|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataCanon));
  416|    948|	if (!d)
  ------------------
  |  Branch (416:6): [True: 0, False: 948]
  ------------------
  417|      0|		return NULL;
  418|       |
  419|    948|	exif_mnote_data_construct (d, mem);
  420|       |
  421|       |	/* Set up function pointers */
  422|    948|	d->methods.free            = exif_mnote_data_canon_free;
  423|    948|	d->methods.set_byte_order  = exif_mnote_data_canon_set_byte_order;
  424|    948|	d->methods.set_offset      = exif_mnote_data_canon_set_offset;
  425|    948|	d->methods.load            = exif_mnote_data_canon_load;
  426|    948|	d->methods.save            = exif_mnote_data_canon_save;
  427|    948|	d->methods.count           = exif_mnote_data_canon_count;
  428|    948|	d->methods.get_id          = exif_mnote_data_canon_get_id;
  429|    948|	d->methods.get_name        = exif_mnote_data_canon_get_name;
  430|    948|	d->methods.get_title       = exif_mnote_data_canon_get_title;
  431|    948|	d->methods.get_description = exif_mnote_data_canon_get_description;
  432|    948|	d->methods.get_value       = exif_mnote_data_canon_get_value;
  433|       |
  434|    948|	dc = (ExifMnoteDataCanon*)d;
  435|    948|	dc->options = o;
  436|    948|	return d;
  437|    948|}
exif-mnote-data-canon.c:exif_mnote_data_canon_free:
   61|    948|{
   62|    948|	if (!n) return;
  ------------------
  |  Branch (62:6): [True: 0, False: 948]
  ------------------
   63|       |
   64|    948|	exif_mnote_data_canon_clear ((ExifMnoteDataCanon *) n);
   65|    948|}
exif-mnote-data-canon.c:exif_mnote_data_canon_clear:
   41|  1.88k|{
   42|  1.88k|	ExifMnoteData *d = (ExifMnoteData *) n;
   43|  1.88k|	unsigned int i;
   44|       |
   45|  1.88k|	if (!n) return;
  ------------------
  |  Branch (45:6): [True: 0, False: 1.88k]
  ------------------
   46|       |
   47|  1.88k|	if (n->entries) {
  ------------------
  |  Branch (47:6): [True: 934, False: 948]
  ------------------
   48|  11.6k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (48:15): [True: 10.7k, False: 934]
  ------------------
   49|  10.7k|			if (n->entries[i].data) {
  ------------------
  |  Branch (49:8): [True: 10.7k, False: 0]
  ------------------
   50|  10.7k|				exif_mem_free (d->mem, n->entries[i].data);
   51|  10.7k|				n->entries[i].data = NULL;
   52|  10.7k|			}
   53|    934|		exif_mem_free (d->mem, n->entries);
   54|       |		n->entries = NULL;
   55|    934|		n->count = 0;
   56|    934|	}
   57|  1.88k|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_byte_order:
  100|    948|{
  101|    948|	ExifByteOrder o_orig;
  102|    948|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) d;
  103|    948|	unsigned int i;
  104|       |
  105|    948|	if (!n) return;
  ------------------
  |  Branch (105:6): [True: 0, False: 948]
  ------------------
  106|       |
  107|    948|	o_orig = n->order;
  108|    948|	n->order = o;
  109|    948|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (109:14): [True: 0, False: 948]
  ------------------
  110|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (110:7): [True: 0, False: 0]
  |  Branch (110:35): [True: 0, False: 0]
  ------------------
  111|      0|			continue;
  112|      0|		n->entries[i].order = o;
  113|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  114|      0|				n->entries[i].components, o_orig, o);
  115|      0|	}
  116|    948|}
exif-mnote-data-canon.c:exif_mnote_data_canon_set_offset:
  120|    948|{
  121|    948|	if (n) ((ExifMnoteDataCanon *) n)->offset = o;
  ------------------
  |  Branch (121:6): [True: 948, False: 0]
  ------------------
  122|    948|}
exif-mnote-data-canon.c:exif_mnote_data_canon_load:
  209|    948|{
  210|    948|	ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
  211|    948|	ExifShort c;
  212|    948|	size_t i, tcount, o, datao;
  213|    948|	long failsafe_size = 0;
  214|       |
  215|    948|	if (!n) return;
  ------------------
  |  Branch (215:6): [True: 0, False: 948]
  ------------------
  216|       |
  217|    948|	if (!buf || !buf_size) {
  ------------------
  |  Branch (217:6): [True: 0, False: 948]
  |  Branch (217:14): [True: 0, False: 948]
  ------------------
  218|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  219|      0|			  "ExifMnoteCanon", "Short MakerNote");
  220|      0|		return;
  221|      0|	}
  222|    948|	if (exif_check_overflow (n->offset, buf_size, 8)) {
  ------------------
  |  Branch (222:6): [True: 0, False: 948]
  ------------------
  223|      0|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  224|      0|			  "ExifMnoteCanon", "Short MakerNote");
  225|      0|		return;
  226|      0|	}
  227|    948|	datao = 6 + n->offset;
  228|       |
  229|       |	/* Read the number of tags */
  230|    948|	c = exif_get_short (buf + datao, n->order);
  231|    948|	datao += 2;
  232|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 24 named tags currently.
  233|       |	 * current 2020 camera EOS M6 Mark 2 had 156 entries.
  234|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  235|    948|	if (c > 250) {
  ------------------
  |  Branch (235:6): [True: 14, False: 934]
  ------------------
  236|     14|		exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Too much tags (%d) in Canon MakerNote", c);
  237|     14|		return;
  238|     14|	}
  239|       |
  240|       |	/* Remove any old entries */
  241|    934|	exif_mnote_data_canon_clear (n);
  242|       |
  243|       |	/* Reserve enough space for all the possible MakerNote tags */
  244|    934|	n->entries = exif_mem_alloc (ne->mem, sizeof (MnoteCanonEntry) * c);
  245|    934|	if (!n->entries) {
  ------------------
  |  Branch (245:6): [True: 0, False: 934]
  ------------------
  246|      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))
  ------------------
  247|      0|		return;
  248|      0|	}
  249|       |
  250|       |	/* Parse the entries */
  251|    934|	tcount = 0;
  252|  47.3k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (252:25): [True: 47.2k, False: 136]
  ------------------
  253|  47.2k|		size_t s;
  254|       |
  255|  47.2k|		memset(&n->entries[tcount], 0, sizeof(MnoteCanonEntry));
  256|  47.2k|		if (exif_check_overflow (o,buf_size,12)) {
  ------------------
  |  Branch (256:7): [True: 794, False: 46.4k]
  ------------------
  257|    794|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  258|    794|				"ExifMnoteCanon", "Short MakerNote");
  259|    794|			break;
  260|    794|		}
  261|       |
  262|  46.4k|		n->entries[tcount].tag        = exif_get_short (buf + o, n->order);
  263|  46.4k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  264|  46.4k|		n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  265|  46.4k|		n->entries[tcount].order      = n->order;
  266|       |
  267|  46.4k|		exif_log (ne->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteCanon",
  268|  46.4k|			"Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  269|  46.4k|			 mnote_canon_tag_get_name (n->entries[tcount].tag));
  270|       |
  271|       |		/* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  272|       |		 * we will check the buffer sizes closer later. */
  273|  46.4k|		if (exif_check_mul_overflow (exif_format_get_size (n->entries[tcount].format),
  ------------------
  |  Branch (273:7): [True: 3.66k, False: 42.7k]
  ------------------
  274|  46.4k|				n->entries[tcount].components, buf_size, &s)) {
  275|  3.66k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  276|  3.66k|				  "ExifMnoteCanon", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  277|  3.66k|			continue;
  278|  3.66k|		}
  279|       |
  280|       |		/*
  281|       |		 * Size? If bigger than 4 bytes, the actual data is not
  282|       |		 * in the entry but somewhere else (offset).
  283|       |		 */
  284|  42.7k|		n->entries[tcount].size = s;
  285|  42.7k|		if (!s) {
  ------------------
  |  Branch (285:7): [True: 31.1k, False: 11.6k]
  ------------------
  286|  31.1k|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  287|  31.1k|				  "ExifMnoteCanon",
  288|  31.1k|				  "Invalid zero-length tag size");
  289|  31.1k|			continue;
  290|       |
  291|  31.1k|		} else {
  292|  11.6k|			size_t dataofs = o + 8;
  293|  11.6k|			if (s > 4) dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  ------------------
  |  Branch (293:8): [True: 7.75k, False: 3.85k]
  ------------------
  294|       |
  295|  11.6k|			if (exif_check_overflow (dataofs, buf_size, s)) {
  ------------------
  |  Branch (295:8): [True: 856, False: 10.7k]
  ------------------
  296|    856|				exif_log (ne->log, EXIF_LOG_CODE_DEBUG,
  297|    856|					"ExifMnoteCanon",
  298|    856|					"Tag data past end of buffer (%u > %u)",
  299|    856|					(unsigned)(dataofs + s), buf_size);
  300|    856|				continue;
  301|    856|			}
  302|       |
  303|  10.7k|			n->entries[tcount].data = exif_mem_alloc (ne->mem, s);
  304|  10.7k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (304:8): [True: 0, False: 10.7k]
  ------------------
  305|      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))
  ------------------
  306|      0|				continue;
  307|      0|			}
  308|  10.7k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  309|  10.7k|		}
  310|       |
  311|       |		/* Track the size of decoded tag data. A malicious file could
  312|       |		 * be crafted to cause extremely large values here without
  313|       |		 * tripping any buffer range checks.  This is especially bad
  314|       |		 * with the libexif representation of Canon MakerNotes because
  315|       |		 * some arrays are turned into individual tags that the
  316|       |		 * application must loop around. */
  317|  10.7k|		failsafe_size += mnote_canon_entry_count_values(&n->entries[tcount]);
  318|       |
  319|  10.7k|		if (failsafe_size > FAILSAFE_SIZE_MAX) {
  ------------------
  |  |   37|  10.7k|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  |  Branch (319:7): [True: 4, False: 10.7k]
  ------------------
  320|       |			/* Abort if the total size of the data in the tags extraordinarily large, */
  321|      4|			exif_mem_free (ne->mem, n->entries[tcount].data);
  322|      4|			exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
  323|      4|					  "ExifMnoteCanon", "Failsafe tag size overflow (%lu > %ld)",
  324|      4|					  failsafe_size, FAILSAFE_SIZE_MAX);
  ------------------
  |  |   37|      4|#define FAILSAFE_SIZE_MAX 1000000L
  ------------------
  325|      4|			break;
  326|      4|		}
  327|       |
  328|       |		/* Tag was successfully parsed */
  329|  10.7k|		++tcount;
  330|  10.7k|	}
  331|       |	/* Store the count of successfully parsed tags */
  332|    934|	n->count = tcount;
  333|    934|}
exif-mnote-data-canon.c:exif_mnote_data_canon_count:
  337|    948|{
  338|    948|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) n;
  339|    948|	unsigned int i, c;
  340|       |
  341|  11.6k|	for (i = c = 0; dc && (i < dc->count); i++)
  ------------------
  |  Branch (341:18): [True: 11.6k, False: 0]
  |  Branch (341:24): [True: 10.7k, False: 948]
  ------------------
  342|  10.7k|		c += mnote_canon_entry_count_values (&dc->entries[i]);
  343|    948|	return c;
  344|    948|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_tags:
   70|  6.82M|{
   71|  6.82M|	unsigned int from = 0, to;
   72|       |
   73|  6.82M|	if (s) *s = 0;
  ------------------
  |  Branch (73:6): [True: 5.12M, False: 1.70M]
  ------------------
   74|       |
   75|  6.82M|	if (!dc || !m) return;
  ------------------
  |  Branch (75:6): [True: 0, False: 6.82M]
  |  Branch (75:13): [True: 0, False: 6.82M]
  ------------------
   76|   170M|	for (*m = 0; *m < dc->count; (*m)++) {
  ------------------
  |  Branch (76:15): [True: 170M, False: 0]
  ------------------
   77|   170M|		to = from + mnote_canon_entry_count_values (&dc->entries[*m]);
   78|   170M|		if (to > n) {
  ------------------
  |  Branch (78:7): [True: 6.82M, False: 163M]
  ------------------
   79|  6.82M|			if (s) *s = n - from;
  ------------------
  |  Branch (79:8): [True: 5.12M, False: 1.70M]
  ------------------
   80|  6.82M|			break;
   81|  6.82M|		}
   82|   163M|		from = to;
   83|   163M|	}
   84|  6.82M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_name:
  360|  1.70M|{
  361|  1.70M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  362|  1.70M|	unsigned int m, s;
  363|       |
  364|  1.70M|	if (!dc) return NULL;
  ------------------
  |  Branch (364:6): [True: 0, False: 1.70M]
  ------------------
  365|  1.70M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  366|  1.70M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (366:6): [True: 0, False: 1.70M]
  ------------------
  367|  1.70M|	return mnote_canon_tag_get_name_sub (dc->entries[m].tag, s, dc->options);
  368|  1.70M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_title:
  372|  1.70M|{
  373|  1.70M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  374|  1.70M|	unsigned int m, s;
  375|       |
  376|  1.70M|	if (!dc) return NULL;
  ------------------
  |  Branch (376:6): [True: 0, False: 1.70M]
  ------------------
  377|  1.70M|	exif_mnote_data_canon_get_tags (dc, i, &m, &s);
  378|  1.70M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (378:6): [True: 0, False: 1.70M]
  ------------------
  379|  1.70M|	return mnote_canon_tag_get_title_sub (dc->entries[m].tag, s, dc->options);
  380|  1.70M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_description:
  384|  1.70M|{
  385|  1.70M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
  386|  1.70M|	unsigned int m;
  387|       |
  388|  1.70M|	if (!dc) return NULL;
  ------------------
  |  Branch (388:6): [True: 0, False: 1.70M]
  ------------------
  389|  1.70M|	exif_mnote_data_canon_get_tags (dc, i, &m, NULL);
  390|  1.70M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (390:6): [True: 0, False: 1.70M]
  ------------------
  391|  1.70M|	return mnote_canon_tag_get_description (dc->entries[m].tag);
  392|  1.70M|}
exif-mnote-data-canon.c:exif_mnote_data_canon_get_value:
   88|  1.70M|{
   89|  1.70M|	ExifMnoteDataCanon *dc = (ExifMnoteDataCanon *) note;
   90|  1.70M|	unsigned int m, s;
   91|       |
   92|  1.70M|	if (!dc) return NULL;
  ------------------
  |  Branch (92:6): [True: 0, False: 1.70M]
  ------------------
   93|  1.70M|	exif_mnote_data_canon_get_tags (dc, n, &m, &s);
   94|  1.70M|	if (m >= dc->count) return NULL;
  ------------------
  |  Branch (94:6): [True: 0, False: 1.70M]
  ------------------
   95|  1.70M|	return mnote_canon_entry_get_value (&dc->entries[m], s, val, maxlen);
   96|  1.70M|}

mnote_canon_entry_count_values:
  505|   170M|{
  506|   170M|	unsigned int  val;
  507|       |
  508|   170M|	if (!entry) return 0;
  ------------------
  |  Branch (508:6): [True: 0, False: 170M]
  ------------------
  509|       |
  510|   170M|	switch (entry->tag) {
  511|   173k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (511:2): [True: 173k, False: 170M]
  ------------------
  512|   173k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (512:2): [True: 508, False: 170M]
  ------------------
  513|   173k|		return entry->components;
  514|   718k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (514:2): [True: 718k, False: 169M]
  ------------------
  515|  1.50M|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (515:2): [True: 782k, False: 169M]
  ------------------
  516|   161M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (516:2): [True: 160M, False: 9.73M]
  ------------------
  517|   162M|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (517:2): [True: 79.3k, False: 170M]
  ------------------
  518|   162M|		if (entry->format != EXIF_FORMAT_SHORT) return 0;
  ------------------
  |  Branch (518:7): [True: 1.03M, False: 161M]
  ------------------
  519|       |
  520|   161M|		val = exif_get_short (entry->data, entry->order);
  521|       |		/* val is buffer size, i.e. # of values plus 1 */
  522|   161M|		return MIN (entry->size - 2, val) / 2;
  ------------------
  |  |  182|   161M|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 155M, False: 5.26M]
  |  |  ------------------
  ------------------
  523|  7.97M|	default:
  ------------------
  |  Branch (523:2): [True: 7.97M, False: 162M]
  ------------------
  524|  7.97M|		return 1;
  525|   170M|	}
  526|   170M|}
mnote_canon_entry_get_value:
  552|  1.70M|{
  553|  1.70M|	char buf[128];
  554|  1.70M|	ExifLong vl;
  555|  1.70M|	ExifSLong vsl;
  556|  1.70M|	ExifShort vs, n;
  557|  1.70M|	ExifSShort vss;
  558|  1.70M|	unsigned char *data;
  559|  1.70M|	size_t	size;
  560|  1.70M|	double d;
  561|       |
  562|  1.70M|	if (!entry) 
  ------------------
  |  Branch (562:6): [True: 0, False: 1.70M]
  ------------------
  563|      0|		return NULL;
  564|  1.70M|	if (maxlen < 1)
  ------------------
  |  Branch (564:6): [True: 0, False: 1.70M]
  ------------------
  565|      0|		return NULL;
  566|       |
  567|  1.70M|	data = entry->data;
  568|  1.70M|	size = entry->size;
  569|       |
  570|  1.70M|	memset (val, 0, maxlen);
  571|  1.70M|	maxlen--;
  572|       |
  573|  1.70M|	switch (entry->tag) {
  574|  3.91k|	case MNOTE_CANON_TAG_SETTINGS_1:
  ------------------
  |  Branch (574:2): [True: 3.91k, False: 1.70M]
  ------------------
  575|  3.91k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  3.91k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  3.91k|{                                                               \
  |  |   38|  3.91k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 3.91k]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  3.91k|}
  ------------------
  576|       |
  577|  3.91k|		if (size < 2) return NULL;
  ------------------
  |  Branch (577:7): [True: 0, False: 3.91k]
  ------------------
  578|  3.91k|		n = exif_get_short (data, entry->order) / 2;
  579|  3.91k|		if (t >= n) return NULL;
  ------------------
  |  Branch (579:7): [True: 0, False: 3.91k]
  ------------------
  580|       |
  581|  3.91k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  3.91k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  3.91k|{                                                                       \
  |  |   50|  3.91k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.50k, False: 2.41k]
  |  |  ------------------
  |  |   51|  1.50k|                snprintf (v, maxlen,                                    \
  |  |   52|  1.50k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.50k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.50k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.50k|                break;                                                  \
  |  |   55|  1.50k|        }                                                               \
  |  |   56|  3.91k|}
  ------------------
  582|       |
  583|  2.41k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (583:7): [True: 0, False: 2.41k]
  ------------------
  584|  2.41k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  585|  2.41k|		switch (t) {
  586|    489|		case 1:
  ------------------
  |  Branch (586:3): [True: 489, False: 1.92k]
  ------------------
  587|    489|			if (!vs) {
  ------------------
  |  Branch (587:8): [True: 195, False: 294]
  ------------------
  588|    195|				strncpy(val, _("Off"), maxlen);
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  589|    195|				break;
  590|    195|			}
  591|    294|			snprintf (val, maxlen, _("%i (ms)"), vs * 100);
  ------------------
  |  |   31|    294|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  592|    294|			break;
  593|      0|		case 15:
  ------------------
  |  Branch (593:3): [True: 0, False: 2.41k]
  ------------------
  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.41k]
  ------------------
  603|      0|		case 23:
  ------------------
  |  Branch (603:3): [True: 0, False: 2.41k]
  ------------------
  604|      0|		case 24:
  ------------------
  |  Branch (604:3): [True: 0, False: 2.41k]
  ------------------
  605|      0|			snprintf (val, maxlen, "%u", vs);
  606|      0|			break;
  607|      0|		case 25:
  ------------------
  |  Branch (607:3): [True: 0, False: 2.41k]
  ------------------
  608|      0|		case 26:
  ------------------
  |  Branch (608:3): [True: 0, False: 2.41k]
  ------------------
  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.41k]
  ------------------
  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.41k]
  ------------------
  615|      0|			snprintf (val, maxlen, "%.2f", vs / 10.0);
  616|      0|			break;
  617|      0|		case 35:
  ------------------
  |  Branch (617:3): [True: 0, False: 2.41k]
  ------------------
  618|      0|		case 36:
  ------------------
  |  Branch (618:3): [True: 0, False: 2.41k]
  ------------------
  619|      0|			snprintf (val, maxlen, "%u", vs);
  620|      0|			break;
  621|  1.92k|		default:
  ------------------
  |  Branch (621:3): [True: 1.92k, False: 489]
  ------------------
  622|  1.92k|			canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
  623|  2.41k|		}
  624|  2.41k|		break;
  625|       |
  626|  2.41k|	case MNOTE_CANON_TAG_FOCAL_LENGTH:
  ------------------
  |  Branch (626:2): [True: 1.66k, False: 1.70M]
  ------------------
  627|  1.66k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.66k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.66k|{                                                               \
  |  |   38|  1.66k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 537, False: 1.12k]
  |  |  ------------------
  |  |   39|    537|                snprintf (v, maxlen,                            \
  |  |   40|    537|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    537|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    537|                        "expected '%s'."),                      \
  |  |   42|    537|                        exif_format_get_name (format),          \
  |  |   43|    537|                        exif_format_get_name (target));         \
  |  |   44|    537|                break;                                          \
  |  |   45|    537|        }                                                       \
  |  |   46|  1.66k|}
  ------------------
  628|  1.12k|		if (size < t*2 + 2) return NULL;
  ------------------
  |  Branch (628:7): [True: 0, False: 1.12k]
  ------------------
  629|  1.12k|		vs = exif_get_short (data + t * 2, entry->order);
  630|  1.12k|		switch (t) {
  631|    285|		case 1:
  ------------------
  |  Branch (631:3): [True: 285, False: 842]
  ------------------
  632|    285|			snprintf (val, maxlen, "%u", vs);
  633|    285|			break;
  634|    276|		case 2:
  ------------------
  |  Branch (634:3): [True: 276, False: 851]
  ------------------
  635|    551|		case 3:
  ------------------
  |  Branch (635:3): [True: 275, False: 852]
  ------------------
  636|    551|			snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
  ------------------
  |  |   31|    551|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  637|    551|			break;
  638|    291|		default:
  ------------------
  |  Branch (638:3): [True: 291, False: 836]
  ------------------
  639|    291|			canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
  640|  1.12k|		}
  641|  1.12k|		break;
  642|       |
  643|  5.12k|	case MNOTE_CANON_TAG_SETTINGS_2:
  ------------------
  |  Branch (643:2): [True: 5.12k, False: 1.70M]
  ------------------
  644|  5.12k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  5.12k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  5.12k|{                                                               \
  |  |   38|  5.12k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 5.12k]
  |  |  ------------------
  |  |   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|  5.12k|}
  ------------------
  645|  5.12k|		if (size < 2) return NULL;
  ------------------
  |  Branch (645:7): [True: 0, False: 5.12k]
  ------------------
  646|  5.12k|		n = exif_get_short (data, entry->order) / 2;
  647|  5.12k|		if (t >= n) return NULL;
  ------------------
  |  Branch (647:7): [True: 0, False: 5.12k]
  ------------------
  648|  5.12k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  5.12k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  5.12k|{                                                                       \
  |  |   50|  5.12k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 614, False: 4.50k]
  |  |  ------------------
  |  |   51|    614|                snprintf (v, maxlen,                                    \
  |  |   52|    614|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    614|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    614|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    614|                break;                                                  \
  |  |   55|    614|        }                                                               \
  |  |   56|  5.12k|}
  ------------------
  649|  4.50k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (649:7): [True: 0, False: 4.50k]
  ------------------
  650|  4.50k|		vss = exif_get_sshort (data + 2 + t * 2, entry->order);
  651|  4.50k|		switch (t) {
  652|    562|		case 0:
  ------------------
  |  Branch (652:3): [True: 562, False: 3.94k]
  ------------------
  653|    562|			snprintf (val, maxlen, "%.3f", pow (2, vss / 32.0));
  654|    562|			break;
  655|    562|		case 1:
  ------------------
  |  Branch (655:3): [True: 562, False: 3.94k]
  ------------------
  656|    562|			snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed (vss / 32.0));
  657|    562|			break;
  658|    562|		case 2:
  ------------------
  |  Branch (658:3): [True: 562, False: 3.94k]
  ------------------
  659|    986|		case 5:
  ------------------
  |  Branch (659:3): [True: 424, False: 4.08k]
  ------------------
  660|    986|		case 14:
  ------------------
  |  Branch (660:3): [True: 0, False: 4.50k]
  ------------------
  661|    986|		case 16:
  ------------------
  |  Branch (661:3): [True: 0, False: 4.50k]
  ------------------
  662|    986|			snprintf (val, maxlen, _("%.2f EV"), vss / 32.0);
  ------------------
  |  |   31|    986|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  663|    986|			break;
  664|    559|		case 3:
  ------------------
  |  Branch (664:3): [True: 559, False: 3.94k]
  ------------------
  665|    559|		case 20:
  ------------------
  |  Branch (665:3): [True: 0, False: 4.50k]
  ------------------
  666|    559|			snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vss / 32.0));
  667|    559|			break;
  668|    559|		case 4:
  ------------------
  |  Branch (668:3): [True: 559, False: 3.94k]
  ------------------
  669|    559|		case 21:
  ------------------
  |  Branch (669:3): [True: 0, False: 4.50k]
  ------------------
  670|    559|			d = apex_value_to_shutter_speed (vss / 32.0);
  671|    559|			if (d < 1)
  ------------------
  |  Branch (671:8): [True: 272, False: 287]
  ------------------
  672|    272|				snprintf (val, maxlen, _("1/%.0f"), 1.0 / d);
  ------------------
  |  |   31|    272|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  673|    287|			else
  674|    287|				snprintf (val, maxlen, "%.0f", d);
  675|    559|			break;
  676|    422|		case 8:
  ------------------
  |  Branch (676:3): [True: 422, False: 4.08k]
  ------------------
  677|    422|			snprintf (val, maxlen, "%u", vss);
  678|    422|			break;
  679|      0|		case 12:
  ------------------
  |  Branch (679:3): [True: 0, False: 4.50k]
  ------------------
  680|      0|			snprintf (val, maxlen, "%.2f", vss / 32.0);
  681|      0|			break;
  682|      0|		case 18:
  ------------------
  |  Branch (682:3): [True: 0, False: 4.50k]
  ------------------
  683|      0|		case 19:
  ------------------
  |  Branch (683:3): [True: 0, False: 4.50k]
  ------------------
  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: 4.50k]
  ------------------
  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|    857|		default:
  ------------------
  |  Branch (693:3): [True: 857, False: 3.65k]
  ------------------
  694|    857|			canon_search_table_value (entries_settings_2, t, vss, val, maxlen);
  695|  4.50k|		}
  696|  4.50k|		break;
  697|       |
  698|  4.50k|	case MNOTE_CANON_TAG_PANORAMA:
  ------------------
  |  Branch (698:2): [True: 0, False: 1.70M]
  ------------------
  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|    482|	case MNOTE_CANON_TAG_OWNER:
  ------------------
  |  Branch (705:2): [True: 482, False: 1.70M]
  ------------------
  706|    482|		CC (entry->components, 32, val, maxlen)
  ------------------
  |  |   48|    482|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    482|{                                                                       \
  |  |   50|    482|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 265, False: 217]
  |  |  ------------------
  |  |   51|    265|                snprintf (v, maxlen,                                    \
  |  |   52|    265|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    265|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    265|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    265|                break;                                                  \
  |  |   55|    265|        }                                                               \
  |  |   56|    482|}
  ------------------
  707|       |		/* Fall through; ImageType can have many sizes */
  708|       |		/* fall through */
  709|    714|	case MNOTE_CANON_TAG_IMAGE_TYPE:
  ------------------
  |  Branch (709:2): [True: 497, False: 1.70M]
  ------------------
  710|    714|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    714|#define CF(format,target,v,maxlen)                              \
  |  |   37|    714|{                                                               \
  |  |   38|    714|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 346, False: 368]
  |  |  ------------------
  |  |   39|    346|                snprintf (v, maxlen,                            \
  |  |   40|    346|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    346|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    346|                        "expected '%s'."),                      \
  |  |   42|    346|                        exif_format_get_name (format),          \
  |  |   43|    346|                        exif_format_get_name (target));         \
  |  |   44|    346|                break;                                          \
  |  |   45|    346|        }                                                       \
  |  |   46|    714|}
  ------------------
  711|    368|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    368|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 102, False: 266]
  |  |  ------------------
  ------------------
  712|    368|		break;
  713|       |
  714|    664|	case MNOTE_CANON_TAG_FIRMWARE:
  ------------------
  |  Branch (714:2): [True: 664, False: 1.70M]
  ------------------
  715|    664|		CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
  ------------------
  |  |   36|    664|#define CF(format,target,v,maxlen)                              \
  |  |   37|    664|{                                                               \
  |  |   38|    664|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 207, False: 457]
  |  |  ------------------
  |  |   39|    207|                snprintf (v, maxlen,                            \
  |  |   40|    207|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    207|                        "expected '%s'."),                      \
  |  |   42|    207|                        exif_format_get_name (format),          \
  |  |   43|    207|                        exif_format_get_name (target));         \
  |  |   44|    207|                break;                                          \
  |  |   45|    207|        }                                                       \
  |  |   46|    664|}
  ------------------
  716|       |/*		CC2 (entry->components, 24, 32, val, maxlen); Can also be 22 */
  717|    457|		strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    457|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 204, False: 253]
  |  |  ------------------
  ------------------
  718|    457|		break;
  719|       |
  720|    936|	case MNOTE_CANON_TAG_IMAGE_NUMBER:
  ------------------
  |  Branch (720:2): [True: 936, False: 1.70M]
  ------------------
  721|    936|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    936|#define CF(format,target,v,maxlen)                              \
  |  |   37|    936|{                                                               \
  |  |   38|    936|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 495, False: 441]
  |  |  ------------------
  |  |   39|    495|                snprintf (v, maxlen,                            \
  |  |   40|    495|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    495|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    495|                        "expected '%s'."),                      \
  |  |   42|    495|                        exif_format_get_name (format),          \
  |  |   43|    495|                        exif_format_get_name (target));         \
  |  |   44|    495|                break;                                          \
  |  |   45|    495|        }                                                       \
  |  |   46|    936|}
  ------------------
  722|    441|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    441|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    441|{                                                                       \
  |  |   50|    441|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 244, False: 197]
  |  |  ------------------
  |  |   51|    244|                snprintf (v, maxlen,                                    \
  |  |   52|    244|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    244|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    244|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    244|                break;                                                  \
  |  |   55|    244|        }                                                               \
  |  |   56|    441|}
  ------------------
  723|    197|		if (size < 4) return NULL;
  ------------------
  |  Branch (723:7): [True: 0, False: 197]
  ------------------
  724|    197|		vl = exif_get_long (data, entry->order);
  725|    197|		snprintf (val, maxlen, "%03lu-%04lu",
  726|    197|				(unsigned long) vl/10000,
  727|    197|				(unsigned long) vl%10000);
  728|    197|		break;
  729|       |
  730|    644|	case MNOTE_CANON_TAG_SERIAL_NUMBER:
  ------------------
  |  Branch (730:2): [True: 644, False: 1.70M]
  ------------------
  731|    644|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   36|    644|#define CF(format,target,v,maxlen)                              \
  |  |   37|    644|{                                                               \
  |  |   38|    644|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 229, False: 415]
  |  |  ------------------
  |  |   39|    229|                snprintf (v, maxlen,                            \
  |  |   40|    229|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    229|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|    229|                        "expected '%s'."),                      \
  |  |   42|    229|                        exif_format_get_name (format),          \
  |  |   43|    229|                        exif_format_get_name (target));         \
  |  |   44|    229|                break;                                          \
  |  |   45|    229|        }                                                       \
  |  |   46|    644|}
  ------------------
  732|    415|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   48|    415|#define CC(number,target,v,maxlen)                                      \
  |  |   49|    415|{                                                                       \
  |  |   50|    415|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 213, False: 202]
  |  |  ------------------
  |  |   51|    213|                snprintf (v, maxlen,                                    \
  |  |   52|    213|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    213|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    213|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    213|                break;                                                  \
  |  |   55|    213|        }                                                               \
  |  |   56|    415|}
  ------------------
  733|    202|		if (size < 4) return NULL;
  ------------------
  |  Branch (733:7): [True: 0, False: 202]
  ------------------
  734|    202|		vl = exif_get_long (data, entry->order);
  735|    202|		snprintf (val, maxlen, "%04X-%05d", (int)vl>>16,(int)vl&0xffff);
  736|    202|		break;
  737|       |
  738|  1.68M|	case MNOTE_CANON_TAG_CUSTOM_FUNCS:
  ------------------
  |  Branch (738:2): [True: 1.68M, False: 18.2k]
  ------------------
  739|  1.68M|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  1.68M|#define CF(format,target,v,maxlen)                              \
  |  |   37|  1.68M|{                                                               \
  |  |   38|  1.68M|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 1.68M]
  |  |  ------------------
  |  |   39|      0|                snprintf (v, maxlen,                            \
  |  |   40|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   41|      0|                        "expected '%s'."),                      \
  |  |   42|      0|                        exif_format_get_name (format),          \
  |  |   43|      0|                        exif_format_get_name (target));         \
  |  |   44|      0|                break;                                          \
  |  |   45|      0|        }                                                       \
  |  |   46|  1.68M|}
  ------------------
  740|  1.68M|		if (size < 2) return NULL;
  ------------------
  |  Branch (740:7): [True: 0, False: 1.68M]
  ------------------
  741|  1.68M|		n = exif_get_short (data, entry->order) / 2;
  742|  1.68M|		if (t >= n) return NULL;
  ------------------
  |  Branch (742:7): [True: 0, False: 1.68M]
  ------------------
  743|  1.68M|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  1.68M|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  1.68M|{                                                                       \
  |  |   50|  1.68M|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 1.67M, False: 17.9k]
  |  |  ------------------
  |  |   51|  1.67M|                snprintf (v, maxlen,                                    \
  |  |   52|  1.67M|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  1.67M|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|  1.67M|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|  1.67M|                break;                                                  \
  |  |   55|  1.67M|        }                                                               \
  |  |   56|  1.68M|}
  ------------------
  744|  17.9k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (744:7): [True: 0, False: 17.9k]
  ------------------
  745|  17.9k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  746|  17.9k|		snprintf (buf, sizeof (buf), "%u", vs);
  747|  17.9k|		strncat (val, buf, maxlen - strlen (val));
  748|  17.9k|		break;
  749|       |
  750|  2.49k|	case MNOTE_CANON_TAG_COLOR_INFORMATION:
  ------------------
  |  Branch (750:2): [True: 2.49k, False: 1.70M]
  ------------------
  751|  2.49k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   36|  2.49k|#define CF(format,target,v,maxlen)                              \
  |  |   37|  2.49k|{                                                               \
  |  |   38|  2.49k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (38:13): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |   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.49k|}
  ------------------
  752|  2.49k|		if (size < 2) return NULL;
  ------------------
  |  Branch (752:7): [True: 0, False: 2.49k]
  ------------------
  753|  2.49k|		n = exif_get_short (data, entry->order) / 2;
  754|  2.49k|		if (t >= n) return NULL;
  ------------------
  |  Branch (754:7): [True: 0, False: 2.49k]
  ------------------
  755|  2.49k|		CC (entry->components, n, val, maxlen)
  ------------------
  |  |   48|  2.49k|#define CC(number,target,v,maxlen)                                      \
  |  |   49|  2.49k|{                                                                       \
  |  |   50|  2.49k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 559, False: 1.93k]
  |  |  ------------------
  |  |   51|    559|                snprintf (v, maxlen,                                    \
  |  |   52|    559|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    559|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   53|    559|                        "expected %i)."), (int) number, (int) target);  \
  |  |   54|    559|                break;                                                  \
  |  |   55|    559|        }                                                               \
  |  |   56|  2.49k|}
  ------------------
  756|  1.93k|		if (size < 2 + t*2 + 2) return NULL;
  ------------------
  |  Branch (756:7): [True: 0, False: 1.93k]
  ------------------
  757|  1.93k|		vs = exif_get_short (data + 2 + t * 2, entry->order);
  758|  1.93k|		canon_search_table_value (color_information, t, vs, val, maxlen);
  759|  1.93k|		break;
  760|       |
  761|  1.85k|	default:
  ------------------
  |  Branch (761:2): [True: 1.85k, False: 1.70M]
  ------------------
  762|  1.85k|		switch (entry->format) {
  763|    240|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (763:3): [True: 240, False: 1.61k]
  ------------------
  764|    240|		  {
  765|    240|			size_t i, len = strlen(val);
  766|  61.4k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (766:13): [True: 61.2k, False: 240]
  ------------------
  767|  61.2k|				if (size < 2)
  ------------------
  |  Branch (767:9): [True: 0, False: 61.2k]
  ------------------
  768|      0|					break;
  769|  61.2k|				vs = exif_get_short (data, entry->order);
  770|  61.2k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  771|  61.2k|				len = strlen(val);
  772|  61.2k|				data += 2;
  773|  61.2k|				size -= 2;
  774|  61.2k|			}
  775|    240|		  }
  776|    240|		  break;
  777|    383|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (777:3): [True: 383, False: 1.46k]
  ------------------
  778|    383|		  {
  779|    383|			size_t i, len = strlen(val);
  780|  72.4k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (780:13): [True: 72.0k, False: 383]
  ------------------
  781|  72.0k|				if (size < 2)
  ------------------
  |  Branch (781:9): [True: 0, False: 72.0k]
  ------------------
  782|      0|					break;
  783|  72.0k|				vss = exif_get_sshort (data, entry->order);
  784|  72.0k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  785|  72.0k|				data += 2;
  786|  72.0k|				size -= 2;
  787|  72.0k|			}
  788|    383|		  }
  789|    383|		  break;
  790|    217|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (790:3): [True: 217, False: 1.63k]
  ------------------
  791|    217|		  {
  792|    217|			size_t i, len = strlen(val);
  793|  21.5k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (793:13): [True: 21.2k, False: 217]
  ------------------
  794|  21.2k|				if (size < 4)
  ------------------
  |  Branch (794:9): [True: 0, False: 21.2k]
  ------------------
  795|      0|					break;
  796|  21.2k|				vl = exif_get_long (data, entry->order);
  797|  21.2k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  798|  21.2k|				data += 4;
  799|  21.2k|				size -= 4;
  800|  21.2k|			}
  801|    217|		  }
  802|    217|		  break;
  803|    311|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (803:3): [True: 311, False: 1.54k]
  ------------------
  804|    311|		  {
  805|    311|			size_t i, len = strlen(val);
  806|  23.5k|			for(i=0; i<entry->components; i++) {
  ------------------
  |  Branch (806:13): [True: 23.2k, False: 311]
  ------------------
  807|  23.2k|				if (size < 4)
  ------------------
  |  Branch (807:9): [True: 0, False: 23.2k]
  ------------------
  808|      0|					break;
  809|  23.2k|				vsl = exif_get_slong (data, entry->order);
  810|  23.2k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  811|  23.2k|				data += 4;
  812|  23.2k|				size -= 4;
  813|  23.2k|			}
  814|    311|		  }
  815|    311|		  break;
  816|    465|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (816:3): [True: 465, False: 1.38k]
  ------------------
  817|    465|			strncpy (val, (char *)data, MIN (entry->size, maxlen));
  ------------------
  |  |  182|    465|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 96, False: 369]
  |  |  ------------------
  ------------------
  818|    465|			break;
  819|    236|		default:
  ------------------
  |  Branch (819:3): [True: 236, False: 1.61k]
  ------------------
  820|    236|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  821|    236|			  entry->size);
  822|    236|		  break;
  823|  1.85k|		}
  824|  1.85k|		break;
  825|  1.70M|	}
  826|  1.70M|	return val;
  827|  1.70M|}
mnote-canon-entry.c:canon_search_table_value:
  444|  5.01k|{
  445|  5.01k|	unsigned int j;
  446|       |
  447|       |	/* Search the table for the first matching subtag and value. */
  448|  72.2k|	for (j = 0; table[j].name && ((table[j].subtag < t) ||
  ------------------
  |  Branch (448:14): [True: 71.4k, False: 792]
  |  Branch (448:32): [True: 52.2k, False: 19.1k]
  ------------------
  449|  68.1k|			((table[j].subtag == t) && table[j].value <= vs)); j++) {
  ------------------
  |  Branch (449:5): [True: 16.6k, False: 2.53k]
  |  Branch (449:31): [True: 15.8k, False: 769]
  ------------------
  450|  68.1k|		if ((table[j].subtag == t) && (table[j].value == vs)) {
  ------------------
  |  Branch (450:7): [True: 15.8k, False: 52.2k]
  |  Branch (450:33): [True: 913, False: 14.9k]
  ------------------
  451|    913|			break;
  452|    913|		}
  453|  68.1k|	}
  454|  5.01k|	if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
  ------------------
  |  Branch (454:6): [True: 1.96k, False: 3.04k]
  |  Branch (454:32): [True: 913, False: 1.05k]
  |  Branch (454:58): [True: 913, False: 0]
  ------------------
  455|       |		/* Matching subtag and value found. */
  456|    913|		strncpy (val, _(table[j].name), maxlen);
  ------------------
  |  |   31|    913|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  457|  4.09k|	} else {
  458|       |		/* No matching subtag and/or value found. */
  459|  4.09k|		snprintf (val, maxlen, "0x%04x", vs);
  460|  4.09k|	}
  461|  5.01k|}
mnote-canon-entry.c:apex_value_to_aperture:
  534|    559|{
  535|    559|	return pow (2, x / 2.);
  536|    559|}
mnote-canon-entry.c:apex_value_to_iso_speed:
  546|    562|{
  547|    562|	return 3.125 * pow (2, x);
  548|    562|}
mnote-canon-entry.c:apex_value_to_shutter_speed:
  540|    559|{
  541|    559|	return 1.0 / pow (2, x);
  542|    559|}

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

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

exif_data_get_mnote_data:
   93|  11.7k|{
   94|  11.7k|	return (d && d->priv) ? d->priv->md : NULL;
  ------------------
  |  Branch (94:10): [True: 11.7k, False: 0]
  |  Branch (94:15): [True: 11.7k, False: 0]
  ------------------
   95|  11.7k|}
exif_data_new_mem:
  110|  11.7k|{
  111|  11.7k|	ExifData *data;
  112|  11.7k|	unsigned int i;
  113|       |
  114|  11.7k|	if (!mem) 
  ------------------
  |  Branch (114:6): [True: 0, False: 11.7k]
  ------------------
  115|      0|		return NULL;
  116|       |
  117|  11.7k|	data = exif_mem_alloc (mem, sizeof (ExifData));
  118|  11.7k|	if (!data) 
  ------------------
  |  Branch (118:6): [True: 0, False: 11.7k]
  ------------------
  119|      0|		return (NULL);
  120|  11.7k|	data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate));
  121|  11.7k|	if (!data->priv) { 
  ------------------
  |  Branch (121:6): [True: 0, False: 11.7k]
  ------------------
  122|      0|	  	exif_mem_free (mem, data); 
  123|      0|		return (NULL); 
  124|      0|	}
  125|  11.7k|	data->priv->ref_count = 1;
  126|       |
  127|  11.7k|	data->priv->mem = mem;
  128|  11.7k|	exif_mem_ref (mem);
  129|       |
  130|  70.2k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (130:14): [True: 58.5k, False: 11.7k]
  ------------------
  131|  58.5k|		data->ifd[i] = exif_content_new_mem (data->priv->mem);
  132|  58.5k|		if (!data->ifd[i]) {
  ------------------
  |  Branch (132:7): [True: 0, False: 58.5k]
  ------------------
  133|      0|			exif_data_free (data);
  134|      0|			return (NULL);
  135|      0|		}
  136|  58.5k|		data->ifd[i]->parent = data;
  137|  58.5k|	}
  138|       |
  139|       |	/* Default options */
  140|  11.7k|#ifndef NO_VERBOSE_TAG_STRINGS
  141|       |	/*
  142|       |	 * When the tag list is compiled away, setting this option prevents
  143|       |	 * any tags from being loaded
  144|       |	 */
  145|  11.7k|	exif_data_set_option (data, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
  146|  11.7k|#endif
  147|  11.7k|	exif_data_set_option (data, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
  148|       |
  149|       |	/* Default data type: none */
  150|  11.7k|	exif_data_set_data_type (data, EXIF_DATA_TYPE_COUNT);
  151|       |
  152|  11.7k|	return (data);
  153|  11.7k|}
exif_data_load_data:
  874|  11.7k|{
  875|  11.7k|	unsigned int l;
  876|  11.7k|	ExifLong offset;
  877|  11.7k|	ExifShort n;
  878|  11.7k|	const unsigned char *d = d_orig;
  879|  11.7k|	unsigned int len, fullds;
  880|       |
  881|  11.7k|	if (!data || !data->priv || !d || !ds)
  ------------------
  |  Branch (881:6): [True: 0, False: 11.7k]
  |  Branch (881:15): [True: 0, False: 11.7k]
  |  Branch (881:30): [True: 0, False: 11.7k]
  |  Branch (881:36): [True: 0, False: 11.7k]
  ------------------
  882|      0|		return;
  883|       |
  884|  11.7k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  885|  11.7k|		  "Parsing %i byte(s) EXIF data...\n", ds);
  886|       |
  887|       |	/*
  888|       |	 * It can be that the data starts with the EXIF header. If it does
  889|       |	 * not, search the EXIF marker.
  890|       |	 */
  891|  11.7k|	if (ds < 6) {
  ------------------
  |  Branch (891:6): [True: 15, False: 11.6k]
  ------------------
  892|     15|		LOG_TOO_SMALL;
  ------------------
  |  |  867|     15|#define LOG_TOO_SMALL \
  |  |  868|     15|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  869|     15|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     15|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  893|     15|		return;
  894|     15|	}
  895|  11.6k|	if (!memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (895:6): [True: 11.4k, False: 228]
  ------------------
  896|  11.4k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  897|  11.4k|			  "Found EXIF header at start.");
  898|  11.4k|	} else {
  899|  1.20k|		while (ds >= 3) {
  ------------------
  |  Branch (899:10): [True: 1.18k, False: 19]
  ------------------
  900|  1.55k|			while (ds && (d[0] == 0xff)) {
  ------------------
  |  Branch (900:11): [True: 1.54k, False: 5]
  |  Branch (900:17): [True: 371, False: 1.17k]
  ------------------
  901|    371|				d++;
  902|    371|				ds--;
  903|    371|			}
  904|       |
  905|       |			/* JPEG_MARKER_SOI */
  906|  1.18k|			if (ds && d[0] == JPEG_MARKER_SOI) {
  ------------------
  |  |   47|  1.17k|#define JPEG_MARKER_SOI  0xd8
  ------------------
  |  Branch (906:8): [True: 1.17k, False: 5]
  |  Branch (906:14): [True: 468, False: 708]
  ------------------
  907|    468|				d++;
  908|    468|				ds--;
  909|    468|				continue;
  910|    468|			}
  911|       |
  912|       |			/* JPEG_MARKER_APP1 */
  913|    713|			if (ds && d[0] == JPEG_MARKER_APP1) {
  ------------------
  |  |   51|    708|#define JPEG_MARKER_APP1 0xe1
  ------------------
  |  Branch (913:8): [True: 708, False: 5]
  |  Branch (913:14): [True: 388, False: 320]
  ------------------
  914|       |				/*
  915|       |				 * Verify the exif header
  916|       |				 * (offset 3, length 6).
  917|       |				 * FF E1 NN NN EXIFHEADER
  918|       |				 *    ^^ d points here currently
  919|       |				 */
  920|    388|				if ((ds >= 9) && !memcmp (d+3, ExifHeader, 6))
  ------------------
  |  Branch (920:9): [True: 358, False: 30]
  |  Branch (920:22): [True: 69, False: 289]
  ------------------
  921|     69|					break;
  922|       |				/* fallthrough */
  923|    388|			}
  924|       |			/* Skip irrelevant APP markers. The branch for APP1 must come before this,
  925|       |			   otherwise this code block will cause APP1 to be skipped. This code path
  926|       |			   is only relevant for files that are nonconformant to the EXIF
  927|       |			   specification. For conformant files, the APP1 code path above will be
  928|       |			   taken. */
  929|    644|			if (ds >= 3 && d[0] >= 0xe0 && d[0] <= 0xef) {  /* JPEG_MARKER_APPn */
  ------------------
  |  Branch (929:8): [True: 634, False: 10]
  |  Branch (929:19): [True: 564, False: 70]
  |  Branch (929:35): [True: 559, False: 5]
  ------------------
  930|    559|				d++;
  931|    559|				ds--;
  932|    559|				l = (((unsigned int)d[0]) << 8) | d[1];
  933|    559|				if (l > ds)
  ------------------
  |  Branch (933:9): [True: 55, False: 504]
  ------------------
  934|     55|					return;
  935|    504|				d += l;
  936|    504|				ds -= l;
  937|    504|				continue;
  938|    559|			}
  939|       |
  940|       |			/* Unknown marker or data. Give up. */
  941|     85|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  942|     85|				  "ExifData", _("EXIF marker not found."));
  ------------------
  |  |   31|     85|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  943|     85|			return;
  944|    644|		}
  945|     88|		if (ds < 3) {
  ------------------
  |  Branch (945:7): [True: 19, False: 69]
  ------------------
  946|     19|			LOG_TOO_SMALL;
  ------------------
  |  |  867|     19|#define LOG_TOO_SMALL \
  |  |  868|     19|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  869|     19|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|     19|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  947|     19|			return;
  948|     19|		}
  949|     69|		d++;
  950|     69|		ds--;
  951|     69|		len = (((unsigned int)d[0]) << 8) | d[1];
  952|     69|		if (len > ds) {
  ------------------
  |  Branch (952:7): [True: 43, False: 26]
  ------------------
  953|     43|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  954|     43|				  "ExifData", _("Read length %d is longer than data length %d."), len, ds);
  ------------------
  |  |   31|     43|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  955|     43|			return;
  956|     43|		}
  957|     26|		if (len < 2) {
  ------------------
  |  Branch (957:7): [True: 2, False: 24]
  ------------------
  958|      2|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  959|      2|				  "ExifData", _("APP Tag too short."));
  ------------------
  |  |   31|      2|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  960|      2|			return;
  961|      2|		}
  962|     24|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  963|     24|			  "We have to deal with %i byte(s) of EXIF data.",
  964|     24|			  len);
  965|     24|		d += 2;
  966|     24|		ds = len - 2;	/* we do not want the full rest size, but only the size of the tag */
  967|     24|	}
  968|       |
  969|       |	/*
  970|       |	 * Verify the exif header
  971|       |	 * (offset 2, length 6).
  972|       |	 */
  973|  11.4k|	if (ds < 6) {
  ------------------
  |  Branch (973:6): [True: 7, False: 11.4k]
  ------------------
  974|      7|		LOG_TOO_SMALL;
  ------------------
  |  |  867|      7|#define LOG_TOO_SMALL \
  |  |  868|      7|exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", \
  |  |  869|      7|		_("Size of data too small to allow for EXIF data."))
  |  |  ------------------
  |  |  |  |   31|      7|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  ------------------
  975|      7|		return;
  976|      7|	}
  977|  11.4k|	if (memcmp (d, ExifHeader, 6)) {
  ------------------
  |  Branch (977:6): [True: 0, False: 11.4k]
  ------------------
  978|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
  979|      0|			  "ExifData", _("EXIF header not found."));
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  980|      0|		return;
  981|      0|	}
  982|       |
  983|  11.4k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  984|  11.4k|		  "Found EXIF header.");
  985|       |
  986|       |	/* Sanity check the data length */
  987|  11.4k|	if (ds < 14)
  ------------------
  |  Branch (987:6): [True: 47, False: 11.4k]
  ------------------
  988|     47|		return;
  989|       |
  990|       |	/* The JPEG APP1 section can be no longer than 64 KiB (including a
  991|       |	   16-bit length), so cap the data length to protect against overflow
  992|       |	   in future offset calculations */
  993|  11.4k|	fullds = ds;
  994|  11.4k|	if (ds > 0xfffe)
  ------------------
  |  Branch (994:6): [True: 11, False: 11.4k]
  ------------------
  995|     11|		ds = 0xfffe;
  996|       |
  997|       |	/* Byte order (offset 6, length 2) */
  998|  11.4k|	if (!memcmp (d + 6, "II", 2))
  ------------------
  |  Branch (998:6): [True: 8.06k, False: 3.36k]
  ------------------
  999|  8.06k|		data->priv->order = EXIF_BYTE_ORDER_INTEL;
 1000|  3.36k|	else if (!memcmp (d + 6, "MM", 2))
  ------------------
  |  Branch (1000:11): [True: 3.32k, False: 47]
  ------------------
 1001|  3.32k|		data->priv->order = EXIF_BYTE_ORDER_MOTOROLA;
 1002|     47|	else {
 1003|     47|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1004|     47|			  "ExifData", _("Unknown encoding."));
  ------------------
  |  |   31|     47|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
 1005|     47|		return;
 1006|     47|	}
 1007|       |
 1008|       |	/* Fixed value */
 1009|  11.3k|	if (exif_get_short (d + 8, data->priv->order) != 0x002a)
  ------------------
  |  Branch (1009:6): [True: 18, False: 11.3k]
  ------------------
 1010|     18|		return;
 1011|       |
 1012|       |	/* IFD 0 offset */
 1013|  11.3k|	offset = exif_get_long (d + 10, data->priv->order);
 1014|  11.3k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", 
 1015|  11.3k|		  "IFD 0 at %i.", (int) offset);
 1016|       |
 1017|       |	/* ds is restricted to 16 bit above, so offset is restricted too, and offset+8 should not overflow. */
 1018|  11.3k|	if (offset > ds || offset + 6 + 2 > ds)
  ------------------
  |  Branch (1018:6): [True: 57, False: 11.3k]
  |  Branch (1018:21): [True: 6, False: 11.3k]
  ------------------
 1019|     63|		return;
 1020|       |
 1021|       |	/* Parse the actual exif data (usually offset 14 from start) */
 1022|  11.3k|	exif_data_load_data_content (data, EXIF_IFD_0, d + 6, ds - 6, offset, 0);
 1023|       |
 1024|       |	/* IFD 1 offset */
 1025|  11.3k|	n = exif_get_short (d + 6 + offset, data->priv->order);
 1026|       |	/* offset < 2<<16, n is 16 bit at most, so this op will not overflow */
 1027|  11.3k|	if (offset + 6 + 2 + 12 * n + 4 > ds)
  ------------------
  |  Branch (1027:6): [True: 2.48k, False: 8.82k]
  ------------------
 1028|  2.48k|		return;
 1029|       |
 1030|  8.82k|	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 1031|  8.82k|	if (offset) {
  ------------------
  |  Branch (1031:6): [True: 8.61k, False: 212]
  ------------------
 1032|  8.61k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
 1033|  8.61k|			  "IFD 1 at %i.", (int) offset);
 1034|       |
 1035|       |		/* Sanity check. ds is ensured to be above 6 above, offset is 16bit */
 1036|  8.61k|		if (offset > ds - 6) {
  ------------------
  |  Branch (1036:7): [True: 1.94k, False: 6.66k]
  ------------------
 1037|  1.94k|			exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA,
 1038|  1.94k|				  "ExifData", "Bogus offset of IFD1.");
 1039|  6.66k|		} else {
 1040|  6.66k|		   exif_data_load_data_content (data, EXIF_IFD_1, d + 6, ds - 6, offset, 0);
 1041|  6.66k|		}
 1042|  8.61k|	}
 1043|       |
 1044|       |	/*
 1045|       |	 * If we got an EXIF_TAG_MAKER_NOTE, try to interpret it. Some
 1046|       |	 * cameras use pointers in the maker note tag that point to the
 1047|       |	 * space between IFDs. Here is the only place where we have access
 1048|       |	 * to that data.
 1049|       |	 */
 1050|  8.82k|	interpret_maker_note(data, d, fullds);
 1051|       |
 1052|       |	/* Fixup tags if requested */
 1053|  8.82k|	if (data->priv->options & EXIF_DATA_OPTION_FOLLOW_SPECIFICATION)
  ------------------
  |  Branch (1053:6): [True: 8.82k, False: 0]
  ------------------
 1054|  8.82k|		exif_data_fix (data);
 1055|  8.82k|}
exif_data_unref:
 1127|  11.7k|{
 1128|  11.7k|	if (!data) 
  ------------------
  |  Branch (1128:6): [True: 0, False: 11.7k]
  ------------------
 1129|      0|		return;
 1130|       |
 1131|  11.7k|	data->priv->ref_count--;
 1132|  11.7k|	if (!data->priv->ref_count) 
  ------------------
  |  Branch (1132:6): [True: 11.7k, False: 0]
  ------------------
 1133|  11.7k|		exif_data_free (data);
 1134|  11.7k|}
exif_data_free:
 1138|  11.7k|{
 1139|  11.7k|	unsigned int i;
 1140|  11.7k|	ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
  ------------------
  |  Branch (1140:18): [True: 11.7k, False: 0]
  |  Branch (1140:26): [True: 11.7k, False: 0]
  ------------------
 1141|       |
 1142|  11.7k|	if (!data) 
  ------------------
  |  Branch (1142:6): [True: 0, False: 11.7k]
  ------------------
 1143|      0|		return;
 1144|       |
 1145|  70.2k|	for (i = 0; i < EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1145:14): [True: 58.5k, False: 11.7k]
  ------------------
 1146|  58.5k|		if (data->ifd[i]) {
  ------------------
  |  Branch (1146:7): [True: 58.5k, False: 0]
  ------------------
 1147|  58.5k|			exif_content_unref (data->ifd[i]);
 1148|  58.5k|			data->ifd[i] = NULL;
 1149|  58.5k|		}
 1150|  58.5k|	}
 1151|       |
 1152|  11.7k|	if (data->data) {
  ------------------
  |  Branch (1152:6): [True: 199, False: 11.5k]
  ------------------
 1153|    199|		exif_mem_free (mem, data->data);
 1154|    199|		data->data = NULL;
 1155|    199|	}
 1156|       |
 1157|  11.7k|	if (data->priv) {
  ------------------
  |  Branch (1157:6): [True: 11.7k, False: 0]
  ------------------
 1158|  11.7k|		if (data->priv->log) {
  ------------------
  |  Branch (1158:7): [True: 0, False: 11.7k]
  ------------------
 1159|      0|			exif_log_unref (data->priv->log);
 1160|      0|			data->priv->log = NULL;
 1161|      0|		}
 1162|  11.7k|		if (data->priv->md) {
  ------------------
  |  Branch (1162:7): [True: 7.41k, False: 4.29k]
  ------------------
 1163|  7.41k|			exif_mnote_data_unref (data->priv->md);
 1164|  7.41k|			data->priv->md = NULL;
 1165|  7.41k|		}
 1166|  11.7k|		exif_mem_free (mem, data->priv);
 1167|  11.7k|		exif_mem_free (mem, data);
 1168|  11.7k|	}
 1169|       |
 1170|  11.7k|	exif_mem_unref (mem);
 1171|  11.7k|}
exif_data_get_byte_order:
 1202|   164k|{
 1203|   164k|	if (!data)
  ------------------
  |  Branch (1203:6): [True: 0, False: 164k]
  ------------------
 1204|      0|		return (0);
 1205|       |
 1206|   164k|	return (data->priv->order);
 1207|   164k|}
exif_data_foreach_content:
 1212|  20.5k|{
 1213|  20.5k|	unsigned int i;
 1214|       |
 1215|  20.5k|	if (!data || !func)
  ------------------
  |  Branch (1215:6): [True: 0, False: 20.5k]
  |  Branch (1215:15): [True: 0, False: 20.5k]
  ------------------
 1216|      0|		return;
 1217|       |
 1218|   123k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1218:14): [True: 102k, False: 20.5k]
  ------------------
 1219|   102k|		func (data->ifd[i], user_data);
 1220|  20.5k|}
exif_data_log:
 1262|  11.7k|{
 1263|  11.7k|	unsigned int i;
 1264|       |
 1265|  11.7k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1265:6): [True: 0, False: 11.7k]
  |  Branch (1265:15): [True: 0, False: 11.7k]
  ------------------
 1266|      0|		return;
 1267|  11.7k|	exif_log_unref (data->priv->log);
 1268|  11.7k|	data->priv->log = log;
 1269|  11.7k|	exif_log_ref (log);
 1270|       |
 1271|  70.2k|	for (i = 0; i < EXIF_IFD_COUNT; i++)
  ------------------
  |  Branch (1271:14): [True: 58.5k, False: 11.7k]
  ------------------
 1272|  58.5k|		exif_content_log (data->ifd[i], log);
 1273|  11.7k|}
exif_data_get_log:
 1279|  81.6k|{
 1280|  81.6k|	if (!data || !data->priv) 
  ------------------
  |  Branch (1280:6): [True: 0, False: 81.6k]
  |  Branch (1280:15): [True: 0, False: 81.6k]
  ------------------
 1281|      0|		return NULL;
 1282|  81.6k|	return data->priv->log;
 1283|  81.6k|}
exif_data_set_option:
 1325|  23.4k|{
 1326|  23.4k|	if (!d) 
  ------------------
  |  Branch (1326:6): [True: 0, False: 23.4k]
  ------------------
 1327|      0|		return;
 1328|       |
 1329|  23.4k|	d->priv->options |= o;
 1330|  23.4k|}
exif_data_fix:
 1371|  8.82k|{
 1372|       |	exif_data_foreach_content (d, fix_func, NULL);
 1373|  8.82k|}
exif_data_set_data_type:
 1377|  11.7k|{
 1378|  11.7k|	if (!d || !d->priv) 
  ------------------
  |  Branch (1378:6): [True: 0, False: 11.7k]
  |  Branch (1378:12): [True: 0, False: 11.7k]
  ------------------
 1379|      0|		return;
 1380|       |
 1381|  11.7k|	d->priv->data_type = dt;
 1382|  11.7k|}
exif_data_get_data_type:
 1386|  52.2k|{
 1387|  52.2k|	return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
  ------------------
  |  Branch (1387:10): [True: 52.2k, False: 0]
  |  Branch (1387:15): [True: 52.2k, False: 0]
  ------------------
 1388|  52.2k|}
exif-data.c:exif_data_load_data_content:
  417|  29.3k|{
  418|  29.3k|	ExifLong o, thumbnail_offset = 0, thumbnail_length = 0;
  419|  29.3k|	ExifShort n;
  420|  29.3k|	ExifEntry *entry;
  421|  29.3k|	unsigned int i;
  422|  29.3k|	ExifTag tag;
  423|       |
  424|  29.3k|	if (!data || !data->priv) 
  ------------------
  |  Branch (424:6): [True: 0, False: 29.3k]
  |  Branch (424:15): [True: 0, False: 29.3k]
  ------------------
  425|      0|		return;
  426|       |
  427|       |	/* check for valid ExifIfd enum range */
  428|  29.3k|	if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  ------------------
  |  Branch (428:6): [True: 0, False: 29.3k]
  |  Branch (428:26): [True: 0, False: 29.3k]
  ------------------
  429|      0|	  return;
  430|       |
  431|  29.3k|	if (recursion_cost > 170) {
  ------------------
  |  Branch (431:6): [True: 33, False: 29.2k]
  ------------------
  432|       |		/*
  433|       |		 * recursion_cost is a logarithmic-scale indicator of how expensive this
  434|       |		 * recursive call might end up being. It is an indicator of the depth of
  435|       |		 * recursion as well as the potential for worst-case future recursive
  436|       |		 * calls. Since it's difficult to tell ahead of time how often recursion
  437|       |		 * will occur, this assumes the worst by assuming every tag could end up
  438|       |		 * causing recursion.
  439|       |		 * The value of 170 was chosen to limit typical EXIF structures to a
  440|       |		 * recursive depth of about 6, but pathological ones (those with very
  441|       |		 * many tags) to only 2.
  442|       |		 */
  443|     33|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  444|     33|			  "Deep/expensive recursion detected!");
  445|     33|		return;
  446|     33|	}
  447|       |
  448|       |	/* Read the number of entries */
  449|  29.2k|	if (exif_check_overflow (offset, ds, 2)) {
  ------------------
  |  Branch (449:6): [True: 22, False: 29.2k]
  ------------------
  450|     22|		exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  451|     22|			  "Tag data past end of buffer (%u+2 > %u)", offset, ds);
  452|     22|		return;
  453|     22|	}
  454|  29.2k|	n = exif_get_short (d + offset, data->priv->order);
  455|  29.2k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  456|  29.2k|	          "Loading %hu entries...", n);
  457|  29.2k|	offset += 2;
  458|       |
  459|       |	/* Check if we have enough data. */
  460|  29.2k|	if (exif_check_overflow (offset, ds, 12*n)) {
  ------------------
  |  Branch (460:6): [True: 18.8k, False: 10.4k]
  ------------------
  461|  18.8k|		n = (ds - offset) / 12;
  462|  18.8k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  463|  18.8k|				  "Short data; only loading %hu entries...", n);
  464|  18.8k|	}
  465|       |
  466|  2.16M|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (466:14): [True: 2.13M, False: 28.6k]
  ------------------
  467|       |
  468|  2.13M|		tag = exif_get_short (d + offset + 12 * i, data->priv->order);
  469|  2.13M|		switch (tag) {
  470|  15.8k|		case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (470:3): [True: 15.8k, False: 2.12M]
  ------------------
  471|  19.4k|		case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (471:3): [True: 3.51k, False: 2.13M]
  ------------------
  472|  22.8k|		case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (472:3): [True: 3.48k, False: 2.13M]
  ------------------
  473|  26.6k|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (473:3): [True: 3.79k, False: 2.13M]
  ------------------
  474|  29.4k|		case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (474:3): [True: 2.78k, False: 2.13M]
  ------------------
  475|  29.4k|			o = exif_get_long (d + offset + 12 * i + 8,
  476|  29.4k|					   data->priv->order);
  477|  29.4k|			if (o >= ds) {
  ------------------
  |  Branch (477:8): [True: 3.61k, False: 25.8k]
  ------------------
  478|  3.61k|				exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  479|  3.61k|					  "Tag data past end of buffer (%u > %u)", offset+2, ds);
  480|  3.61k|				if (recursion_cost > 0)
  ------------------
  |  Branch (480:9): [True: 661, False: 2.94k]
  ------------------
  481|    661|					return;
  482|  2.94k|				break;
  483|  3.61k|			}
  484|       |			/* FIXME: IFD_POINTER tags aren't marked as being in a
  485|       |			 * specific IFD, so exif_tag_get_name_in_ifd won't work
  486|       |			 */
  487|  25.8k|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  488|  25.8k|				  "Sub-IFD entry 0x%x ('%s') at %u.", tag,
  489|  25.8k|				  exif_tag_get_name(tag), o);
  490|  25.8k|			switch (tag) {
  491|  15.2k|			case EXIF_TAG_EXIF_IFD_POINTER:
  ------------------
  |  Branch (491:4): [True: 15.2k, False: 10.5k]
  ------------------
  492|  23.9k|				CHECK_REC (EXIF_IFD_EXIF)
  ------------------
  |  |  362|  15.2k|#define CHECK_REC(i) 					\
  |  |  363|  15.2k|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (363:5): [True: 1.76k, False: 13.5k]
  |  |  ------------------
  |  |  364|  1.76k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  365|  1.76k|		"ExifData", "Recursive entry in IFD "	\
  |  |  366|  1.76k|		"'%s' detected. Skipping...",		\
  |  |  367|  1.76k|		exif_ifd_get_name (i));			\
  |  |  368|  1.76k|	break;						\
  |  |  369|  13.5k|}							\
  |  |  370|  13.5k|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (370:5): [True: 3.10k, False: 10.3k]
  |  |  ------------------
  |  |  371|  3.10k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  372|  3.10k|		"ExifData", "Attempt to load IFD "	\
  |  |  373|  3.10k|		"'%s' multiple times detected. "	\
  |  |  374|  3.10k|		"Skipping...",				\
  |  |  375|  3.10k|		exif_ifd_get_name (i));			\
  |  |  376|  3.10k|	break;						\
  |  |  377|  10.3k|}							\
  |  |  378|  10.3k|if (data->priv->ifd_used[i]) {				\
  |  |  ------------------
  |  |  |  Branch (378:5): [True: 757, False: 9.64k]
  |  |  ------------------
  |  |  379|    757|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  380|    757|		"ExifData", "Attempt to load IFD "	\
  |  |  381|    757|		"'%s' multiple times detected. "	\
  |  |  382|    757|		"Skipping...",				\
  |  |  383|    757|		exif_ifd_get_name (i));			\
  |  |  384|    757|	break;						\
  |  |  385|  9.64k|} else {						\
  |  |  386|  9.64k|	data->priv->ifd_used[i] = 1;			\
  |  |  387|  9.64k|}
  ------------------
  493|  9.64k|				exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o,
  494|  9.64k|					recursion_cost + level_cost(n));
  495|  9.64k|				break;
  496|  3.40k|			case EXIF_TAG_GPS_INFO_IFD_POINTER:
  ------------------
  |  Branch (496:4): [True: 3.40k, False: 22.4k]
  ------------------
  497|  4.27k|				CHECK_REC (EXIF_IFD_GPS)
  ------------------
  |  |  362|  3.40k|#define CHECK_REC(i) 					\
  |  |  363|  3.40k|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (363:5): [True: 961, False: 2.44k]
  |  |  ------------------
  |  |  364|    961|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  365|    961|		"ExifData", "Recursive entry in IFD "	\
  |  |  366|    961|		"'%s' detected. Skipping...",		\
  |  |  367|    961|		exif_ifd_get_name (i));			\
  |  |  368|    961|	break;						\
  |  |  369|  2.44k|}							\
  |  |  370|  2.44k|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (370:5): [True: 614, False: 1.82k]
  |  |  ------------------
  |  |  371|    614|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  372|    614|		"ExifData", "Attempt to load IFD "	\
  |  |  373|    614|		"'%s' multiple times detected. "	\
  |  |  374|    614|		"Skipping...",				\
  |  |  375|    614|		exif_ifd_get_name (i));			\
  |  |  376|    614|	break;						\
  |  |  377|  1.82k|}							\
  |  |  378|  1.82k|if (data->priv->ifd_used[i]) {				\
  |  |  ------------------
  |  |  |  Branch (378:5): [True: 793, False: 1.03k]
  |  |  ------------------
  |  |  379|    793|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  380|    793|		"ExifData", "Attempt to load IFD "	\
  |  |  381|    793|		"'%s' multiple times detected. "	\
  |  |  382|    793|		"Skipping...",				\
  |  |  383|    793|		exif_ifd_get_name (i));			\
  |  |  384|    793|	break;						\
  |  |  385|  1.03k|} else {						\
  |  |  386|  1.03k|	data->priv->ifd_used[i] = 1;			\
  |  |  387|  1.03k|}
  ------------------
  498|  1.03k|				exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o,
  499|  1.03k|					recursion_cost + level_cost(n));
  500|  1.03k|				break;
  501|  3.33k|			case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
  ------------------
  |  Branch (501:4): [True: 3.33k, False: 22.5k]
  ------------------
  502|  4.38k|				CHECK_REC (EXIF_IFD_INTEROPERABILITY)
  ------------------
  |  |  362|  3.33k|#define CHECK_REC(i) 					\
  |  |  363|  3.33k|if ((i) == ifd) {				\
  |  |  ------------------
  |  |  |  Branch (363:5): [True: 831, False: 2.50k]
  |  |  ------------------
  |  |  364|    831|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \
  |  |  365|    831|		"ExifData", "Recursive entry in IFD "	\
  |  |  366|    831|		"'%s' detected. Skipping...",		\
  |  |  367|    831|		exif_ifd_get_name (i));			\
  |  |  368|    831|	break;						\
  |  |  369|  2.50k|}							\
  |  |  370|  2.50k|if (data->ifd[(i)]->count) {				\
  |  |  ------------------
  |  |  |  Branch (370:5): [True: 620, False: 1.88k]
  |  |  ------------------
  |  |  371|    620|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  372|    620|		"ExifData", "Attempt to load IFD "	\
  |  |  373|    620|		"'%s' multiple times detected. "	\
  |  |  374|    620|		"Skipping...",				\
  |  |  375|    620|		exif_ifd_get_name (i));			\
  |  |  376|    620|	break;						\
  |  |  377|  1.88k|}							\
  |  |  378|  1.88k|if (data->priv->ifd_used[i]) {				\
  |  |  ------------------
  |  |  |  Branch (378:5): [True: 1.20k, False: 684]
  |  |  ------------------
  |  |  379|  1.20k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,	\
  |  |  380|  1.20k|		"ExifData", "Attempt to load IFD "	\
  |  |  381|  1.20k|		"'%s' multiple times detected. "	\
  |  |  382|  1.20k|		"Skipping...",				\
  |  |  383|  1.20k|		exif_ifd_get_name (i));			\
  |  |  384|  1.20k|	break;						\
  |  |  385|  1.20k|} else {						\
  |  |  386|    684|	data->priv->ifd_used[i] = 1;			\
  |  |  387|    684|}
  ------------------
  503|    684|				exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o,
  504|    684|					recursion_cost + level_cost(n));
  505|    684|				break;
  506|  2.08k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
  ------------------
  |  Branch (506:4): [True: 2.08k, False: 23.7k]
  ------------------
  507|  2.08k|				thumbnail_offset = o;
  508|  2.08k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (508:9): [True: 1.75k, False: 331]
  |  Branch (508:29): [True: 708, False: 1.04k]
  ------------------
  509|    708|					exif_data_load_data_thumbnail (data, d,
  510|    708|								       ds, thumbnail_offset,
  511|    708|								       thumbnail_length);
  512|  2.08k|				break;
  513|  1.76k|			case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH:
  ------------------
  |  Branch (513:4): [True: 1.76k, False: 24.0k]
  ------------------
  514|  1.76k|				thumbnail_length = o;
  515|  1.76k|				if (thumbnail_offset && thumbnail_length)
  ------------------
  |  Branch (515:9): [True: 1.09k, False: 676]
  |  Branch (515:29): [True: 829, False: 261]
  ------------------
  516|    829|					exif_data_load_data_thumbnail (data, d,
  517|    829|								       ds, thumbnail_offset,
  518|    829|								       thumbnail_length);
  519|  1.76k|				break;
  520|      0|			default:
  ------------------
  |  Branch (520:4): [True: 0, False: 25.8k]
  ------------------
  521|      0|				return;
  522|  25.8k|			}
  523|  25.8k|			break;
  524|  2.10M|		default:
  ------------------
  |  Branch (524:3): [True: 2.10M, False: 29.4k]
  ------------------
  525|       |
  526|       |			/*
  527|       |			 * If we don't know the tag, don't fail. It could be that new 
  528|       |			 * versions of the standard have defined additional tags. Note that
  529|       |			 * 0 is a valid tag in the GPS IFD.
  530|       |			 */
  531|  2.10M|			if (!exif_tag_get_name_in_ifd (tag, ifd)) {
  ------------------
  |  Branch (531:8): [True: 1.90M, False: 208k]
  ------------------
  532|       |
  533|       |				/*
  534|       |				 * Special case: Tag and format 0. That's against specification
  535|       |				 * (at least up to 2.2). But Photoshop writes it anyways.
  536|       |				 */
  537|  1.90M|				if (!memcmp (d + offset + 12 * i, "\0\0\0\0", 4)) {
  ------------------
  |  Branch (537:9): [True: 187k, False: 1.71M]
  ------------------
  538|   187k|					exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  539|   187k|						  "Skipping empty entry at position %u in '%s'.", i, 
  540|   187k|						  exif_ifd_get_name (ifd));
  541|   187k|					break;
  542|   187k|				}
  543|  1.71M|				exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  544|  1.71M|					  "Unknown tag 0x%04x (entry %u in '%s'). Please report this tag "
  545|  1.71M|					  "to <libexif-devel@lists.sourceforge.net>.", tag, i,
  546|  1.71M|					  exif_ifd_get_name (ifd));
  547|  1.71M|				if (data->priv->options & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS)
  ------------------
  |  Branch (547:9): [True: 1.71M, False: 0]
  ------------------
  548|  1.71M|					break;
  549|  1.71M|			}
  550|   208k|			entry = exif_entry_new_mem (data->priv->mem);
  551|   208k|			if (!entry) {
  ------------------
  |  Branch (551:8): [True: 0, False: 208k]
  ------------------
  552|      0|				  exif_log (data->priv->log, EXIF_LOG_CODE_NO_MEMORY, "ExifData",
  553|      0|                                          "Could not allocate memory");
  554|      0|				  return;
  555|      0|			}
  556|   208k|			if (exif_data_load_data_entry (data, entry, d, ds,
  ------------------
  |  Branch (556:8): [True: 29.4k, False: 179k]
  ------------------
  557|   208k|						   offset + 12 * i))
  558|  29.4k|				exif_content_add_entry (data->ifd[ifd], entry);
  559|   208k|			exif_entry_unref (entry);
  560|   208k|			break;
  561|  2.13M|		}
  562|  2.13M|	}
  563|  29.2k|}
exif-data.c:level_cost:
  396|  11.3k|{
  397|  11.3k|    static const double log_1_1 = 0.09531017980432493;
  398|       |
  399|       |	/* Adding 0.1 protects against the case where n==1 */
  400|  11.3k|	return ceil(log(n + 0.1)/log_1_1);
  401|  11.3k|}
exif-data.c:exif_data_load_data_thumbnail:
  340|  1.53k|{
  341|       |	/* Sanity checks */
  342|  1.53k|	if (o >= ds) {
  ------------------
  |  Branch (342:6): [True: 0, False: 1.53k]
  ------------------
  343|      0|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o);
  344|      0|		return;
  345|      0|	}
  346|  1.53k|	if (exif_check_overflow (o,ds,s)) {
  ------------------
  |  Branch (346:6): [True: 312, False: 1.22k]
  ------------------
  347|    312|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o);
  348|    312|		return;
  349|    312|	}
  350|  1.22k|	if (data->data) 
  ------------------
  |  Branch (350:6): [True: 1.02k, False: 199]
  ------------------
  351|  1.02k|		exif_mem_free (data->priv->mem, data->data);
  352|  1.22k|	if (!(data->data = exif_data_alloc (data, s))) {
  ------------------
  |  Branch (352:6): [True: 0, False: 1.22k]
  ------------------
  353|      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))
  ------------------
  354|      0|		data->size = 0;
  355|      0|		return;
  356|      0|	}
  357|  1.22k|	data->size = s;
  358|  1.22k|	memcpy (data->data, d + o, s);
  359|  1.22k|}
exif-data.c:exif_data_load_data_entry:
  169|   208k|{
  170|   208k|	unsigned int s, doff;
  171|   208k|	unsigned char formatsize;
  172|       |
  173|   208k|	entry->tag        = exif_get_short (d + offset + 0, data->priv->order);
  174|   208k|	entry->format     = exif_get_short (d + offset + 2, data->priv->order);
  175|   208k|	entry->components = exif_get_long  (d + offset + 4, data->priv->order);
  176|       |
  177|       |	/* FIXME: should use exif_tag_get_name_in_ifd here but entry->parent 
  178|       |	 * has not been set yet
  179|       |	 */
  180|   208k|	exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  181|   208k|		  "Loading entry 0x%x ('%s')...", entry->tag,
  182|   208k|		  exif_tag_get_name (entry->tag));
  183|       |
  184|       |	/* {0,1,2,4,8} x { 0x00000000 .. 0xffffffff } 
  185|       |	 *   -> { 0x000000000 .. 0x7fffffff8 } */
  186|       |
  187|   208k|	formatsize = exif_format_get_size(entry->format);
  188|   208k|	if (!formatsize || (entry->components >= (0xffffffff / formatsize)))
  ------------------
  |  Branch (188:6): [True: 156k, False: 51.8k]
  |  Branch (188:21): [True: 1.99k, False: 49.8k]
  ------------------
  189|   158k|		return 0;
  190|       |
  191|  49.8k|	s = formatsize * entry->components;
  192|  49.8k|	if ((s < entry->components) || (s == 0)) {
  ------------------
  |  Branch (192:6): [True: 0, False: 49.8k]
  |  Branch (192:33): [True: 3.46k, False: 46.3k]
  ------------------
  193|  3.46k|		return 0;
  194|  3.46k|	}
  195|       |
  196|       |	/*
  197|       |	 * Size? If bigger than 4 bytes, the actual data is not
  198|       |	 * in the entry but somewhere else (offset).
  199|       |	 */
  200|  46.3k|	if (s > 4)
  ------------------
  |  Branch (200:6): [True: 35.9k, False: 10.4k]
  ------------------
  201|  35.9k|		doff = exif_get_long (d + offset + 8, data->priv->order);
  202|  10.4k|	else
  203|  10.4k|		doff = offset + 8;
  204|       |
  205|       |	/* Sanity checks */
  206|  46.3k|	if (doff >= size) {
  ------------------
  |  Branch (206:6): [True: 14.2k, False: 32.0k]
  ------------------
  207|  14.2k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  208|  14.2k|				  "Tag starts past end of buffer (%u > %u)", doff, size);
  209|  14.2k|		return 0;
  210|  14.2k|	}
  211|       |
  212|  32.0k|	if (s > size - doff) {
  ------------------
  |  Branch (212:6): [True: 2.61k, False: 29.4k]
  ------------------
  213|  2.61k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  214|  2.61k|				  "Tag data goes past end of buffer (%u > %u)", doff+s, size);
  215|  2.61k|		return 0;
  216|  2.61k|	}
  217|       |
  218|  29.4k|	entry->data = exif_data_alloc (data, s);
  219|  29.4k|	if (entry->data) {
  ------------------
  |  Branch (219:6): [True: 29.4k, False: 0]
  ------------------
  220|  29.4k|		entry->size = s;
  221|  29.4k|		memcpy (entry->data, d + doff, s);
  222|  29.4k|	} else {
  223|      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))
  ------------------
  224|      0|		return 0;
  225|      0|	}
  226|       |
  227|       |	/* If this is the MakerNote, remember the offset */
  228|  29.4k|	if (entry->tag == EXIF_TAG_MAKER_NOTE) {
  ------------------
  |  Branch (228:6): [True: 9.10k, False: 20.3k]
  ------------------
  229|  9.10k|		if (!entry->data) {
  ------------------
  |  Branch (229:7): [True: 0, False: 9.10k]
  ------------------
  230|      0|			exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
  231|      0|					  "MakerNote found with empty data");	
  232|  9.10k|		} else if (entry->size > 6) {
  ------------------
  |  Branch (232:14): [True: 8.14k, False: 962]
  ------------------
  233|  8.14k|			exif_log (data->priv->log,
  234|  8.14k|					       EXIF_LOG_CODE_DEBUG, "ExifData",
  235|  8.14k|					       "MakerNote found (%02x %02x %02x %02x "
  236|  8.14k|					       "%02x %02x %02x...).",
  237|  8.14k|					       entry->data[0], entry->data[1], entry->data[2],
  238|  8.14k|					       entry->data[3], entry->data[4], entry->data[5],
  239|  8.14k|					       entry->data[6]);
  240|  8.14k|		}
  241|  9.10k|		data->priv->offset_mnote = doff;
  242|  9.10k|	}
  243|  29.4k|	return 1;
  244|  29.4k|}
exif-data.c:interpret_maker_note:
  818|  8.82k|{
  819|  8.82k|	int mnoteid;
  820|  8.82k|	ExifEntry* e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE);
  ------------------
  |  |  253|  8.82k|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 0, False: 8.82k]
  |  |  ------------------
  |  |  254|  8.82k|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|  8.82k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 0, False: 8.82k]
  |  |  ------------------
  |  |  256|  8.82k|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|  8.82k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 7.63k, False: 1.18k]
  |  |  ------------------
  |  |  258|  8.82k|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|  8.82k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 1.18k]
  |  |  ------------------
  |  |  260|  1.18k|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|  1.18k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 1.18k]
  |  |  ------------------
  |  |  262|  1.18k|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  821|  8.82k|	if (!e)
  ------------------
  |  Branch (821:6): [True: 1.18k, False: 7.63k]
  ------------------
  822|  1.18k|		return;
  823|       |	
  824|  7.63k|	if ((mnoteid = exif_mnote_data_olympus_identify (data, e)) != 0) {
  ------------------
  |  Branch (824:6): [True: 4.25k, False: 3.37k]
  ------------------
  825|  4.25k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  826|  4.25k|			"ExifData", "Olympus MakerNote variant type %d", mnoteid);
  827|  4.25k|		data->priv->md = exif_mnote_data_olympus_new (data->priv->mem);
  828|       |
  829|  4.25k|	} else if ((mnoteid = exif_mnote_data_canon_identify (data, e)) != 0) {
  ------------------
  |  Branch (829:13): [True: 948, False: 2.43k]
  ------------------
  830|    948|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  831|    948|			"ExifData", "Canon MakerNote variant type %d", mnoteid);
  832|    948|		data->priv->md = exif_mnote_data_canon_new (data->priv->mem, data->priv->options);
  833|       |
  834|  2.43k|	} else if ((mnoteid = exif_mnote_data_fuji_identify (data, e)) != 0) {
  ------------------
  |  Branch (834:13): [True: 1.10k, False: 1.32k]
  ------------------
  835|  1.10k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  836|  1.10k|			"ExifData", "Fuji MakerNote variant type %d", mnoteid);
  837|  1.10k|		data->priv->md = exif_mnote_data_fuji_new (data->priv->mem);
  838|       |
  839|       |	/* NOTE: Must do Pentax detection last because some of the
  840|       |	 * heuristics are pretty general. */
  841|  1.32k|	} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
  ------------------
  |  Branch (841:13): [True: 1.10k, False: 220]
  ------------------
  842|  1.10k|		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  843|  1.10k|			"ExifData", "Pentax MakerNote variant type %d", mnoteid);
  844|  1.10k|		data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
  845|  1.10k|	}
  846|       |/* Marcus: disabled until apple makernote can also be saved
  847|       |	else if ((mnoteid = exif_mnote_data_apple_identify (data, e)) != 0) {
  848|       |		exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
  849|       |			"ExifData", "Apple MakerNote variant type %d", mnoteid);
  850|       |		data->priv->md = exif_mnote_data_apple_new (data->priv->mem);
  851|       |	}
  852|       |*/
  853|       |
  854|       |	/* 
  855|       |	 * If we are able to interpret the maker note, do so.
  856|       |	 */
  857|  7.63k|	if (data->priv->md) {
  ------------------
  |  Branch (857:6): [True: 7.41k, False: 220]
  ------------------
  858|  7.41k|		exif_mnote_data_log (data->priv->md, data->priv->log);
  859|  7.41k|		exif_mnote_data_set_byte_order (data->priv->md,
  860|  7.41k|						data->priv->order);
  861|  7.41k|		exif_mnote_data_set_offset (data->priv->md,
  862|  7.41k|					    data->priv->offset_mnote);
  863|  7.41k|		exif_mnote_data_load (data->priv->md, d, ds);
  864|  7.41k|	}
  865|  7.63k|}
exif-data.c:exif_data_alloc:
   77|  30.6k|{
   78|  30.6k|	void *d;
   79|       |
   80|  30.6k|	if (!data || !i) 
  ------------------
  |  Branch (80:6): [True: 0, False: 30.6k]
  |  Branch (80:15): [True: 0, False: 30.6k]
  ------------------
   81|      0|		return NULL;
   82|       |
   83|  30.6k|	d = exif_mem_alloc (data->priv->mem, i);
   84|  30.6k|	if (d) 
  ------------------
  |  Branch (84:6): [True: 30.6k, False: 0]
  ------------------
   85|  30.6k|		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|  30.6k|}
exif-data.c:fix_func:
 1343|  44.1k|{
 1344|  44.1k|	switch (exif_content_get_ifd (c)) {
 1345|  8.82k|	case EXIF_IFD_1:
  ------------------
  |  Branch (1345:2): [True: 8.82k, False: 35.2k]
  ------------------
 1346|  8.82k|		if (c->parent->data)
  ------------------
  |  Branch (1346:7): [True: 164, False: 8.65k]
  ------------------
 1347|    164|			exif_content_fix (c);
 1348|  8.65k|		else if (c->count) {
  ------------------
  |  Branch (1348:12): [True: 623, False: 8.03k]
  ------------------
 1349|    623|			exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1350|    623|				  "No thumbnail but entries on thumbnail. These entries have been "
 1351|    623|				  "removed.");
 1352|  2.12k|			while (c->count) {
  ------------------
  |  Branch (1352:11): [True: 1.50k, False: 623]
  ------------------
 1353|  1.50k|				unsigned int cnt = c->count;
 1354|  1.50k|				exif_content_remove_entry (c, c->entries[c->count - 1]);
 1355|  1.50k|				if (cnt == c->count) {
  ------------------
  |  Branch (1355:9): [True: 0, False: 1.50k]
  ------------------
 1356|       |					/* safety net */
 1357|      0|					exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
 1358|      0|						  "failed to remove entry from entries.");
 1359|      0|					break;
 1360|      0|				}
 1361|  1.50k|			}
 1362|    623|		}
 1363|  8.82k|		break;
 1364|  35.2k|	default:
  ------------------
  |  Branch (1364:2): [True: 35.2k, False: 8.82k]
  ------------------
 1365|  35.2k|		exif_content_fix (c);
 1366|  44.1k|	}
 1367|  44.1k|}

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

exif_format_get_name:
   56|  44.4k|{
   57|  44.4k|	unsigned int i;
   58|       |
   59|  44.4k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   60|       |
   61|   265k|	for (i = 0; ExifFormatTable[i].name; i++)
  ------------------
  |  Branch (61:14): [True: 254k, False: 11.1k]
  ------------------
   62|   254k|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (62:7): [True: 33.2k, False: 221k]
  ------------------
   63|  33.2k|			return _(ExifFormatTable[i].name);
  ------------------
  |  |   31|  33.2k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
   64|  11.1k|	return NULL;
   65|  44.4k|}
exif_format_get_size:
   69|  1.23M|{
   70|  1.23M|	unsigned int i;
   71|       |
   72|  7.72M|	for (i = 0; ExifFormatTable[i].size; i++)
  ------------------
  |  Branch (72:14): [True: 7.46M, False: 257k]
  ------------------
   73|  7.46M|		if (ExifFormatTable[i].format == format)
  ------------------
  |  Branch (73:7): [True: 974k, False: 6.48M]
  ------------------
   74|   974k|			return ExifFormatTable[i].size;
   75|   257k|	return 0;
   76|  1.23M|}

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

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

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

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

exif-data.c:exif_check_overflow:
   60|  60.1k|{
   61|  60.1k|	return (offset >= datasize) || (structsize > datasize) ||
  ------------------
  |  Branch (61:9): [True: 29, False: 60.0k]
  |  Branch (61:33): [True: 18.7k, False: 41.2k]
  ------------------
   62|  41.2k|	       (offset > datasize - structsize);
  ------------------
  |  Branch (62:9): [True: 391, False: 40.8k]
  ------------------
   63|  60.1k|}
exif-mnote-data-canon.c:exif_check_overflow:
   60|  59.7k|{
   61|  59.7k|	return (offset >= datasize) || (structsize > datasize) ||
  ------------------
  |  Branch (61:9): [True: 1.18k, False: 58.5k]
  |  Branch (61:33): [True: 0, False: 58.5k]
  ------------------
   62|  58.5k|	       (offset > datasize - structsize);
  ------------------
  |  Branch (62:9): [True: 470, False: 58.1k]
  ------------------
   63|  59.7k|}
exif-mnote-data-canon.c:exif_check_mul_overflow:
   75|  46.4k|{
   76|  46.4k|	if (a && (b > max / a))
  ------------------
  |  Branch (76:6): [True: 15.5k, False: 30.8k]
  |  Branch (76:11): [True: 3.66k, False: 11.9k]
  ------------------
   77|  3.66k|		return 1;
   78|  42.7k|	*res = a * b;
   79|  42.7k|	return 0;
   80|  46.4k|}
exif-mnote-data-fuji.c:exif_check_overflow:
   60|  31.5k|{
   61|  31.5k|	return (offset >= datasize) || (structsize > datasize) ||
  ------------------
  |  Branch (61:9): [True: 787, False: 30.7k]
  |  Branch (61:33): [True: 0, False: 30.7k]
  ------------------
   62|  30.7k|	       (offset > datasize - structsize);
  ------------------
  |  Branch (62:9): [True: 647, False: 30.1k]
  ------------------
   63|  31.5k|}
exif-mnote-data-fuji.c:exif_check_mul_overflow:
   75|  23.0k|{
   76|  23.0k|	if (a && (b > max / a))
  ------------------
  |  Branch (76:6): [True: 8.45k, False: 14.5k]
  |  Branch (76:11): [True: 1.17k, False: 7.28k]
  ------------------
   77|  1.17k|		return 1;
   78|  21.8k|	*res = a * b;
   79|  21.8k|	return 0;
   80|  23.0k|}
exif-mnote-data-olympus.c:exif_check_overflow:
   60|   146k|{
   61|   146k|	return (offset >= datasize) || (structsize > datasize) ||
  ------------------
  |  Branch (61:9): [True: 3.37k, False: 142k]
  |  Branch (61:33): [True: 62, False: 142k]
  ------------------
   62|   142k|	       (offset > datasize - structsize);
  ------------------
  |  Branch (62:9): [True: 1.43k, False: 141k]
  ------------------
   63|   146k|}
exif-mnote-data-olympus.c:exif_check_mul_overflow:
   75|  95.9k|{
   76|  95.9k|	if (a && (b > max / a))
  ------------------
  |  Branch (76:6): [True: 49.7k, False: 46.2k]
  |  Branch (76:11): [True: 4.03k, False: 45.7k]
  ------------------
   77|  4.03k|		return 1;
   78|  91.9k|	*res = a * b;
   79|  91.9k|	return 0;
   80|  95.9k|}
exif-mnote-data-pentax.c:exif_check_overflow:
   60|  28.0k|{
   61|  28.0k|	return (offset >= datasize) || (structsize > datasize) ||
  ------------------
  |  Branch (61:9): [True: 927, False: 27.1k]
  |  Branch (61:33): [True: 0, False: 27.1k]
  ------------------
   62|  27.1k|	       (offset > datasize - structsize);
  ------------------
  |  Branch (62:9): [True: 367, False: 26.7k]
  ------------------
   63|  28.0k|}
exif-mnote-data-pentax.c:exif_check_mul_overflow:
   75|  18.1k|{
   76|  18.1k|	if (a && (b > max / a))
  ------------------
  |  Branch (76:6): [True: 9.50k, False: 8.66k]
  |  Branch (76:11): [True: 186, False: 9.32k]
  ------------------
   77|    186|		return 1;
   78|  17.9k|	*res = a * b;
   79|  17.9k|	return 0;
   80|  18.1k|}

exif_tag_table_count:
  978|  15.0M|{
  979|  15.0M|	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
  980|  15.0M|}
exif_tag_table_get_tag:
  985|  5.99M|{
  986|  5.99M|	return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0;
  ------------------
  |  Branch (986:9): [True: 5.99M, False: 0]
  ------------------
  987|  5.99M|}
exif_tag_get_name_in_ifd:
 1043|  2.98M|{
 1044|  2.98M|	unsigned int i;
 1045|  2.98M|	int first;
 1046|       |
 1047|  2.98M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1047:6): [True: 0, False: 2.98M]
  ------------------
 1048|      0|		return NULL;
 1049|  2.98M|	first = exif_tag_table_first(tag);
 1050|  2.98M|	if (first < 0)
  ------------------
  |  Branch (1050:6): [True: 1.19M, False: 1.79M]
  ------------------
 1051|  1.19M|		return NULL;
 1052|       |
 1053|  3.24M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1053:18): [True: 3.24M, False: 219]
  ------------------
 1054|  3.24M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1054:7): [True: 1.93M, False: 1.30M]
  ------------------
 1055|  1.93M|		   if (RECORDED)
  ------------------
  |  | 1035|  1.93M|#define RECORDED \
  |  | 1036|  1.93M|((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1036:2): [True: 477k, False: 1.45M]
  |  |  ------------------
  |  | 1037|  1.93M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1037:2): [True: 0, False: 1.45M]
  |  |  ------------------
  |  | 1038|  1.93M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \
  |  |  ------------------
  |  |  |  Branch (1038:2): [True: 1.66k, False: 1.45M]
  |  |  ------------------
  |  | 1039|  1.93M| (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED))
  |  |  ------------------
  |  |  |  Branch (1039:2): [True: 4.50k, False: 1.45M]
  |  |  ------------------
  ------------------
 1056|   484k|			   break;
 1057|  1.93M|		} else
 1058|  1.30M|			return NULL; /* Recorded tag not found in the table */
 1059|  3.24M|	}
 1060|   484k|	return ExifTagTable[i].name;
 1061|  1.79M|}
exif_tag_get_name:
 1152|   243k|{
 1153|   243k|	return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd);
 1154|   243k|}
exif_tag_get_support_level_in_ifd:
 1261|  6.00M|{
 1262|  6.00M|	if (ifd >= EXIF_IFD_COUNT)
  ------------------
  |  Branch (1262:6): [True: 0, False: 6.00M]
  ------------------
 1263|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1264|       |
 1265|  6.00M|	if (t >= EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1265:6): [True: 6.00M, False: 0]
  ------------------
 1266|  6.00M|		return get_support_level_any_type (tag, ifd);
 1267|       |
 1268|      0|	return get_support_level_in_ifd (tag, ifd, t);
 1269|  6.00M|}
exif-tag.c:exif_tag_table_first:
 1016|  8.99M|{
 1017|  8.99M|	int i;
 1018|  8.99M|	const struct TagEntry *entry = bsearch(&tag, ExifTagTable,
 1019|  8.99M|		exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
 1020|  8.99M|	if (!entry)
  ------------------
  |  Branch (1020:6): [True: 1.19M, False: 7.80M]
  ------------------
 1021|  1.19M|		return -1;	/* Not found */
 1022|       |
 1023|       |	/* Calculate index of found entry */
 1024|  7.80M|	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|  8.11M|	while ((i > 0) && (ExifTagTable[i-1].tag == tag)) {
  ------------------
  |  Branch (1029:9): [True: 7.17M, False: 940k]
  |  Branch (1029:20): [True: 312k, False: 6.86M]
  ------------------
 1030|   312k|		--i;
 1031|   312k|	}
 1032|  7.80M|	return i;
 1033|  8.99M|}
exif-tag.c:match_tag:
 1003|  60.7M|{
 1004|  60.7M|	return *(int*)tag - ((struct TagEntry *)entry)->tag;
 1005|  60.7M|}
exif-tag.c:exif_tag_get_stuff:
 1130|   243k|{
 1131|       |	/* Search IFDs in this order, in decreasing order of number of valid tags */
 1132|   243k|	static const ExifIfd ifds[EXIF_IFD_COUNT] = {
 1133|   243k|		EXIF_IFD_EXIF,
 1134|   243k|		EXIF_IFD_0,
 1135|   243k|		EXIF_IFD_1,
 1136|   243k|		EXIF_IFD_INTEROPERABILITY,
 1137|   243k|		EXIF_IFD_GPS
 1138|   243k|	};
 1139|   243k|	int i;
 1140|   843k|	for (i=0; i<EXIF_IFD_COUNT; i++) {
  ------------------
  |  Branch (1140:12): [True: 821k, False: 22.0k]
  ------------------
 1141|   821k|		const char *result = func(tag, ifds[i]);
 1142|   821k|		if (result != NULL) {
  ------------------
  |  Branch (1142:7): [True: 221k, False: 600k]
  ------------------
 1143|   221k|			return result;
 1144|   221k|		}
 1145|   821k|	}
 1146|  22.0k|	return (const char *) NULL;
 1147|   243k|}
exif-tag.c:get_support_level_any_type:
 1227|  6.00M|{
 1228|  6.00M|	unsigned int i;
 1229|  6.00M|	int first = exif_tag_table_first(tag);
 1230|  6.00M|	if (first < 0)
  ------------------
  |  Branch (1230:6): [True: 0, False: 6.00M]
  ------------------
 1231|      0|		return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1232|       |
 1233|  10.2M|	for (i = first; ExifTagTable[i].name; i++) {
  ------------------
  |  Branch (1233:18): [True: 10.2M, False: 17.8k]
  ------------------
 1234|  10.2M|		if (ExifTagTable[i].tag == tag) {
  ------------------
  |  Branch (1234:7): [True: 6.11M, False: 4.09M]
  ------------------
 1235|       |			/*
 1236|       |			 * Check whether the support level is the same for all possible
 1237|       |			 * data types and isn't marked not recorded.
 1238|       |			 */
 1239|  6.11M|			const ExifSupportLevel supp = ExifTagTable[i].esl[ifd][0];
 1240|       |			/* If level is not recorded, keep searching for another */
 1241|  6.11M|			if (supp != EXIF_SUPPORT_LEVEL_NOT_RECORDED) {
  ------------------
  |  Branch (1241:8): [True: 1.98M, False: 4.13M]
  ------------------
 1242|  1.98M|				unsigned int dt;
 1243|  9.80M|				for (dt = 0; dt < EXIF_DATA_TYPE_COUNT; ++dt) {
  ------------------
  |  Branch (1243:18): [True: 7.91M, False: 1.89M]
  ------------------
 1244|  7.91M|					if (ExifTagTable[i].esl[ifd][dt] != supp)
  ------------------
  |  Branch (1244:10): [True: 89.9k, False: 7.82M]
  ------------------
 1245|  89.9k|						break;
 1246|  7.91M|				}
 1247|  1.98M|				if (dt == EXIF_DATA_TYPE_COUNT)
  ------------------
  |  Branch (1247:9): [True: 1.89M, False: 89.9k]
  ------------------
 1248|       |					/* Support level is always the same, so return it */
 1249|  1.89M|					return supp;
 1250|  1.98M|			}
 1251|       |			/* Keep searching the table for another tag for our IFD */
 1252|  6.11M|		} else {
 1253|  4.09M|			break; /* We've reached the end of the matching tags */
 1254|  4.09M|		}
 1255|  10.2M|	}
 1256|  4.11M|	return EXIF_SUPPORT_LEVEL_UNKNOWN;
 1257|  6.00M|}

exif_get_sshort:
   90|   166M|{
   91|   166M|	if (!buf) return 0;
  ------------------
  |  Branch (91:6): [True: 393, False: 166M]
  ------------------
   92|   166M|        switch (order) {
  ------------------
  |  Branch (92:17): [True: 166M, False: 0]
  ------------------
   93|   114k|        case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (93:9): [True: 114k, False: 166M]
  ------------------
   94|   114k|                return (((unsigned int)buf[0] << 8) | buf[1]);
   95|   166M|        case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (95:9): [True: 166M, False: 114k]
  ------------------
   96|   166M|                return (((unsigned int)buf[1] << 8) | buf[0]);
   97|   166M|        }
   98|       |
   99|       |	/* Won't be reached */
  100|      0|	return (0);
  101|   166M|}
exif_get_short:
  105|   166M|{
  106|   166M|	return (exif_get_sshort (buf, order) & 0xffff);
  107|   166M|}
exif_set_sshort:
  111|   125k|{
  112|   125k|	if (!b) return;
  ------------------
  |  Branch (112:6): [True: 0, False: 125k]
  ------------------
  113|   125k|	switch (order) {
  ------------------
  |  Branch (113:10): [True: 125k, False: 0]
  ------------------
  114|  4.87k|	case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (114:2): [True: 4.87k, False: 120k]
  ------------------
  115|  4.87k|		b[0] = (unsigned char) (value >> 8);
  116|  4.87k|		b[1] = (unsigned char) value;
  117|  4.87k|		break;
  118|   120k|	case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (118:2): [True: 120k, False: 4.87k]
  ------------------
  119|   120k|		b[0] = (unsigned char) value;
  120|   120k|		b[1] = (unsigned char) (value >> 8);
  121|   120k|		break;
  122|   125k|	}
  123|   125k|}
exif_set_short:
  127|   125k|{
  128|   125k|	exif_set_sshort (b, order, value);
  129|   125k|}
exif_get_slong:
  133|  1.08M|{
  134|  1.08M|	if (!b) return 0;
  ------------------
  |  Branch (134:6): [True: 567, False: 1.08M]
  ------------------
  135|  1.08M|        switch (order) {
  ------------------
  |  Branch (135:17): [True: 1.08M, False: 0]
  ------------------
  136|  81.3k|        case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (136:9): [True: 81.3k, False: 1.00M]
  ------------------
  137|  81.3k|                return (((uint32_t)b[0] << 24) | ((uint32_t)b[1] << 16) | ((uint32_t)b[2] << 8) | (uint32_t)b[3]);
  138|  1.00M|        case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (138:9): [True: 1.00M, False: 81.3k]
  ------------------
  139|  1.00M|                return (((uint32_t)b[3] << 24) | ((uint32_t)b[2] << 16) | ((uint32_t)b[1] << 8) | (uint32_t)b[0]);
  140|  1.08M|        }
  141|       |
  142|       |	/* Won't be reached */
  143|      0|	return (0);
  144|  1.08M|}
exif_set_slong:
  148|   118k|{
  149|   118k|	if (!b) return;
  ------------------
  |  Branch (149:6): [True: 0, False: 118k]
  ------------------
  150|   118k|	switch (order) {
  ------------------
  |  Branch (150:10): [True: 118k, False: 0]
  ------------------
  151|  8.95k|	case EXIF_BYTE_ORDER_MOTOROLA:
  ------------------
  |  Branch (151:2): [True: 8.95k, False: 109k]
  ------------------
  152|  8.95k|		b[0] = (unsigned char) (value >> 24);
  153|  8.95k|		b[1] = (unsigned char) (value >> 16);
  154|  8.95k|		b[2] = (unsigned char) (value >> 8);
  155|  8.95k|		b[3] = (unsigned char) value;
  156|  8.95k|		break;
  157|   109k|	case EXIF_BYTE_ORDER_INTEL:
  ------------------
  |  Branch (157:2): [True: 109k, False: 8.95k]
  ------------------
  158|   109k|		b[3] = (unsigned char) (value >> 24);
  159|   109k|		b[2] = (unsigned char) (value >> 16);
  160|   109k|		b[1] = (unsigned char) (value >> 8);
  161|   109k|		b[0] = (unsigned char) value;
  162|   109k|		break;
  163|   118k|	}
  164|   118k|}
exif_get_long:
  168|   831k|{
  169|   831k|        return (exif_get_slong (buf, order) & 0xffffffff);
  170|   831k|}
exif_set_long:
  174|  91.7k|{
  175|  91.7k|	exif_set_slong (b, order, value);
  176|  91.7k|}
exif_get_srational:
  180|  76.6k|{
  181|  76.6k|	ExifSRational r;
  182|       |
  183|  76.6k|	r.numerator   = buf ? exif_get_slong (buf, order) : 0;
  ------------------
  |  Branch (183:18): [True: 76.4k, False: 202]
  ------------------
  184|  76.6k|	r.denominator = buf ? exif_get_slong (buf + 4, order) : 0;
  ------------------
  |  Branch (184:18): [True: 76.4k, False: 202]
  ------------------
  185|       |
  186|  76.6k|	return (r);
  187|  76.6k|}
exif_get_rational:
  191|  98.6k|{
  192|  98.6k|	ExifRational r;
  193|       |
  194|  98.6k|	r.numerator   = buf ? exif_get_long (buf, order) : 0;
  ------------------
  |  Branch (194:18): [True: 98.5k, False: 69]
  ------------------
  195|  98.6k|	r.denominator = buf ? exif_get_long (buf + 4, order) : 0;
  ------------------
  |  Branch (195:18): [True: 98.5k, False: 69]
  ------------------
  196|       |
  197|  98.6k|	return (r);
  198|  98.6k|}
exif_set_rational:
  203|  45.8k|{
  204|  45.8k|	if (!buf) return;
  ------------------
  |  Branch (204:6): [True: 0, False: 45.8k]
  ------------------
  205|  45.8k|	exif_set_long (buf, order, value.numerator);
  206|  45.8k|	exif_set_long (buf + 4, order, value.denominator);
  207|  45.8k|}
exif_set_srational:
  212|  13.2k|{
  213|  13.2k|	if (!buf) return;
  ------------------
  |  Branch (213:6): [True: 0, False: 13.2k]
  ------------------
  214|  13.2k|	exif_set_slong (buf, order, value.numerator);
  215|  13.2k|	exif_set_slong (buf + 4, order, value.denominator);
  216|  13.2k|}
exif_convert_utf16_to_utf8:
  223|    123|{
  224|    123|	if (!outlen) {
  ------------------
  |  Branch (224:6): [True: 0, False: 123]
  ------------------
  225|      0|		return;
  226|      0|	}
  227|   105k|	for (;;) {
  228|   105k|		ExifShort v;
  229|   105k|		if (inlen < 2)
  ------------------
  |  Branch (229:7): [True: 0, False: 105k]
  ------------------
  230|      0|			break;
  231|   105k|		v = exif_get_short(in, EXIF_BYTE_ORDER_INTEL);
  232|   105k|		if (!v)
  ------------------
  |  Branch (232:7): [True: 93, False: 105k]
  ------------------
  233|     93|			break;
  234|   105k|		if (v < 0x80) {
  ------------------
  |  Branch (234:7): [True: 1.07k, False: 104k]
  ------------------
  235|  1.07k|			if (outlen > 1) {
  ------------------
  |  Branch (235:8): [True: 1.06k, False: 10]
  ------------------
  236|  1.06k|				*out++ = (char)v;
  237|  1.06k|				outlen--;
  238|  1.06k|			} else {
  239|     10|				break;
  240|     10|			}
  241|   104k|		} else if (v < 0x800) {
  ------------------
  |  Branch (241:14): [True: 2.76k, False: 101k]
  ------------------
  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|   101k|		} else {
  250|   101k|			if (outlen > 3) {
  ------------------
  |  Branch (250:8): [True: 101k, False: 10]
  ------------------
  251|   101k|				*out++ = ((v >> 12) & 0x0F) | 0xE0;
  252|   101k|				*out++ = ((v >> 6) & 0x3F) | 0x80;
  253|   101k|				*out++ = (v & 0x3F) | 0x80;
  254|   101k|				outlen -= 3;
  255|   101k|			} else {
  256|     10|				break;
  257|     10|			}
  258|   101k|		}
  259|   105k|		in += 2;
  260|   105k|		inlen -= 2;
  261|   105k|	}
  262|    123|	*out = 0;
  263|    123|}

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

mnote_fuji_entry_get_value:
  194|  10.1k|{
  195|  10.1k|	ExifLong  vl;
  196|  10.1k|	ExifSLong vsl;
  197|  10.1k|	ExifShort vs, vs2;
  198|  10.1k|	ExifSShort vss;
  199|  10.1k|	ExifRational vr;
  200|  10.1k|	ExifSRational vsr;
  201|  10.1k|	int i, j;
  202|       |
  203|  10.1k|	if (!entry) return (NULL);
  ------------------
  |  Branch (203:6): [True: 0, False: 10.1k]
  ------------------
  204|  10.1k|	if (maxlen < 1) return NULL;
  ------------------
  |  Branch (204:6): [True: 0, False: 10.1k]
  ------------------
  205|       |
  206|  10.1k|	memset (val, 0, maxlen);
  207|  10.1k|	maxlen--;
  208|       |
  209|  10.1k|	switch (entry->tag) {
  210|  1.18k|	  case MNOTE_FUJI_TAG_VERSION:
  ------------------
  |  Branch (210:4): [True: 1.18k, False: 8.93k]
  ------------------
  211|  1.18k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   33|  1.18k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.18k|{                                                               \
  |  |   35|  1.18k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 700, False: 483]
  |  |  ------------------
  |  |   36|    700|                snprintf (v, maxlen,	                        \
  |  |   37|    700|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    700|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    700|                        "expected '%s'."),                      \
  |  |   39|    700|                        exif_format_get_name (format),          \
  |  |   40|    700|                        exif_format_get_name (target));         \
  |  |   41|    700|                break;                                          \
  |  |   42|    700|        }                                                       \
  |  |   43|  1.18k|}
  ------------------
  212|    483|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   45|    483|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    483|{                                                                       \
  |  |   47|    483|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 282, False: 201]
  |  |  ------------------
  |  |   48|    282|                snprintf (v, maxlen,                                    \
  |  |   49|    282|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    282|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    282|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    282|                break;                                                  \
  |  |   52|    282|        }                                                               \
  |  |   53|    483|}
  ------------------
  213|    201|		memcpy (val, entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    201|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 201]
  |  |  ------------------
  ------------------
  214|    201|		break;
  215|    211|	  case MNOTE_FUJI_TAG_SHARPNESS:
  ------------------
  |  Branch (215:4): [True: 211, False: 9.91k]
  ------------------
  216|    472|	  case MNOTE_FUJI_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (216:4): [True: 261, False: 9.86k]
  ------------------
  217|    677|	  case MNOTE_FUJI_TAG_COLOR:
  ------------------
  |  Branch (217:4): [True: 205, False: 9.91k]
  ------------------
  218|    931|  	  case MNOTE_FUJI_TAG_TONE:
  ------------------
  |  Branch (218:6): [True: 254, False: 9.86k]
  ------------------
  219|  1.16k|	  case MNOTE_FUJI_TAG_FLASH_MODE:
  ------------------
  |  Branch (219:4): [True: 238, False: 9.88k]
  ------------------
  220|  1.43k|	  case MNOTE_FUJI_TAG_MACRO:
  ------------------
  |  Branch (220:4): [True: 269, False: 9.85k]
  ------------------
  221|  1.78k|	  case MNOTE_FUJI_TAG_FOCUS_MODE:
  ------------------
  |  Branch (221:4): [True: 349, False: 9.77k]
  ------------------
  222|  2.00k|	  case MNOTE_FUJI_TAG_SLOW_SYNC:
  ------------------
  |  Branch (222:4): [True: 216, False: 9.90k]
  ------------------
  223|  2.21k|	  case MNOTE_FUJI_TAG_PICTURE_MODE:
  ------------------
  |  Branch (223:4): [True: 215, False: 9.90k]
  ------------------
  224|  2.42k|	  case MNOTE_FUJI_TAG_CONT_TAKING:
  ------------------
  |  Branch (224:4): [True: 209, False: 9.91k]
  ------------------
  225|  2.62k|	  case MNOTE_FUJI_TAG_FINEPIX_COLOR:
  ------------------
  |  Branch (225:4): [True: 199, False: 9.92k]
  ------------------
  226|  2.84k|	  case MNOTE_FUJI_TAG_BLUR_CHECK:
  ------------------
  |  Branch (226:4): [True: 216, False: 9.90k]
  ------------------
  227|  3.04k|	  case MNOTE_FUJI_TAG_FOCUS_CHECK:
  ------------------
  |  Branch (227:4): [True: 206, False: 9.91k]
  ------------------
  228|  3.24k|	  case MNOTE_FUJI_TAG_AUTO_EXPOSURE_CHECK:
  ------------------
  |  Branch (228:4): [True: 200, False: 9.92k]
  ------------------
  229|  3.81k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE:
  ------------------
  |  Branch (229:4): [True: 564, False: 9.55k]
  ------------------
  230|  4.04k|	  case MNOTE_FUJI_TAG_FILM_MODE:
  ------------------
  |  Branch (230:4): [True: 228, False: 9.89k]
  ------------------
  231|  4.28k|	  case MNOTE_FUJI_TAG_DYNAMIC_RANGE_SETTING:
  ------------------
  |  Branch (231:4): [True: 243, False: 9.87k]
  ------------------
  232|  4.28k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|  4.28k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  4.28k|{                                                               \
  |  |   35|  4.28k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 2.28k, False: 1.99k]
  |  |  ------------------
  |  |   36|  2.28k|                snprintf (v, maxlen,	                        \
  |  |   37|  2.28k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.28k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|  2.28k|                        "expected '%s'."),                      \
  |  |   39|  2.28k|                        exif_format_get_name (format),          \
  |  |   40|  2.28k|                        exif_format_get_name (target));         \
  |  |   41|  2.28k|                break;                                          \
  |  |   42|  2.28k|        }                                                       \
  |  |   43|  4.28k|}
  ------------------
  233|  1.99k|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|  1.99k|#define CC(number,target,v,maxlen)                                      \
  |  |   46|  1.99k|{                                                                       \
  |  |   47|  1.99k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 305, False: 1.69k]
  |  |  ------------------
  |  |   48|    305|                snprintf (v, maxlen,                                    \
  |  |   49|    305|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    305|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    305|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    305|                break;                                                  \
  |  |   52|    305|        }                                                               \
  |  |   53|  1.99k|}
  ------------------
  234|  1.69k|		vs = exif_get_short (entry->data, entry->order);
  235|       |
  236|       |		/* search the tag */
  237|  13.7k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (237:16): [True: 13.7k, False: 0]
  |  Branch (237:32): [True: 12.0k, False: 1.69k]
  ------------------
  238|  1.69k|		if (!items[i].tag) {
  ------------------
  |  Branch (238:7): [True: 0, False: 1.69k]
  ------------------
  239|      0|			snprintf (val, maxlen,
  240|      0|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  241|      0|		  	break;
  242|      0|		}
  243|       |
  244|       |		/* find the value */
  245|  8.92k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (245:15): [True: 8.02k, False: 900]
  ------------------
  246|  8.02k|		    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (246:7): [True: 7.23k, False: 791]
  ------------------
  247|  1.69k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (247:7): [True: 1.16k, False: 527]
  ------------------
  248|  1.16k|			snprintf (val, maxlen,
  249|  1.16k|				  _("Internal error (unknown value %i)"), vs);
  ------------------
  |  |   31|  1.16k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  250|  1.16k|			break;
  251|  1.16k|		}
  252|    527|		strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    527|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  253|    527|		break;
  254|    591|	  case MNOTE_FUJI_TAG_FOCUS_POINT:
  ------------------
  |  Branch (254:4): [True: 591, False: 9.53k]
  ------------------
  255|    591|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   33|    591|#define CF(format,target,v,maxlen)                              \
  |  |   34|    591|{                                                               \
  |  |   35|    591|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 203, False: 388]
  |  |  ------------------
  |  |   36|    203|                snprintf (v, maxlen,	                        \
  |  |   37|    203|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    203|                        "expected '%s'."),                      \
  |  |   39|    203|                        exif_format_get_name (format),          \
  |  |   40|    203|                        exif_format_get_name (target));         \
  |  |   41|    203|                break;                                          \
  |  |   42|    203|        }                                                       \
  |  |   43|    591|}
  ------------------
  256|    388|		CC (entry->components, 2, val, maxlen)
  ------------------
  |  |   45|    388|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    388|{                                                                       \
  |  |   47|    388|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 194, False: 194]
  |  |  ------------------
  |  |   48|    194|                snprintf (v, maxlen,                                    \
  |  |   49|    194|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    194|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    194|                break;                                                  \
  |  |   52|    194|        }                                                               \
  |  |   53|    388|}
  ------------------
  257|    194|		vs = exif_get_short (entry->data, entry->order);
  258|    194|		vs2 = exif_get_short (entry->data+2, entry->order);
  259|    194|		snprintf (val, maxlen, "%i, %i", vs, vs2);
  260|    194|		break;
  261|    362|	  case MNOTE_FUJI_TAG_MIN_FOCAL_LENGTH:
  ------------------
  |  Branch (261:4): [True: 362, False: 9.76k]
  ------------------
  262|  1.30k|	  case MNOTE_FUJI_TAG_MAX_FOCAL_LENGTH:
  ------------------
  |  Branch (262:4): [True: 942, False: 9.18k]
  ------------------
  263|  1.30k|		CF (entry->format, EXIF_FORMAT_RATIONAL, val, maxlen)
  ------------------
  |  |   33|  1.30k|#define CF(format,target,v,maxlen)                              \
  |  |   34|  1.30k|{                                                               \
  |  |   35|  1.30k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (35:13): [True: 332, False: 972]
  |  |  ------------------
  |  |   36|    332|                snprintf (v, maxlen,	                        \
  |  |   37|    332|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    332|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   38|    332|                        "expected '%s'."),                      \
  |  |   39|    332|                        exif_format_get_name (format),          \
  |  |   40|    332|                        exif_format_get_name (target));         \
  |  |   41|    332|                break;                                          \
  |  |   42|    332|        }                                                       \
  |  |   43|  1.30k|}
  ------------------
  264|    972|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   45|    972|#define CC(number,target,v,maxlen)                                      \
  |  |   46|    972|{                                                                       \
  |  |   47|    972|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 202, False: 770]
  |  |  ------------------
  |  |   48|    202|                snprintf (v, maxlen,                                    \
  |  |   49|    202|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   50|    202|                        "expected %i)."), (int) number, (int) target);  \
  |  |   51|    202|                break;                                                  \
  |  |   52|    202|        }                                                               \
  |  |   53|    972|}
  ------------------
  265|    770|		vr = exif_get_rational (entry->data, entry->order);
  266|    770|		if (!vr.denominator) break;
  ------------------
  |  Branch (266:7): [True: 229, False: 541]
  ------------------
  267|    541|		snprintf (val, maxlen, _("%2.2f mm"), (double) vr.numerator /
  ------------------
  |  |   31|    541|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  268|    541|			  vr.denominator);
  269|    541|		break;
  270|       |
  271|  2.76k|	default:
  ------------------
  |  Branch (271:2): [True: 2.76k, False: 7.36k]
  ------------------
  272|  2.76k|		switch (entry->format) {
  273|    233|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (273:3): [True: 233, False: 2.52k]
  ------------------
  274|    233|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    233|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 99, False: 134]
  |  |  ------------------
  ------------------
  275|    233|		  break;
  276|    203|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (276:3): [True: 203, False: 2.55k]
  ------------------
  277|    203|		  vs = exif_get_short (entry->data, entry->order);
  278|    203|		  snprintf (val, maxlen, "%hu", vs);
  279|    203|		  break;
  280|    198|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (280:3): [True: 198, False: 2.56k]
  ------------------
  281|    198|		  vss = exif_get_sshort (entry->data, entry->order);
  282|    198|		  snprintf (val, maxlen, "%hi", vss);
  283|    198|		  break;
  284|    214|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (284:3): [True: 214, False: 2.54k]
  ------------------
  285|    214|		  vl = exif_get_long (entry->data, entry->order);
  286|    214|		  snprintf (val, maxlen, "%lu", (long unsigned) vl);
  287|    214|		  break;
  288|    360|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (288:3): [True: 360, False: 2.40k]
  ------------------
  289|    360|		  vsl = exif_get_slong (entry->data, entry->order);
  290|    360|		  snprintf (val, maxlen, "%li", (long int) vsl);
  291|    360|		  break;
  292|    519|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (292:3): [True: 519, False: 2.24k]
  ------------------
  293|    519|		  vr = exif_get_rational (entry->data, entry->order);
  294|    519|		  if (!vr.denominator) break;
  ------------------
  |  Branch (294:9): [True: 98, False: 421]
  ------------------
  295|    421|		  snprintf (val, maxlen, "%2.4f", (double) vr.numerator /
  296|    421|						    vr.denominator);
  297|    421|		  break;
  298|    515|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (298:3): [True: 515, False: 2.24k]
  ------------------
  299|    515|		  vsr = exif_get_srational (entry->data, entry->order);
  300|    515|		  if (!vsr.denominator) break;
  ------------------
  |  Branch (300:9): [True: 233, False: 282]
  ------------------
  301|    282|		  snprintf (val, maxlen, "%2.4f", (double) vsr.numerator /
  302|    282|			  vsr.denominator);
  303|    282|		  break;
  304|      0|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (304:3): [True: 0, False: 2.76k]
  ------------------
  305|    519|		default:
  ------------------
  |  Branch (305:3): [True: 519, False: 2.24k]
  ------------------
  306|    519|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    519|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  307|    519| 			  entry->size);
  308|    519|		  break;
  309|  2.76k|		}
  310|  2.76k|		break;
  311|  10.1k|	}
  312|       |
  313|  10.1k|	return (val);
  314|  10.1k|}

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

exif_mnote_data_olympus_identify:
  623|  7.63k|{
  624|  7.63k|	int variant = exif_mnote_data_olympus_identify_variant(e->data, e->size);
  625|       |
  626|  7.63k|	if (variant == nikonV0) {
  ------------------
  |  Branch (626:6): [True: 597, False: 7.03k]
  ------------------
  627|       |		/* This variant needs some extra checking with the Make */
  628|    597|		char value[5];
  629|    597|		ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
  ------------------
  |  |  253|    597|	(exif_content_get_entry(d->ifd[EXIF_IFD_0],t) ?			\
  |  |  ------------------
  |  |  |  Branch (253:3): [True: 13, False: 584]
  |  |  ------------------
  |  |  254|    597|	 exif_content_get_entry(d->ifd[EXIF_IFD_0],t) :			\
  |  |  255|    597|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) ?			\
  |  |  ------------------
  |  |  |  Branch (255:3): [True: 68, False: 516]
  |  |  ------------------
  |  |  256|    584|	 exif_content_get_entry(d->ifd[EXIF_IFD_1],t) :			\
  |  |  257|    584|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) ?		\
  |  |  ------------------
  |  |  |  Branch (257:3): [True: 0, False: 516]
  |  |  ------------------
  |  |  258|    516|	 exif_content_get_entry(d->ifd[EXIF_IFD_EXIF],t) :		\
  |  |  259|    516|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) ?		\
  |  |  ------------------
  |  |  |  Branch (259:3): [True: 0, False: 516]
  |  |  ------------------
  |  |  260|    516|	 exif_content_get_entry(d->ifd[EXIF_IFD_GPS],t) :		\
  |  |  261|    516|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) ?	\
  |  |  ------------------
  |  |  |  Branch (261:3): [True: 0, False: 516]
  |  |  ------------------
  |  |  262|    516|	 exif_content_get_entry(d->ifd[EXIF_IFD_INTEROPERABILITY],t) : NULL)
  ------------------
  630|    597|		variant = unrecognized;
  631|       |
  632|    597|		if (em) {
  ------------------
  |  Branch (632:7): [True: 81, False: 516]
  ------------------
  633|     81|			const char *v = exif_entry_get_value (em, value, sizeof(value));
  634|     81|			if (v && (!strncmp (v, "Nikon", sizeof(value)) || 
  ------------------
  |  Branch (634:8): [True: 81, False: 0]
  |  Branch (634:14): [True: 0, False: 81]
  ------------------
  635|     81|					  !strncmp (v, "NIKON", sizeof(value)) ))
  ------------------
  |  Branch (635:8): [True: 0, False: 81]
  ------------------
  636|       |				/* When saved, this variant will be written out like the
  637|       |				 * alternative nikonV2 form above instead
  638|       |				 */
  639|      0|				variant = nikonV0;
  640|     81|		}
  641|    597|	}
  642|       |
  643|  7.63k|	return variant;
  644|  7.63k|}
exif_mnote_data_olympus_new:
  649|  4.25k|{
  650|  4.25k|	ExifMnoteData *d;
  651|       |
  652|  4.25k|	if (!mem) return NULL;
  ------------------
  |  Branch (652:6): [True: 0, False: 4.25k]
  ------------------
  653|       |	
  654|  4.25k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus));
  655|  4.25k|	if (!d) return NULL;
  ------------------
  |  Branch (655:6): [True: 0, False: 4.25k]
  ------------------
  656|       |
  657|  4.25k|	exif_mnote_data_construct (d, mem);
  658|       |
  659|       |	/* Set up function pointers */
  660|  4.25k|	d->methods.free            = exif_mnote_data_olympus_free;
  661|  4.25k|	d->methods.set_byte_order  = exif_mnote_data_olympus_set_byte_order;
  662|  4.25k|	d->methods.set_offset      = exif_mnote_data_olympus_set_offset;
  663|  4.25k|	d->methods.load            = exif_mnote_data_olympus_load;
  664|  4.25k|	d->methods.save            = exif_mnote_data_olympus_save;
  665|  4.25k|	d->methods.count           = exif_mnote_data_olympus_count;
  666|  4.25k|	d->methods.get_id          = exif_mnote_data_olympus_get_id;
  667|  4.25k|	d->methods.get_name        = exif_mnote_data_olympus_get_name;
  668|  4.25k|	d->methods.get_title       = exif_mnote_data_olympus_get_title;
  669|  4.25k|	d->methods.get_description = exif_mnote_data_olympus_get_description;
  670|  4.25k|	d->methods.get_value       = exif_mnote_data_olympus_get_value;
  671|       |
  672|  4.25k|	return d;
  673|  4.25k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_identify_variant:
  592|  11.8k|{
  593|       |	/* Olympus, Nikon, Sanyo, Epson */
  594|  11.8k|	if (buf_size >= 8) {
  ------------------
  |  Branch (594:6): [True: 11.6k, False: 241]
  ------------------
  595|       |		/* Match the terminating NUL character, too */
  596|  11.6k|		if (!memcmp (buf, "OLYMPUS", 8))
  ------------------
  |  Branch (596:7): [True: 1.34k, False: 10.2k]
  ------------------
  597|  1.34k|			   return olympusV2;
  598|  10.2k|		else if (!memcmp (buf, "OLYMP", 6))
  ------------------
  |  Branch (598:12): [True: 2.32k, False: 7.97k]
  ------------------
  599|  2.32k|			   return olympusV1;
  600|  7.97k|		else if (!memcmp (buf, "SANYO", 6))
  ------------------
  |  Branch (600:12): [True: 3.05k, False: 4.92k]
  ------------------
  601|  3.05k|			   return sanyoV1;
  602|  4.92k|		else if (!memcmp (buf, "EPSON", 6))
  ------------------
  |  Branch (602:12): [True: 1.32k, False: 3.59k]
  ------------------
  603|  1.32k|			   return epsonV1;
  604|  3.59k|		else if (!memcmp (buf, "Nikon", 6)) {
  ------------------
  |  Branch (604:12): [True: 399, False: 3.19k]
  ------------------
  605|    399|			switch (buf[6]) {
  606|    137|				case 1:  return nikonV1;
  ------------------
  |  Branch (606:5): [True: 137, False: 262]
  ------------------
  607|    255|				case 2:  return nikonV2;
  ------------------
  |  Branch (607:5): [True: 255, False: 144]
  ------------------
  608|      7|				default: return 0; /* Unrecognized Nikon variant */
  ------------------
  |  Branch (608:5): [True: 7, False: 392]
  ------------------
  609|    399|			}
  610|    399|		}
  611|  11.6k|	}
  612|       |
  613|       |	/* Another variant of Nikon */
  614|  3.43k|	if ((buf_size >= 2) && (buf[0] == 0x00) && (buf[1] == 0x1b)) {
  ------------------
  |  Branch (614:6): [True: 3.42k, False: 14]
  |  Branch (614:25): [True: 664, False: 2.75k]
  |  Branch (614:45): [True: 624, False: 40]
  ------------------
  615|    624|		return nikonV0;
  616|    624|	}
  617|       |
  618|  2.81k|	return unrecognized;
  619|  3.43k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_free:
   68|  4.25k|{
   69|  4.25k|	if (!n) return;
  ------------------
  |  Branch (69:6): [True: 0, False: 4.25k]
  ------------------
   70|       |
   71|  4.25k|	exif_mnote_data_olympus_clear ((ExifMnoteDataOlympus *) n);
   72|  4.25k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_clear:
   48|  8.26k|{
   49|  8.26k|	ExifMnoteData *d = (ExifMnoteData *) n;
   50|  8.26k|	unsigned int i;
   51|       |
   52|  8.26k|	if (!n) return;
  ------------------
  |  Branch (52:6): [True: 0, False: 8.26k]
  ------------------
   53|       |
   54|  8.26k|	if (n->entries) {
  ------------------
  |  Branch (54:6): [True: 4.00k, False: 4.25k]
  ------------------
   55|  94.2k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (55:15): [True: 90.2k, False: 4.00k]
  ------------------
   56|  90.2k|			if (n->entries[i].data) {
  ------------------
  |  Branch (56:8): [True: 36.3k, False: 53.9k]
  ------------------
   57|  36.3k|				exif_mem_free (d->mem, n->entries[i].data);
   58|  36.3k|				n->entries[i].data = NULL;
   59|  36.3k|			}
   60|  4.00k|		exif_mem_free (d->mem, n->entries);
   61|       |		n->entries = NULL;
   62|  4.00k|		n->count = 0;
   63|  4.00k|	}
   64|  8.26k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_byte_order:
  565|  4.25k|{
  566|  4.25k|	ExifByteOrder o_orig;
  567|  4.25k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  568|  4.25k|	unsigned int i;
  569|       |
  570|  4.25k|	if (!n) return;
  ------------------
  |  Branch (570:6): [True: 0, False: 4.25k]
  ------------------
  571|       |
  572|  4.25k|	o_orig = n->order;
  573|  4.25k|	n->order = o;
  574|  4.25k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (574:14): [True: 0, False: 4.25k]
  ------------------
  575|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  |  Branch (575:35): [True: 0, False: 0]
  ------------------
  576|      0|			continue;
  577|      0|		n->entries[i].order = o;
  578|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  579|      0|				n->entries[i].components, o_orig, o);
  580|      0|	}
  581|  4.25k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_set_offset:
  585|  4.25k|{
  586|  4.25k|	if (n) ((ExifMnoteDataOlympus *) n)->offset = o;
  ------------------
  |  Branch (586:6): [True: 4.25k, False: 0]
  ------------------
  587|  4.25k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_load:
  241|  4.25k|{
  242|  4.25k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en;
  243|  4.25k|	ExifShort c;
  244|  4.25k|	size_t i, tcount, o, o2, datao = 6, base = 0;
  245|       |
  246|  4.25k|	if (!n) return;
  ------------------
  |  Branch (246:6): [True: 0, False: 4.25k]
  ------------------
  247|       |
  248|  4.25k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (248:6): [True: 0, False: 4.25k]
  |  Branch (248:14): [True: 0, False: 4.25k]
  ------------------
  249|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  250|      0|			  "ExifMnoteDataOlympus", "Short MakerNote");
  251|      0|		return;
  252|      0|	}
  253|  4.25k|	o2 = 6 + n->offset; /* Start of interesting data */
  254|  4.25k|	if (exif_check_overflow (o2,buf_size,10)) {
  ------------------
  |  Branch (254:6): [True: 9, False: 4.24k]
  ------------------
  255|      9|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  256|      9|			  "ExifMnoteDataOlympus", "Short MakerNote");
  257|      9|		return;
  258|      9|	}
  259|       |
  260|       |	/*
  261|       |	 * Olympus headers start with "OLYMP" and need to have at least
  262|       |	 * a size of 22 bytes (6 for 'OLYMP', 2 other bytes, 2 for the
  263|       |	 * number of entries, and 12 for one entry.
  264|       |	 *
  265|       |	 * Sanyo format is identical and uses identical tags except that
  266|       |	 * header starts with "SANYO".
  267|       |	 *
  268|       |	 * Epson format is identical and uses identical tags except that
  269|       |	 * header starts with "EPSON".
  270|       |	 *
  271|       |	 * Nikon headers start with "Nikon" (6 bytes including '\0'), 
  272|       |	 * version number (1 or 2).
  273|       |	 * 
  274|       |	 * Version 1 continues with 0, 1, 0, number_of_tags,
  275|       |	 * or just with number_of_tags (models D1H, D1X...).
  276|       |	 * 
  277|       |	 * Version 2 continues with an unknown byte (0 or 10),
  278|       |	 * two unknown bytes (0), "MM" or "II", another byte 0 and 
  279|       |	 * lastly 0x2A.
  280|       |	 */
  281|  4.24k|	n->version = exif_mnote_data_olympus_identify_variant(buf+o2, buf_size-o2);
  282|  4.24k|	switch (n->version) {
  283|  1.14k|	case olympusV1:
  ------------------
  |  Branch (283:2): [True: 1.14k, False: 3.10k]
  ------------------
  284|  2.66k|	case sanyoV1:
  ------------------
  |  Branch (284:2): [True: 1.51k, False: 2.72k]
  ------------------
  285|  3.30k|	case epsonV1:
  ------------------
  |  Branch (285:2): [True: 645, False: 3.60k]
  ------------------
  286|  3.30k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  287|  3.30k|			"Parsing Olympus/Sanyo/Epson maker note v1...");
  288|       |
  289|       |		/* The number of entries is at position 8. */
  290|  3.30k|		if (buf[o2 + 6] == 1)
  ------------------
  |  Branch (290:7): [True: 99, False: 3.20k]
  ------------------
  291|     99|			n->order = EXIF_BYTE_ORDER_INTEL;
  292|  3.20k|		else if (buf[o2 + 6 + 1] == 1)
  ------------------
  |  Branch (292:12): [True: 23, False: 3.18k]
  ------------------
  293|     23|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  294|  3.30k|		o2 += 8;
  295|  3.30k|		c = exif_get_short (buf + o2, n->order);
  296|  3.30k|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (296:7): [True: 764, False: 2.54k]
  |  Branch (296:24): [True: 609, False: 155]
  ------------------
  297|    609|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (297:8): [True: 575, False: 34]
  ------------------
  298|    575|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  299|    575|			} else {
  300|     34|				n->order = EXIF_BYTE_ORDER_INTEL;
  301|     34|			}
  302|    609|		}
  303|  3.30k|		break;
  304|       |
  305|    670|	case olympusV2:
  ------------------
  |  Branch (305:2): [True: 670, False: 3.57k]
  ------------------
  306|       |		/* Olympus S760, S770 */
  307|    670|		datao = o2;
  308|    670|		o2 += 8;
  309|    670|		if (exif_check_overflow (o2,buf_size,4)) return;
  ------------------
  |  Branch (309:7): [True: 2, False: 668]
  ------------------
  310|    668|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  311|    668|			"Parsing Olympus maker note v2 (0x%02x, %02x, %02x, %02x)...",
  312|    668|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  313|       |
  314|    668|		if ((buf[o2] == 'I') && (buf[o2 + 1] == 'I'))
  ------------------
  |  Branch (314:7): [True: 7, False: 661]
  |  Branch (314:27): [True: 2, False: 5]
  ------------------
  315|      2|			n->order = EXIF_BYTE_ORDER_INTEL;
  316|    666|		else if ((buf[o2] == 'M') && (buf[o2 + 1] == 'M'))
  ------------------
  |  Branch (316:12): [True: 15, False: 651]
  |  Branch (316:32): [True: 1, False: 14]
  ------------------
  317|      1|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  318|       |
  319|       |		/* The number of entries is at position 8+4. */
  320|    668|		o2 += 4;
  321|    668|		break;
  322|       |
  323|     63|	case nikonV1:
  ------------------
  |  Branch (323:2): [True: 63, False: 4.18k]
  ------------------
  324|     63|		o2 += 6;
  325|     63|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  326|     63|			"Parsing Nikon maker note v1 (0x%02x, %02x, %02x, "
  327|     63|			"%02x)...",
  328|     63|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3]);
  329|       |
  330|       |		/* Skip version number */
  331|     63|		o2 += 1;
  332|       |
  333|       |		/* Skip an unknown byte (00 or 0A). */
  334|     63|		o2 += 1;
  335|       |
  336|     63|		base = MNOTE_NIKON1_TAG_BASE;
  337|       |		/* Fix endianness, if needed */
  338|     63|		c = exif_get_short (buf + o2, n->order);
  339|     63|		if ((!(c & 0xFF)) && (c > 0x500)) {
  ------------------
  |  Branch (339:7): [True: 19, False: 44]
  |  Branch (339:24): [True: 15, False: 4]
  ------------------
  340|     15|			if (n->order == EXIF_BYTE_ORDER_INTEL) {
  ------------------
  |  Branch (340:8): [True: 10, False: 5]
  ------------------
  341|     10|				n->order = EXIF_BYTE_ORDER_MOTOROLA;
  342|     10|			} else {
  343|      5|				n->order = EXIF_BYTE_ORDER_INTEL;
  344|      5|			}
  345|     15|		}
  346|     63|		break;
  347|       |
  348|    145|	case nikonV2:
  ------------------
  |  Branch (348:2): [True: 145, False: 4.10k]
  ------------------
  349|    145|		o2 += 6;
  350|    145|		if (exif_check_overflow (o2,buf_size,12)) return;
  ------------------
  |  Branch (350:7): [True: 6, False: 139]
  ------------------
  351|    139|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  352|    139|			"Parsing Nikon maker note v2 (0x%02x, %02x, %02x, "
  353|    139|			"%02x, %02x, %02x, %02x, %02x)...",
  354|    139|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3],
  355|    139|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  356|       |
  357|       |		/* Skip version number */
  358|    139|		o2 += 1;
  359|       |
  360|       |		/* Skip an unknown byte (00 or 0A). */
  361|    139|		o2 += 1;
  362|       |
  363|       |		/* Skip 2 unknown bytes (00 00). */
  364|    139|		o2 += 2;
  365|       |
  366|       |		/*
  367|       |		 * Byte order. From here the data offset
  368|       |		 * gets calculated.
  369|       |		 */
  370|    139|		datao = o2;
  371|    139|		if (!strncmp ((char *)&buf[o2], "II", 2))
  ------------------
  |  Branch (371:7): [True: 88, False: 51]
  ------------------
  372|     88|			n->order = EXIF_BYTE_ORDER_INTEL;
  373|     51|		else if (!strncmp ((char *)&buf[o2], "MM", 2))
  ------------------
  |  Branch (373:12): [True: 20, False: 31]
  ------------------
  374|     20|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  375|     31|		else {
  376|     31|			exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  377|     31|				"ExifMnoteDataOlympus", "Unknown "
  378|     31|				"byte order '%c%c'", buf[o2],
  379|     31|				buf[o2 + 1]);
  380|     31|			return;
  381|     31|		}
  382|    108|		o2 += 2;
  383|       |
  384|       |		/* Skip 2 unknown bytes (00 2A). */
  385|    108|		o2 += 2;
  386|       |
  387|       |		/* Go to where the number of entries is. */
  388|    108|		if (exif_check_overflow (o2,buf_size,exif_get_long (buf + o2, n->order))) return;
  ------------------
  |  Branch (388:7): [True: 87, False: 21]
  ------------------
  389|     21|		o2 = datao + exif_get_long (buf + o2, n->order);
  390|     21|		break;
  391|       |
  392|     27|	case nikonV0:
  ------------------
  |  Branch (392:2): [True: 27, False: 4.22k]
  ------------------
  393|     27|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  394|     27|			"Parsing Nikon maker note v0 (0x%02x, %02x, %02x, "
  395|     27|			"%02x, %02x, %02x, %02x, %02x)...",
  396|     27|			buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
  397|     27|			buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
  398|       |		/* 00 1b is # of entries in Motorola order - the rest should also be in MM order */
  399|     27|		n->order = EXIF_BYTE_ORDER_MOTOROLA;
  400|     27|		break;
  401|       |
  402|     36|	default:
  ------------------
  |  Branch (402:2): [True: 36, False: 4.21k]
  ------------------
  403|     36|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
  404|     36|			"Unknown Olympus variant %i.", n->version);
  405|     36|		return;
  406|  4.24k|	}
  407|       |
  408|       |	/* Sanity check the offset */
  409|  4.08k|	if (exif_check_overflow (o2,buf_size,2)) {
  ------------------
  |  Branch (409:6): [True: 32, False: 4.05k]
  ------------------
  410|     32|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  411|     32|			  "ExifMnoteOlympus", "Short MakerNote");
  412|     32|		return;
  413|     32|	}
  414|       |
  415|       |	/* Read the number of tags */
  416|  4.05k|	c = exif_get_short (buf + o2, n->order);
  417|  4.05k|	o2 += 2;
  418|       |
  419|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 150 named tags currently.
  420|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  421|  4.05k|	if (c > 300) {
  ------------------
  |  Branch (421:6): [True: 45, False: 4.00k]
  ------------------
  422|     45|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Too much tags (%d) in Olympus MakerNote", c);
  423|     45|		return;
  424|     45|	}
  425|       |
  426|       |	/* Remove any old entries */
  427|  4.00k|	exif_mnote_data_olympus_clear (n);
  428|       |
  429|       |	/* Reserve enough space for all the possible MakerNote tags */
  430|  4.00k|	n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c);
  431|  4.00k|	if (!n->entries) {
  ------------------
  |  Branch (431:6): [True: 0, False: 4.00k]
  ------------------
  432|      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))
  ------------------
  433|      0|		return;
  434|      0|	}
  435|       |
  436|       |	/* Parse all c entries, storing ones that are successfully parsed */
  437|  4.00k|	tcount = 0;
  438|  99.9k|	for (i = c, o = o2; i; --i, o += 12) {
  ------------------
  |  Branch (438:22): [True: 99.0k, False: 937]
  ------------------
  439|  99.0k|		size_t s;
  440|  99.0k|		memset(&n->entries[tcount], 0, sizeof(MnoteOlympusEntry));
  441|  99.0k|		if (exif_check_overflow (o, buf_size, 12)) {
  ------------------
  |  Branch (441:7): [True: 3.07k, False: 95.9k]
  ------------------
  442|  3.07k|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  443|  3.07k|				  "ExifMnoteOlympus", "Short MakerNote");
  444|  3.07k|			break;
  445|  3.07k|		}
  446|       |
  447|  95.9k|	    n->entries[tcount].tag        = exif_get_short (buf + o, n->order) + base;
  448|  95.9k|	    n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  449|  95.9k|	    n->entries[tcount].components = exif_get_long (buf + o + 4, n->order);
  450|  95.9k|	    n->entries[tcount].order      = n->order;
  451|       |
  452|  95.9k|	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  453|  95.9k|		      "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  454|  95.9k|		      mnote_olympus_tag_get_name (n->entries[tcount].tag));
  455|       |/*	    exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteOlympus",
  456|       |			    "0x%x %d %ld*(%d)",
  457|       |		    n->entries[tcount].tag,
  458|       |		    n->entries[tcount].format,
  459|       |		    n->entries[tcount].components,
  460|       |		    (int)exif_format_get_size(n->entries[tcount].format)); */
  461|       |
  462|       |	    /* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  463|       |	     * we will check the buffer sizes closer later. */
  464|  95.9k|	    if (exif_check_mul_overflow (exif_format_get_size (n->entries[tcount].format),
  ------------------
  |  Branch (464:10): [True: 4.03k, False: 91.9k]
  ------------------
  465|  95.9k|			n->entries[tcount].components, buf_size, &s)) {
  466|  4.03k|		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);
  467|  4.03k|		continue;
  468|  4.03k|	    }
  469|       |	    /*
  470|       |	     * Size? If bigger than 4 bytes, the actual data is not
  471|       |	     * in the entry but somewhere else (offset).
  472|       |	     */
  473|  91.9k|		n->entries[tcount].size = s;
  474|  91.9k|		if (s) {
  ------------------
  |  Branch (474:7): [True: 37.9k, False: 53.9k]
  ------------------
  475|  37.9k|			size_t dataofs = o + 8;
  476|  37.9k|			if (s > 4) {
  ------------------
  |  Branch (476:8): [True: 19.4k, False: 18.5k]
  ------------------
  477|       |				/* The data in this case is merely a pointer */
  478|  19.4k|				dataofs = exif_get_long (buf + dataofs, n->order) + datao;
  479|       |#ifdef EXIF_OVERCOME_SANYO_OFFSET_BUG
  480|       |				/* Some Sanyo models (e.g. VPC-C5, C40) suffer from a bug when
  481|       |				 * writing the offset for the MNOTE_OLYMPUS_TAG_THUMBNAILIMAGE
  482|       |				 * tag in its MakerNote. The offset is actually the absolute
  483|       |				 * position in the file instead of the position within the IFD.
  484|       |				 */
  485|       |			    if (dataofs > (buf_size - s) && n->version == sanyoV1) {
  486|       |					/* fix pointer */
  487|       |					dataofs -= datao + 6;
  488|       |					exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  489|       |						  "ExifMnoteOlympus",
  490|       |						  "Inconsistent thumbnail tag offset; attempting to recover");
  491|       |			    }
  492|       |#endif
  493|  19.4k|			}
  494|  37.9k|			if (exif_check_overflow (dataofs, buf_size, s)) {
  ------------------
  |  Branch (494:8): [True: 1.66k, False: 36.3k]
  ------------------
  495|  1.66k|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  496|  1.66k|					  "ExifMnoteOlympus",
  497|  1.66k|					  "Tag data past end of buffer (%u > %u)",
  498|  1.66k|					  (unsigned)(dataofs + s), buf_size);
  499|  1.66k|				continue;
  500|  1.66k|			}
  501|       |
  502|  36.3k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  503|  36.3k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (503:8): [True: 0, False: 36.3k]
  ------------------
  504|      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))
  ------------------
  505|      0|				continue;
  506|      0|			}
  507|  36.3k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  508|  36.3k|		}
  509|       |
  510|       |		/* Tag was successfully parsed */
  511|  90.2k|		++tcount;
  512|  90.2k|	}
  513|       |	/* Store the count of successfully parsed tags */
  514|  4.00k|	n->count = tcount;
  515|  4.00k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_count:
  519|  4.25k|{
  520|  4.25k|	return n ? ((ExifMnoteDataOlympus *) n)->count : 0;
  ------------------
  |  Branch (520:9): [True: 4.25k, False: 0]
  ------------------
  521|  4.25k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_name:
  535|  51.7k|{
  536|  51.7k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  537|       |
  538|  51.7k|	if (!n) return NULL;
  ------------------
  |  Branch (538:6): [True: 0, False: 51.7k]
  ------------------
  539|  51.7k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (539:6): [True: 0, False: 51.7k]
  ------------------
  540|  51.7k|	return mnote_olympus_tag_get_name (n->entries[i].tag);
  541|  51.7k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_title:
  545|  50.4k|{
  546|  50.4k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  547|       |	
  548|  50.4k|	if (!n) return NULL;
  ------------------
  |  Branch (548:6): [True: 0, False: 50.4k]
  ------------------
  549|  50.4k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (549:6): [True: 0, False: 50.4k]
  ------------------
  550|  50.4k|        return mnote_olympus_tag_get_title (n->entries[i].tag);
  551|  50.4k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_description:
  555|  50.4k|{
  556|  50.4k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
  557|       |	
  558|  50.4k|	if (!n) return NULL;
  ------------------
  |  Branch (558:6): [True: 0, False: 50.4k]
  ------------------
  559|  50.4k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (559:6): [True: 0, False: 50.4k]
  ------------------
  560|  50.4k|        return mnote_olympus_tag_get_description (n->entries[i].tag);
  561|  50.4k|}
exif-mnote-data-olympus.c:exif_mnote_data_olympus_get_value:
   76|  50.4k|{
   77|  50.4k|	ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) d;
   78|       |
   79|  50.4k|	if (!d || !val) return NULL;
  ------------------
  |  Branch (79:6): [True: 0, False: 50.4k]
  |  Branch (79:12): [True: 0, False: 50.4k]
  ------------------
   80|  50.4k|	if (i >= n->count) return NULL;
  ------------------
  |  Branch (80:6): [True: 0, False: 50.4k]
  ------------------
   81|       |/*
   82|       |	exif_log (d->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
   83|       |		  "Querying value for tag '%s'...",
   84|       |		  mnote_olympus_tag_get_name (n->entries[i].tag));
   85|       |*/
   86|  50.4k|	return mnote_olympus_entry_get_value (&n->entries[i], val, maxlen);
   87|  50.4k|}

mnote_olympus_entry_get_value:
  276|  50.4k|{
  277|  50.4k|	char         buf[30];
  278|  50.4k|	ExifLong     vl;
  279|  50.4k|	ExifSLong    vsl;
  280|  50.4k|	ExifShort    vs = 0;
  281|  50.4k|	ExifSShort   vss = 0;
  282|  50.4k|	ExifRational vr, vr2;
  283|  50.4k|	ExifSRational vsr;
  284|  50.4k|	int          i, j;
  285|  50.4k|	double       r, b;
  286|       |
  287|  50.4k|	if (!entry)
  ------------------
  |  Branch (287:6): [True: 0, False: 50.4k]
  ------------------
  288|      0|		return (NULL);
  289|  50.4k|	if (maxlen < 1)
  ------------------
  |  Branch (289:6): [True: 0, False: 50.4k]
  ------------------
  290|      0|		return NULL;
  291|       |
  292|  50.4k|	memset (v, 0, maxlen);
  293|  50.4k|	maxlen--;
  294|       |
  295|  50.4k|	if ((!entry->data) && (entry->components > 0)) 
  ------------------
  |  Branch (295:6): [True: 15.1k, False: 35.3k]
  |  Branch (295:24): [True: 2.42k, False: 12.7k]
  ------------------
  296|  2.42k|		return (v);
  297|       |
  298|  48.0k|	if ((!entry->data) && (entry->size > 0))
  ------------------
  |  Branch (298:6): [True: 12.7k, False: 35.3k]
  |  Branch (298:24): [True: 0, False: 12.7k]
  ------------------
  299|      0|		return NULL;  /* internal inconsistency error */
  300|       |
  301|  48.0k|	switch (entry->tag) {
  302|       |	
  303|       |	/* Nikon */
  304|    808|	case MNOTE_NIKON_TAG_FIRMWARE:
  ------------------
  |  Branch (304:2): [True: 808, False: 47.2k]
  ------------------
  305|    808|		CF (entry->format,  EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    808|#define CF(format,target,v,maxlen)                              \
  |  |   36|    808|{                                                               \
  |  |   37|    808|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 212, False: 596]
  |  |  ------------------
  |  |   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|    808|}
  ------------------
  306|    596|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    596|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    596|{                                                                       \
  |  |   62|    596|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 203, False: 393]
  |  |  ------------------
  |  |   63|    203|                snprintf (v, maxlen,                                    \
  |  |   64|    203|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    203|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    203|                break;                                                  \
  |  |   67|    203|        }                                                               \
  |  |   68|    596|}
  ------------------
  307|    393|		vl = exif_get_long (entry->data, EXIF_BYTE_ORDER_INTEL);
  308|    393|		if ((vl & 0xF0F0F0F0) == 0x30303030) {
  ------------------
  |  Branch (308:7): [True: 198, False: 195]
  ------------------
  309|    198|			memcpy (v, entry->data, MIN (maxlen, 4));
  ------------------
  |  |  182|    198|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 198]
  |  |  ------------------
  ------------------
  310|    198|		} else {
  311|    195|			snprintf (v, maxlen, "%04lx", (long unsigned int) vl);
  312|    195|		}
  313|    393|		break;
  314|    659|	case MNOTE_NIKON_TAG_ISO:
  ------------------
  |  Branch (314:2): [True: 659, False: 47.4k]
  ------------------
  315|    659|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    659|#define CF(format,target,v,maxlen)                              \
  |  |   36|    659|{                                                               \
  |  |   37|    659|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 247, False: 412]
  |  |  ------------------
  |  |   38|    247|                snprintf (v, maxlen,	                        \
  |  |   39|    247|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    247|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    247|                        "expected '%s'."),                      \
  |  |   41|    247|                        exif_format_get_name (format),          \
  |  |   42|    247|                        exif_format_get_name (target));         \
  |  |   43|    247|                break;                                          \
  |  |   44|    247|        }                                                       \
  |  |   45|    659|}
  ------------------
  316|    412|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    412|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    412|{                                                                       \
  |  |   62|    412|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 218, False: 194]
  |  |  ------------------
  |  |   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|    412|}
  ------------------
  317|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  318|    194|                vs = exif_get_short (entry->data + 2, entry->order);
  319|    194|                snprintf (v, maxlen, "ISO %hd", vs);
  320|    194|                break;
  321|    606|	case MNOTE_NIKON_TAG_ISO2:
  ------------------
  |  Branch (321:2): [True: 606, False: 47.4k]
  ------------------
  322|    606|                CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    606|#define CF(format,target,v,maxlen)                              \
  |  |   36|    606|{                                                               \
  |  |   37|    606|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 204, False: 402]
  |  |  ------------------
  |  |   38|    204|                snprintf (v, maxlen,	                        \
  |  |   39|    204|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    204|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    204|                        "expected '%s'."),                      \
  |  |   41|    204|                        exif_format_get_name (format),          \
  |  |   42|    204|                        exif_format_get_name (target));         \
  |  |   43|    204|                break;                                          \
  |  |   44|    204|        }                                                       \
  |  |   45|    606|}
  ------------------
  323|    402|                CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    402|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    402|{                                                                       \
  |  |   62|    402|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 208, False: 194]
  |  |  ------------------
  |  |   63|    208|                snprintf (v, maxlen,                                    \
  |  |   64|    208|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    208|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    208|                break;                                                  \
  |  |   67|    208|        }                                                               \
  |  |   68|    402|}
  ------------------
  324|       |                /*vs = exif_get_short (entry->data, entry->order);*/
  325|    194|                vs = exif_get_short (entry->data + 2, entry->order);
  326|    194|                snprintf (v, maxlen, "ISO2 %hd", vs);
  327|    194|                break;
  328|    201|	case MNOTE_NIKON_TAG_QUALITY:
  ------------------
  |  Branch (328:2): [True: 201, False: 47.8k]
  ------------------
  329|    432|	case MNOTE_NIKON_TAG_COLORMODE:
  ------------------
  |  Branch (329:2): [True: 231, False: 47.8k]
  ------------------
  330|    646|	case MNOTE_NIKON_TAG_COLORMODE1:
  ------------------
  |  Branch (330:2): [True: 214, False: 47.8k]
  ------------------
  331|    851|	case MNOTE_NIKON_TAG_WHITEBALANCE:
  ------------------
  |  Branch (331:2): [True: 205, False: 47.8k]
  ------------------
  332|  1.07k|	case MNOTE_NIKON_TAG_SHARPENING:
  ------------------
  |  Branch (332:2): [True: 220, False: 47.8k]
  ------------------
  333|  1.33k|	case MNOTE_NIKON_TAG_FOCUSMODE:
  ------------------
  |  Branch (333:2): [True: 261, False: 47.8k]
  ------------------
  334|  1.55k|	case MNOTE_NIKON_TAG_FLASHSETTING:
  ------------------
  |  Branch (334:2): [True: 219, False: 47.8k]
  ------------------
  335|  1.75k|	case MNOTE_NIKON_TAG_ISOSELECTION:
  ------------------
  |  Branch (335:2): [True: 202, False: 47.8k]
  ------------------
  336|  1.94k|	case MNOTE_NIKON_TAG_FLASHMODE:
  ------------------
  |  Branch (336:2): [True: 196, False: 47.8k]
  ------------------
  337|  2.14k|	case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (337:2): [True: 197, False: 47.8k]
  ------------------
  338|  2.34k|	case MNOTE_NIKON_TAG_ADAPTER:
  ------------------
  |  Branch (338:2): [True: 196, False: 47.8k]
  ------------------
  339|  2.53k|	case MNOTE_NIKON_TAG_SATURATION2:
  ------------------
  |  Branch (339:2): [True: 195, False: 47.8k]
  ------------------
  340|  2.62k|	case MNOTE_EPSON_TAG_SOFTWARE:
  ------------------
  |  Branch (340:2): [True: 88, False: 47.9k]
  ------------------
  341|  2.62k|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|  2.62k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.62k|{                                                               \
  |  |   37|  2.62k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 2.00k, False: 622]
  |  |  ------------------
  |  |   38|  2.00k|                snprintf (v, maxlen,	                        \
  |  |   39|  2.00k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.00k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  2.00k|                        "expected '%s'."),                      \
  |  |   41|  2.00k|                        exif_format_get_name (format),          \
  |  |   42|  2.00k|                        exif_format_get_name (target));         \
  |  |   43|  2.00k|                break;                                          \
  |  |   44|  2.00k|        }                                                       \
  |  |   45|  2.62k|}
  ------------------
  342|    622|		memcpy(v, entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    622|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 212, False: 410]
  |  |  ------------------
  ------------------
  343|    622|		break;
  344|    219|	case MNOTE_NIKON_TAG_TOTALPICTURES:
  ------------------
  |  Branch (344:2): [True: 219, False: 47.8k]
  ------------------
  345|    415|	case MNOTE_EPSON_TAG_IMAGE_WIDTH:
  ------------------
  |  Branch (345:2): [True: 196, False: 47.8k]
  ------------------
  346|    630|	case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
  ------------------
  |  Branch (346:2): [True: 215, False: 47.8k]
  ------------------
  347|    630|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|    630|#define CF(format,target,v,maxlen)                              \
  |  |   36|    630|{                                                               \
  |  |   37|    630|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 215, False: 415]
  |  |  ------------------
  |  |   38|    215|                snprintf (v, maxlen,	                        \
  |  |   39|    215|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    215|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    215|                        "expected '%s'."),                      \
  |  |   41|    215|                        exif_format_get_name (format),          \
  |  |   42|    215|                        exif_format_get_name (target));         \
  |  |   43|    215|                break;                                          \
  |  |   44|    215|        }                                                       \
  |  |   45|    630|}
  ------------------
  348|    415|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    415|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    415|{                                                                       \
  |  |   62|    415|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 215, False: 200]
  |  |  ------------------
  |  |   63|    215|                snprintf (v, maxlen,                                    \
  |  |   64|    215|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    215|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    215|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    215|                break;                                                  \
  |  |   67|    215|        }                                                               \
  |  |   68|    415|}
  ------------------
  349|    200|		vl =  exif_get_long (entry->data, entry->order);
  350|    200|		snprintf (v, maxlen, "%lu",  (long unsigned int) vl );
  351|    200|		break;
  352|    586|	case MNOTE_NIKON_TAG_LENS_FSTOPS:
  ------------------
  |  Branch (352:2): [True: 586, False: 47.4k]
  ------------------
  353|    985|	case MNOTE_NIKON_TAG_EXPOSUREDIFF: {
  ------------------
  |  Branch (353:2): [True: 399, False: 47.6k]
  ------------------
  354|    985|		unsigned char h,m,l;
  355|    985|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    985|#define CF(format,target,v,maxlen)                              \
  |  |   36|    985|{                                                               \
  |  |   37|    985|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 240, False: 745]
  |  |  ------------------
  |  |   38|    240|                snprintf (v, maxlen,	                        \
  |  |   39|    240|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    240|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    240|                        "expected '%s'."),                      \
  |  |   41|    240|                        exif_format_get_name (format),          \
  |  |   42|    240|                        exif_format_get_name (target));         \
  |  |   43|    240|                break;                                          \
  |  |   44|    240|        }                                                       \
  |  |   45|    985|}
  ------------------
  356|    745|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    745|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    745|{                                                                       \
  |  |   62|    745|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 206, False: 539]
  |  |  ------------------
  |  |   63|    206|                snprintf (v, maxlen,                                    \
  |  |   64|    206|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    206|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    206|                break;                                                  \
  |  |   67|    206|        }                                                               \
  |  |   68|    745|}
  ------------------
  357|    539|		vl =  exif_get_long (entry->data, entry->order);
  358|    539|		h = (vl>>24)&0xff; m = (vl>>16)&0xff; l = (vl>>8)&0xff;
  359|    539|		snprintf (v, maxlen, "%.1f",  l?(double)h*((double)m/(double)l):0 );
  ------------------
  |  Branch (359:33): [True: 315, False: 224]
  ------------------
  360|    539|		break;
  361|    745|	}
  362|    217|	case MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION:
  ------------------
  |  Branch (362:2): [True: 217, False: 47.8k]
  ------------------
  363|    611|	case MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL:
  ------------------
  |  Branch (363:2): [True: 394, False: 47.6k]
  ------------------
  364|    611|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    611|#define CF(format,target,v,maxlen)                              \
  |  |   36|    611|{                                                               \
  |  |   37|    611|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 286, False: 325]
  |  |  ------------------
  |  |   38|    286|                snprintf (v, maxlen,	                        \
  |  |   39|    286|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    286|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    286|                        "expected '%s'."),                      \
  |  |   41|    286|                        exif_format_get_name (format),          \
  |  |   42|    286|                        exif_format_get_name (target));         \
  |  |   43|    286|                break;                                          \
  |  |   44|    286|        }                                                       \
  |  |   45|    611|}
  ------------------
  365|    325|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    325|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    325|{                                                                       \
  |  |   62|    325|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 207, False: 118]
  |  |  ------------------
  |  |   63|    207|                snprintf (v, maxlen,                                    \
  |  |   64|    207|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    207|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    207|                break;                                                  \
  |  |   67|    207|        }                                                               \
  |  |   68|    325|}
  ------------------
  366|    118|		vl =  exif_get_long (entry->data, entry->order);
  367|    118|		snprintf (v, maxlen, "%.1f",  ((long unsigned int) vl>>24)/6.0 );
  368|    118|		break;
  369|    673|	case MNOTE_NIKON_TAG_SATURATION:
  ------------------
  |  Branch (369:2): [True: 673, False: 47.4k]
  ------------------
  370|    882|	case MNOTE_NIKON_TAG_WHITEBALANCEFINE:
  ------------------
  |  Branch (370:2): [True: 209, False: 47.8k]
  ------------------
  371|  1.09k|	case MNOTE_NIKON_TAG_HUE:
  ------------------
  |  Branch (371:2): [True: 208, False: 47.8k]
  ------------------
  372|  1.28k|	case MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE:
  ------------------
  |  Branch (372:2): [True: 195, False: 47.8k]
  ------------------
  373|  1.49k|	case MNOTE_OLYMPUS_TAG_LENSTEMPERATURE:
  ------------------
  |  Branch (373:2): [True: 205, False: 47.8k]
  ------------------
  374|  1.49k|		CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|  1.49k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.49k|{                                                               \
  |  |   37|  1.49k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 759, False: 731]
  |  |  ------------------
  |  |   38|    759|                snprintf (v, maxlen,	                        \
  |  |   39|    759|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    759|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    759|                        "expected '%s'."),                      \
  |  |   41|    759|                        exif_format_get_name (format),          \
  |  |   42|    759|                        exif_format_get_name (target));         \
  |  |   43|    759|                break;                                          \
  |  |   44|    759|        }                                                       \
  |  |   45|  1.49k|}
  ------------------
  375|    731|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    731|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    731|{                                                                       \
  |  |   62|    731|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 327, False: 404]
  |  |  ------------------
  |  |   63|    327|                snprintf (v, maxlen,                                    \
  |  |   64|    327|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    327|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    327|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    327|                break;                                                  \
  |  |   67|    327|        }                                                               \
  |  |   68|    731|}
  ------------------
  376|    404|		vs = exif_get_short (entry->data, entry->order);
  377|    404|		snprintf (v, maxlen, "%hd", vs);
  378|    404|		break;
  379|  1.28k|	case MNOTE_NIKON_TAG_WHITEBALANCERB:
  ------------------
  |  Branch (379:2): [True: 1.28k, False: 46.7k]
  ------------------
  380|  1.28k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.28k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.28k|{                                                               \
  |  |   37|  1.28k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 215, False: 1.07k]
  |  |  ------------------
  |  |   38|    215|                snprintf (v, maxlen,	                        \
  |  |   39|    215|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    215|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    215|                        "expected '%s'."),                      \
  |  |   41|    215|                        exif_format_get_name (format),          \
  |  |   42|    215|                        exif_format_get_name (target));         \
  |  |   43|    215|                break;                                          \
  |  |   44|    215|        }                                                       \
  |  |   45|  1.28k|}
  ------------------
  381|  1.07k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.07k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.07k|{                                                                       \
  |  |   62|  1.07k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 228, False: 843]
  |  |  ------------------
  |  |   63|    228|                snprintf (v, maxlen,                                    \
  |  |   64|    228|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    228|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    228|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    228|                break;                                                  \
  |  |   67|    228|        }                                                               \
  |  |   68|  1.07k|}
  ------------------
  382|    843|		vr = exif_get_rational (entry->data, entry->order);
  383|    843|		r = R2D(vr);
  ------------------
  |  |   82|    843|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 621, False: 222]
  |  |  ------------------
  ------------------
  384|    843|		vr = exif_get_rational (entry->data+8, entry->order);
  385|    843|		b = R2D(vr);
  ------------------
  |  |   82|    843|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 619, False: 224]
  |  |  ------------------
  ------------------
  386|    843|		snprintf (v, maxlen, _("Red Correction %f, blue Correction %f"), r,b);
  ------------------
  |  |   31|    843|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  387|    843|		break;
  388|  1.12k|	case MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE:
  ------------------
  |  Branch (388:2): [True: 1.12k, False: 46.9k]
  ------------------
  389|  1.12k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.12k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.12k|{                                                               \
  |  |   37|  1.12k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 300, False: 826]
  |  |  ------------------
  |  |   38|    300|                snprintf (v, maxlen,	                        \
  |  |   39|    300|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    300|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    300|                        "expected '%s'."),                      \
  |  |   41|    300|                        exif_format_get_name (format),          \
  |  |   42|    300|                        exif_format_get_name (target));         \
  |  |   43|    300|                break;                                          \
  |  |   44|    300|        }                                                       \
  |  |   45|  1.12k|}
  ------------------
  390|    826|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    826|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    826|{                                                                       \
  |  |   62|    826|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 222, False: 604]
  |  |  ------------------
  |  |   63|    222|                snprintf (v, maxlen,                                    \
  |  |   64|    222|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    222|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    222|                break;                                                  \
  |  |   67|    222|        }                                                               \
  |  |   68|    826|}
  ------------------
  391|    604|		vr = exif_get_rational (entry->data, entry->order);
  392|    604|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (392:7): [True: 196, False: 408]
  |  Branch (392:24): [True: 97, False: 311]
  ------------------
  393|    293|			strncpy (v, _("No manual focus selection"), maxlen);
  ------------------
  |  |   31|    293|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  394|    311|		} else {
  395|    311|			r = R2D(vr);
  ------------------
  |  |   82|    311|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 311, False: 0]
  |  |  ------------------
  ------------------
  396|    311|			snprintf (v, maxlen, _("%2.2f meters"), r);
  ------------------
  |  |   31|    311|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  397|    311|		}
  398|    604|		break;
  399|  1.60k|	case MNOTE_NIKON_TAG_SENSORPIXELSIZE:
  ------------------
  |  Branch (399:2): [True: 1.60k, False: 46.4k]
  ------------------
  400|  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: 226, False: 1.38k]
  |  |  ------------------
  |  |   38|    226|                snprintf (v, maxlen,	                        \
  |  |   39|    226|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    226|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    226|                        "expected '%s'."),                      \
  |  |   41|    226|                        exif_format_get_name (format),          \
  |  |   42|    226|                        exif_format_get_name (target));         \
  |  |   43|    226|                break;                                          \
  |  |   44|    226|        }                                                       \
  |  |   45|  1.60k|}
  ------------------
  401|  1.38k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.38k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.38k|{                                                                       \
  |  |   62|  1.38k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 283, False: 1.09k]
  |  |  ------------------
  |  |   63|    283|                snprintf (v, maxlen,                                    \
  |  |   64|    283|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    283|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    283|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    283|                break;                                                  \
  |  |   67|    283|        }                                                               \
  |  |   68|  1.38k|}
  ------------------
  402|  1.09k|		vr = exif_get_rational (entry->data, entry->order);
  403|  1.09k|		vr2 = exif_get_rational (entry->data+8, entry->order);
  404|  1.09k|		r = R2D(vr);
  ------------------
  |  |   82|  1.09k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 857, False: 242]
  |  |  ------------------
  ------------------
  405|  1.09k|		b = R2D(vr2);
  ------------------
  |  |   82|  1.09k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 854, False: 245]
  |  |  ------------------
  ------------------
  406|  1.09k|		snprintf (v, maxlen, "%2.2f x %2.2f um", r, b);
  407|  1.09k|		break;
  408|    942|	case MNOTE_NIKON_TAG_BRACKETING:
  ------------------
  |  Branch (408:2): [True: 942, False: 47.1k]
  ------------------
  409|    942|		CF2 (entry->format, EXIF_FORMAT_BYTE, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   47|    942|#define CF2(format,target1,target2,v,maxlen)                    \
  |  |   48|    942|{                                                               \
  |  |   49|    942|        if ((format != target1) && (format != target2)) {       \
  |  |  ------------------
  |  |  |  Branch (49:13): [True: 672, False: 270]
  |  |  |  Branch (49:36): [True: 340, False: 332]
  |  |  ------------------
  |  |   50|    340|                snprintf (v, maxlen,	                        \
  |  |   51|    340|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    340|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   52|    340|                        "expected '%s' or '%s'."),              \
  |  |   53|    340|                        exif_format_get_name (format),          \
  |  |   54|    340|                        exif_format_get_name (target1),         \
  |  |   55|    340|                        exif_format_get_name (target2));        \
  |  |   56|    340|                break;                                          \
  |  |   57|    340|        }                                                       \
  |  |   58|    942|}
  ------------------
  410|    602|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    602|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    602|{                                                                       \
  |  |   62|    602|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 204, False: 398]
  |  |  ------------------
  |  |   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|    602|}
  ------------------
  411|    398|		if (EXIF_FORMAT_SHORT == entry->format) {
  ------------------
  |  Branch (411:7): [True: 202, False: 196]
  ------------------
  412|    202|			vs = exif_get_short (entry->data, entry->order);
  413|    202|		} else {
  414|    196|			vs = entry->data[0];
  415|    196|		}
  416|    398|		snprintf (v, maxlen, "%hd", vs);
  417|    398|		break;
  418|  2.77k|	case MNOTE_NIKON_TAG_AFFOCUSPOSITION:
  ------------------
  |  Branch (418:2): [True: 2.77k, False: 45.3k]
  ------------------
  419|  2.77k|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|  2.77k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.77k|{                                                               \
  |  |   37|  2.77k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 202, False: 2.56k]
  |  |  ------------------
  |  |   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|  2.77k|}
  ------------------
  420|  2.56k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  2.56k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.56k|{                                                                       \
  |  |   62|  2.56k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 209, False: 2.36k]
  |  |  ------------------
  |  |   63|    209|                snprintf (v, maxlen,                                    \
  |  |   64|    209|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    209|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    209|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    209|                break;                                                  \
  |  |   67|    209|        }                                                               \
  |  |   68|  2.56k|}
  ------------------
  421|  2.36k|		switch (  *( entry->data+1)  ) {
  422|    200|		  	case  0: strncpy (v, _("AF position: center"), maxlen); break;
  ------------------
  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (422:6): [True: 200, False: 2.16k]
  ------------------
  423|    194|		  	case  1: strncpy (v, _("AF position: top"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (423:6): [True: 194, False: 2.16k]
  ------------------
  424|    194|		  	case  2: strncpy (v, _("AF position: bottom"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (424:6): [True: 194, False: 2.16k]
  ------------------
  425|    196|		  	case  3: strncpy (v, _("AF position: left"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (425:6): [True: 196, False: 2.16k]
  ------------------
  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.16k]
  ------------------
  427|    194|			case  5: strncpy (v, _("AF position: upper-left"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (427:4): [True: 194, False: 2.16k]
  ------------------
  428|    208|		  	case  6: strncpy (v, _("AF position: upper-right"), maxlen); break;
  ------------------
  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (428:6): [True: 208, False: 2.15k]
  ------------------
  429|    194|		  	case  7: strncpy (v, _("AF position: lower-left"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (429:6): [True: 194, False: 2.16k]
  ------------------
  430|    194|		  	case  8: strncpy (v, _("AF position: lower-right"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (430:6): [True: 194, False: 2.16k]
  ------------------
  431|    196|		  	case  9: strncpy (v, _("AF position: far left"), maxlen); break;
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (431:6): [True: 196, False: 2.16k]
  ------------------
  432|    194|		  	case  10: strncpy (v, _("AF position: far right"), maxlen); break;
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (432:6): [True: 194, False: 2.16k]
  ------------------
  433|    202|		  	default: strncpy (v, _("Unknown AF position"), maxlen);
  ------------------
  |  |   31|    202|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  |  Branch (433:6): [True: 202, False: 2.15k]
  ------------------
  434|  2.36k|		}     
  435|  2.36k|		break;
  436|  2.36k|	case MNOTE_OLYMPUS_TAG_FLASHDEVICE:
  ------------------
  |  Branch (436:2): [True: 1.38k, False: 46.6k]
  ------------------
  437|  1.38k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.38k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.38k|{                                                               \
  |  |   37|  1.38k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 1.17k]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|  1.38k|}
  ------------------
  438|  1.17k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  1.17k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.17k|{                                                                       \
  |  |   62|  1.17k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 197, False: 973]
  |  |  ------------------
  |  |   63|    197|                snprintf (v, maxlen,                                    \
  |  |   64|    197|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    197|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    197|                break;                                                  \
  |  |   67|    197|        }                                                               \
  |  |   68|  1.17k|}
  ------------------
  439|    973|		vs = exif_get_short(entry->data, entry->order);
  440|       |		/* search for the tag */
  441|  13.6k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (441:16): [True: 13.6k, False: 0]
  |  Branch (441:32): [True: 12.6k, False: 973]
  ------------------
  442|  12.6k|			;
  443|    973|		if (!items[i].tag) {
  ------------------
  |  Branch (443:7): [True: 0, False: 973]
  ------------------
  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|    973|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|    973|#define CF(format,target,v,maxlen)                              \
  |  |   36|    973|{                                                               \
  |  |   37|    973|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 973]
  |  |  ------------------
  |  |   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|    973|}
  ------------------
  448|       |		/* find the value */
  449|  2.67k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (449:15): [True: 2.42k, False: 245]
  ------------------
  450|  2.42k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (450:8): [True: 1.69k, False: 728]
  ------------------
  451|    973|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (451:7): [True: 264, False: 709]
  ------------------
  452|    264|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|    264|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  453|    264|			break;
  454|    264|		}
  455|    709|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    709|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  456|    709|		break;
  457|  1.31k|	case MNOTE_OLYMPUS_TAG_DIGIZOOM:
  ------------------
  |  Branch (457:2): [True: 1.31k, False: 46.7k]
  ------------------
  458|  1.31k|		if (entry->format == EXIF_FORMAT_RATIONAL) {
  ------------------
  |  Branch (458:7): [True: 960, False: 353]
  ------------------
  459|    960|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    960|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    960|{                                                                       \
  |  |   62|    960|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 217, False: 743]
  |  |  ------------------
  |  |   63|    217|                snprintf (v, maxlen,                                    \
  |  |   64|    217|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    217|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    217|                break;                                                  \
  |  |   67|    217|        }                                                               \
  |  |   68|    960|}
  ------------------
  460|    743|			vr = exif_get_rational (entry->data, entry->order);
  461|    743|			if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (461:8): [True: 203, False: 540]
  |  Branch (461:25): [True: 226, False: 314]
  ------------------
  462|    429|				strncpy (v, _("None"), maxlen);
  ------------------
  |  |   31|    429|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  463|    429|			} else {
  464|    314|				r = R2D(vr);
  ------------------
  |  |   82|    314|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 314, False: 0]
  |  |  ------------------
  ------------------
  465|    314|				snprintf (v, maxlen, "%2.2f", r);
  466|    314|			}
  467|    743|			break;
  468|    960|		}
  469|       |		/* to handle SHORT version of this tag, */
  470|       |		/* fall through */
  471|    552|	case MNOTE_NIKON_TAG_LENSTYPE:
  ------------------
  |  Branch (471:2): [True: 199, False: 47.8k]
  ------------------
  472|    758|	case MNOTE_NIKON_TAG_FLASHUSED:
  ------------------
  |  Branch (472:2): [True: 206, False: 47.8k]
  ------------------
  473|    963|	case MNOTE_NIKON1_TAG_QUALITY:
  ------------------
  |  Branch (473:2): [True: 205, False: 47.8k]
  ------------------
  474|  1.16k|	case MNOTE_NIKON1_TAG_COLORMODE:
  ------------------
  |  Branch (474:2): [True: 198, False: 47.8k]
  ------------------
  475|  1.38k|	case MNOTE_NIKON1_TAG_IMAGEADJUSTMENT:
  ------------------
  |  Branch (475:2): [True: 219, False: 47.8k]
  ------------------
  476|  1.59k|	case MNOTE_NIKON1_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (476:2): [True: 217, False: 47.8k]
  ------------------
  477|  1.82k|	case MNOTE_NIKON1_TAG_WHITEBALANCE:
  ------------------
  |  Branch (477:2): [True: 228, False: 47.8k]
  ------------------
  478|  2.02k|	case MNOTE_NIKON1_TAG_CONVERTER:
  ------------------
  |  Branch (478:2): [True: 203, False: 47.8k]
  ------------------
  479|  2.25k|	case MNOTE_OLYMPUS_TAG_QUALITY:
  ------------------
  |  Branch (479:2): [True: 228, False: 47.8k]
  ------------------
  480|  2.45k|	case MNOTE_OLYMPUS_TAG_MACRO:
  ------------------
  |  Branch (480:2): [True: 200, False: 47.8k]
  ------------------
  481|  2.78k|	case MNOTE_OLYMPUS_TAG_BWMODE:
  ------------------
  |  Branch (481:2): [True: 333, False: 47.7k]
  ------------------
  482|  2.99k|	case MNOTE_OLYMPUS_TAG_ONETOUCHWB:
  ------------------
  |  Branch (482:2): [True: 209, False: 47.8k]
  ------------------
  483|  3.20k|	case MNOTE_OLYMPUS_TAG_FLASHMODE:
  ------------------
  |  Branch (483:2): [True: 206, False: 47.8k]
  ------------------
  484|  3.40k|	case MNOTE_OLYMPUS_TAG_FOCUSRANGE:
  ------------------
  |  Branch (484:2): [True: 196, False: 47.8k]
  ------------------
  485|  3.61k|	case MNOTE_OLYMPUS_TAG_MANFOCUS:
  ------------------
  |  Branch (485:2): [True: 213, False: 47.8k]
  ------------------
  486|  3.81k|	case MNOTE_OLYMPUS_TAG_SHARPNESS:
  ------------------
  |  Branch (486:2): [True: 198, False: 47.8k]
  ------------------
  487|  4.00k|	case MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE:
  ------------------
  |  Branch (487:2): [True: 194, False: 47.8k]
  ------------------
  488|  4.47k|	case MNOTE_OLYMPUS_TAG_CONTRAST:
  ------------------
  |  Branch (488:2): [True: 468, False: 47.6k]
  ------------------
  489|  4.67k|	case MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID:
  ------------------
  |  Branch (489:2): [True: 197, False: 47.8k]
  ------------------
  490|  4.87k|	case MNOTE_OLYMPUS_TAG_CCDSCANMODE:
  ------------------
  |  Branch (490:2): [True: 200, False: 47.8k]
  ------------------
  491|  5.07k|	case MNOTE_SANYO_TAG_SEQUENTIALSHOT:
  ------------------
  |  Branch (491:2): [True: 204, False: 47.8k]
  ------------------
  492|  5.27k|	case MNOTE_SANYO_TAG_FOCUSMODE:
  ------------------
  |  Branch (492:2): [True: 197, False: 47.8k]
  ------------------
  493|  5.46k|	case MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE:
  ------------------
  |  Branch (493:2): [True: 194, False: 47.8k]
  ------------------
  494|  5.65k|	case MNOTE_SANYO_TAG_RESAVED:
  ------------------
  |  Branch (494:2): [True: 194, False: 47.8k]
  ------------------
  495|  5.86k|	case MNOTE_SANYO_TAG_CCDSENSITIVITY:
  ------------------
  |  Branch (495:2): [True: 201, False: 47.8k]
  ------------------
  496|  6.05k|	case MNOTE_SANYO_TAG_SCENESELECT:
  ------------------
  |  Branch (496:2): [True: 195, False: 47.8k]
  ------------------
  497|  6.41k|	case MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL:
  ------------------
  |  Branch (497:2): [True: 355, False: 47.7k]
  ------------------
  498|  6.41k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  6.41k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  6.41k|{                                                                       \
  |  |   62|  6.41k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 2.49k, False: 3.91k]
  |  |  ------------------
  |  |   63|  2.49k|                snprintf (v, maxlen,                                    \
  |  |   64|  2.49k|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|  2.49k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|  2.49k|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|  2.49k|                break;                                                  \
  |  |   67|  2.49k|        }                                                               \
  |  |   68|  6.41k|}
  ------------------
  499|  3.91k|		switch (entry->format) {
  500|    790|		case EXIF_FORMAT_BYTE:
  ------------------
  |  Branch (500:3): [True: 790, False: 3.12k]
  ------------------
  501|  1.49k|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (501:3): [True: 706, False: 3.21k]
  ------------------
  502|  1.49k|			vs = entry->data[0];
  503|  1.49k|			break;
  504|  1.65k|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (504:3): [True: 1.65k, False: 2.25k]
  ------------------
  505|  1.65k|			vs = exif_get_short(entry->data, entry->order);
  506|  1.65k|			break;
  507|    762|		default:
  ------------------
  |  Branch (507:3): [True: 762, False: 3.15k]
  ------------------
  508|    762|			vs = 0;
  509|    762|			break;
  510|  3.91k|		}
  511|       |		/* search for the tag */
  512|  68.0k|		for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++)
  ------------------
  |  Branch (512:16): [True: 67.8k, False: 210]
  |  Branch (512:32): [True: 64.1k, False: 3.70k]
  ------------------
  513|  64.1k|			;
  514|  3.91k|		if (!items[i].tag) {
  ------------------
  |  Branch (514:7): [True: 210, False: 3.70k]
  ------------------
  515|    210|		  	snprintf (v, maxlen, _("Internal error (unknown value %hi)"), vs);
  ------------------
  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  516|    210|		  	break;
  517|    210|		}
  518|  3.70k|		CF (entry->format, items[i].fmt, v, maxlen)
  ------------------
  |  |   35|  3.70k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  3.70k|{                                                               \
  |  |   37|  3.70k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 1.80k, False: 1.90k]
  |  |  ------------------
  |  |   38|  1.80k|                snprintf (v, maxlen,	                        \
  |  |   39|  1.80k|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  1.80k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|  1.80k|                        "expected '%s'."),                      \
  |  |   41|  1.80k|                        exif_format_get_name (format),          \
  |  |   42|  1.80k|                        exif_format_get_name (target));         \
  |  |   43|  1.80k|                break;                                          \
  |  |   44|  1.80k|        }                                                       \
  |  |   45|  3.70k|}
  ------------------
  519|       |		/* find the value */
  520|  9.91k|		for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (520:15): [True: 8.87k, False: 1.04k]
  ------------------
  521|  8.87k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (521:8): [True: 8.00k, False: 863]
  ------------------
  522|  1.90k|		if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (522:7): [True: 1.08k, False: 820]
  ------------------
  523|  1.08k|			snprintf (v, maxlen, _("Unknown value %hi"), vs);
  ------------------
  |  |   31|  1.08k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  524|  1.08k|			break;
  525|  1.08k|		}
  526|    820|		strncpy (v, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    820|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  527|    820|		break;
  528|    215|	case MNOTE_OLYMPUS_TAG_NOISEREDUCTION:
  ------------------
  |  Branch (528:2): [True: 215, False: 47.8k]
  ------------------
  529|    422|	case MNOTE_SANYO_TAG_WIDERANGE:
  ------------------
  |  Branch (529:2): [True: 207, False: 47.8k]
  ------------------
  530|    626|	case MNOTE_SANYO_TAG_COLORADJUSTMENTMODE:
  ------------------
  |  Branch (530:2): [True: 204, False: 47.8k]
  ------------------
  531|    826|	case MNOTE_SANYO_TAG_QUICKSHOT:
  ------------------
  |  Branch (531:2): [True: 200, False: 47.8k]
  ------------------
  532|  1.02k|	case MNOTE_SANYO_TAG_VOICEMEMO:
  ------------------
  |  Branch (532:2): [True: 200, False: 47.8k]
  ------------------
  533|  1.22k|	case MNOTE_SANYO_TAG_FLICKERREDUCE:
  ------------------
  |  Branch (533:2): [True: 194, False: 47.8k]
  ------------------
  534|  1.60k|	case MNOTE_SANYO_TAG_OPTICALZOOM:
  ------------------
  |  Branch (534:2): [True: 384, False: 47.6k]
  ------------------
  535|  1.79k|	case MNOTE_SANYO_TAG_DIGITALZOOM:
  ------------------
  |  Branch (535:2): [True: 194, False: 47.8k]
  ------------------
  536|  2.12k|	case MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL:
  ------------------
  |  Branch (536:2): [True: 331, False: 47.7k]
  ------------------
  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: 798, False: 1.33k]
  |  |  ------------------
  |  |   38|    798|                snprintf (v, maxlen,	                        \
  |  |   39|    798|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    798|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    798|                        "expected '%s'."),                      \
  |  |   41|    798|                        exif_format_get_name (format),          \
  |  |   42|    798|                        exif_format_get_name (target));         \
  |  |   43|    798|                break;                                          \
  |  |   44|    798|        }                                                       \
  |  |   45|  2.12k|}
  ------------------
  538|  1.33k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.33k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.33k|{                                                                       \
  |  |   62|  1.33k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 344, False: 987]
  |  |  ------------------
  |  |   63|    344|                snprintf (v, maxlen,                                    \
  |  |   64|    344|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    344|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    344|                break;                                                  \
  |  |   67|    344|        }                                                               \
  |  |   68|  1.33k|}
  ------------------
  539|    987|		vs = exif_get_short (entry->data, entry->order);
  540|    987|		switch (vs) {
  541|    360|		case 0:
  ------------------
  |  Branch (541:3): [True: 360, False: 627]
  ------------------
  542|    360|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    360|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  543|    360|			break;
  544|    203|		case 1:
  ------------------
  |  Branch (544:3): [True: 203, False: 784]
  ------------------
  545|    203|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    203|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  546|    203|			break;
  547|    424|		default:
  ------------------
  |  Branch (547:3): [True: 424, False: 563]
  ------------------
  548|    424|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    424|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  549|    424|			strncat (v, buf, maxlen - strlen (v));
  550|    424|			break;
  551|    987|		}
  552|    987|		break;
  553|  1.26k|	case MNOTE_SANYO_TAG_SELFTIMER:
  ------------------
  |  Branch (553:2): [True: 1.26k, False: 46.8k]
  ------------------
  554|  1.26k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.26k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.26k|{                                                               \
  |  |   37|  1.26k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 1.04k]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|  1.26k|}
  ------------------
  555|  1.04k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.04k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.04k|{                                                                       \
  |  |   62|  1.04k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 210, False: 839]
  |  |  ------------------
  |  |   63|    210|                snprintf (v, maxlen,                                    \
  |  |   64|    210|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    210|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    210|                break;                                                  \
  |  |   67|    210|        }                                                               \
  |  |   68|  1.04k|}
  ------------------
  556|    839|		vs = exif_get_short (entry->data, entry->order);
  557|    839|		switch (vs) {
  558|    251|		case 0:
  ------------------
  |  Branch (558:3): [True: 251, False: 588]
  ------------------
  559|    251|			strncpy (v, _("Off"), maxlen);
  ------------------
  |  |   31|    251|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  560|    251|			break;
  561|    195|		case 1:
  ------------------
  |  Branch (561:3): [True: 195, False: 644]
  ------------------
  562|    195|			strncpy (v, _("On"), maxlen);
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  563|    195|			break;
  564|    196|		case 2:
  ------------------
  |  Branch (564:3): [True: 196, False: 643]
  ------------------
  565|    196|			strncpy (v, _("2 sec."), maxlen);
  ------------------
  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  566|    196|			break;
  567|    197|		default:
  ------------------
  |  Branch (567:3): [True: 197, False: 642]
  ------------------
  568|    197|			sprintf (buf, _("Unknown %hu"), vs);
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  569|    197|			strncat (v, buf, maxlen - strlen (v));
  570|    197|			break;
  571|    839|		}
  572|    839|		break;
  573|  1.80k|	case MNOTE_NIKON_TAG_LENS:
  ------------------
  |  Branch (573:2): [True: 1.80k, False: 46.2k]
  ------------------
  574|  1.80k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.80k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.80k|{                                                               \
  |  |   37|  1.80k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 213, False: 1.58k]
  |  |  ------------------
  |  |   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|  1.80k|}
  ------------------
  575|  1.58k|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|  1.58k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.58k|{                                                                       \
  |  |   62|  1.58k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 205, False: 1.38k]
  |  |  ------------------
  |  |   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.58k|}
  ------------------
  576|  1.38k|		{
  577|  1.38k|			double ao,ac;
  578|  1.38k|			unsigned long fs,fl;
  579|  1.38k|			vr = exif_get_rational (entry->data, entry->order);
  580|  1.38k|			fs = R2L(vr);
  ------------------
  |  |   81|  1.38k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 869, False: 513]
  |  |  ------------------
  ------------------
  581|  1.38k|			vr = exif_get_rational (entry->data+8, entry->order);
  582|  1.38k|			fl = R2L(vr);
  ------------------
  |  |   81|  1.38k|#define R2L(n) ((n).denominator ? (unsigned long)(n).numerator/(n).denominator : 0L)
  |  |  ------------------
  |  |  |  Branch (81:17): [True: 1.14k, False: 235]
  |  |  ------------------
  ------------------
  583|  1.38k|			vr = exif_get_rational (entry->data+16, entry->order);
  584|  1.38k|			ao = R2D(vr);
  ------------------
  |  |   82|  1.38k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 1.15k, False: 227]
  |  |  ------------------
  ------------------
  585|  1.38k|			vr = exif_get_rational (entry->data+24, entry->order);
  586|  1.38k|			ac = R2D(vr);
  ------------------
  |  |   82|  1.38k|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 920, False: 462]
  |  |  ------------------
  ------------------
  587|  1.38k|			snprintf (v, maxlen, "%ld-%ldmm 1:%3.1f - %3.1f",fs,fl,ao,ac);
  588|  1.38k|		}
  589|  1.38k|		break;
  590|       |
  591|       |	/* Olympus */
  592|  2.02k|	case MNOTE_OLYMPUS_TAG_MODE:
  ------------------
  |  Branch (592:2): [True: 2.02k, False: 46.0k]
  ------------------
  593|  2.02k|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|  2.02k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.02k|{                                                               \
  |  |   37|  2.02k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 1.81k]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|  2.02k|}
  ------------------
  594|  1.81k|		CC (entry->components, 3, v, maxlen)
  ------------------
  |  |   60|  1.81k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.81k|{                                                                       \
  |  |   62|  1.81k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 236, False: 1.58k]
  |  |  ------------------
  |  |   63|    236|                snprintf (v, maxlen,                                    \
  |  |   64|    236|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    236|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    236|                break;                                                  \
  |  |   67|    236|        }                                                               \
  |  |   68|  1.81k|}
  ------------------
  595|  1.58k|		vl = exif_get_long (entry->data, entry->order);
  596|  1.58k|		switch (vl) {
  597|    242|		case 0:
  ------------------
  |  Branch (597:3): [True: 242, False: 1.33k]
  ------------------
  598|    242|			strncpy (v, _("Normal"), maxlen);
  ------------------
  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  599|    242|			break;
  600|    211|		case 1:
  ------------------
  |  Branch (600:3): [True: 211, False: 1.36k]
  ------------------
  601|    211|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  602|    211|			break;
  603|    194|		case 2:
  ------------------
  |  Branch (603:3): [True: 194, False: 1.38k]
  ------------------
  604|    194|			strncpy (v, _("Fast"), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  605|    194|			break;
  606|    194|		case 3:
  ------------------
  |  Branch (606:3): [True: 194, False: 1.38k]
  ------------------
  607|    194|			strncpy (v, _("Panorama"), maxlen);
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  608|    194|			break;
  609|    739|		default:
  ------------------
  |  Branch (609:3): [True: 739, False: 841]
  ------------------
  610|    739|			snprintf (v, maxlen, "%li", (long int) vl);
  611|  1.58k|		}
  612|  1.58k|		vl = exif_get_long (entry->data + 4, entry->order);
  613|  1.58k|		snprintf (buf, sizeof (buf), "/%li/", (long int) vl);
  614|  1.58k|		strncat (v, buf, maxlen - strlen (v));
  615|  1.58k|		vl = exif_get_long (entry->data + 8, entry->order);
  616|  1.58k|		switch (vl) {
  617|    194|		case 1:
  ------------------
  |  Branch (617:3): [True: 194, False: 1.38k]
  ------------------
  618|    194|			strncat (v, _("Left to right"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  619|    194|			break;
  620|    194|		case 2:
  ------------------
  |  Branch (620:3): [True: 194, False: 1.38k]
  ------------------
  621|    194|			strncat (v, _("Right to left"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  622|    194|			break;
  623|    201|		case 3:
  ------------------
  |  Branch (623:3): [True: 201, False: 1.37k]
  ------------------
  624|    201|			strncat (v, _("Bottom to top"), maxlen - strlen (v));
  ------------------
  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  625|    201|			break;
  626|    194|		case 4:
  ------------------
  |  Branch (626:3): [True: 194, False: 1.38k]
  ------------------
  627|    194|			strncat (v, _("Top to bottom"), maxlen - strlen (v));
  ------------------
  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  628|    194|			break;
  629|    797|		default:
  ------------------
  |  Branch (629:3): [True: 797, False: 783]
  ------------------
  630|    797|			snprintf (buf, sizeof (buf), "%li",
  631|    797|				  (long int) vl);
  632|    797|			strncat (v, buf, maxlen - strlen (v));
  633|  1.58k|		}
  634|  1.58k|		break;
  635|  1.58k|	case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
  ------------------
  |  Branch (635:2): [True: 1.50k, False: 46.5k]
  ------------------
  636|  1.50k|		if (entry->format == EXIF_FORMAT_SHORT) {
  ------------------
  |  Branch (636:7): [True: 401, False: 1.10k]
  ------------------
  637|       |			/* Epson uses a single SHORT here */
  638|    401|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    401|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    401|{                                                                       \
  |  |   62|    401|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 207, False: 194]
  |  |  ------------------
  |  |   63|    207|                snprintf (v, maxlen,                                    \
  |  |   64|    207|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    207|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    207|                break;                                                  \
  |  |   67|    207|        }                                                               \
  |  |   68|    401|}
  ------------------
  639|    194|			vs = exif_get_short (entry->data, entry->order);
  640|    194|			sprintf (buf, "%hu", vs);
  641|    194|			strncat (v, buf, maxlen - strlen (v));
  642|  1.10k|		} else {
  643|       |			/* Others use an array of SSHORT here */
  644|  1.10k|			CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|  1.10k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.10k|{                                                                       \
  |  |   62|  1.10k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 210, False: 898]
  |  |  ------------------
  |  |   63|    210|                snprintf (v, maxlen,                                    \
  |  |   64|    210|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    210|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    210|                break;                                                  \
  |  |   67|    210|        }                                                               \
  |  |   68|  1.10k|}
  ------------------
  645|    898|			CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen)
  ------------------
  |  |   35|    898|#define CF(format,target,v,maxlen)                              \
  |  |   36|    898|{                                                               \
  |  |   37|    898|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 197, False: 701]
  |  |  ------------------
  |  |   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|    898|}
  ------------------
  646|  4.90k|			for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (646:14): [True: 4.20k, False: 701]
  ------------------
  647|  4.20k|				vss = exif_get_sshort (entry->data+2*i, entry->order);
  648|  4.20k|				sprintf (buf, "%hd ", vss);
  649|  4.20k|				strncat (v, buf, maxlen - strlen (v));
  650|  4.20k|			}
  651|    701|		}
  652|    895|		break;
  653|  1.08k|	case MNOTE_OLYMPUS_TAG_COLORCONTROL:
  ------------------
  |  Branch (653:2): [True: 1.08k, False: 46.9k]
  ------------------
  654|  1.08k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.08k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.08k|{                                                               \
  |  |   37|  1.08k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 194, False: 886]
  |  |  ------------------
  |  |   38|    194|                snprintf (v, maxlen,	                        \
  |  |   39|    194|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    194|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    194|                        "expected '%s'."),                      \
  |  |   41|    194|                        exif_format_get_name (format),          \
  |  |   42|    194|                        exif_format_get_name (target));         \
  |  |   43|    194|                break;                                          \
  |  |   44|    194|        }                                                       \
  |  |   45|  1.08k|}
  ------------------
  655|    886|		CC (entry->components, 6, v, maxlen)
  ------------------
  |  |   60|    886|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    886|{                                                                       \
  |  |   62|    886|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 197, False: 689]
  |  |  ------------------
  |  |   63|    197|                snprintf (v, maxlen,                                    \
  |  |   64|    197|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    197|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    197|                break;                                                  \
  |  |   67|    197|        }                                                               \
  |  |   68|    886|}
  ------------------
  656|  4.82k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (656:13): [True: 4.13k, False: 689]
  ------------------
  657|  4.13k|			vs = exif_get_short (entry->data+2*i, entry->order);
  658|  4.13k|			sprintf (buf, "%hu ", vs);
  659|  4.13k|			strncat (v, buf, maxlen - strlen (v));
  660|  4.13k|		}
  661|    689|		break;
  662|    864|	case MNOTE_OLYMPUS_TAG_VERSION:
  ------------------
  |  Branch (662:2): [True: 864, False: 47.2k]
  ------------------
  663|    864|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    864|#define CF(format,target,v,maxlen)                              \
  |  |   36|    864|{                                                               \
  |  |   37|    864|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 201, False: 663]
  |  |  ------------------
  |  |   38|    201|                snprintf (v, maxlen,	                        \
  |  |   39|    201|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    201|                        "expected '%s'."),                      \
  |  |   41|    201|                        exif_format_get_name (format),          \
  |  |   42|    201|                        exif_format_get_name (target));         \
  |  |   43|    201|                break;                                          \
  |  |   44|    201|        }                                                       \
  |  |   45|    864|}
  ------------------
  664|    663|		CC2 (entry->components, 5, 8, v, maxlen)
  ------------------
  |  |   70|    663|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    663|{                                                                       \
  |  |   72|    663|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 202, False: 461]
  |  |  |  Branch (72:23): [True: 234, False: 227]
  |  |  ------------------
  |  |   73|    436|		snprintf (v, maxlen,                                    \
  |  |   74|    436|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    436|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    436|			"expected %i or %i)."), (int) number,		\
  |  |   76|    436|			(int) t1, (int) t2);  				\
  |  |   77|    436|		break;                                                  \
  |  |   78|    436|	}                                                               \
  |  |   79|    663|}
  ------------------
  665|    227|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    227|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 227]
  |  |  ------------------
  ------------------
  666|    227|		break;
  667|    700|	case MNOTE_OLYMPUS_TAG_SERIALNUMBER2:
  ------------------
  |  Branch (667:2): [True: 700, False: 47.3k]
  ------------------
  668|    700|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    700|#define CF(format,target,v,maxlen)                              \
  |  |   36|    700|{                                                               \
  |  |   37|    700|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 206, False: 494]
  |  |  ------------------
  |  |   38|    206|                snprintf (v, maxlen,	                        \
  |  |   39|    206|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    206|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    206|                        "expected '%s'."),                      \
  |  |   41|    206|                        exif_format_get_name (format),          \
  |  |   42|    206|                        exif_format_get_name (target));         \
  |  |   43|    206|                break;                                          \
  |  |   44|    206|        }                                                       \
  |  |   45|    700|}
  ------------------
  669|    494|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    494|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 234, False: 260]
  |  |  ------------------
  ------------------
  670|    494|		break;
  671|    916|	case MNOTE_OLYMPUS_TAG_INFO:
  ------------------
  |  Branch (671:2): [True: 916, False: 47.1k]
  ------------------
  672|    916|		CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen)
  ------------------
  |  |   35|    916|#define CF(format,target,v,maxlen)                              \
  |  |   36|    916|{                                                               \
  |  |   37|    916|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 208, False: 708]
  |  |  ------------------
  |  |   38|    208|                snprintf (v, maxlen,	                        \
  |  |   39|    208|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    208|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    208|                        "expected '%s'."),                      \
  |  |   41|    208|                        exif_format_get_name (format),          \
  |  |   42|    208|                        exif_format_get_name (target));         \
  |  |   43|    208|                break;                                          \
  |  |   44|    208|        }                                                       \
  |  |   45|    916|}
  ------------------
  673|    708|		CC2 (entry->components, 52, 60, v, maxlen)
  ------------------
  |  |   70|    708|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   71|    708|{                                                                       \
  |  |   72|    708|	if ((number < t1) || (number > t2)) {                           \
  |  |  ------------------
  |  |  |  Branch (72:6): [True: 206, False: 502]
  |  |  |  Branch (72:23): [True: 257, False: 245]
  |  |  ------------------
  |  |   73|    463|		snprintf (v, maxlen,                                    \
  |  |   74|    463|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    463|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   75|    463|			"expected %i or %i)."), (int) number,		\
  |  |   76|    463|			(int) t1, (int) t2);  				\
  |  |   77|    463|		break;                                                  \
  |  |   78|    463|	}                                                               \
  |  |   79|    708|}
  ------------------
  674|    245|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    245|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 245]
  |  |  ------------------
  ------------------
  675|    245|		break;
  676|    642|	case MNOTE_OLYMPUS_TAG_ID:
  ------------------
  |  Branch (676:2): [True: 642, False: 47.4k]
  ------------------
  677|    642|		CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen)
  ------------------
  |  |   35|    642|#define CF(format,target,v,maxlen)                              \
  |  |   36|    642|{                                                               \
  |  |   37|    642|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 235, False: 407]
  |  |  ------------------
  |  |   38|    235|                snprintf (v, maxlen,	                        \
  |  |   39|    235|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    235|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    235|                        "expected '%s'."),                      \
  |  |   41|    235|                        exif_format_get_name (format),          \
  |  |   42|    235|                        exif_format_get_name (target));         \
  |  |   43|    235|                break;                                          \
  |  |   44|    235|        }                                                       \
  |  |   45|    642|}
  ------------------
  678|    407|		CC (entry->components, 32, v, maxlen)
  ------------------
  |  |   60|    407|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    407|{                                                                       \
  |  |   62|    407|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 213, False: 194]
  |  |  ------------------
  |  |   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|    407|}
  ------------------
  679|    194|		strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    194|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 194]
  |  |  ------------------
  ------------------
  680|    194|		break;
  681|      0|	case MNOTE_OLYMPUS_TAG_UNKNOWN_4:
  ------------------
  |  Branch (681:2): [True: 0, False: 48.0k]
  ------------------
  682|      0|		CF (entry->format, EXIF_FORMAT_LONG, v, maxlen)
  ------------------
  |  |   35|      0|#define CF(format,target,v,maxlen)                              \
  |  |   36|      0|{                                                               \
  |  |   37|      0|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|                snprintf (v, maxlen,	                        \
  |  |   39|      0|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|      0|                        "expected '%s'."),                      \
  |  |   41|      0|                        exif_format_get_name (format),          \
  |  |   42|      0|                        exif_format_get_name (target));         \
  |  |   43|      0|                break;                                          \
  |  |   44|      0|        }                                                       \
  |  |   45|      0|}
  ------------------
  683|      0|		CC (entry->components, 30, v, maxlen)
  ------------------
  |  |   60|      0|#define CC(number,target,v,maxlen)                                      \
  |  |   61|      0|{                                                                       \
  |  |   62|      0|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   63|      0|                snprintf (v, maxlen,                                    \
  |  |   64|      0|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|      0|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|      0|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|      0|                break;                                                  \
  |  |   67|      0|        }                                                               \
  |  |   68|      0|}
  ------------------
  684|      0|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (684:13): [True: 0, False: 0]
  ------------------
  685|      0|			vl = exif_get_long (entry->data+4*i, entry->order);
  686|      0|			sprintf (buf, "%lu ", (unsigned long)vl);
  687|      0|			strncat (v, buf, maxlen - strlen (v));
  688|      0|		}
  689|      0|		break;
  690|  1.19k|	case MNOTE_OLYMPUS_TAG_FOCUSDIST:
  ------------------
  |  Branch (690:2): [True: 1.19k, False: 46.8k]
  ------------------
  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: 88, False: 1.10k]
  |  |  ------------------
  |  |   38|     88|                snprintf (v, maxlen,	                        \
  |  |   39|     88|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|     88|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|     88|                        "expected '%s'."),                      \
  |  |   41|     88|                        exif_format_get_name (format),          \
  |  |   42|     88|                        exif_format_get_name (target));         \
  |  |   43|     88|                break;                                          \
  |  |   44|     88|        }                                                       \
  |  |   45|  1.19k|}
  ------------------
  692|  1.10k|		CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|  1.10k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  1.10k|{                                                                       \
  |  |   62|  1.10k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 217, False: 886]
  |  |  ------------------
  |  |   63|    217|                snprintf (v, maxlen,                                    \
  |  |   64|    217|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    217|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    217|                break;                                                  \
  |  |   67|    217|        }                                                               \
  |  |   68|  1.10k|}
  ------------------
  693|    886|		vr = exif_get_rational (entry->data, entry->order);
  694|    886|		if (!vr.numerator || !vr.denominator) {
  ------------------
  |  Branch (694:7): [True: 199, False: 687]
  |  Branch (694:24): [True: 225, False: 462]
  ------------------
  695|    424|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    424|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  696|    424|		}
  697|    462|		else {
  698|    462|			unsigned long tmp = vr.numerator / vr.denominator;
  699|    462|			snprintf (v, maxlen, "%li mm", tmp);
  700|    462|		}
  701|    886|		break;
  702|  2.42k|	case MNOTE_OLYMPUS_TAG_WBALANCE:
  ------------------
  |  Branch (702:2): [True: 2.42k, False: 45.6k]
  ------------------
  703|  2.42k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  2.42k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  2.42k|{                                                               \
  |  |   37|  2.42k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 211, False: 2.21k]
  |  |  ------------------
  |  |   38|    211|                snprintf (v, maxlen,	                        \
  |  |   39|    211|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    211|                        "expected '%s'."),                      \
  |  |   41|    211|                        exif_format_get_name (format),          \
  |  |   42|    211|                        exif_format_get_name (target));         \
  |  |   43|    211|                break;                                          \
  |  |   44|    211|        }                                                       \
  |  |   45|  2.42k|}
  ------------------
  704|  2.21k|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|  2.21k|#define CC(number,target,v,maxlen)                                      \
  |  |   61|  2.21k|{                                                                       \
  |  |   62|  2.21k|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 213, False: 2.00k]
  |  |  ------------------
  |  |   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|  2.21k|}
  ------------------
  705|  2.00k|		vs = exif_get_short (entry->data, entry->order);
  706|  2.00k|		switch (vs) {
  707|    223|		case 1:
  ------------------
  |  Branch (707:3): [True: 223, False: 1.78k]
  ------------------
  708|    223|			strncpy (v, _("Automatic"), maxlen);
  ------------------
  |  |   31|    223|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  709|    223|			break;
  710|  1.34k|		case 2:
  ------------------
  |  Branch (710:3): [True: 1.34k, False: 662]
  ------------------
  711|  1.34k|			{
  712|  1.34k|				ExifShort v2 = exif_get_short (entry->data + 2, entry->order);
  713|  1.34k|				unsigned long colorTemp = 0;
  714|  1.34k|				switch (v2) {
  ------------------
  |  Branch (714:13): [True: 1.13k, False: 211]
  ------------------
  715|     67|				case 2:
  ------------------
  |  Branch (715:5): [True: 67, False: 1.27k]
  ------------------
  716|     67|					colorTemp = 3000;
  717|     67|					break;
  718|    204|				case 3:
  ------------------
  |  Branch (718:5): [True: 204, False: 1.13k]
  ------------------
  719|    204|					colorTemp = 3700;
  720|    204|					break;
  721|    212|				case 4:
  ------------------
  |  Branch (721:5): [True: 212, False: 1.13k]
  ------------------
  722|    212|					colorTemp = 4000;
  723|    212|					break;
  724|     66|				case 5:
  ------------------
  |  Branch (724:5): [True: 66, False: 1.27k]
  ------------------
  725|     66|					colorTemp = 4500;
  726|     66|					break;
  727|    321|				case 6:
  ------------------
  |  Branch (727:5): [True: 321, False: 1.02k]
  ------------------
  728|    321|					colorTemp = 5500;
  729|    321|					break;
  730|     67|				case 7:
  ------------------
  |  Branch (730:5): [True: 67, False: 1.27k]
  ------------------
  731|     67|					colorTemp = 6500;
  732|     67|					break;
  733|    194|				case 9:
  ------------------
  |  Branch (733:5): [True: 194, False: 1.14k]
  ------------------
  734|    194|					colorTemp = 7500;
  735|    194|					break;
  736|  1.34k|				}
  737|  1.34k|				if (colorTemp) {
  ------------------
  |  Branch (737:9): [True: 1.13k, False: 211]
  ------------------
  738|  1.13k|					snprintf (v, maxlen, _("Manual: %liK"), colorTemp);
  ------------------
  |  |   31|  1.13k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  739|  1.13k|				}
  740|    211|				else {
  741|    211|					strncpy (v, _("Manual: unknown"), maxlen);
  ------------------
  |  |   31|    211|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  742|    211|				}
  743|       |
  744|  1.34k|			}
  745|      0|			break;
  746|    214|		case 3:
  ------------------
  |  Branch (746:3): [True: 214, False: 1.79k]
  ------------------
  747|    214|			strncpy (v, _("One-touch"), maxlen);
  ------------------
  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  748|    214|			break;
  749|    225|		default:
  ------------------
  |  Branch (749:3): [True: 225, False: 1.77k]
  ------------------
  750|    225|			strncpy (v, _("Unknown"), maxlen);
  ------------------
  |  |   31|    225|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  751|    225|			break;
  752|  2.00k|		}
  753|  2.00k|		break;
  754|  2.00k|	case MNOTE_OLYMPUS_TAG_REDBALANCE:
  ------------------
  |  Branch (754:2): [True: 263, False: 47.8k]
  ------------------
  755|    653|	case MNOTE_OLYMPUS_TAG_BLUEBALANCE:
  ------------------
  |  Branch (755:2): [True: 390, False: 47.6k]
  ------------------
  756|    653|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|    653|#define CF(format,target,v,maxlen)                              \
  |  |   36|    653|{                                                               \
  |  |   37|    653|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 220, False: 433]
  |  |  ------------------
  |  |   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|    653|}
  ------------------
  757|    433|		CC (entry->components, 2, v, maxlen)
  ------------------
  |  |   60|    433|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    433|{                                                                       \
  |  |   62|    433|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 196, False: 237]
  |  |  ------------------
  |  |   63|    196|                snprintf (v, maxlen,                                    \
  |  |   64|    196|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    196|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    196|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    196|                break;                                                  \
  |  |   67|    196|        }                                                               \
  |  |   68|    433|}
  ------------------
  758|    237|		vs = exif_get_short (entry->data, entry->order);
  759|    237|		snprintf (v, maxlen, "%hu ", vs);
  760|    237|		vs = exif_get_short (entry->data + 2, entry->order);
  761|    237|		sprintf (buf, "%hu", vs);
  762|    237|		strncat (v, buf, maxlen - strlen (v));
  763|    237|		break;
  764|    198|	case MNOTE_OLYMPUS_TAG_BLACKLEVEL:
  ------------------
  |  Branch (764:2): [True: 198, False: 47.8k]
  ------------------
  765|    550|	case MNOTE_NIKON_TAG_IMAGEBOUNDARY:
  ------------------
  |  Branch (765:2): [True: 352, False: 47.7k]
  ------------------
  766|    550|		CC (entry->components, 4, v, maxlen)
  ------------------
  |  |   60|    550|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    550|{                                                                       \
  |  |   62|    550|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 197, False: 353]
  |  |  ------------------
  |  |   63|    197|                snprintf (v, maxlen,                                    \
  |  |   64|    197|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    197|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    197|                break;                                                  \
  |  |   67|    197|        }                                                               \
  |  |   68|    550|}
  ------------------
  767|       |		/* Fall through to COLORMATRIX */
  768|       |		/* fall through */
  769|  1.03k|	case MNOTE_OLYMPUS_TAG_COLORMATRIX:
  ------------------
  |  Branch (769:2): [True: 681, False: 47.3k]
  ------------------
  770|  1.03k|		CF (entry->format, EXIF_FORMAT_SHORT, v, maxlen)
  ------------------
  |  |   35|  1.03k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.03k|{                                                               \
  |  |   37|  1.03k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 242, False: 792]
  |  |  ------------------
  |  |   38|    242|                snprintf (v, maxlen,	                        \
  |  |   39|    242|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    242|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    242|                        "expected '%s'."),                      \
  |  |   41|    242|                        exif_format_get_name (format),          \
  |  |   42|    242|                        exif_format_get_name (target));         \
  |  |   43|    242|                break;                                          \
  |  |   44|    242|        }                                                       \
  |  |   45|  1.03k|}
  ------------------
  771|    792|		if (entry->tag == MNOTE_OLYMPUS_TAG_COLORMATRIX)
  ------------------
  |  Branch (771:7): [True: 459, False: 333]
  ------------------
  772|    459|			CC (entry->components, 9, v, maxlen)
  ------------------
  |  |   60|    459|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    459|{                                                                       \
  |  |   62|    459|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 207, False: 252]
  |  |  ------------------
  |  |   63|    207|                snprintf (v, maxlen,                                    \
  |  |   64|    207|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    207|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    207|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    207|                break;                                                  \
  |  |   67|    207|        }                                                               \
  |  |   68|    459|}
  ------------------
  773|  4.18k|		for (i=0; i < (int)entry->components; ++i) {
  ------------------
  |  Branch (773:13): [True: 3.60k, False: 585]
  ------------------
  774|  3.60k|			vs = exif_get_short (entry->data+2*i, entry->order);
  775|  3.60k|			sprintf (buf, "%hu ", vs);
  776|  3.60k|			strncat (v, buf, maxlen - strlen (v));
  777|  3.60k|		}
  778|    585|		break;
  779|    198|	case MNOTE_NIKON1_TAG_FOCUS:
  ------------------
  |  Branch (779:2): [True: 198, False: 47.8k]
  ------------------
  780|    545|	case MNOTE_NIKON_TAG_DIGITALZOOM:
  ------------------
  |  Branch (780:2): [True: 347, False: 47.7k]
  ------------------
  781|    741|	case MNOTE_NIKON1_TAG_DIGITALZOOM:
  ------------------
  |  Branch (781:2): [True: 196, False: 47.8k]
  ------------------
  782|  1.16k|	case MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL:
  ------------------
  |  Branch (782:2): [True: 420, False: 47.6k]
  ------------------
  783|  1.16k|		CF (entry->format, EXIF_FORMAT_RATIONAL, v, maxlen)
  ------------------
  |  |   35|  1.16k|#define CF(format,target,v,maxlen)                              \
  |  |   36|  1.16k|{                                                               \
  |  |   37|  1.16k|        if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 498, False: 663]
  |  |  ------------------
  |  |   38|    498|                snprintf (v, maxlen,	                        \
  |  |   39|    498|                        _("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    498|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   40|    498|                        "expected '%s'."),                      \
  |  |   41|    498|                        exif_format_get_name (format),          \
  |  |   42|    498|                        exif_format_get_name (target));         \
  |  |   43|    498|                break;                                          \
  |  |   44|    498|        }                                                       \
  |  |   45|  1.16k|}
  ------------------
  784|       |		/* Fall through to default handler for display */
  785|       |		/* fall through */
  786|  4.25k|	default:
  ------------------
  |  Branch (786:2): [True: 3.58k, False: 44.4k]
  ------------------
  787|  4.25k|		switch (entry->format) {
  788|    489|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (788:3): [True: 489, False: 3.76k]
  ------------------
  789|    489|			strncpy (v, (char *)entry->data, MIN (maxlen, entry->size));
  ------------------
  |  |  182|    489|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 224, False: 265]
  |  |  ------------------
  ------------------
  790|    489|			break;
  791|    426|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (791:3): [True: 426, False: 3.82k]
  ------------------
  792|    426|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    426|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    426|{                                                                       \
  |  |   62|    426|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 231, False: 195]
  |  |  ------------------
  |  |   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|    426|}
  ------------------
  793|    195|			vs = exif_get_short (entry->data, entry->order);
  794|    195|			snprintf (v, maxlen, "%hu", vs);
  795|    195|			break;
  796|    410|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (796:3): [True: 410, False: 3.84k]
  ------------------
  797|    410|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    410|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    410|{                                                                       \
  |  |   62|    410|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 210, False: 200]
  |  |  ------------------
  |  |   63|    210|                snprintf (v, maxlen,                                    \
  |  |   64|    210|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    210|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    210|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    210|                break;                                                  \
  |  |   67|    210|        }                                                               \
  |  |   68|    410|}
  ------------------
  798|    200|			vss = exif_get_sshort (entry->data, entry->order);
  799|    200|			snprintf (v, maxlen, "%hi", vss);
  800|    200|			break;
  801|    401|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (801:3): [True: 401, False: 3.84k]
  ------------------
  802|    401|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    401|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    401|{                                                                       \
  |  |   62|    401|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 205, False: 196]
  |  |  ------------------
  |  |   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|    401|}
  ------------------
  803|    196|			vl = exif_get_long (entry->data, entry->order);
  804|    196|			snprintf (v, maxlen, "%lu", (long unsigned) vl);
  805|    196|			break;
  806|    449|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (806:3): [True: 449, False: 3.80k]
  ------------------
  807|    449|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    449|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    449|{                                                                       \
  |  |   62|    449|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 234, False: 215]
  |  |  ------------------
  |  |   63|    234|                snprintf (v, maxlen,                                    \
  |  |   64|    234|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    234|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    234|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    234|                break;                                                  \
  |  |   67|    234|        }                                                               \
  |  |   68|    449|}
  ------------------
  808|    215|			vsl = exif_get_slong (entry->data, entry->order);
  809|    215|			snprintf (v, maxlen, "%li", (long int) vsl);
  810|    215|			break;
  811|    831|		case EXIF_FORMAT_RATIONAL:
  ------------------
  |  Branch (811:3): [True: 831, False: 3.41k]
  ------------------
  812|    831|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    831|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    831|{                                                                       \
  |  |   62|    831|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 304, False: 527]
  |  |  ------------------
  |  |   63|    304|                snprintf (v, maxlen,                                    \
  |  |   64|    304|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    304|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    304|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    304|                break;                                                  \
  |  |   67|    304|        }                                                               \
  |  |   68|    831|}
  ------------------
  813|    527|			vr = exif_get_rational (entry->data, entry->order);
  814|    527|			if (!vr.denominator) {
  ------------------
  |  Branch (814:8): [True: 229, False: 298]
  ------------------
  815|    229|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    229|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  816|    298|			} else {
  817|    298|				r = R2D(vr);
  ------------------
  |  |   82|    298|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 298, False: 0]
  |  |  ------------------
  ------------------
  818|    298|				snprintf (v, maxlen, "%2.3f", r);
  819|    298|			}
  820|    527|			break;
  821|    753|		case EXIF_FORMAT_SRATIONAL:
  ------------------
  |  Branch (821:3): [True: 753, False: 3.49k]
  ------------------
  822|    753|			CC (entry->components, 1, v, maxlen)
  ------------------
  |  |   60|    753|#define CC(number,target,v,maxlen)                                      \
  |  |   61|    753|{                                                                       \
  |  |   62|    753|        if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (62:13): [True: 235, False: 518]
  |  |  ------------------
  |  |   63|    235|                snprintf (v, maxlen,                                    \
  |  |   64|    235|                        _("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    235|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   65|    235|                        "expected %i)."), (int) number, (int) target);  \
  |  |   66|    235|                break;                                                  \
  |  |   67|    235|        }                                                               \
  |  |   68|    753|}
  ------------------
  823|    518|			vsr = exif_get_srational (entry->data, entry->order);
  824|    518|			if (!vsr.denominator) {
  ------------------
  |  Branch (824:8): [True: 222, False: 296]
  ------------------
  825|    222|				strncpy (v, _("Infinite"), maxlen);
  ------------------
  |  |   31|    222|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  826|    296|			} else {
  827|    296|				r = R2D(vsr);
  ------------------
  |  |   82|    296|#define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
  |  |  ------------------
  |  |  |  Branch (82:17): [True: 296, False: 0]
  |  |  ------------------
  ------------------
  828|    296|				snprintf (v, maxlen, "%2.3f", r);
  829|    296|			}
  830|    518|			break;
  831|    213|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (831:3): [True: 213, False: 4.03k]
  ------------------
  832|    491|		default:
  ------------------
  |  Branch (832:3): [True: 278, False: 3.97k]
  ------------------
  833|    491|			snprintf (v, maxlen, _("%i bytes unknown data: "),
  ------------------
  |  |   31|    491|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  834|    491|				  entry->size);
  835|  67.5k|			for (i = 0; i < (int)entry->size; i++) {
  ------------------
  |  Branch (835:16): [True: 67.0k, False: 491]
  ------------------
  836|  67.0k|				sprintf (buf, "%02x", entry->data[i]);
  837|  67.0k|				strncat (v, buf, maxlen - strlen (v));
  838|  67.0k|			}
  839|    491|			break;
  840|  4.25k|		}
  841|  4.25k|		break;
  842|  48.0k|	}
  843|       |
  844|  48.0k|	return (v);
  845|  48.0k|}

mnote_olympus_tag_get_name:
  232|   147k|{
  233|   147k|	unsigned int i;
  234|       |
  235|  15.8M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (235:14): [True: 15.8M, False: 24.8k]
  ------------------
  236|  15.8M|		if (table[i].tag == t) return (table[i].name);
  ------------------
  |  Branch (236:7): [True: 122k, False: 15.7M]
  ------------------
  237|  24.8k|	return NULL;
  238|   147k|}
mnote_olympus_tag_get_title:
  242|  50.4k|{
  243|  50.4k|	unsigned int i;
  244|       |
  245|  50.4k|	(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  246|  4.34M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (246:14): [True: 4.34M, False: 0]
  ------------------
  247|  4.34M|		if (table[i].tag == t) {
  ------------------
  |  Branch (247:7): [True: 50.4k, False: 4.29M]
  ------------------
  248|  50.4k|			if (!table[i].title)
  ------------------
  |  Branch (248:8): [True: 0, False: 50.4k]
  ------------------
  249|      0|				return NULL;
  250|  50.4k|			return _(table[i].title);
  ------------------
  |  |   31|  50.4k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  251|  50.4k|		}
  252|      0|	return NULL;
  253|  50.4k|}
mnote_olympus_tag_get_description:
  257|  50.4k|{
  258|  50.4k|	unsigned int i;
  259|       |
  260|  4.34M|	for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
  ------------------
  |  Branch (260:14): [True: 4.34M, False: 0]
  ------------------
  261|  4.34M|		if (table[i].tag == t) {
  ------------------
  |  Branch (261:7): [True: 50.4k, False: 4.29M]
  ------------------
  262|  50.4k|			if (!table[i].description || !*table[i].description)
  ------------------
  |  Branch (262:8): [True: 219, False: 50.2k]
  |  Branch (262:33): [True: 49.5k, False: 704]
  ------------------
  263|  49.7k|				return "";
  264|    704|			(void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  265|    704|			return _(table[i].description);
  ------------------
  |  |   31|    704|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  266|  50.4k|		}
  267|      0|	return NULL;
  268|  50.4k|}

exif_mnote_data_pentax_identify:
  425|  1.32k|{
  426|  1.32k|	(void) ed;  /* unused */
  427|  1.32k|	if ((e->size >= 8) && !memcmp (e->data, "AOC", 4)) {
  ------------------
  |  Branch (427:6): [True: 1.11k, False: 216]
  |  Branch (427:24): [True: 482, False: 629]
  ------------------
  428|    482|		if (((e->data[4] == 'I') && (e->data[5] == 'I')) ||
  ------------------
  |  Branch (428:8): [True: 154, False: 328]
  |  Branch (428:31): [True: 6, False: 148]
  ------------------
  429|    476|		    ((e->data[4] == 'M') && (e->data[5] == 'M')))
  ------------------
  |  Branch (429:8): [True: 17, False: 459]
  |  Branch (429:31): [True: 2, False: 15]
  ------------------
  430|      8|			return pentaxV3;
  431|    474|		else
  432|       |			/* Uses Casio v2 tags */
  433|    474|			return pentaxV2;
  434|    482|	}
  435|       |
  436|    845|	if ((e->size >= 8) && !memcmp (e->data, "QVC", 4))
  ------------------
  |  Branch (436:6): [True: 629, False: 216]
  |  Branch (436:24): [True: 34, False: 595]
  ------------------
  437|     34|		return casioV2;
  438|       |
  439|       |	/* This isn't a very robust test, so make sure it's done last */
  440|       |	/* Maybe we should additionally check for a make of Asahi or Pentax */
  441|    811|	if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b))
  ------------------
  |  Branch (441:6): [True: 799, False: 12]
  |  Branch (441:24): [True: 623, False: 176]
  |  Branch (441:48): [True: 591, False: 32]
  ------------------
  442|    591|		return pentaxV1;
  443|       |
  444|    220|	return 0;
  445|    811|}
exif_mnote_data_pentax_new:
  449|  1.10k|{
  450|  1.10k|	ExifMnoteData *d;
  451|       |
  452|  1.10k|	if (!mem) return NULL;
  ------------------
  |  Branch (452:6): [True: 0, False: 1.10k]
  ------------------
  453|       |
  454|  1.10k|	d = exif_mem_alloc (mem, sizeof (ExifMnoteDataPentax));
  455|  1.10k|	if (!d) return NULL;
  ------------------
  |  Branch (455:6): [True: 0, False: 1.10k]
  ------------------
  456|       |
  457|  1.10k|	exif_mnote_data_construct (d, mem);
  458|       |
  459|       |	/* Set up function pointers */
  460|  1.10k|	d->methods.free            = exif_mnote_data_pentax_free;
  461|  1.10k|	d->methods.set_byte_order  = exif_mnote_data_pentax_set_byte_order;
  462|  1.10k|	d->methods.set_offset      = exif_mnote_data_pentax_set_offset;
  463|  1.10k|	d->methods.load            = exif_mnote_data_pentax_load;
  464|  1.10k|	d->methods.save            = exif_mnote_data_pentax_save;
  465|  1.10k|	d->methods.count           = exif_mnote_data_pentax_count;
  466|  1.10k|	d->methods.get_id          = exif_mnote_data_pentax_get_id;
  467|  1.10k|	d->methods.get_name        = exif_mnote_data_pentax_get_name;
  468|  1.10k|	d->methods.get_title       = exif_mnote_data_pentax_get_title;
  469|  1.10k|	d->methods.get_description = exif_mnote_data_pentax_get_description;
  470|  1.10k|	d->methods.get_value       = exif_mnote_data_pentax_get_value;
  471|       |
  472|  1.10k|	return d;
  473|  1.10k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_free:
   56|  1.10k|{
   57|  1.10k|	if (!n) return;
  ------------------
  |  Branch (57:6): [True: 0, False: 1.10k]
  ------------------
   58|       |
   59|  1.10k|	exif_mnote_data_pentax_clear ((ExifMnoteDataPentax *) n);
   60|  1.10k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_clear:
   36|  2.04k|{
   37|  2.04k|	ExifMnoteData *d = (ExifMnoteData *) n;
   38|  2.04k|	unsigned int i;
   39|       |
   40|  2.04k|	if (!n) return;
  ------------------
  |  Branch (40:6): [True: 0, False: 2.04k]
  ------------------
   41|       |
   42|  2.04k|	if (n->entries) {
  ------------------
  |  Branch (42:6): [True: 938, False: 1.10k]
  ------------------
   43|  18.3k|		for (i = 0; i < n->count; i++)
  ------------------
  |  Branch (43:15): [True: 17.4k, False: 938]
  ------------------
   44|  17.4k|			if (n->entries[i].data) {
  ------------------
  |  Branch (44:8): [True: 7.48k, False: 9.95k]
  ------------------
   45|  7.48k|				exif_mem_free (d->mem, n->entries[i].data);
   46|  7.48k|				n->entries[i].data = NULL;
   47|  7.48k|			}
   48|    938|		exif_mem_free (d->mem, n->entries);
   49|       |		n->entries = NULL;
   50|    938|		n->count = 0;
   51|    938|	}
   52|  2.04k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_byte_order:
  405|  1.10k|{
  406|  1.10k|	ExifByteOrder o_orig;
  407|  1.10k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
  408|  1.10k|	unsigned int i;
  409|       |
  410|  1.10k|	if (!n) return;
  ------------------
  |  Branch (410:6): [True: 0, False: 1.10k]
  ------------------
  411|       |
  412|  1.10k|	o_orig = n->order;
  413|  1.10k|	n->order = o;
  414|  1.10k|	for (i = 0; i < n->count; i++) {
  ------------------
  |  Branch (414:14): [True: 0, False: 1.10k]
  ------------------
  415|      0|		if (n->entries[i].components && (n->entries[i].size/n->entries[i].components < exif_format_get_size (n->entries[i].format)))
  ------------------
  |  Branch (415:7): [True: 0, False: 0]
  |  Branch (415:35): [True: 0, False: 0]
  ------------------
  416|      0|			continue;
  417|      0|		n->entries[i].order = o;
  418|      0|		exif_array_set_byte_order (n->entries[i].format, n->entries[i].data,
  419|      0|				n->entries[i].components, o_orig, o);
  420|      0|	}
  421|  1.10k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_set_offset:
  399|  1.10k|{
  400|  1.10k|	if (d) ((ExifMnoteDataPentax *) d)->offset = o;
  ------------------
  |  Branch (400:6): [True: 1.10k, False: 0]
  ------------------
  401|  1.10k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_load:
  219|  1.10k|{
  220|  1.10k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) en;
  221|  1.10k|	size_t i, tcount, o, datao, base = 0;
  222|  1.10k|	ExifShort c;
  223|       |
  224|  1.10k|	if (!n) return;
  ------------------
  |  Branch (224:6): [True: 0, False: 1.10k]
  ------------------
  225|       |
  226|  1.10k|	if (!buf || !buf_size) {
  ------------------
  |  Branch (226:6): [True: 0, False: 1.10k]
  |  Branch (226:14): [True: 0, False: 1.10k]
  ------------------
  227|      0|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  228|      0|			  "ExifMnoteDataPentax", "Short MakerNote");
  229|      0|		return;
  230|      0|	}
  231|  1.10k|	datao = 6 + n->offset;
  232|  1.10k|	if (exif_check_overflow (datao, buf_size, 8)) {
  ------------------
  |  Branch (232:6): [True: 18, False: 1.08k]
  ------------------
  233|     18|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  234|     18|			  "ExifMnoteDataPentax", "Short MakerNote");
  235|     18|		return;
  236|     18|	}
  237|       |
  238|       |	/* Detect variant of Pentax/Casio MakerNote found */
  239|  1.08k|	if (!memcmp(buf + datao, "AOC", 4)) {
  ------------------
  |  Branch (239:6): [True: 451, False: 638]
  ------------------
  240|    451|		if ((buf[datao + 4] == 'I') && (buf[datao + 5] == 'I')) {
  ------------------
  |  Branch (240:7): [True: 148, False: 303]
  |  Branch (240:34): [True: 6, False: 142]
  ------------------
  241|      6|			n->version = pentaxV3;
  242|      6|			n->order = EXIF_BYTE_ORDER_INTEL;
  243|    445|		} else if ((buf[datao + 4] == 'M') && (buf[datao + 5] == 'M')) {
  ------------------
  |  Branch (243:14): [True: 17, False: 428]
  |  Branch (243:41): [True: 2, False: 15]
  ------------------
  244|      2|			n->version = pentaxV3;
  245|      2|			n->order = EXIF_BYTE_ORDER_MOTOROLA;
  246|    443|		} else {
  247|       |			/* Uses Casio v2 tags */
  248|    443|			n->version = pentaxV2;
  249|    443|		}
  250|    451|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  251|    451|			"Parsing Pentax maker note v%d...", (int)n->version);
  252|    451|		datao += 4 + 2;
  253|    451|		base = MNOTE_PENTAX2_TAG_BASE;
  254|    638|	} else if (!memcmp(buf + datao, "QVC", 4)) {
  ------------------
  |  Branch (254:13): [True: 23, False: 615]
  ------------------
  255|     23|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  256|     23|			"Parsing Casio maker note v2...");
  257|     23|		n->version = casioV2;
  258|     23|		base = MNOTE_CASIO2_TAG_BASE;
  259|     23|		datao += 4 + 2;
  260|    615|	} else {
  261|       |		/* probably assert(!memcmp(buf + datao, "\x00\x1b", 2)) */
  262|    615|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataPentax",
  263|    615|			"Parsing Pentax maker note v1...");
  264|    615|		n->version = pentaxV1;
  265|    615|	}
  266|       |
  267|       |	/* Read the number of tags */
  268|  1.08k|	c = exif_get_short (buf + datao, n->order);
  269|  1.08k|	datao += 2;
  270|       |
  271|       |	/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 102 named tags currently.
  272|       |	 * The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
  273|  1.08k|	if (c > 200) {
  ------------------
  |  Branch (273:6): [True: 151, False: 938]
  ------------------
  274|    151|		exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataPentax", "Too much tags (%d) in Pentax MakerNote", c);
  275|    151|		return;
  276|    151|	}
  277|       |
  278|       |
  279|       |	/* Remove any old entries */
  280|    938|	exif_mnote_data_pentax_clear (n);
  281|       |
  282|       |	/* Reserve enough space for all the possible MakerNote tags */
  283|    938|	n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c);
  284|    938|	if (!n->entries) {
  ------------------
  |  Branch (284:6): [True: 0, False: 938]
  ------------------
  285|      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))
  ------------------
  286|      0|		return;
  287|      0|	}
  288|       |
  289|       |	/* Parse all c entries, storing ones that are successfully parsed */
  290|    938|	tcount = 0;
  291|  18.9k|	for (i = c, o = datao; i; --i, o += 12) {
  ------------------
  |  Branch (291:25): [True: 18.9k, False: 22]
  ------------------
  292|  18.9k|		size_t s;
  293|       |
  294|  18.9k|		memset(&n->entries[tcount], 0, sizeof(MnotePentaxEntry));
  295|  18.9k|		if (exif_check_overflow (o,buf_size,12)) {
  ------------------
  |  Branch (295:7): [True: 730, False: 18.1k]
  ------------------
  296|    730|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  297|    730|				  "ExifMnoteDataPentax", "Short MakerNote");
  298|    730|			break;
  299|    730|		}
  300|       |
  301|  18.1k|		n->entries[tcount].tag        = exif_get_short (buf + o + 0, n->order) + base;
  302|  18.1k|		n->entries[tcount].format     = exif_get_short (buf + o + 2, n->order);
  303|  18.1k|		n->entries[tcount].components = exif_get_long  (buf + o + 4, n->order);
  304|  18.1k|		n->entries[tcount].order      = n->order;
  305|       |
  306|  18.1k|		exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnotePentax",
  307|  18.1k|			  "Loading entry 0x%x ('%s')...", n->entries[tcount].tag,
  308|  18.1k|			  mnote_pentax_tag_get_name (n->entries[tcount].tag));
  309|       |
  310|       |		/* Check if we overflow the multiplication. Use buf_size as the max size for integer overflow detection,
  311|       |		 * we will check the buffer sizes closer later. */
  312|  18.1k|		if (exif_check_mul_overflow (exif_format_get_size (n->entries[tcount].format),
  ------------------
  |  Branch (312:7): [True: 186, False: 17.9k]
  ------------------
  313|  18.1k|				n->entries[tcount].components, buf_size, &s)) {
  314|    186|			exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
  315|    186|				  "ExifMnoteDataPentax", "Tag size overflow detected (%u * %lu)", exif_format_get_size (n->entries[tcount].format), n->entries[tcount].components);
  316|    186|			break;
  317|    186|		}
  318|       |		/*
  319|       |		 * Size? If bigger than 4 bytes, the actual data is not
  320|       |		 * in the entry but somewhere else (offset).
  321|       |		 */
  322|  17.9k|		n->entries[tcount].size = s;
  323|  17.9k|		if (s) {
  ------------------
  |  Branch (323:7): [True: 8.02k, False: 9.95k]
  ------------------
  324|  8.02k|			size_t dataofs = o + 8;
  325|  8.02k|			if (s > 4)
  ------------------
  |  Branch (325:8): [True: 2.79k, False: 5.23k]
  ------------------
  326|       |				/* The data in this case is merely a pointer */
  327|  2.79k|			   	dataofs = exif_get_long (buf + dataofs, n->order) + 6;
  328|       |
  329|  8.02k|			if (exif_check_overflow (dataofs, buf_size, s)) {
  ------------------
  |  Branch (329:8): [True: 546, False: 7.48k]
  ------------------
  330|    546|				exif_log (en->log, EXIF_LOG_CODE_DEBUG,
  331|    546|						  "ExifMnoteDataPentax", "Tag data past end "
  332|    546|					  "of buffer (%u > %u)", (unsigned)(dataofs + s), buf_size);
  333|    546|				continue;
  334|    546|			}
  335|       |
  336|  7.48k|			n->entries[tcount].data = exif_mem_alloc (en->mem, s);
  337|  7.48k|			if (!n->entries[tcount].data) {
  ------------------
  |  Branch (337:8): [True: 0, False: 7.48k]
  ------------------
  338|      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))
  ------------------
  339|      0|				continue;
  340|      0|			}
  341|  7.48k|			memcpy (n->entries[tcount].data, buf + dataofs, s);
  342|  7.48k|		}
  343|       |
  344|       |		/* Tag was successfully parsed */
  345|  17.4k|		++tcount;
  346|  17.4k|	}
  347|       |	/* Store the count of successfully parsed tags */
  348|    938|	n->count = tcount;
  349|    938|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_count:
  353|  1.10k|{
  354|  1.10k|	return n ? ((ExifMnoteDataPentax *) n)->count : 0;
  ------------------
  |  Branch (354:9): [True: 1.10k, False: 0]
  ------------------
  355|  1.10k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_name:
  369|  12.5k|{
  370|  12.5k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  371|       |
  372|  12.5k|	if (!note) return NULL;
  ------------------
  |  Branch (372:6): [True: 0, False: 12.5k]
  ------------------
  373|  12.5k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (373:6): [True: 0, False: 12.5k]
  ------------------
  374|  12.5k|	return mnote_pentax_tag_get_name (note->entries[n].tag);
  375|  12.5k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_title:
  379|  12.2k|{
  380|  12.2k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  381|       |
  382|  12.2k|	if (!note) return NULL;
  ------------------
  |  Branch (382:6): [True: 0, False: 12.2k]
  ------------------
  383|  12.2k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (383:6): [True: 0, False: 12.2k]
  ------------------
  384|  12.2k|	return mnote_pentax_tag_get_title (note->entries[n].tag);
  385|  12.2k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_description:
  389|  12.2k|{
  390|  12.2k|	ExifMnoteDataPentax *note = (ExifMnoteDataPentax *) d;
  391|       |	
  392|  12.2k|	if (!note) return NULL;
  ------------------
  |  Branch (392:6): [True: 0, False: 12.2k]
  ------------------
  393|  12.2k|	if (note->count <= n) return NULL;
  ------------------
  |  Branch (393:6): [True: 0, False: 12.2k]
  ------------------
  394|  12.2k|	return mnote_pentax_tag_get_description (note->entries[n].tag);
  395|  12.2k|}
exif-mnote-data-pentax.c:exif_mnote_data_pentax_get_value:
   64|  12.2k|{
   65|  12.2k|	ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) d;
   66|       |
   67|  12.2k|	if (!n) return NULL;
  ------------------
  |  Branch (67:6): [True: 0, False: 12.2k]
  ------------------
   68|  12.2k|	if (n->count <= i) return NULL;
  ------------------
  |  Branch (68:6): [True: 0, False: 12.2k]
  ------------------
   69|  12.2k|	return mnote_pentax_entry_get_value (&n->entries[i], val, maxlen);
   70|  12.2k|}

mnote_pentax_entry_get_value:
  312|  12.2k|{
  313|  12.2k|	ExifLong vl;
  314|  12.2k|	ExifSLong vsl;
  315|  12.2k|	ExifShort vs, vs2;
  316|  12.2k|	ExifSShort vss;
  317|  12.2k|	int i = 0, j = 0;
  318|       |
  319|  12.2k|	if (!entry) return (NULL);
  ------------------
  |  Branch (319:6): [True: 0, False: 12.2k]
  ------------------
  320|  12.2k|	if (maxlen < 1) return (NULL);
  ------------------
  |  Branch (320:6): [True: 0, False: 12.2k]
  ------------------
  321|       |
  322|  12.2k|	memset (val, 0, maxlen);
  323|  12.2k|	maxlen--;
  324|       |
  325|  12.2k|	switch (entry->tag) {
  326|    233|	  case MNOTE_PENTAX_TAG_MODE:
  ------------------
  |  Branch (326:4): [True: 233, False: 12.0k]
  ------------------
  327|    877|	  case MNOTE_PENTAX_TAG_QUALITY:
  ------------------
  |  Branch (327:4): [True: 644, False: 11.6k]
  ------------------
  328|  1.09k|	  case MNOTE_PENTAX_TAG_FOCUS:
  ------------------
  |  Branch (328:4): [True: 213, False: 12.0k]
  ------------------
  329|  1.33k|	  case MNOTE_PENTAX_TAG_FLASH:
  ------------------
  |  Branch (329:4): [True: 245, False: 12.0k]
  ------------------
  330|  1.55k|	  case MNOTE_PENTAX_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (330:4): [True: 215, False: 12.0k]
  ------------------
  331|  1.77k|	  case MNOTE_PENTAX_TAG_SHARPNESS:
  ------------------
  |  Branch (331:4): [True: 221, False: 12.0k]
  ------------------
  332|  2.16k|	  case MNOTE_PENTAX_TAG_CONTRAST:
  ------------------
  |  Branch (332:4): [True: 394, False: 11.8k]
  ------------------
  333|  2.36k|	  case MNOTE_PENTAX_TAG_SATURATION:
  ------------------
  |  Branch (333:4): [True: 201, False: 12.0k]
  ------------------
  334|  2.56k|	  case MNOTE_PENTAX_TAG_ISO_SPEED:
  ------------------
  |  Branch (334:4): [True: 203, False: 12.0k]
  ------------------
  335|  2.82k|	  case MNOTE_PENTAX_TAG_COLOR:
  ------------------
  |  Branch (335:4): [True: 251, False: 12.0k]
  ------------------
  336|  3.04k|	  case MNOTE_PENTAX2_TAG_MODE:
  ------------------
  |  Branch (336:4): [True: 226, False: 12.0k]
  ------------------
  337|  3.28k|	  case MNOTE_PENTAX2_TAG_QUALITY:
  ------------------
  |  Branch (337:4): [True: 238, False: 12.0k]
  ------------------
  338|  3.48k|	  case MNOTE_PENTAX2_TAG_FLASH_MODE:
  ------------------
  |  Branch (338:4): [True: 199, False: 12.0k]
  ------------------
  339|  3.68k|	  case MNOTE_PENTAX2_TAG_FOCUS_MODE:
  ------------------
  |  Branch (339:4): [True: 206, False: 12.0k]
  ------------------
  340|  3.93k|	  case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED:
  ------------------
  |  Branch (340:4): [True: 245, False: 12.0k]
  ------------------
  341|  4.34k|	  case MNOTE_PENTAX2_TAG_AUTO_AFPOINT:
  ------------------
  |  Branch (341:4): [True: 411, False: 11.8k]
  ------------------
  342|  4.77k|	  case MNOTE_PENTAX2_TAG_WHITE_BALANCE:
  ------------------
  |  Branch (342:4): [True: 425, False: 11.8k]
  ------------------
  343|  5.24k|	  case MNOTE_PENTAX2_TAG_PICTURE_MODE:
  ------------------
  |  Branch (343:4): [True: 474, False: 11.7k]
  ------------------
  344|  5.74k|	  case MNOTE_PENTAX2_TAG_IMAGE_SIZE:
  ------------------
  |  Branch (344:4): [True: 499, False: 11.7k]
  ------------------
  345|  5.96k|	  case MNOTE_CASIO2_TAG_BESTSHOT_MODE:
  ------------------
  |  Branch (345:4): [True: 217, False: 12.0k]
  ------------------
  346|  5.96k|		CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  5.96k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  5.96k|{                                                               \
  |  |   39|  5.96k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 2.73k, False: 3.22k]
  |  |  ------------------
  |  |   40|  2.73k|		snprintf (v, maxlen,	                        \
  |  |   41|  2.73k|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|  2.73k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|  2.73k|			"expected '%s'."),                      \
  |  |   43|  2.73k|			exif_format_get_name (format),          \
  |  |   44|  2.73k|			exif_format_get_name (target));         \
  |  |   45|  2.73k|		break;                                          \
  |  |   46|  2.73k|	}                                                       \
  |  |   47|  5.96k|}
  ------------------
  347|  3.22k|		CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  3.22k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  3.22k|{                                                                       \
  |  |   61|  3.22k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.24k, False: 1.97k]
  |  |  |  Branch (61:24): [True: 231, False: 1.01k]
  |  |  ------------------
  |  |   62|    231|		snprintf (v, maxlen,                                    \
  |  |   63|    231|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    231|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    231|			"expected %i or %i)."), (int) number,		\
  |  |   65|    231|			(int) t1, (int) t2);  				\
  |  |   66|    231|		break;                                                  \
  |  |   67|    231|	}                                                               \
  |  |   68|  3.22k|}
  ------------------
  348|  2.99k|		if (entry->components == 1) {
  ------------------
  |  Branch (348:7): [True: 1.97k, False: 1.01k]
  ------------------
  349|  1.97k|			vs = exif_get_short (entry->data, entry->order);
  350|       |
  351|       |			/* search the tag */
  352|  25.9k|			for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++);
  ------------------
  |  Branch (352:17): [True: 25.9k, False: 0]
  |  Branch (352:33): [True: 23.9k, False: 1.97k]
  ------------------
  353|  1.97k|			if (!items[i].tag) {
  ------------------
  |  Branch (353:8): [True: 0, False: 1.97k]
  ------------------
  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|  13.0k|			for (j = 0; items[i].elem[j].string &&
  ------------------
  |  Branch (360:16): [True: 12.0k, False: 1.01k]
  ------------------
  361|  12.0k|			    (items[i].elem[j].index < vs); j++);
  ------------------
  |  Branch (361:8): [True: 11.0k, False: 965]
  ------------------
  362|  1.97k|			if (items[i].elem[j].index != vs) {
  ------------------
  |  Branch (362:8): [True: 1.42k, False: 551]
  ------------------
  363|  1.42k|				snprintf (val, maxlen,
  364|  1.42k|					  _("Internal error (unknown value %hu)"), vs);
  ------------------
  |  |   31|  1.42k|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  365|  1.42k|				break;
  366|  1.42k|			}
  367|    551|			strncpy (val, _(items[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    551|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  368|  1.01k|		} else {
  369|       |			/* Two-component values */
  370|  1.01k|			CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen)
  ------------------
  |  |   37|  1.01k|#define CF(format,target,v,maxlen)                              \
  |  |   38|  1.01k|{                                                               \
  |  |   39|  1.01k|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 0, False: 1.01k]
  |  |  ------------------
  |  |   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.01k|}
  ------------------
  371|  1.01k|			CC2 (entry->components, 1, 2, val, maxlen)
  ------------------
  |  |   59|  1.01k|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|  1.01k|{                                                                       \
  |  |   61|  1.01k|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 1.01k, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 1.01k]
  |  |  ------------------
  |  |   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.01k|}
  ------------------
  372|  1.01k|			vs = exif_get_short (entry->data, entry->order);
  373|  1.01k|			vs2 = ((unsigned int)exif_get_short (entry->data+2, entry->order)) << 16;
  374|       |
  375|       |			/* search the tag */
  376|  2.24k|			for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++);
  ------------------
  |  Branch (376:17): [True: 1.76k, False: 475]
  |  Branch (376:34): [True: 1.22k, False: 541]
  ------------------
  377|  1.01k|			if (!items2[i].tag) {
  ------------------
  |  Branch (377:8): [True: 475, False: 541]
  ------------------
  378|    475|				snprintf (val, maxlen,
  379|    475|					  _("Internal error (unknown value %hu %hu)"), vs, vs2);
  ------------------
  |  |   31|    475|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  380|    475|			  	break;
  381|    475|			}
  382|       |
  383|       |			/* find the value */
  384|  2.28k|			for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2)
  ------------------
  |  Branch (384:16): [True: 2.28k, False: 0]
  |  Branch (384:45): [True: 0, False: 2.28k]
  ------------------
  385|  2.28k|				|| ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++);
  ------------------
  |  Branch (385:9): [True: 1.94k, False: 331]
  |  Branch (385:46): [True: 1.73k, False: 210]
  ------------------
  386|    541|			if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) {
  ------------------
  |  Branch (386:8): [True: 344, False: 197]
  |  Branch (386:44): [True: 0, False: 197]
  ------------------
  387|    344|				snprintf (val, maxlen,
  388|    344|					  _("Internal error (unknown value %hi %hi)"), vs, vs2);
  ------------------
  |  |   31|    344|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  389|    344|				break;
  390|    344|			}
  391|    197|			strncpy (val, _(items2[i].elem[j].string), maxlen);
  ------------------
  |  |   31|    197|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  392|    197|		}
  393|    748|		break;
  394|       |
  395|    748|	case MNOTE_PENTAX_TAG_ZOOM:
  ------------------
  |  Branch (395:2): [True: 519, False: 11.7k]
  ------------------
  396|    519|		CF (entry->format, EXIF_FORMAT_LONG, val, maxlen)
  ------------------
  |  |   37|    519|#define CF(format,target,v,maxlen)                              \
  |  |   38|    519|{                                                               \
  |  |   39|    519|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 233, False: 286]
  |  |  ------------------
  |  |   40|    233|		snprintf (v, maxlen,	                        \
  |  |   41|    233|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    233|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    233|			"expected '%s'."),                      \
  |  |   43|    233|			exif_format_get_name (format),          \
  |  |   44|    233|			exif_format_get_name (target));         \
  |  |   45|    233|		break;                                          \
  |  |   46|    233|	}                                                       \
  |  |   47|    519|}
  ------------------
  397|    286|		CC (entry->components, 1, val, maxlen)
  ------------------
  |  |   49|    286|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    286|{                                                                       \
  |  |   51|    286|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 48, False: 238]
  |  |  ------------------
  |  |   52|     48|		snprintf (v, maxlen,                                    \
  |  |   53|     48|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|     48|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|     48|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|     48|		break;                                                  \
  |  |   56|     48|	}                                                               \
  |  |   57|    286|}
  ------------------
  398|    238|		vl = exif_get_long (entry->data, entry->order);
  399|    238|		snprintf (val, maxlen, "%lu", (long unsigned) vl);
  400|    238|		break;
  401|    632|	case MNOTE_PENTAX_TAG_PRINTIM:
  ------------------
  |  Branch (401:2): [True: 632, False: 11.6k]
  ------------------
  402|    632|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    632|#define CF(format,target,v,maxlen)                              \
  |  |   38|    632|{                                                               \
  |  |   39|    632|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 236, False: 396]
  |  |  ------------------
  |  |   40|    236|		snprintf (v, maxlen,	                        \
  |  |   41|    236|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    236|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    236|			"expected '%s'."),                      \
  |  |   43|    236|			exif_format_get_name (format),          \
  |  |   44|    236|			exif_format_get_name (target));         \
  |  |   45|    236|		break;                                          \
  |  |   46|    236|	}                                                       \
  |  |   47|    632|}
  ------------------
  403|    396|		CC (entry->components, 124, val, maxlen)
  ------------------
  |  |   49|    396|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    396|{                                                                       \
  |  |   51|    396|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 201, False: 195]
  |  |  ------------------
  |  |   52|    201|		snprintf (v, maxlen,                                    \
  |  |   53|    201|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    201|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    201|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    201|		break;                                                  \
  |  |   56|    201|	}                                                               \
  |  |   57|    396|}
  ------------------
  404|    195|		snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    195|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  405|    195|			entry->size);
  406|    195|		break;
  407|    411|	case MNOTE_PENTAX_TAG_TZ_CITY:
  ------------------
  |  Branch (407:2): [True: 411, False: 11.8k]
  ------------------
  408|    798|	case MNOTE_PENTAX_TAG_TZ_DST:
  ------------------
  |  Branch (408:2): [True: 387, False: 11.8k]
  ------------------
  409|    798|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    798|#define CF(format,target,v,maxlen)                              \
  |  |   38|    798|{                                                               \
  |  |   39|    798|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 243, False: 555]
  |  |  ------------------
  |  |   40|    243|		snprintf (v, maxlen,	                        \
  |  |   41|    243|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    243|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    243|			"expected '%s'."),                      \
  |  |   43|    243|			exif_format_get_name (format),          \
  |  |   44|    243|			exif_format_get_name (target));         \
  |  |   45|    243|		break;                                          \
  |  |   46|    243|	}                                                       \
  |  |   47|    798|}
  ------------------
  410|    555|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    555|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    555|{                                                                       \
  |  |   51|    555|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 343, False: 212]
  |  |  ------------------
  |  |   52|    343|		snprintf (v, maxlen,                                    \
  |  |   53|    343|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    343|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    343|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    343|		break;                                                  \
  |  |   56|    343|	}                                                               \
  |  |   57|    555|}
  ------------------
  411|    212|		strncpy (val, (char*)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    212|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 0, False: 212]
  |  |  ------------------
  ------------------
  412|    212|		break;
  413|    614|	case MNOTE_PENTAX2_TAG_DATE:
  ------------------
  |  Branch (413:2): [True: 614, False: 11.6k]
  ------------------
  414|    614|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    614|#define CF(format,target,v,maxlen)                              \
  |  |   38|    614|{                                                               \
  |  |   39|    614|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 217, False: 397]
  |  |  ------------------
  |  |   40|    217|		snprintf (v, maxlen,	                        \
  |  |   41|    217|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    217|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    217|			"expected '%s'."),                      \
  |  |   43|    217|			exif_format_get_name (format),          \
  |  |   44|    217|			exif_format_get_name (target));         \
  |  |   45|    217|		break;                                          \
  |  |   46|    217|	}                                                       \
  |  |   47|    614|}
  ------------------
  415|    397|		CC (entry->components, 4, val, maxlen)
  ------------------
  |  |   49|    397|#define CC(number,target,v,maxlen)                                      \
  |  |   50|    397|{                                                                       \
  |  |   51|    397|	if (number != target) {                                         \
  |  |  ------------------
  |  |  |  Branch (51:6): [True: 200, False: 197]
  |  |  ------------------
  |  |   52|    200|		snprintf (v, maxlen,                                    \
  |  |   53|    200|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    200|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   54|    200|			"expected %i)."), (int) number, (int) target);  \
  |  |   55|    200|		break;                                                  \
  |  |   56|    200|	}                                                               \
  |  |   57|    397|}
  ------------------
  416|       |		/* Note: format is UNDEFINED, not SHORT -> order is fixed: MOTOROLA */
  417|    197|		vs = exif_get_short (entry->data, EXIF_BYTE_ORDER_MOTOROLA);
  418|    197|		snprintf (val, maxlen, "%hi:%02i:%02i", vs, entry->data[2], entry->data[3]);
  419|    197|		break;
  420|    866|	case MNOTE_PENTAX2_TAG_TIME:
  ------------------
  |  Branch (420:2): [True: 866, False: 11.3k]
  ------------------
  421|    866|		CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen)
  ------------------
  |  |   37|    866|#define CF(format,target,v,maxlen)                              \
  |  |   38|    866|{                                                               \
  |  |   39|    866|	if (format != target) {                                 \
  |  |  ------------------
  |  |  |  Branch (39:6): [True: 237, False: 629]
  |  |  ------------------
  |  |   40|    237|		snprintf (v, maxlen,	                        \
  |  |   41|    237|			_("Invalid format '%s', "               \
  |  |  ------------------
  |  |  |  |   31|    237|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   42|    237|			"expected '%s'."),                      \
  |  |   43|    237|			exif_format_get_name (format),          \
  |  |   44|    237|			exif_format_get_name (target));         \
  |  |   45|    237|		break;                                          \
  |  |   46|    237|	}                                                       \
  |  |   47|    866|}
  ------------------
  422|    629|		CC2 (entry->components, 3, 4, val, maxlen)
  ------------------
  |  |   59|    629|#define CC2(number,t1,t2,v,maxlen)                                      \
  |  |   60|    629|{                                                                       \
  |  |   61|    629|	if ((number != t1) && (number != t2)) {                         \
  |  |  ------------------
  |  |  |  Branch (61:6): [True: 408, False: 221]
  |  |  |  Branch (61:24): [True: 214, False: 194]
  |  |  ------------------
  |  |   62|    214|		snprintf (v, maxlen,                                    \
  |  |   63|    214|			_("Invalid number of components (%i, "          \
  |  |  ------------------
  |  |  |  |   31|    214|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  |  |  ------------------
  |  |   64|    214|			"expected %i or %i)."), (int) number,		\
  |  |   65|    214|			(int) t1, (int) t2);  				\
  |  |   66|    214|		break;                                                  \
  |  |   67|    214|	}                                                               \
  |  |   68|    629|}
  ------------------
  423|    415|		snprintf (val, maxlen, "%02i:%02i:%02i", entry->data[0], entry->data[1], entry->data[2]);
  424|    415|		break;
  425|  2.87k|	default:
  ------------------
  |  Branch (425:2): [True: 2.87k, False: 9.38k]
  ------------------
  426|  2.87k|		switch (entry->format) {
  427|    451|		case EXIF_FORMAT_ASCII:
  ------------------
  |  Branch (427:3): [True: 451, False: 2.42k]
  ------------------
  428|    451|		  strncpy (val, (char *)entry->data, MIN(maxlen, entry->size));
  ------------------
  |  |  182|    451|#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (182:21): [True: 229, False: 222]
  |  |  ------------------
  ------------------
  429|    451|		  break;
  430|    522|		case EXIF_FORMAT_SHORT:
  ------------------
  |  Branch (430:3): [True: 522, False: 2.35k]
  ------------------
  431|    522|		  {
  432|    522|			const unsigned char *data = entry->data;
  433|    522|			size_t k, len = strlen(val), sizeleft;
  434|       |
  435|    522|			sizeleft = entry->size;
  436|  68.8k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (436:13): [True: 68.3k, False: 522]
  ------------------
  437|  68.3k|				if (sizeleft < 2)
  ------------------
  |  Branch (437:9): [True: 0, False: 68.3k]
  ------------------
  438|      0|					break;
  439|  68.3k|				vs = exif_get_short (data, entry->order);
  440|  68.3k|				snprintf (val+len, maxlen-len, "%hu ", vs);
  441|  68.3k|				len = strlen(val);
  442|  68.3k|				data += 2;
  443|  68.3k|				sizeleft -= 2;
  444|  68.3k|			}
  445|    522|		  }
  446|    522|		  break;
  447|    651|		case EXIF_FORMAT_SSHORT:
  ------------------
  |  Branch (447:3): [True: 651, False: 2.22k]
  ------------------
  448|    651|		  {
  449|    651|			const unsigned char *data = entry->data;
  450|    651|			size_t k, len = strlen(val), sizeleft;
  451|       |
  452|    651|			sizeleft = entry->size;
  453|  71.3k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (453:13): [True: 70.7k, False: 651]
  ------------------
  454|  70.7k|				if (sizeleft < 2)
  ------------------
  |  Branch (454:9): [True: 0, False: 70.7k]
  ------------------
  455|      0|					break;
  456|  70.7k|				vss = exif_get_sshort (data, entry->order);
  457|  70.7k|				snprintf (val+len, maxlen-len, "%hi ", vss);
  458|  70.7k|				len = strlen(val);
  459|  70.7k|				data += 2;
  460|  70.7k|				sizeleft -= 2;
  461|  70.7k|			}
  462|    651|		  }
  463|    651|		  break;
  464|    450|		case EXIF_FORMAT_LONG:
  ------------------
  |  Branch (464:3): [True: 450, False: 2.42k]
  ------------------
  465|    450|		  {
  466|    450|			const unsigned char *data = entry->data;
  467|    450|			size_t k, len = strlen(val), sizeleft;
  468|       |
  469|    450|			sizeleft = entry->size;
  470|  24.0k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (470:13): [True: 23.5k, False: 450]
  ------------------
  471|  23.5k|				if (sizeleft < 4)
  ------------------
  |  Branch (471:9): [True: 0, False: 23.5k]
  ------------------
  472|      0|					break;
  473|  23.5k|				vl = exif_get_long (data, entry->order);
  474|  23.5k|				snprintf (val+len, maxlen-len, "%lu ", (long unsigned) vl);
  475|  23.5k|				len = strlen(val);
  476|  23.5k|				data += 4;
  477|  23.5k|				sizeleft -= 4;
  478|  23.5k|			}
  479|    450|		  }
  480|    450|		  break;
  481|    439|		case EXIF_FORMAT_SLONG:
  ------------------
  |  Branch (481:3): [True: 439, False: 2.43k]
  ------------------
  482|    439|		  {
  483|    439|			const unsigned char *data = entry->data;
  484|    439|			size_t k, len = strlen(val), sizeleft;
  485|       |
  486|    439|			sizeleft = entry->size;
  487|  16.9k|			for(k=0; k<entry->components; k++) {
  ------------------
  |  Branch (487:13): [True: 16.5k, False: 439]
  ------------------
  488|  16.5k|				if (sizeleft < 4)
  ------------------
  |  Branch (488:9): [True: 0, False: 16.5k]
  ------------------
  489|      0|					break;
  490|  16.5k|				vsl = exif_get_slong (data, entry->order);
  491|  16.5k|				snprintf (val+len, maxlen-len, "%li ", (long int) vsl);
  492|  16.5k|				len = strlen(val);
  493|  16.5k|				data += 4;
  494|  16.5k|				sizeleft -= 4;
  495|  16.5k|			}
  496|    439|		  }
  497|    439|		  break;
  498|      1|		case EXIF_FORMAT_UNDEFINED:
  ------------------
  |  Branch (498:3): [True: 1, False: 2.87k]
  ------------------
  499|    359|		default:
  ------------------
  |  Branch (499:3): [True: 358, False: 2.51k]
  ------------------
  500|    359|		  snprintf (val, maxlen, _("%i bytes unknown data"),
  ------------------
  |  |   31|    359|#  define _(String) dgettext (GETTEXT_PACKAGE, String)
  ------------------
  501|    359|			  entry->size);
  502|    359|		  break;
  503|  2.87k|		}
  504|  2.87k|		break;
  505|  12.2k|	}
  506|       |
  507|  12.2k|	return val;
  508|  12.2k|}

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

