Class MetadataExtractor.NikonType2MakernoteDirectory

  • Enclosing class:
    MetadataExtractor

    public class MetadataExtractor.NikonType2MakernoteDirectory
    extends MetadataExtractor.Directory
    Describes tags specific to Nikon (type 2) cameras. Type-2 applies to the E990 and D-series cameras such as the E990, D1, D70 and D100.

    Thanks to Fabrizio Giudici for publishing his reverse-engineering of the D100 makernote data. http://www.timelesswanderings.net/equipment/D100/NEF.html

    Note that the camera implements image protection (locking images) via the file's 'readonly' attribute. Similarly image hiding uses the 'hidden' attribute (observed on the D70). Consequently, these values are not available here.

    Additional sample images have been observed, and their tag values recorded in javadoc comments for each tag's field. New tags have subsequently been added since Fabrizio's observations.

    In earlier models (such as the E990 and D1), this directory begins at the first byte of the makernote IFD. In later models, the IFD was given the standard prefix to indicate the camera models (most other manufacturers also provide this prefix to aid in software decoding).

    Author:
    Drew Noakes https://drewnoakes.com
    • Field Detail

      • TAG_FIRMWARE_VERSION

        public static final int TAG_FIRMWARE_VERSION
        Values observed - 0200 (D70) - 0200 (D1X)
        See Also:
        Constant Field Values
      • TAG_ISO_1

        public static final int TAG_ISO_1
        Values observed - 0 250 - 0 400
        See Also:
        Constant Field Values
      • TAG_COLOR_MODE

        public static final int TAG_COLOR_MODE
        The camera's color mode, as an uppercase string. Examples include:
        • B & W
        • COLOR
        • COOL
        • SEPIA
        • VIVID
        See Also:
        Constant Field Values
      • TAG_QUALITY_AND_FILE_FORMAT

        public static final int TAG_QUALITY_AND_FILE_FORMAT
        The camera's quality setting, as an uppercase string. Examples include:
        • BASIC
        • FINE
        • NORMAL
        • RAW
        • RAW2.7M
        See Also:
        Constant Field Values
      • TAG_CAMERA_WHITE_BALANCE

        public static final int TAG_CAMERA_WHITE_BALANCE
        The camera's white balance setting, as an uppercase string. Examples include:
        • AUTO
        • CLOUDY
        • FLASH
        • FLUORESCENT
        • INCANDESCENT
        • PRESET
        • PRESET0
        • PRESET1
        • PRESET3
        • SUNNY
        • WHITE PRESET
        • 4350K
        • 5000K
        • DAY WHITE FL
        • SHADE
        See Also:
        Constant Field Values
      • TAG_CAMERA_SHARPENING

        public static final int TAG_CAMERA_SHARPENING
        The camera's sharpening setting, as an uppercase string. Examples include:
        • AUTO
        • HIGH
        • LOW
        • NONE
        • NORMAL
        • MED.H
        • MED.L
        See Also:
        Constant Field Values
      • TAG_AF_TYPE

        public static final int TAG_AF_TYPE
        The camera's auto-focus mode, as an uppercase string. Examples include:
        • AF-C
        • AF-S
        • MANUAL
        • AF-A
        See Also:
        Constant Field Values
      • TAG_FLASH_SYNC_MODE

        public static final int TAG_FLASH_SYNC_MODE
        The camera's flash setting, as an uppercase string. Examples include:
        • NORMAL
        • RED-EYE
        • SLOW
        • NEW_TTL
        • REAR
        • REAR SLOW
        Note: when TAG_AUTO_FLASH_MODE is blank (whitespace), Nikon Browser displays "Flash Sync Mode: Not Attached"
        See Also:
        Constant Field Values
      • TAG_AUTO_FLASH_MODE

        public static final int TAG_AUTO_FLASH_MODE
        The type of flash used in the photograph, as a string. Examples include:
        • Built-in,TTL
        • NEW_TTL Nikon Browser interprets as "D-TTL"
        • Built-in,M
        • Optional,TTL with speedlight SB800, flash sync mode as "NORMAL"
        See Also:
        Constant Field Values
      • TAG_UNKNOWN_34

        public static final int TAG_UNKNOWN_34
        An unknown tag, as a rational. Several values given here: http://gvsoft.homedns.org/exif/makernote-nikon-type2.html#0x000b
        See Also:
        Constant Field Values
      • TAG_CAMERA_WHITE_BALANCE_FINE

        public static final int TAG_CAMERA_WHITE_BALANCE_FINE
        The camera's white balance bias setting, as an uint16 array having either one or two elements.
        • 0
        • 1
        • -3
        • -2
        • -1
        • 0,0
        • 1,0
        • 5,-5
        See Also:
        Constant Field Values
      • TAG_CAMERA_WHITE_BALANCE_RB_COEFF

        public static final int TAG_CAMERA_WHITE_BALANCE_RB_COEFF
        The first two numbers are coefficients to multiply red and blue channels according to white balance as set in the camera. The meaning of the third and the fourth numbers is unknown. Values observed - 2.25882352 1.76078431 0.0 0.0 - 10242/1 34305/1 0/1 0/1 - 234765625/100000000 1140625/1000000 1/1 1/1
        See Also:
        Constant Field Values
      • TAG_PROGRAM_SHIFT

        public static final int TAG_PROGRAM_SHIFT
        The camera's program shift setting, as an array of four integers. The value, in EV, is calculated as a*b/c.
        • 0,1,3,0 = 0 EV
        • 1,1,3,0 = 0.33 EV
        • -3,1,3,0 = -1 EV
        • 1,1,2,0 = 0.5 EV
        • 2,1,6,0 = 0.33 EV
        See Also:
        Constant Field Values
      • TAG_EXPOSURE_DIFFERENCE

        public static final int TAG_EXPOSURE_DIFFERENCE
        The exposure difference, as an array of four integers. The value, in EV, is calculated as a*b/c.
        • -105,1,12,0 = -8.75 EV
        • -72,1,12,0 = -6.00 EV
        • -11,1,12,0 = -0.92 EV
        See Also:
        Constant Field Values
      • TAG_ISO_MODE

        public static final int TAG_ISO_MODE
        The camera's ISO mode, as an uppercase string.
        • AUTO
        • MANUAL
        See Also:
        Constant Field Values
      • TAG_DATA_DUMP

        public static final int TAG_DATA_DUMP
        Added during merge of Type2 & Type3. May apply to earlier models, such as E990 and D1.
        See Also:
        Constant Field Values
      • TAG_PREVIEW_IFD

        public static final int TAG_PREVIEW_IFD
        Preview to another IFD (?)

        Details here: http://gvsoft.homedns.org/exif/makernote-nikon-2-tag0x0011.html // TODO if this is another IFD, decode it

        See Also:
        Constant Field Values
      • TAG_AUTO_FLASH_COMPENSATION

        public static final int TAG_AUTO_FLASH_COMPENSATION
        The flash compensation, as an array of four integers. The value, in EV, is calculated as a*b/c.
        • -18,1,6,0 = -3 EV
        • 4,1,6,0 = 0.67 EV
        • 6,1,6,0 = 1 EV
        See Also:
        Constant Field Values
      • TAG_ISO_REQUESTED

        public static final int TAG_ISO_REQUESTED
        The requested ISO value, as an array of two integers.
        • 0,0
        • 0,125
        • 1,2500
        See Also:
        Constant Field Values
      • TAG_IMAGE_BOUNDARY

        public static final int TAG_IMAGE_BOUNDARY
        Defines the photo corner coordinates, in 8 bytes. Treated as four 16-bit integers, they decode as: top-left (x,y); bot-right (x,y) - 0 0 49163 53255 - 0 0 3008 2000 (the image dimensions were 3008x2000) (D70)
        • 0,0,4288,2848 The max resolution of the D300 camera
        • 0,0,3008,2000 The max resolution of the D70 camera
        • 0,0,4256,2832 The max resolution of the D3 camera
        See Also:
        Constant Field Values
      • TAG_FLASH_EXPOSURE_COMPENSATION

        public static final int TAG_FLASH_EXPOSURE_COMPENSATION
        The flash exposure compensation, as an array of four integers. The value, in EV, is calculated as a*b/c.
        • 0,0,0,0 = 0 EV
        • 0,1,6,0 = 0 EV
        • 4,1,6,0 = 0.67 EV
        See Also:
        Constant Field Values
      • TAG_FLASH_BRACKET_COMPENSATION

        public static final int TAG_FLASH_BRACKET_COMPENSATION
        The flash bracket compensation, as an array of four integers. The value, in EV, is calculated as a*b/c.
        • 0,0,0,0 = 0 EV
        • 0,1,6,0 = 0 EV
        • 4,1,6,0 = 0.67 EV
        See Also:
        Constant Field Values
      • TAG_AE_BRACKET_COMPENSATION

        public static final int TAG_AE_BRACKET_COMPENSATION
        The AE bracket compensation, as a rational number.
        • 0/0
        • 0/1
        • 0/6
        • 4/6
        • 6/6
        See Also:
        Constant Field Values
      • TAG_FLASH_MODE

        public static final int TAG_FLASH_MODE
        Flash mode, as a string.
        • Red Eye Reduction
        • D-Lighting
        • Distortion control
        See Also:
        Constant Field Values
      • TAG_CAMERA_SERIAL_NUMBER

        public static final int TAG_CAMERA_SERIAL_NUMBER
        The camera's serial number, as a string. Note that D200 is always blank, and D50 is always "D50".
        See Also:
        Constant Field Values
      • TAG_COLOR_SPACE

        public static final int TAG_COLOR_SPACE
        The camera's color space setting.
        • 1 sRGB
        • 2 Adobe RGB
        See Also:
        Constant Field Values
      • TAG_IMAGE_AUTHENTICATION

        public static final int TAG_IMAGE_AUTHENTICATION
        See Also:
        Constant Field Values
      • TAG_ACTIVE_D_LIGHTING

        public static final int TAG_ACTIVE_D_LIGHTING
        The active D-Lighting setting.
        • 0 Off
        • 1 Low
        • 3 Normal
        • 5 High
        • 7 Extra High
        • 65535 Auto
        See Also:
        Constant Field Values
      • TAG_VIGNETTE_CONTROL

        public static final int TAG_VIGNETTE_CONTROL
        The camera's vignette control setting.
        • 0 Off
        • 1 Low
        • 3 Normal
        • 5 High
        See Also:
        Constant Field Values
      • TAG_IMAGE_ADJUSTMENT

        public static final int TAG_IMAGE_ADJUSTMENT
        The camera's image adjustment setting, as a string.
        • AUTO
        • CONTRAST(+)
        • CONTRAST(-)
        • NORMAL
        • B & W
        • BRIGHTNESS(+)
        • BRIGHTNESS(-)
        • SEPIA
        See Also:
        Constant Field Values
      • TAG_CAMERA_TONE_COMPENSATION

        public static final int TAG_CAMERA_TONE_COMPENSATION
        The camera's tone compensation setting, as a string.
        • NORMAL
        • LOW
        • MED.L
        • MED.H
        • HIGH
        • AUTO
        See Also:
        Constant Field Values
      • TAG_ADAPTER

        public static final int TAG_ADAPTER
        A description of any auxiliary lens, as a string.
        • OFF
        • FISHEYE 1
        • FISHEYE 2
        • TELEPHOTO 2
        • WIDE ADAPTER
        See Also:
        Constant Field Values
      • TAG_LENS_TYPE

        public static final int TAG_LENS_TYPE
        The type of lens used, as a byte.
        • 0x00 AF
        • 0x01 MF
        • 0x02 D
        • 0x06 G, D
        • 0x08 VR
        • 0x0a VR, D
        • 0x0e VR, G, D
        See Also:
        Constant Field Values
      • TAG_LENS

        public static final int TAG_LENS
        A pair of focal/max-fstop values that describe the lens used. Values observed - 180.0,180.0,2.8,2.8 (D100) - 240/10 850/10 35/10 45/10 - 18-70mm f/3.5-4.5 (D70) - 17-35mm f/2.8-2.8 (D1X) - 70-200mm f/2.8-2.8 (D70) Nikon Browser identifies the lens as "18-70mm F/3.5-4.5 G" which is identical to metadata extractor, except for the "G". This must be coming from another tag...
        See Also:
        Constant Field Values
      • TAG_MANUAL_FOCUS_DISTANCE

        public static final int TAG_MANUAL_FOCUS_DISTANCE
        Added during merge of Type2 & Type3. May apply to earlier models, such as E990 and D1.
        See Also:
        Constant Field Values
      • TAG_DIGITAL_ZOOM

        public static final int TAG_DIGITAL_ZOOM
        The amount of digital zoom used.
        See Also:
        Constant Field Values
      • TAG_FLASH_USED

        public static final int TAG_FLASH_USED
        Whether the flash was used in this image.
        • 0 Flash Not Used
        • 1 Manual Flash
        • 3 Flash Not Ready
        • 7 External Flash
        • 8 Fired, Commander Mode
        • 9 Fired, TTL Mode
        See Also:
        Constant Field Values
      • TAG_AF_FOCUS_POSITION

        public static final int TAG_AF_FOCUS_POSITION
        The position of the autofocus target.
        See Also:
        Constant Field Values
      • TAG_SHOOTING_MODE

        public static final int TAG_SHOOTING_MODE
        The camera's shooting mode.

        A bit-array with:

        • 0 Single Frame
        • 1 Continuous
        • 2 Delay
        • 8 PC Control
        • 16 Exposure Bracketing
        • 32 Auto ISO
        • 64 White-Balance Bracketing
        • 128 IR Control
        See Also:
        Constant Field Values
      • TAG_LENS_STOPS

        public static final int TAG_LENS_STOPS
        Lens stops, as an array of four integers. The value, in EV, is calculated as a*b/c.
        • 64,1,12,0 = 5.33 EV
        • 72,1,12,0 = 6 EV
        See Also:
        Constant Field Values
      • TAG_CAMERA_COLOR_MODE

        public static final int TAG_CAMERA_COLOR_MODE
        The color space as set in the camera, as a string.
        • MODE1 = Mode 1 (sRGB)
        • MODE1a = Mode 1 (sRGB)
        • MODE2 = Mode 2 (Adobe RGB)
        • MODE3 = Mode 2 (sRGB): Higher Saturation
        • MODE3a = Mode 2 (sRGB): Higher Saturation
        • B & W = B & W
        See Also:
        Constant Field Values
      • TAG_SCENE_MODE

        public static final int TAG_SCENE_MODE
        The camera's scene mode, as a string. Examples include:
        • BEACH/SNOW
        • CLOSE UP
        • NIGHT PORTRAIT
        • PORTRAIT
        • ANTI-SHAKE
        • BACK LIGHT
        • BEST FACE
        • BEST
        • COPY
        • DAWN/DUSK
        • FACE-PRIORITY
        • FIREWORKS
        • FOOD
        • HIGH SENS.
        • LAND SCAPE
        • MUSEUM
        • PANORAMA ASSIST
        • PARTY/INDOOR
        • SCENE AUTO
        • SMILE
        • SPORT
        • SPORT CONT.
        • SUNSET
        See Also:
        Constant Field Values
      • TAG_LIGHT_SOURCE

        public static final int TAG_LIGHT_SOURCE
        The lighting type, as a string. Examples include:
        • NATURAL
        • SPEEDLIGHT
        • COLORED
        • MIXED
        • NORMAL
        See Also:
        Constant Field Values
      • TAG_SHOT_INFO

        public static final int TAG_SHOT_INFO
        Advertised as ASCII, but actually isn't. A variable number of bytes (eg. 18 to 533). Actual number of bytes appears fixed for a given camera model.
        See Also:
        Constant Field Values
      • TAG_CAMERA_HUE_ADJUSTMENT

        public static final int TAG_CAMERA_HUE_ADJUSTMENT
        The hue adjustment as set in the camera. Values observed are either 0 or 3.
        See Also:
        Constant Field Values
      • TAG_NEF_COMPRESSION

        public static final int TAG_NEF_COMPRESSION
        The NEF (RAW) compression. Examples include:
        • 1 Lossy (Type 1)
        • 2 Uncompressed
        • 3 Lossless
        • 4 Lossy (Type 2)
        See Also:
        Constant Field Values
      • TAG_SATURATION

        public static final int TAG_SATURATION
        The saturation level, as a signed integer. Examples include:
        • +3
        • +2
        • +1
        • 0 Normal
        • -1
        • -2
        • -3 (B&W)
        See Also:
        Constant Field Values
      • TAG_NOISE_REDUCTION

        public static final int TAG_NOISE_REDUCTION
        The type of noise reduction, as a string. Examples include:
        • OFF
        • FPNR
        See Also:
        Constant Field Values
      • TAG_LINEARIZATION_TABLE

        public static final int TAG_LINEARIZATION_TABLE
        See Also:
        Constant Field Values
      • TAG_NEF_THUMBNAIL_SIZE

        public static final int TAG_NEF_THUMBNAIL_SIZE
        The NEF (RAW) thumbnail size, as an integer array with two items representing [width,height].
        See Also:
        Constant Field Values
      • TAG_SENSOR_PIXEL_SIZE

        public static final int TAG_SENSOR_PIXEL_SIZE
        The sensor pixel size, as a pair of rational numbers.
        See Also:
        Constant Field Values
      • TAG_CAMERA_SERIAL_NUMBER_2

        public static final int TAG_CAMERA_SERIAL_NUMBER_2
        The camera serial number, as a string.
        • NO= 00002539
        • NO= -1000d71
        • PKG597230621263
        • PKG5995671330625116
        • PKG49981281631130677
        • BU672230725063
        • NO= 200332c7
        • NO= 30045efe
        See Also:
        Constant Field Values
      • TAG_DELETED_IMAGE_COUNT

        public static final int TAG_DELETED_IMAGE_COUNT
        See Also:
        Constant Field Values
      • TAG_EXPOSURE_SEQUENCE_NUMBER

        public static final int TAG_EXPOSURE_SEQUENCE_NUMBER
        The number of total shutter releases. This value increments for each exposure (observed on D70).
        See Also:
        Constant Field Values
      • TAG_IMAGE_OPTIMISATION

        public static final int TAG_IMAGE_OPTIMISATION
        The camera's image optimisation, as a string.
        • NORMAL
        • CUSTOM
        • BLACK AND WHITE
        • LAND SCAPE
        • MORE VIVID
        • PORTRAIT
        • SOFT
        • VIVID
        See Also:
        Constant Field Values
      • TAG_SATURATION_2

        public static final int TAG_SATURATION_2
        The camera's saturation level, as a string.
        • NORMAL
        • AUTO
        • ENHANCED
        • MODERATE
        See Also:
        Constant Field Values
      • TAG_DIGITAL_VARI_PROGRAM

        public static final int TAG_DIGITAL_VARI_PROGRAM
        The camera's digital vari-program setting, as a string.
        • AUTO
        • AUTO(FLASH OFF)
        • CLOSE UP
        • LANDSCAPE
        • NIGHT PORTRAIT
        • PORTRAIT
        • SPORT
        See Also:
        Constant Field Values
      • TAG_IMAGE_STABILISATION

        public static final int TAG_IMAGE_STABILISATION
        The camera's digital vari-program setting, as a string.
        • VR-ON
        • VR-OFF
        • VR-HYBRID
        • VR-ACTIVE
        See Also:
        Constant Field Values
      • TAG_AF_RESPONSE

        public static final int TAG_AF_RESPONSE
        The camera's digital vari-program setting, as a string.
        • HYBRID
        • STANDARD
        See Also:
        Constant Field Values
      • TAG_HIGH_ISO_NOISE_REDUCTION

        public static final int TAG_HIGH_ISO_NOISE_REDUCTION
        The camera's high ISO noise reduction setting, as an integer.
        • 0 Off
        • 1 Minimal
        • 2 Low
        • 4 Normal
        • 6 High
        See Also:
        Constant Field Values
      • TAG_PRINT_IMAGE_MATCHING_INFO

        public static final int TAG_PRINT_IMAGE_MATCHING_INFO
        See Also:
        Constant Field Values
      • TAG_NIKON_CAPTURE_DATA

        public static final int TAG_NIKON_CAPTURE_DATA
        Data about changes set by Nikon Capture Editor. Values observed
        See Also:
        Constant Field Values
      • TAG_NIKON_CAPTURE_VERSION

        public static final int TAG_NIKON_CAPTURE_VERSION
        See Also:
        Constant Field Values
      • TAG_NIKON_CAPTURE_OFFSETS

        public static final int TAG_NIKON_CAPTURE_OFFSETS
        See Also:
        Constant Field Values
      • _tagNameMap

        private final java.util.HashMap<java.lang.Integer,​java.lang.String> _tagNameMap
      • _decTable1

        private final int[] _decTable1
        Nikon decryption tables used in exiftool
      • _decTable2

        private final int[] _decTable2
    • Constructor Detail

      • NikonType2MakernoteDirectory

        public NikonType2MakernoteDirectory()
    • Method Detail

      • getDecryptedIntArray

        public int[] getDecryptedIntArray​(int tagType)
        decryption algorithm adapted from exiftool