INT64 LibRaw::x3f_thumb_size()
{
	try {
		x3f_t *x3f = (x3f_t*)_x3f_data;
		if (!x3f) return -1; // No data pointer set
		x3f_directory_entry_t *DE = x3f_get_thumb_jpeg(x3f);
		if (!DE)
			DE = x3f_get_thumb_plain(x3f);
		if (!DE)
			return -1;
		int64_t p = x3f_load_data_size(x3f, DE);
		if (p < 0 || p > 0xffffffff)
			return -1;
		return p;
	}
	catch (...)
	{
		return -1;
	}
}
INT64 LibRaw::x3f_thumb_size()
{
	try {
		x3f_t *x3f = (x3f_t*)_x3f_data;
		if (!x3f) return -1;  
		x3f_directory_entry_t *DE = x3f_get_thumb_jpeg(x3f);
		if (!DE)
			DE = x3f_get_thumb_plain(x3f);
		if (!DE)
			return -1;
		int64_t p = x3f_load_data_size(x3f, DE);
		if (p < 0 || p > 0xffffffff)
			return -1;
		return p;
	}
	catch (...)
	{
		return -1;
	}
}