Tests: Add unit tests for new exiftool tags
This commit is contained in:
parent
3b3276b53e
commit
dc2a261884
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
BIN
internal/meta/testdata/iptc-fields-500.jpg
vendored
Normal file
BIN
internal/meta/testdata/iptc-fields-500.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 72 KiB |
30
internal/meta/testdata/iptc-fields-500.json
vendored
Normal file
30
internal/meta/testdata/iptc-fields-500.json
vendored
Normal 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
|
||||
}]
|
Loading…
Reference in a new issue