-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathJpegNikon1Bibble5Test.cs
More file actions
523 lines (509 loc) · 20.6 KB
/
JpegNikon1Bibble5Test.cs
File metadata and controls
523 lines (509 loc) · 20.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
using System;
using NUnit.Framework;
using TagLib;
using TagLib.IFD;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
using TagLib.Xmp;
using TaglibSharp.Tests.Images.Validators;
namespace TaglibSharp.Tests.Images
{
[TestFixture]
public class JpegNikon1Bibble5Test
{
[Test]
public void Test ()
{
ImageTest.Run ("sample_nikon1_bibble5.jpg",
new JpegNikon1Bibble5TestInvariantValidator (),
NoModificationValidator.Instance,
new CommentModificationValidator (string.Empty),
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
new TagCommentModificationValidator (null, TagTypes.XMP, true),
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
);
}
}
public class JpegNikon1Bibble5TestInvariantValidator : IMetadataInvariantValidator
{
public void ValidateMetadataInvariants (TagLib.Image.File file)
{
Assert.IsNotNull (file);
// ---------- Start of IFD tests ----------
var tag = file.GetTag (TagTypes.TiffIFD) as IFDTag;
Assert.IsNotNull (tag, "IFD tag not found");
var structure = tag.Structure;
// Image.0x010F (Make/Ascii/18) "NIKON CORPORATION"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.Make);
Assert.IsNotNull (entry, "Entry 0x010F missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("NIKON CORPORATION", (entry as StringIFDEntry).Value);
}
// Image.0x0110 (Model/Ascii/11) "NIKON D70s"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.Model);
Assert.IsNotNull (entry, "Entry 0x0110 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("NIKON D70s", (entry as StringIFDEntry).Value);
}
// Image.0x011A (XResolution/Rational/1) "150/1"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.XResolution);
Assert.IsNotNull (entry, "Entry 0x011A missing in IFD 0");
Assert.IsNotNull (entry as RationalIFDEntry, "Entry is not a rational!");
Assert.AreEqual (150, (entry as RationalIFDEntry).Value.Numerator);
Assert.AreEqual (1, (entry as RationalIFDEntry).Value.Denominator);
}
// Image.0x011B (YResolution/Rational/1) "150/1"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.YResolution);
Assert.IsNotNull (entry, "Entry 0x011B missing in IFD 0");
Assert.IsNotNull (entry as RationalIFDEntry, "Entry is not a rational!");
Assert.AreEqual (150, (entry as RationalIFDEntry).Value.Numerator);
Assert.AreEqual (1, (entry as RationalIFDEntry).Value.Denominator);
}
// Image.0x0128 (ResolutionUnit/Short/1) "2"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.ResolutionUnit);
Assert.IsNotNull (entry, "Entry 0x0128 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (2, (entry as ShortIFDEntry).Value);
}
// Image.0x0131 (Software/Ascii/17) "Bibble 5 Pro 5.0"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.Software);
Assert.IsNotNull (entry, "Entry 0x0131 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("Bibble 5 Pro 5.0", (entry as StringIFDEntry).Value);
}
// Image.0x8769 (ExifTag/SubIFD/1) "8"
{
var entry = structure.GetEntry (0, (ushort)IFDEntryTag.ExifIFD);
Assert.IsNotNull (entry, "Entry 0x8769 missing in IFD 0");
Assert.IsNotNull (entry as SubIFDEntry, "Entry is not a sub IFD!");
}
var exif = structure.GetEntry (0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry;
Assert.IsNotNull (exif, "Exif tag not found");
var exif_structure = exif.Structure;
// Photo.0x010F (0x010f/Ascii/18) "NIKON CORPORATION"
{
var entry = exif_structure.GetEntry (0, (ushort)IFDEntryTag.Make);
Assert.IsNotNull (entry, "Entry 0x010F missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("NIKON CORPORATION", (entry as StringIFDEntry).Value);
}
// Photo.0x0110 (0x0110/Ascii/11) "NIKON D70s"
{
var entry = exif_structure.GetEntry (0, (ushort)IFDEntryTag.Model);
Assert.IsNotNull (entry, "Entry 0x0110 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("NIKON D70s", (entry as StringIFDEntry).Value);
}
// Photo.0x0132 (0x0132/Ascii/20) "2010:02:03 11:02:18"
{
var entry = exif_structure.GetEntry (0, (ushort)IFDEntryTag.DateTime);
Assert.IsNotNull (entry, "Entry 0x0132 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("2010:02:03 11:02:18", (entry as StringIFDEntry).Value);
}
// Photo.0x829A (ExposureTime/Rational/1) "10/7500"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.ExposureTime);
Assert.IsNotNull (entry, "Entry 0x829A missing in IFD 0");
Assert.IsNotNull (entry as RationalIFDEntry, "Entry is not a rational!");
Assert.AreEqual (10, (entry as RationalIFDEntry).Value.Numerator);
Assert.AreEqual (7500, (entry as RationalIFDEntry).Value.Denominator);
}
// Photo.0x829D (FNumber/Rational/1) "13/1"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.FNumber);
Assert.IsNotNull (entry, "Entry 0x829D missing in IFD 0");
Assert.IsNotNull (entry as RationalIFDEntry, "Entry is not a rational!");
Assert.AreEqual (13, (entry as RationalIFDEntry).Value.Numerator);
Assert.AreEqual (1, (entry as RationalIFDEntry).Value.Denominator);
}
// Photo.0x8822 (ExposureProgram/Short/1) "2"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.ExposureProgram);
Assert.IsNotNull (entry, "Entry 0x8822 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (2, (entry as ShortIFDEntry).Value);
}
// Photo.0x8827 (ISOSpeedRatings/Short/1) "1600"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.ISOSpeedRatings);
Assert.IsNotNull (entry, "Entry 0x8827 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (1600, (entry as ShortIFDEntry).Value);
}
// Photo.0x9003 (DateTimeOriginal/Ascii/20) "2007:02:15 17:07:48"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.DateTimeOriginal);
Assert.IsNotNull (entry, "Entry 0x9003 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("2007:02:15 17:07:48", (entry as StringIFDEntry).Value);
}
// Photo.0x9004 (DateTimeDigitized/Ascii/20) "2007:02:15 17:07:48"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.DateTimeDigitized);
Assert.IsNotNull (entry, "Entry 0x9004 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("2007:02:15 17:07:48", (entry as StringIFDEntry).Value);
}
// Photo.0x9204 (ExposureBiasValue/SRational/1) "0/6"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.ExposureBiasValue);
Assert.IsNotNull (entry, "Entry 0x9204 missing in IFD 0");
Assert.IsNotNull (entry as SRationalIFDEntry, "Entry is not a srational!");
Assert.AreEqual (0, (entry as SRationalIFDEntry).Value.Numerator);
Assert.AreEqual (6, (entry as SRationalIFDEntry).Value.Denominator);
}
// Photo.0x9205 (MaxApertureValue/Rational/1) "50/10"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.MaxApertureValue);
Assert.IsNotNull (entry, "Entry 0x9205 missing in IFD 0");
Assert.IsNotNull (entry as RationalIFDEntry, "Entry is not a rational!");
Assert.AreEqual (50, (entry as RationalIFDEntry).Value.Numerator);
Assert.AreEqual (10, (entry as RationalIFDEntry).Value.Denominator);
}
// Photo.0x9207 (MeteringMode/Short/1) "5"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.MeteringMode);
Assert.IsNotNull (entry, "Entry 0x9207 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (5, (entry as ShortIFDEntry).Value);
}
// Photo.0x9208 (LightSource/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.LightSource);
Assert.IsNotNull (entry, "Entry 0x9208 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// Photo.0x920A (FocalLength/Rational/1) "50/1"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.FocalLength);
Assert.IsNotNull (entry, "Entry 0x920A missing in IFD 0");
Assert.IsNotNull (entry as RationalIFDEntry, "Entry is not a rational!");
Assert.AreEqual (50, (entry as RationalIFDEntry).Value.Numerator);
Assert.AreEqual (1, (entry as RationalIFDEntry).Value.Denominator);
}
// Photo.0x9290 (SubSecTime/Ascii/4) "889"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.SubsecTime);
Assert.IsNotNull (entry, "Entry 0x9290 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("889", (entry as StringIFDEntry).Value);
}
// Photo.0x9291 (SubSecTimeOriginal/Ascii/4) "800"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.SubsecTimeOriginal);
Assert.IsNotNull (entry, "Entry 0x9291 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("800", (entry as StringIFDEntry).Value);
}
// Photo.0x9292 (SubSecTimeDigitized/Ascii/4) "800"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.SubsecTimeDigitized);
Assert.IsNotNull (entry, "Entry 0x9292 missing in IFD 0");
Assert.IsNotNull (entry as StringIFDEntry, "Entry is not a string!");
Assert.AreEqual ("800", (entry as StringIFDEntry).Value);
}
// Photo.0xA402 (ExposureMode/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.ExposureMode);
Assert.IsNotNull (entry, "Entry 0xA402 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// Photo.0xA403 (WhiteBalance/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.WhiteBalance);
Assert.IsNotNull (entry, "Entry 0xA403 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// Photo.0xA405 (FocalLengthIn35mmFilm/Short/1) "75"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.FocalLengthIn35mmFilm);
Assert.IsNotNull (entry, "Entry 0xA405 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (75, (entry as ShortIFDEntry).Value);
}
// Photo.0xA406 (SceneCaptureType/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.SceneCaptureType);
Assert.IsNotNull (entry, "Entry 0xA406 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// Photo.0xA408 (Contrast/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.Contrast);
Assert.IsNotNull (entry, "Entry 0xA408 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// Photo.0xA409 (Saturation/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.Saturation);
Assert.IsNotNull (entry, "Entry 0xA409 missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// Photo.0xA40A (Sharpness/Short/1) "1"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.Sharpness);
Assert.IsNotNull (entry, "Entry 0xA40A missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (1, (entry as ShortIFDEntry).Value);
}
// Photo.0xA40C (SubjectDistanceRange/Short/1) "0"
{
var entry = exif_structure.GetEntry (0, (ushort)ExifEntryTag.SubjectDistanceRange);
Assert.IsNotNull (entry, "Entry 0xA40C missing in IFD 0");
Assert.IsNotNull (entry as ShortIFDEntry, "Entry is not a short!");
Assert.AreEqual (0, (entry as ShortIFDEntry).Value);
}
// ---------- End of IFD tests ----------
// ---------- Start of XMP tests ----------
var xmp = file.GetTag (TagTypes.XMP) as XmpTag;
// Xmp.tiff.Model (XmpText/10) "NIKON D70s"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "Model");
Assert.IsNotNull (node);
Assert.AreEqual ("NIKON D70s", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.Make (XmpText/17) "NIKON CORPORATION"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "Make");
Assert.IsNotNull (node);
Assert.AreEqual ("NIKON CORPORATION", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.ImageWidth (XmpText/4) "3024"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "ImageWidth");
Assert.IsNotNull (node);
Assert.AreEqual ("3024", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.ImageLength (XmpText/4) "1998"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "ImageLength");
Assert.IsNotNull (node);
Assert.AreEqual ("1998", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.FNumber (XmpText/6) "130/10"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "FNumber");
Assert.IsNotNull (node);
Assert.AreEqual ("130/10", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.XResolution (XmpText/5) "150/1"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "XResolution");
Assert.IsNotNull (node);
Assert.AreEqual ("150/1", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.YResolution (XmpText/5) "150/1"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "YResolution");
Assert.IsNotNull (node);
Assert.AreEqual ("150/1", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.tiff.ResolutionUnit (XmpText/1) "2"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.TIFF_NS, "ResolutionUnit");
Assert.IsNotNull (node);
Assert.AreEqual ("2", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.ExposureProgram (XmpText/1) "2"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "ExposureProgram");
Assert.IsNotNull (node);
Assert.AreEqual ("2", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.MeteringMode (XmpText/1) "5"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "MeteringMode");
Assert.IsNotNull (node);
Assert.AreEqual ("5", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.LightSource (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "LightSource");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.ExposureMode (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "ExposureMode");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.WhiteBalance (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "WhiteBalance");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.FocalLengthIn35mmFilm (XmpText/2) "75"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "FocalLengthIn35mmFilm");
Assert.IsNotNull (node);
Assert.AreEqual ("75", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.SceneCaptureType (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "SceneCaptureType");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.Contrast (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "Contrast");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.Saturation (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "Saturation");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.Sharpness (XmpText/1) "1"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "Sharpness");
Assert.IsNotNull (node);
Assert.AreEqual ("1", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.SubjectDistanceRange (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "SubjectDistanceRange");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.ISOSpeedRating (XmpText/4) "1600"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "ISOSpeedRating");
Assert.IsNotNull (node);
Assert.AreEqual ("1600", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.MaxApertureValue (XmpText/5) "50/10"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "MaxApertureValue");
Assert.IsNotNull (node);
Assert.AreEqual ("50/10", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.ExposureTime (XmpText/7) "10/7500"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "ExposureTime");
Assert.IsNotNull (node);
Assert.AreEqual ("10/7500", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.ExposureBiasValue (XmpText/3) "0/6"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "ExposureBiasValue");
Assert.IsNotNull (node);
Assert.AreEqual ("0/6", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.exif.FocalLength (XmpText/6) "500/10"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.EXIF_NS, "FocalLength");
Assert.IsNotNull (node);
Assert.AreEqual ("500/10", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.photoshop.DateCreated (XmpText/24) "2007-02-15T17:07:48.800Z"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.PHOTOSHOP_NS, "DateCreated");
Assert.IsNotNull (node);
Assert.AreEqual ("2007-02-15T17:07:48.800Z", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// Xmp.xmp.Rating (XmpText/1) "0"
{
var node = xmp.NodeTree;
node = node.GetChild (XmpTag.XAP_NS, "Rating");
Assert.IsNotNull (node);
Assert.AreEqual ("0", node.Value);
Assert.AreEqual (XmpNodeType.Simple, node.Type);
Assert.AreEqual (0, node.Children.Count);
}
// ---------- End of XMP tests ----------
}
}
}