rem: printf("No Compression"); return; case 2: printf("CCITT Group 3 1-Dimensional Modified Huffman run-length encoding");
add: printf("No Compression (1)"); return; case 2: printf("CCITT Group 3 1-Dimensional Modified Huffman run-length encoding (2)"); return; case 3: printf("Fax Group 3 (3)"); return; case 4: printf("Fax Group 4 (4)");
context: print_ifd_value(IFDEntry &entry, BFile &file, swap_action swp){	switch (entry.tag) {		case 254: // NewSubfileType			if (entry.count == 1 && entry.fieldType == TIFF_LONG) {				if (entry.longval & 1)					printf("Low Res ");				if (entry.longval & 2)					printf("Page ");				if (entry.longval & 4)					printf("Mask ");								printf("(0x%.8lx)", entry.longval);				return;			}			break;					case 256: // ImageWidth		case 257: // ImageHeight			if (entry.count == 1) {				printf("%d",					((entry.fieldType == TIFF_SHORT) ?						entry.shortvals[0] : static_cast<unsigned int>(entry.longval)));				return;			}			break;					case 259:			if (entry.count == 1 && entry.fieldType == TIFF_SHORT) {				switch (entry.shortvals[0]) {					case 1:						printf("No Compression");						return;					case 2:						printf("CCITT Group 3 1-Dimensional Modified Huffman run-length encoding");						return;					case 5:						printf("LZW");						return;					case 32773:						printf("PackBits");						return;				}			}			break;					case 262: // PhotometricInterpretation			if (entry.count == 1 && entry.fieldType == TIFF_SHORT) {				switch (entry.shortvals[0]) {					case 0:						printf("White is Zero (%d)", entry.shortvals[0]);						return;					case 1:						printf("Black is Zero (%d)", entry.shortvals[0]);						return;					case 2:						printf("RGB (%d)", entry.shortvals[0]);						return;					case 3:						printf("Palette Color (%d)", entry.shortvals[0]);						return;					case 4:						printf("Transparency Mask (%d)", entry.shortvals[0]);						return;				}			}			break;					case 274: // Orientation			if (entry.count == 1 && entry.fieldType == TIFF_SHORT) {				switch (entry.shortvals[0]) {					case 1:						printf("top to bottom, left to right");						return;					case 2:						printf("top to bottom, right to left");						return;					case 3:						printf("bottom to top, right to left");						return;					case 4:						printf("bottom to top, left to right");						return;					case 5:						printf("left to right, top to bottom");						return;					case 6:						printf("right to left, top to bottom");						return;					case 7:						printf("right to left, bottom to top");						return;					case 8:						printf("left to right, bottom to top");						return;				}			}			break;					case 284: // PlanarConfiguration			if (entry.count == 1 && entry.fieldType == TIFF_SHORT) {				if (entry.shortvals[0] == 1) {					printf("Chunky (%d)", entry.shortvals[0]);					return;				}				else if (entry.shortvals[0] == 2) {					printf("Planar (%d)", entry.shortvals[0]);					return;				}			}			break;					case 296: // ResolutionUnit			if (entry.count == 1 && entry.fieldType == TIFF_SHORT) {				switch (entry.shortvals[0]) {					case 1:						printf("None (%d)", entry.shortvals[0]);						return;					case 2:						printf("Inch (%d)", entry.shortvals[0]);						return;					case 3:						printf("Cenimeter (%d)", entry.shortvals[0]);						return;				}			}			break;					default:			if (entry.fieldType == TIFF_ASCII) {				char ascfield[256] = { 0 };								if (entry.count <= 4)					memcpy(ascfield, &entry.longval, entry.count);				else if (entry.count > 4 && entry.count < 256) {					ssize_t nread = file.ReadAt(entry.longval, ascfield, entry.count);					if (nread != static_cast<ssize_t>(entry.count))						ascfield[0] = '\0';				}								if (ascfield[0] != '\0') {					printf("%s", ascfield);					return;				}			} else if (entry.fieldType == TIFF_RATIONAL && entry.count == 1) {				struct { uint32 numerator; uint32 denominator; } rational;								ssize_t	nread = file.ReadAt(entry.longval, &rational, 8);				if (nread == 8 &&					swap_data(B_UINT32_TYPE, &rational, 8, swp) == B_OK) {										printf("%d / %d",						static_cast<unsigned int>(rational.numerator),						static_cast<unsigned int>(rational.denominator));					return;				}							} else if (entry.fieldType == TIFF_LONG && entry.count == 1) {				printf("%d",					static_cast<unsigned int>(entry.longval));				return;			} else if (entry.fieldType == TIFF_SHORT && entry.count <= 2) {				for (uint32 i = 0; i < entry.count; i++) {					if (i > 0)						printf(", ");					printf("%d", entry.shortvals[i]);				}				return;			} else if (entry.fieldType == TIFF_BYTE && entry.count <= 4) {				for (uint32 i = 0; i < entry.count; i++) {					if (i > 0)						printf(", ");					printf("%d", entry.bytevals[i]);				}				return;			}			break;	}	printf("0x%.8lx", entry.longval);}