Skip to content

Commit

Permalink
added back tests with APP1 segment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganesh Tiwari(gtiwari333) committed Nov 14, 2023
1 parent 9a671dc commit 526eef0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Binary file added Tests/Data/nikonD610.jpg.app1.0
Binary file not shown.
Binary file added Tests/Data/nikonD750.jpg.app1.0
Binary file not shown.
26 changes: 26 additions & 0 deletions Tests/com/drew/metadata/exif/NikonType2MakernoteTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
package com.drew.metadata.exif;

import com.drew.lang.Rational;
import com.drew.metadata.Directory;
import com.drew.metadata.Metadata;
import com.drew.metadata.exif.makernotes.NikonPictureControl1Directory;
import com.drew.metadata.exif.makernotes.NikonPictureControl2Directory;
import com.drew.metadata.exif.makernotes.NikonType2MakernoteDirectory;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -56,6 +59,29 @@ public void setUp() throws Exception
assertNotNull(_exifSubIFDDirectory);
}


@Test
public void testNikonPictureControl1Directory() throws Exception {
Metadata metadata = ExifReaderTest.processBytes("Tests/Data/nikonD610.jpg.app1.0");

Directory directory = metadata.getFirstDirectoryOfType(NikonPictureControl1Directory.class);
assertNotNull(directory);
assertEquals( "0100", directory.getDescription(NikonPictureControl1Directory.TAG_PICTURE_CONTROL_VERSION));
assertEquals( "STANDARD", directory.getDescription(NikonPictureControl1Directory.TAG_PICTURE_CONTROL_NAME));
assertEquals( "STANDARD", directory.getDescription(NikonPictureControl1Directory.TAG_PICTURE_CONTROL_BASE));
assertEquals( "Default Settings", directory.getDescription(NikonPictureControl1Directory.TAG_PICTURE_CONTROL_ADJUST));
}
@Test
public void testNikonPictureControl2Directory() throws Exception {
Metadata metadata = ExifReaderTest.processBytes("Tests/Data/nikonD750.jpg.app1.0");
Directory directory = metadata.getFirstDirectoryOfType(NikonPictureControl2Directory.class);
assertNotNull(directory);
assertEquals( "0200", directory.getDescription(NikonPictureControl2Directory.TAG_PICTURE_CONTROL_VERSION));
assertEquals( "STANDARD", directory.getDescription(NikonPictureControl2Directory.TAG_PICTURE_CONTROL_NAME));
assertEquals( "STANDARD", directory.getDescription(NikonPictureControl2Directory.TAG_PICTURE_CONTROL_BASE));
assertEquals( "Default Settings", directory.getDescription(NikonPictureControl2Directory.TAG_PICTURE_CONTROL_ADJUST));
}

/*
[Nikon Makernote] Makernote Unknown 1 =
[Nikon Makernote] ISO Setting = Unknown (0 0)
Expand Down

0 comments on commit 526eef0

Please sign in to comment.