Skip to content

Instantly share code, notes, and snippets.

@chsami
Last active October 3, 2020 09:48
Show Gist options
  • Save chsami/5524329862c4087a200a0ec41b7aec9f to your computer and use it in GitHub Desktop.
Save chsami/5524329862c4087a200a0ec41b7aec9f to your computer and use it in GitHub Desktop.
There's a lot more metadata that you can pull from the picture
public abstract class ExifDirectoryBase : Directory
{
public const int TagInteropIndex = 1;
public const int TagImageNumber = 37393;
public const int TagSecurityClassification = 37394;
public const int TagImageHistory = 37395;
public const int TagSubjectLocationTiffEp = 37396;
public const int TagExposureIndexTiffEp = 37397;
public const int TagStandardIdTiffEp = 37398;
//
// Summary:
// This tag holds the Exif Makernote.
//
// Remarks:
// Makernotes are free to be in any format, though they are often IFDs. To determine
// the format, we consider the starting bytes of the makernote itself and sometimes
// the camera model and make.
// The component count for this tag includes all of the bytes needed for the makernote.
public const int TagMakernote = 37500;
public const int TagFocalPlaneYResolutionTiffEp = 37391;
public const int TagUserComment = 37510;
public const int TagSubsecondTimeOriginal = 37521;
public const int TagSubsecondTimeDigitized = 37522;
//
// Summary:
// The image title, as used by Windows XP.
public const int TagWinTitle = 40091;
//
// Summary:
// The image comment, as used by Windows XP.
public const int TagWinComment = 40092;
//
// Summary:
// The image author, as used by Windows XP (called Artist in the Windows shell).
public const int TagWinAuthor = 40093;
//
// Summary:
// The image keywords, as used by Windows XP.
public const int TagWinKeywords = 40094;
//
// Summary:
// The image subject, as used by Windows XP.
public const int TagWinSubject = 40095;
public const int TagSubsecondTime = 37520;
public const int TagFlashpixVersion = 40960;
public const int TagFocalPlaneXResolutionTiffEp = 37390;
public const int TagSpatialFreqResponseTiffEp = 37388;
public const int TagTimeZone = 36880;
public const int TagTimeZoneOriginal = 36881;
public const int TagTimeZoneDigitized = 36882;
public const int TagComponentsConfiguration = 37121;
//
// Summary:
// Average (rough estimate) compression level in JPEG bits per pixel.
public const int TagCompressedAverageBitsPerPixel = 37122;
//
// Summary:
// Shutter speed by APEX value.
//
// Remarks:
// To convert this value to ordinary 'Shutter Speed'; calculate this value's power
// of 2, then reciprocal. For example, if the ShutterSpeedValue is '4', shutter
// speed is 1/(24)=1/16 second.
public const int TagShutterSpeed = 37377;
//
// Summary:
// The actual aperture value of lens when the image was taken.
//
// Remarks:
// Unit is APEX. To convert this value to ordinary F-number (F-stop), calculate
// this value's power of root 2 (=1.4142). For example, if the ApertureValue is
// '5', F-number is 1.4142^5 = F5.6.
public const int TagAperture = 37378;
public const int TagNoise = 37389;
public const int TagBrightnessValue = 37379;
//
// Summary:
// Maximum aperture value of lens.
//
// Remarks:
// You can convert to F-number by calculating power of root 2 (same process of ApertureValue:0x9202).
// The actual aperture value of lens when the image was taken. To convert this value
// to ordinary f-number(f-stop), calculate the value's power of root 2 (=1.4142).
// For example, if the ApertureValue is '5', f-number is 1.41425^5 = F5.6.
public const int TagMaxAperture = 37381;
//
// Summary:
// Indicates the distance the autofocus camera is focused to.
//
// Remarks:
// Tends to be less accurate as distance increases.
public const int TagSubjectDistance = 37382;
//
// Summary:
// Exposure metering method.
//
// Remarks:
// '0' means unknown, '1' average, '2' center weighted average, '3' spot, '4' multi-spot,
// '5' multi-segment, '6' partial, '255' other.
public const int TagMeteringMode = 37383;
//
// Summary:
// White balance (aka light source).
//
// Remarks:
// '0' means unknown, '1' daylight, '2' fluorescent, '3' tungsten, '10' flash, '17'
// standard light A, '18' standard light B, '19' standard light C, '20' D55, '21'
// D65, '22' D75, '255' other.
public const int TagWhiteBalance = 37384;
//
// Summary:
// 0x0 = 0000000 = No Flash 0x1 = 0000001 = Fired 0x5 = 0000101 = Fired, Return
// not detected 0x7 = 0000111 = Fired, Return detected 0x9 = 0001001 = On 0xd =
// 0001101 = On, Return not detected 0xf = 0001111 = On, Return detected 0x10 =
// 0010000 = Off 0x18 = 0011000 = Auto, Did not fire 0x19 = 0011001 = Auto, Fired
// 0x1d = 0011101 = Auto, Fired, Return not detected 0x1f = 0011111 = Auto, Fired,
// Return detected 0x20 = 0100000 = No flash function 0x41 = 1000001 = Fired, Red-eye
// reduction 0x45 = 1000101 = Fired, Red-eye reduction, Return not detected 0x47
// = 1000111 = Fired, Red-eye reduction, Return detected 0x49 = 1001001 = On, Red-eye
// reduction 0x4d = 1001101 = On, Red-eye reduction, Return not detected 0x4f =
// 1001111 = On, Red-eye reduction, Return detected 0x59 = 1011001 = Auto, Fired,
// Red-eye reduction 0x5d = 1011101 = Auto, Fired, Red-eye reduction, Return not
// detected 0x5f = 1011111 = Auto, Fired, Red-eye reduction, Return detected 6543210
// (positions) This is a bitmask. 0 = flash fired 1 = return detected 2 = return
// able to be detected 3 = unknown 4 = auto used 5 = unknown 6 = red eye reduction
// used
public const int TagFlash = 37385;
//
// Summary:
// Focal length of lens used to take image.
//
// Remarks:
// Unit is millimeter. Nice digital cameras actually save the focal length as a
// function of how far they are zoomed in.
public const int TagFocalLength = 37386;
public const int TagFlashEnergyTiffEp = 37387;
public const int TagExposureBias = 37380;
//
// Summary:
// Defines Color Space.
//
// Remarks:
// DCF image must use sRGB color space so value is always '1'. If the picture uses
// the other color space, value is '65535':Uncalibrated.
public const int TagColorSpace = 40961;
public const int TagExifImageWidth = 40962;
public const int TagExifImageHeight = 40963;
//
// Summary:
// This tag indicates the direction of sharpness processing applied by the camera
// when the image was shot.
//
// Remarks:
// Tag = 41994 (A40A.H) Type = SHORT Count = 1 Default = 0 0 = Normal 1 = Soft 2
// = Hard Other = reserved
public const int TagSharpness = 41994;
//
// Summary:
// This tag indicates information on the picture-taking conditions of a particular
// camera model.
//
// Remarks:
// The tag is used only to indicate the picture-taking conditions in the reader.
// Tag = 41995 (A40B.H) Type = UNDEFINED Count = Any Default = none The information
// is recorded in the format shown below. The data is recorded in Unicode using
// SHORT type for the number of display rows and columns and UNDEFINED type for
// the camera settings. The Unicode (UCS-2) string including Signature is NULL terminated.
// The specifics of the Unicode string are as given in ISO/IEC 10464-1. Length Type
// Meaning ------+-----------+------------------ 2 SHORT Display columns 2 SHORT
// Display rows Any UNDEFINED Camera setting-1 Any UNDEFINED Camera setting-2 :
// : : Any UNDEFINED Camera setting-n
public const int TagDeviceSettingDescription = 41995;
//
// Summary:
// This tag indicates the distance to the subject.
//
// Remarks:
// Tag = 41996 (A40C.H) Type = SHORT Count = 1 Default = none 0 = unknown 1 = Macro
// 2 = Close view 3 = Distant view Other = reserved
public const int TagSubjectDistanceRange = 41996;
//
// Summary:
// This tag indicates an identifier assigned uniquely to each image.
//
// Remarks:
// It is recorded as an ASCII string equivalent to hexadecimal notation and 128-bit
// fixed length. Tag = 42016 (A420.H) Type = ASCII Count = 33 Default = none
public const int TagImageUniqueId = 42016;
//
// Summary:
// String.
public const int TagCameraOwnerName = 42032;
//
// Summary:
// String.
public const int TagBodySerialNumber = 42033;
//
// Summary:
// An array of four Rational64u numbers giving focal and aperture ranges.
public const int TagLensSpecification = 42034;
//
// Summary:
// This tag indicates the direction of saturation processing applied by the camera
// when the image was shot.
//
// Remarks:
// Tag = 41993 (A409.H) Type = SHORT Count = 1 Default = 0 0 = Normal 1 = Low saturation
// 2 = High saturation Other = reserved
public const int TagSaturation = 41993;
//
// Summary:
// String.
public const int TagLensMake = 42035;
//
// Summary:
// String.
public const int TagLensSerialNumber = 42037;
//
// Summary:
// Rational64u.
public const int TagGamma = 42240;
public const int TagPrintImageMatchingInfo = 50341;
public const int TagPanasonicTitle = 50898;
public const int TagPanasonicTitle2 = 50899;
public const int TagPadding = 59932;
public const int TagLens = 65002;
//
// Summary:
// String.
public const int TagLensModel = 42036;
//
// Summary:
// This tag indicates the direction of contrast processing applied by the camera
// when the image was shot.
//
// Remarks:
// Tag = 41992 (A408.H) Type = SHORT Count = 1 Default = 0 0 = Normal 1 = Soft 2
// = Hard Other = reserved
public const int TagContrast = 41992;
//
// Summary:
// This tag indicates the degree of overall image gain adjustment.
//
// Remarks:
// Tag = 41991 (A407.H) Type = SHORT Count = 1 Default = none 0 = None 1 = Low gain
// up 2 = High gain up 3 = Low gain down 4 = High gain down Other = reserved
public const int TagGainControl = 41991;
//
// Summary:
// This tag indicates the type of scene that was shot.
//
// Remarks:
// It can also be used to record the mode in which the image was shot. Note that
// this differs from the scene type (SceneType) tag. Tag = 41990 (A406.H) Type =
// SHORT Count = 1 Default = 0 0 = Standard 1 = Landscape 2 = Portrait 3 = Night
// scene Other = reserved
public const int TagSceneCaptureType = 41990;
public const int TagRelatedSoundFile = 40964;
public const int TagFlashEnergy = 41483;
public const int TagSpatialFreqResponse = 41484;
public const int TagFocalPlaneXResolution = 41486;
public const int TagFocalPlaneYResolution = 41487;
//
// Summary:
// Unit of FocalPlaneXResolution/FocalPlaneYResolution.
//
// Remarks:
// '1' means no-unit, '2' inch, '3' centimeter. Note: Some of Fujifilm's digicam(e.g.FX2700,FX2900,Finepix4700Z/40i
// etc) uses value '3' so it must be 'centimeter', but it seems that they use a
// '8.3mm?'(1/3in.?) to their ResolutionUnit. Fuji's BUG? Finepix4900Z has been
// changed to use value '2' but it doesn't match to actual value also.
public const int TagFocalPlaneResolutionUnit = 41488;
public const int TagSubjectLocation = 41492;
public const int TagExposureIndex = 41493;
public const int TagSensingMethod = 41495;
public const int TagFileSource = 41728;
public const int TagSceneType = 41729;
public const int TagCfaPattern = 41730;
//
// Summary:
// This tag indicates the use of special processing on image data, such as rendering
// geared to output.
//
// Remarks:
// When special processing is performed, the reader is expected to disable or minimize
// any further processing. Tag = 41985 (A401.H) Type = SHORT Count = 1 Default =
// 0 0 = Normal process 1 = Custom process Other = reserved
public const int TagCustomRendered = 41985;
//
// Summary:
// This tag indicates the exposure mode set when the image was shot.
//
// Remarks:
// In auto-bracketing mode, the camera shoots a series of frames of the same scene
// at different exposure settings. Tag = 41986 (A402.H) Type = SHORT Count = 1 Default
// = none 0 = Auto exposure 1 = Manual exposure 2 = Auto bracket Other = reserved
public const int TagExposureMode = 41986;
//
// Summary:
// This tag indicates the white balance mode set when the image was shot.
//
// Remarks:
// Tag = 41987 (A403.H) Type = SHORT Count = 1 Default = none 0 = Auto white balance
// 1 = Manual white balance Other = reserved
public const int TagWhiteBalanceMode = 41987;
//
// Summary:
// This tag indicates the digital zoom ratio when the image was shot.
//
// Remarks:
// If the numerator of the recorded value is 0, this indicates that digital zoom
// was not used. Tag = 41988 (A404.H) Type = RATIONAL Count = 1 Default = none
public const int TagDigitalZoomRatio = 41988;
//
// Summary:
// This tag indicates the equivalent focal length assuming a 35mm film camera, in
// mm.
//
// Remarks:
// A value of 0 means the focal length is unknown. Note that this tag differs from
// the FocalLength tag. Tag = 41989 (A405.H) Type = SHORT Count = 1 Default = none
public const int Tag35MMFilmEquivFocalLength = 41989;
public const int TagDateTimeDigitized = 36868;
public const int TagDateTimeOriginal = 36867;
public const int TagExifVersion = 36864;
//
// Summary:
// Tag is a pointer to one or more sub-IFDs.
//
// Remarks:
// Seems to be used exclusively by raw formats, referencing one or two IFDs.
public const int TagSubIfdOffset = 330;
public const int TagYResolution = 283;
//
// Summary:
// When image format is no compression YCbCr, this value shows byte aligns of YCbCr
// data.
//
// Remarks:
// If value is '1', Y/Cb/Cr value is chunky format, contiguous for each subsampling
// pixel. If value is '2', Y/Cb/Cr value is separated and stored to Y plane/Cb plane/Cr
// plane format.
public const int TagPlanarConfiguration = 284;
public const int TagPageName = 285;
public const int TagResolutionUnit = 296;
public const int TagPageNumber = 297;
public const int TagTransferFunction = 301;
public const int TagSoftware = 305;
public const int TagXResolution = 282;
public const int TagDateTime = 306;
public const int TagHostComputer = 316;
public const int TagPredictor = 317;
public const int TagWhitePoint = 318;
public const int TagPrimaryChromaticities = 319;
public const int TagTileWidth = 322;
public const int TagTileLength = 323;
public const int TagTileOffsets = 324;
public const int TagArtist = 315;
public const int TagTileByteCounts = 325;
public const int TagMaxSampleValue = 281;
//
// Summary:
// The size of the raster data in bytes.
public const int TagStripByteCounts = 279;
//
// Summary:
// The old subfile type tag.
//
// Remarks:
// 1 = Full-resolution image (Main image) 2 = Reduced-resolution image (Thumbnail)
// 3 = Single page of multi-page image
public const int TagSubfileType = 255;
public const int TagImageWidth = 256;
public const int TagImageHeight = 257;
//
// Summary:
// When image format is no compression, this value shows the number of bits per
// component for each pixel.
//
// Remarks:
// Usually this value is '8,8,8'.
public const int TagBitsPerSample = 258;
public const int TagCompression = 259;
//
// Summary:
// Shows the color space of the image data components.
//
// Remarks:
// 0 = WhiteIsZero 1 = BlackIsZero 2 = RGB 3 = RGB Palette 4 = Transparency Mask
// 5 = CMYK 6 = YCbCr 8 = CIELab 9 = ICCLab 10 = ITULab 32803 = Color Filter Array
// 32844 = Pixar LogL 32845 = Pixar LogLuv 34892 = Linear Raw
public const int TagPhotometricInterpretation = 262;
//
// Summary:
// 1 = No dithering or halftoning 2 = Ordered dither or halftone 3 = Randomized
// dither
public const int TagThresholding = 263;
public const int TagMinSampleValue = 280;
//
// Summary:
// 1 = Normal 2 = Reversed
public const int TagFillOrder = 266;
public const int TagImageDescription = 270;
public const int TagMake = 271;
public const int TagModel = 272;
//
// Summary:
// The position in the file of raster data.
public const int TagStripOffsets = 273;
public const int TagOrientation = 274;
//
// Summary:
// Each pixel is composed of this many samples.
public const int TagSamplesPerPixel = 277;
//
// Summary:
// The raster is codified by a single block of data holding this many rows.
public const int TagRowsPerStrip = 278;
public const int TagDocumentName = 269;
public const int TagSelfTimerMode = 34859;
public const int TagTransferRange = 342;
public const int TagJpegTables = 347;
//
// Summary:
// Exposure time (reciprocal of shutter speed).
//
// Remarks:
// Unit is second.
public const int TagExposureTime = 33434;
//
// Summary:
// The actual F-number(F-stop) of lens when the image was taken.
public const int TagFNumber = 33437;
public const int TagIptcNaa = 33723;
public const int TagPhotoshopSettings = 34377;
public const int TagInterColorProfile = 34675;
//
// Summary:
// Exposure program that the camera used when image was taken.
//
// Remarks:
// '1' means manual control, '2' program normal, '3' aperture priority, '4' shutter
// priority, '5' program creative (slow program), '6' program action (high-speed
// program), '7' portrait mode, '8' landscape mode.
public const int TagExposureProgram = 34850;
public const int TagSpectralSensitivity = 34852;
public const int TagCopyright = 33432;
public const int TagIsoEquivalent = 34855;
public const int TagInterlace = 34857;
public const int TagTimeZoneOffsetTiffEp = 34858;
public const int TagSelfTimerModeTiffEp = 34859;
//
// Summary:
// Applies to ISO tag.
//
// Remarks:
// 0 = Unknown 1 = Standard Output Sensitivity 2 = Recommended Exposure Index 3
// = ISO Speed 4 = Standard Output Sensitivity and Recommended Exposure Index 5
// = Standard Output Sensitivity and ISO Speed 6 = Recommended Exposure Index and
// ISO Speed 7 = Standard Output Sensitivity, Recommended Exposure Index and ISO
// Speed
public const int TagSensitivityType = 34864;
public const int TagStandardOutputSensitivity = 34865;
public const int TagRecommendedExposureIndex = 34866;
//
// Summary:
// Non-standard, but in use.
public const int TagTimeZoneOffset = 34858;
//
// Summary:
// Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524.
//
// Remarks:
// OECF is the relationship between the camera optical input and the image values.
// The values are:
// • Two shorts, indicating respectively number of columns, and number of rows.
// • For each column, the column name in a null-terminated ASCII string.
// • For each cell, an SRATIONAL value.
public const int TagOptoElectricConversionFunction = 34856;
public const int TagBatteryLevel = 33423;
//
// Summary:
// There are two definitions for CFA pattern, I don't know the difference...
public const int TagCfaPattern2 = 33422;
public const int TagCfaRepeatPatternDim = 33421;
public const int TagJpegProc = 512;
public const int TagJpegRestartInterval = 515;
public const int TagJpegLosslessPredictors = 517;
public const int TagJpegPointTransforms = 518;
public const int TagJpegQTables = 519;
public const int TagJpegDcTables = 520;
public const int TagJpegAcTables = 521;
public const int TagYCbCrCoefficients = 529;
public const int TagYCbCrSubsampling = 530;
public const int TagYCbCrPositioning = 531;
public const int TagReferenceBlackWhite = 532;
public const int TagStripRowCounts = 559;
public const int TagApplicationNotes = 700;
public const int TagRelatedImageFileFormat = 4096;
public const int TagRelatedImageWidth = 4097;
public const int TagRelatedImageHeight = 4098;
public const int TagRating = 18246;
//
// Summary:
// The new subfile type tag.
//
// Remarks:
// 0 = Full-resolution Image 1 = Reduced-resolution image 2 = Single page of multi-page
// image 3 = Single page of multi-page reduced-resolution image 4 = Transparency
// mask 5 = Transparency mask of reduced-resolution image 6 = Transparency mask
// of multi-page image 7 = Transparency mask of reduced-resolution multi-page image
public const int TagNewSubfileType = 254;
public const int TagInteropVersion = 2;
protected ExifDirectoryBase();
[NullableContextAttribute(1)]
protected static void AddExifTagNames(Dictionary<int, string> map);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment