Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/parser/tiff/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var tiffTagNames = map[uint16]string{
0x0102: "BitsPerSample",
0x0103: "Compression",
0x0106: "PhotometricInterpretation",
0x010A: "FillOrder",
0x010E: "ImageDescription",
0x010F: "Make",
0x0110: "Model",
Expand All @@ -56,14 +57,18 @@ var tiffTagNames = map[uint16]string{
0x011B: "YResolution",
0x011C: "PlanarConfiguration",
0x0128: "ResolutionUnit",
0x0129: "PageNumber",
0x0131: "Software",
0x0132: "DateTime",
0x013B: "Artist",
0x013C: "HostComputer",
0x013D: "Predictor",
0x013E: "WhitePoint",
0x013F: "PrimaryChromaticities",
0x0142: "TileWidth",
0x0143: "TileLength",
0x0152: "ExtraSamples",
0x0153: "SampleFormat",
0x0201: "JPEGInterchangeFormat",
0x0202: "JPEGInterchangeFormatLength",
0x0211: "YCbCrCoefficients",
Expand Down
5 changes: 5 additions & 0 deletions internal/parser/tiff/lookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func TestGetTIFFTagName(t *testing.T) {
{"Software", 0x0131, "Software"},
{"DateTime", 0x0132, "DateTime"},
{"Artist", 0x013B, "Artist"},
{"FillOrder", 0x010A, "FillOrder"},
{"PageNumber", 0x0129, "PageNumber"},
{"Predictor", 0x013D, "Predictor"},
{"ExtraSamples", 0x0152, "ExtraSamples"},
{"SampleFormat", 0x0153, "SampleFormat"},
{"Copyright", 0x8298, "Copyright"},
{"ExifIFDPointer", 0x8769, "ExifIFDPointer"},
{"GPSInfoIFDPointer", 0x8825, "GPSInfoIFDPointer"},
Expand Down
28 changes: 28 additions & 0 deletions internal/parser/tiff/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,41 @@ var tiffEnumValues = map[uint16]map[uint16]string{
2: "Planar",
},

// FillOrder (0x010A)
0x010A: {
1: "Normal",
2: "Reversed",
},

// ResolutionUnit (0x0128)
0x0128: {
1: "None",
2: "inches",
3: "centimeters",
},

// Predictor (0x013D)
0x013D: {
1: "None",
2: "Horizontal differencing",
3: "Floating point predictor",
},

// ExtraSamples (0x0152)
0x0152: {
0: "Unspecified",
1: "Associated Alpha",
2: "Unassociated Alpha",
},

// SampleFormat (0x0153)
0x0153: {
1: "Unsigned integer",
2: "Signed integer",
3: "IEEE floating point",
4: "Undefined",
},

// YCbCrPositioning (0x0213)
0x0213: {
1: "Centered",
Expand Down
56 changes: 56 additions & 0 deletions internal/parser/tiff/values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,62 @@ func TestDecodeEnumValue(t *testing.T) {
value: uint16(1),
expected: "Centered",
},
{
name: "FillOrder Normal",
tag: 0x010A,
dirName: "IFD0",
value: uint16(1),
expected: "Normal",
},
{
name: "FillOrder Reversed",
tag: 0x010A,
dirName: "IFD0",
value: uint16(2),
expected: "Reversed",
},
{
name: "Predictor None",
tag: 0x013D,
dirName: "IFD0",
value: uint16(1),
expected: "None",
},
{
name: "Predictor Horizontal differencing",
tag: 0x013D,
dirName: "IFD0",
value: uint16(2),
expected: "Horizontal differencing",
},
{
name: "ExtraSamples Unspecified",
tag: 0x0152,
dirName: "IFD0",
value: uint16(0),
expected: "Unspecified",
},
{
name: "ExtraSamples Associated Alpha",
tag: 0x0152,
dirName: "IFD0",
value: uint16(1),
expected: "Associated Alpha",
},
{
name: "SampleFormat Unsigned integer",
tag: 0x0153,
dirName: "IFD0",
value: uint16(1),
expected: "Unsigned integer",
},
{
name: "SampleFormat IEEE floating point",
tag: 0x0153,
dirName: "IFD0",
value: uint16(3),
expected: "IEEE floating point",
},

// EXIF tags
{
Expand Down
Loading