Tests: Add unit tests for new exiftool tags

This commit is contained in:
theresa 2022-05-25 17:26:26 +02:00
parent 3b3276b53e
commit dc2a261884
3 changed files with 46 additions and 0 deletions

View file

@ -1049,4 +1049,20 @@ func TestJSON(t *testing.T) {
assert.Equal(t, "", data.Projection)
assert.Equal(t, "", data.ColorProfile)
})
t.Run("iptc-fields-500", func(t *testing.T) {
data, err := JSON("testdata/iptc-fields-500.json", "")
if err != nil {
t.Fatal(err)
}
//t.Logf("all: %+v", data.exif)
assert.Equal(t, "creator A, creator B", data.Artist)
assert.Equal(t, "my image headline", data.Title)
assert.Equal(t, "my iptc description", data.Description)
assert.Equal(t, "my iptc copyright", data.Copyright)
//TODO
//assert.Equal(t, "zqdtcxt1q9wrxnur", data.DocumentID)
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -0,0 +1,30 @@
[{
"SourceFile": "iptc-fields-500.jpg",
"ExifToolVersion": 12.41,
"FileName": "iptc-fields-500.jpg",
"Directory": ".",
"FileSize": "72 KiB",
"FileModifyDate": "2022:05:25 13:39:29+00:00",
"FileAccessDate": "2022:05:25 13:58:00+00:00",
"FileInodeChangeDate": "2022:05:25 13:58:00+00:00",
"FilePermissions": "-rw-rw-r--",
"FileType": "JPEG",
"FileTypeExtension": "jpg",
"MIMEType": "image/jpeg",
"CurrentIPTCDigest": "faf6f79bac264b4c90595a44051b1318",
"Headline": "my image headline",
"ApplicationRecordVersion": 4,
"CopyrightNotice": "my iptc copyright",
"Caption-Abstract": "my iptc description",
"By-line": ["creator A","creator B"],
"XMPToolkit": "Image::ExifTool 12.16",
"DigitalImageGUID": "zqdtcxt1q9wrxnur",
"ImageWidth": 500,
"ImageHeight": 375,
"EncodingProcess": "Baseline DCT, Huffman coding",
"BitsPerSample": 8,
"ColorComponents": 3,
"YCbCrSubSampling": "YCbCr4:2:0 (2 2)",
"ImageSize": "500x375",
"Megapixels": 0.188
}]