public PNGText(ExifTag tag, string keyword, string value, bool compressed) : base(tag) { Keyword = keyword; mValue = value; Compressed = compressed; }
private void AddTagToList(ExifTag tag) { ListViewItem item = listExif.Items.Add(tag.Id.ToString()); item.SubItems.Add(tag.FieldName); item.SubItems.Add(tag.Description); item.SubItems.Add(tag.Value); }
/// <summary> /// Returns the string representation for the given exif tag. /// </summary> public static string GetTagName(ExifTag tag) { string name = Enum.GetName(typeof(ExifTag), tag); if (name == null) return "Unknown"; else return name; }
/// <summary> /// Returns the string representation for the given exif tag including /// IFD section and tag id. /// </summary> public static string GetTagLongName(ExifTag tag) { string ifdname = Enum.GetName(typeof(IFD), GetTagIFD(tag)); string name = Enum.GetName(typeof(ExifTag), tag); if (name == null) name = "Unknown"; string tagidname = GetTagID(tag).ToString(); return ifdname + ": " + name + " (" + tagidname + ")"; }
public PNGInternationalText(ExifTag tag, string keyword, string value, bool compressed, string language, string translatedKeyword) : base(tag) { Keyword = keyword; mValue = value; Compressed = compressed; Language = language; TranslatedKeyword = translatedKeyword; }
bool MakeExifNode (TreeIter parent, TreeIter iter, ExifData ed, ExifTag tag) { string val = ed.Lookup (tag); if (val == null || val == "") return false; MakeNode (parent, out iter, ExifUtil.GetTagTitle (tag) + ":", ed.Lookup (tag)); return true; }
/// <summary> /// Gets or sets the Exif property with the given key. /// </summary> /// <param name="key">The Exif tag associated with the Exif property.</param> /// <returns></returns> public ExifProperty this[ExifTag key] { get { return Properties[key]; } set { Properties[key] = value; } }
public static string GetDescription(ExifTag tag, object value) { ExifTagDescriptionAttribute[] attributes = TypeHelper.GetCustomAttributes<ExifTagDescriptionAttribute>(tag); if (attributes == null || attributes.Length == 0) return null; foreach (ExifTagDescriptionAttribute attribute in attributes) { if (Equals(attribute._value, value)) return attribute._description; } return null; }
public ExifTag GetExifData(string filename) { Metadata fileMetadata = GetExifMetadata(filename); ExifTag newTags = new ExifTag(); newTags.CameraModel = fileMetadata.CameraModel.DisplayValue; newTags.EquipmentMake = fileMetadata.EquipmentMake.DisplayValue; newTags.Date = fileMetadata.DatePictureTaken.DisplayValue; newTags.ExposureCompensation = fileMetadata.ExposureCompensation.DisplayValue; newTags.ExposureTime = fileMetadata.ExposureTime.DisplayValue; newTags.Flash = fileMetadata.Flash.DisplayValue; newTags.Fstop = fileMetadata.Fstop.DisplayValue; newTags.ImgDimensions = fileMetadata.ImageDimensions.DisplayValue; newTags.MeteringMod = fileMetadata.MeteringMode.DisplayValue; newTags.Resolutions = fileMetadata.Resolution.DisplayValue; newTags.ShutterSpeed = fileMetadata.ShutterSpeed.DisplayValue; newTags.ViewComment = fileMetadata.ViewerComments.DisplayValue; return newTags; }
public GPSTimeStamp(ExifTag tag, MathEx.UFraction32[] value) : base(tag, value) { ; }
public GPSLatitudeLongitude(ExifTag tag, MathEx.UFraction32[] value) : base(tag, value) { ; }
public ExifRectangularSubjectArea(ExifTag tag, ushort[] value) : base(tag, value) { ; }
public ExifByteArray(ExifTag tag, byte[] value) : base(tag) { mValue = value; }
public ExifSIntArray(ExifTag tag, int[] value) : base(tag) { mValue = value; }
public ExifURational(ExifTag tag, MathEx.UFraction32 value) : base(tag) { mValue = value; }
public ExifSRational(ExifTag tag, int numerator, int denominator) : base(tag) { mValue = new MathEx.Fraction32(numerator, denominator); }
public ExifSInt(ExifTag tag, int value) : base(tag) { mValue = value; }
public ExifUndefined(ExifTag tag, byte[] value) : base(tag) { mValue = value; }
public ExifUShortArray(ExifTag tag, ushort[] value) : base(tag) { mValue = value; }
public ExifUShort(ExifTag tag, ushort value) : base(tag) { mValue = value; }
public ExifSRationalArray(ExifTag tag, MathEx.Fraction32[] value) : base(tag) { mValue = value; }
public ExifByte(ExifTag tag, byte value) : base(tag) { mValue = value; }
/// <summary> /// Creates a new <see cref="ExifValue"/> /// </summary> /// <param name="tag">The tag.</param> /// <param name="value">The value.</param> /// <returns> /// The <see cref="ExifValue"/>. /// </returns> /// <exception cref="NotSupportedException"> /// Thrown if the tag is not supported. /// </exception> internal static ExifValue Create(ExifTag tag, object value) { Guard.IsFalse(tag == ExifTag.Unknown, nameof(tag), "Invalid Tag"); switch (tag) { case ExifTag.ImageDescription: case ExifTag.Make: case ExifTag.Model: case ExifTag.Software: case ExifTag.DateTime: case ExifTag.Artist: case ExifTag.HostComputer: case ExifTag.Copyright: case ExifTag.DocumentName: case ExifTag.PageName: case ExifTag.InkNames: case ExifTag.TargetPrinter: case ExifTag.ImageID: case ExifTag.MDLabName: case ExifTag.MDSampleInfo: case ExifTag.MDPrepDate: case ExifTag.MDPrepTime: case ExifTag.MDFileUnits: case ExifTag.SEMInfo: case ExifTag.SpectralSensitivity: case ExifTag.DateTimeOriginal: case ExifTag.DateTimeDigitized: case ExifTag.SubsecTime: case ExifTag.SubsecTimeOriginal: case ExifTag.SubsecTimeDigitized: case ExifTag.FaxSubaddress: case ExifTag.OffsetTime: case ExifTag.OffsetTimeOriginal: case ExifTag.OffsetTimeDigitized: case ExifTag.SecurityClassification: case ExifTag.ImageHistory: case ExifTag.ImageUniqueID: case ExifTag.OwnerName: case ExifTag.SerialNumber: case ExifTag.LensMake: case ExifTag.LensModel: case ExifTag.LensSerialNumber: case ExifTag.GDALMetadata: case ExifTag.GDALNoData: case ExifTag.GPSLatitudeRef: case ExifTag.GPSLongitudeRef: case ExifTag.GPSSatellites: case ExifTag.GPSStatus: case ExifTag.GPSMeasureMode: case ExifTag.GPSSpeedRef: case ExifTag.GPSTrackRef: case ExifTag.GPSImgDirectionRef: case ExifTag.GPSMapDatum: case ExifTag.GPSDestLatitudeRef: case ExifTag.GPSDestLongitudeRef: case ExifTag.GPSDestBearingRef: case ExifTag.GPSDestDistanceRef: case ExifTag.GPSDateStamp: return(new ExifValue(tag, ExifDataType.Ascii, value, true)); case ExifTag.ClipPath: case ExifTag.VersionYear: case ExifTag.XMP: case ExifTag.CFAPattern2: case ExifTag.TIFFEPStandardID: case ExifTag.XPTitle: case ExifTag.XPComment: case ExifTag.XPAuthor: case ExifTag.XPKeywords: case ExifTag.XPSubject: case ExifTag.GPSVersionID: return(new ExifValue(tag, ExifDataType.Byte, value, true)); case ExifTag.FaxProfile: case ExifTag.ModeNumber: case ExifTag.GPSAltitudeRef: return(new ExifValue(tag, ExifDataType.Byte, value, false)); case ExifTag.FreeOffsets: case ExifTag.FreeByteCounts: case ExifTag.ColorResponseUnit: case ExifTag.TileOffsets: case ExifTag.SMinSampleValue: case ExifTag.SMaxSampleValue: case ExifTag.JPEGQTables: case ExifTag.JPEGDCTables: case ExifTag.JPEGACTables: case ExifTag.StripRowCounts: case ExifTag.IntergraphRegisters: case ExifTag.TimeZoneOffset: return(new ExifValue(tag, ExifDataType.Long, value, true)); case ExifTag.SubfileType: case ExifTag.SubIFDOffset: case ExifTag.GPSIFDOffset: case ExifTag.T4Options: case ExifTag.T6Options: case ExifTag.XClipPathUnits: case ExifTag.YClipPathUnits: case ExifTag.ProfileType: case ExifTag.CodingMethods: case ExifTag.T82ptions: case ExifTag.JPEGInterchangeFormat: case ExifTag.JPEGInterchangeFormatLength: case ExifTag.MDFileTag: case ExifTag.StandardOutputSensitivity: case ExifTag.RecommendedExposureIndex: case ExifTag.ISOSpeed: case ExifTag.ISOSpeedLatitudeyyy: case ExifTag.ISOSpeedLatitudezzz: case ExifTag.FaxRecvParams: case ExifTag.FaxRecvTime: case ExifTag.ImageNumber: return(new ExifValue(tag, ExifDataType.Long, value, false)); case ExifTag.WhitePoint: case ExifTag.PrimaryChromaticities: case ExifTag.YCbCrCoefficients: case ExifTag.ReferenceBlackWhite: case ExifTag.PixelScale: case ExifTag.IntergraphMatrix: case ExifTag.ModelTiePoint: case ExifTag.ModelTransform: case ExifTag.GPSLatitude: case ExifTag.GPSLongitude: case ExifTag.GPSTimestamp: case ExifTag.GPSDestLatitude: case ExifTag.GPSDestLongitude: return(new ExifValue(tag, ExifDataType.Rational, value, true)); case ExifTag.XPosition: case ExifTag.YPosition: case ExifTag.XResolution: case ExifTag.YResolution: case ExifTag.BatteryLevel: case ExifTag.ExposureTime: case ExifTag.FNumber: case ExifTag.MDScalePixel: case ExifTag.CompressedBitsPerPixel: case ExifTag.ApertureValue: case ExifTag.MaxApertureValue: case ExifTag.SubjectDistance: case ExifTag.FocalLength: case ExifTag.FlashEnergy2: case ExifTag.FocalPlaneXResolution2: case ExifTag.FocalPlaneYResolution2: case ExifTag.ExposureIndex2: case ExifTag.Humidity: case ExifTag.Pressure: case ExifTag.Acceleration: case ExifTag.FlashEnergy: case ExifTag.FocalPlaneXResolution: case ExifTag.FocalPlaneYResolution: case ExifTag.ExposureIndex: case ExifTag.DigitalZoomRatio: case ExifTag.LensInfo: case ExifTag.GPSAltitude: case ExifTag.GPSDOP: case ExifTag.GPSSpeed: case ExifTag.GPSTrack: case ExifTag.GPSImgDirection: case ExifTag.GPSDestBearing: case ExifTag.GPSDestDistance: return(new ExifValue(tag, ExifDataType.Rational, value, false)); case ExifTag.BitsPerSample: case ExifTag.MinSampleValue: case ExifTag.MaxSampleValue: case ExifTag.GrayResponseCurve: case ExifTag.ColorMap: case ExifTag.ExtraSamples: case ExifTag.PageNumber: case ExifTag.TransferFunction: case ExifTag.Predictor: case ExifTag.HalftoneHints: case ExifTag.SampleFormat: case ExifTag.TransferRange: case ExifTag.DefaultImageColor: case ExifTag.JPEGLosslessPredictors: case ExifTag.JPEGPointTransforms: case ExifTag.YCbCrSubsampling: case ExifTag.CFARepeatPatternDim: case ExifTag.IntergraphPacketData: case ExifTag.ISOSpeedRatings: case ExifTag.SubjectArea: case ExifTag.SubjectLocation: return(new ExifValue(tag, ExifDataType.Short, value, true)); case ExifTag.OldSubfileType: case ExifTag.Compression: case ExifTag.PhotometricInterpretation: case ExifTag.Thresholding: case ExifTag.CellWidth: case ExifTag.CellLength: case ExifTag.FillOrder: case ExifTag.Orientation: case ExifTag.SamplesPerPixel: case ExifTag.PlanarConfiguration: case ExifTag.GrayResponseUnit: case ExifTag.ResolutionUnit: case ExifTag.CleanFaxData: case ExifTag.InkSet: case ExifTag.NumberOfInks: case ExifTag.DotRange: case ExifTag.Indexed: case ExifTag.OPIProxy: case ExifTag.JPEGProc: case ExifTag.JPEGRestartInterval: case ExifTag.YCbCrPositioning: case ExifTag.Rating: case ExifTag.RatingPercent: case ExifTag.ExposureProgram: case ExifTag.Interlace: case ExifTag.SelfTimerMode: case ExifTag.SensitivityType: case ExifTag.MeteringMode: case ExifTag.LightSource: case ExifTag.FocalPlaneResolutionUnit2: case ExifTag.SensingMethod2: case ExifTag.Flash: case ExifTag.ColorSpace: case ExifTag.FocalPlaneResolutionUnit: case ExifTag.SensingMethod: case ExifTag.CustomRendered: case ExifTag.ExposureMode: case ExifTag.WhiteBalance: case ExifTag.FocalLengthIn35mmFilm: case ExifTag.SceneCaptureType: case ExifTag.GainControl: case ExifTag.Contrast: case ExifTag.Saturation: case ExifTag.Sharpness: case ExifTag.SubjectDistanceRange: case ExifTag.GPSDifferential: return(new ExifValue(tag, ExifDataType.Short, value, false)); case ExifTag.Decode: return(new ExifValue(tag, ExifDataType.SignedRational, value, true)); case ExifTag.ShutterSpeedValue: case ExifTag.BrightnessValue: case ExifTag.ExposureBiasValue: case ExifTag.AmbientTemperature: case ExifTag.WaterDepth: case ExifTag.CameraElevationAngle: return(new ExifValue(tag, ExifDataType.SignedRational, value, false)); case ExifTag.JPEGTables: case ExifTag.OECF: case ExifTag.ExifVersion: case ExifTag.ComponentsConfiguration: case ExifTag.MakerNote: case ExifTag.UserComment: case ExifTag.FlashpixVersion: case ExifTag.SpatialFrequencyResponse: case ExifTag.SpatialFrequencyResponse2: case ExifTag.Noise: case ExifTag.CFAPattern: case ExifTag.DeviceSettingDescription: case ExifTag.ImageSourceData: case ExifTag.GPSProcessingMethod: case ExifTag.GPSAreaInformation: return(new ExifValue(tag, ExifDataType.Undefined, value, true)); case ExifTag.FileSource: case ExifTag.SceneType: return(new ExifValue(tag, ExifDataType.Undefined, value, false)); case ExifTag.StripOffsets: case ExifTag.TileByteCounts: case ExifTag.ImageLayer: return(CreateNumber(tag, value, true)); case ExifTag.ImageWidth: case ExifTag.ImageLength: case ExifTag.TileWidth: case ExifTag.TileLength: case ExifTag.BadFaxLines: case ExifTag.ConsecutiveBadFaxLines: case ExifTag.PixelXDimension: case ExifTag.PixelYDimension: return(CreateNumber(tag, value, false)); default: throw new NotSupportedException(); } }
public Boolean RemoveValue(ExifTag tag) { object result; try { result = _Instance.CallMethod("RemoveValue", new Type[] {Types.ExifTag}, tag); } catch (Exception ex) { throw ExceptionHelper.Create(ex); } return (Boolean)result; }
/// <summary> /// Creates an ExifProperty from the given interoperability parameters. /// </summary> /// <param name="tag">The tag id of the exif property.</param> /// <param name="type">The type id of the exif property.</param> /// <param name="count">Byte or component count.</param> /// <param name="value">Field data as an array of bytes.</param> /// <param name="byteOrder">Byte order of value.</param> /// <param name="ifd">IFD section containing this propery.</param> /// <param name="encoding">The encoding to be used for text metadata when the source encoding is unknown.</param> /// <returns>an ExifProperty initialized from the interoperability parameters.</returns> public static ExifProperty Get(ushort tag, ushort type, uint count, byte[] value, BitConverterEx.ByteOrder byteOrder, IFD ifd, Encoding encoding) { BitConverterEx conv = new BitConverterEx(byteOrder, BitConverterEx.SystemByteOrder); // Find the exif tag corresponding to given tag id ExifTag etag = ExifTagFactory.GetExifTag(ifd, tag); if (ifd == IFD.Zeroth) { if (tag == 0x103) // Compression { return(new ExifEnumProperty <Compression>(ExifTag.Compression, (Compression)conv.ToUInt16(value, 0))); } else if (tag == 0x106) // PhotometricInterpretation { return(new ExifEnumProperty <PhotometricInterpretation>(ExifTag.PhotometricInterpretation, (PhotometricInterpretation)conv.ToUInt16(value, 0))); } else if (tag == 0x112) // Orientation { return(new ExifEnumProperty <Orientation>(ExifTag.Orientation, (Orientation)conv.ToUInt16(value, 0))); } else if (tag == 0x11c) // PlanarConfiguration { return(new ExifEnumProperty <PlanarConfiguration>(ExifTag.PlanarConfiguration, (PlanarConfiguration)conv.ToUInt16(value, 0))); } else if (tag == 0x213) // YCbCrPositioning { return(new ExifEnumProperty <YCbCrPositioning>(ExifTag.YCbCrPositioning, (YCbCrPositioning)conv.ToUInt16(value, 0))); } else if (tag == 0x128) // ResolutionUnit { return(new ExifEnumProperty <ResolutionUnit>(ExifTag.ResolutionUnit, (ResolutionUnit)conv.ToUInt16(value, 0))); } else if (tag == 0x132) // DateTime { return(new ExifDateTime(ExifTag.DateTime, ExifBitConverter.ToDateTime(value))); } else if (tag == 0x9c9b || tag == 0x9c9c || // Windows tags tag == 0x9c9d || tag == 0x9c9e || tag == 0x9c9f) { return(new WindowsByteString(etag, Encoding.Unicode.GetString(value).TrimEnd('\0'))); } } else if (ifd == IFD.EXIF) { if (tag == 0x9000) // ExifVersion { return(new ExifVersion(ExifTag.ExifVersion, ExifBitConverter.ToAscii(value, Encoding.ASCII))); } else if (tag == 0xa000) // FlashpixVersion { return(new ExifVersion(ExifTag.FlashpixVersion, ExifBitConverter.ToAscii(value, Encoding.ASCII))); } else if (tag == 0xa001) // ColorSpace { return(new ExifEnumProperty <ColorSpace>(ExifTag.ColorSpace, (ColorSpace)conv.ToUInt16(value, 0))); } else if (tag == 0x9286) // UserComment { // Default to ASCII Encoding enc = Encoding.ASCII; bool hasenc; if (value.Length < 8) { hasenc = false; } else { hasenc = true; string encstr = enc.GetString(value, 0, 8); if (string.Compare(encstr, "ASCII\0\0\0", StringComparison.OrdinalIgnoreCase) == 0) { enc = Encoding.ASCII; } else if (string.Compare(encstr, "JIS\0\0\0\0\0", StringComparison.OrdinalIgnoreCase) == 0) { enc = Encoding.GetEncoding("Japanese (JIS 0208-1990 and 0212-1990)"); } else if (string.Compare(encstr, "Unicode\0", StringComparison.OrdinalIgnoreCase) == 0) { enc = Encoding.Unicode; } else { hasenc = false; } } string val = (hasenc ? enc.GetString(value, 8, value.Length - 8) : enc.GetString(value)).Trim('\0'); return(new ExifEncodedString(ExifTag.UserComment, val, enc)); } else if (tag == 0x9003) // DateTimeOriginal { return(new ExifDateTime(ExifTag.DateTimeOriginal, ExifBitConverter.ToDateTime(value))); } else if (tag == 0x9004) // DateTimeDigitized { return(new ExifDateTime(ExifTag.DateTimeDigitized, ExifBitConverter.ToDateTime(value))); } else if (tag == 0x8822) // ExposureProgram { return(new ExifEnumProperty <ExposureProgram>(ExifTag.ExposureProgram, (ExposureProgram)conv.ToUInt16(value, 0))); } else if (tag == 0x9207) // MeteringMode { return(new ExifEnumProperty <MeteringMode>(ExifTag.MeteringMode, (MeteringMode)conv.ToUInt16(value, 0))); } else if (tag == 0x9208) // LightSource { return(new ExifEnumProperty <LightSource>(ExifTag.LightSource, (LightSource)conv.ToUInt16(value, 0))); } else if (tag == 0x9209) // Flash { return(new ExifEnumProperty <Flash>(ExifTag.Flash, (Flash)conv.ToUInt16(value, 0), true)); } else if (tag == 0x9214) // SubjectArea { if (count == 3) { return(new ExifCircularSubjectArea(ExifTag.SubjectArea, ExifBitConverter.ToUShortArray(value, (int)count, byteOrder))); } else if (count == 4) { return(new ExifRectangularSubjectArea(ExifTag.SubjectArea, ExifBitConverter.ToUShortArray(value, (int)count, byteOrder))); } else // count == 2 { return(new ExifPointSubjectArea(ExifTag.SubjectArea, ExifBitConverter.ToUShortArray(value, (int)count, byteOrder))); } } else if (tag == 0xa210) // FocalPlaneResolutionUnit { return(new ExifEnumProperty <ResolutionUnit>(ExifTag.FocalPlaneResolutionUnit, (ResolutionUnit)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa214) // SubjectLocation { return(new ExifPointSubjectArea(ExifTag.SubjectLocation, ExifBitConverter.ToUShortArray(value, (int)count, byteOrder))); } else if (tag == 0xa217) // SensingMethod { return(new ExifEnumProperty <SensingMethod>(ExifTag.SensingMethod, (SensingMethod)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa300) // FileSource { return(new ExifEnumProperty <FileSource>(ExifTag.FileSource, (FileSource)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa301) // SceneType { return(new ExifEnumProperty <SceneType>(ExifTag.SceneType, (SceneType)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa401) // CustomRendered { return(new ExifEnumProperty <CustomRendered>(ExifTag.CustomRendered, (CustomRendered)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa402) // ExposureMode { return(new ExifEnumProperty <ExposureMode>(ExifTag.ExposureMode, (ExposureMode)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa403) // WhiteBalance { return(new ExifEnumProperty <WhiteBalance>(ExifTag.WhiteBalance, (WhiteBalance)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa406) // SceneCaptureType { return(new ExifEnumProperty <SceneCaptureType>(ExifTag.SceneCaptureType, (SceneCaptureType)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa407) // GainControl { return(new ExifEnumProperty <GainControl>(ExifTag.GainControl, (GainControl)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa408) // Contrast { return(new ExifEnumProperty <Contrast>(ExifTag.Contrast, (Contrast)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa409) // Saturation { return(new ExifEnumProperty <Saturation>(ExifTag.Saturation, (Saturation)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa40a) // Sharpness { return(new ExifEnumProperty <Sharpness>(ExifTag.Sharpness, (Sharpness)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa40c) // SubjectDistanceRange { return(new ExifEnumProperty <SubjectDistanceRange>(ExifTag.SubjectDistanceRange, (SubjectDistanceRange)conv.ToUInt16(value, 0), true)); } else if (tag == 0xa432) // LensSpecification { return(new LensSpecification(ExifTag.LensSpecification, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } } else if (ifd == IFD.GPS) { if (tag == 0) // GPSVersionID { return(new VersionID(ExifTag.GPSVersionID, value)); } else if (tag == 1) // GPSLatitudeRef { return(new ExifEnumProperty <GPSLatitudeRef>(ExifTag.GPSLatitudeRef, (GPSLatitudeRef)value[0])); } else if (tag == 2) // GPSLatitude { return(new GPSLatitudeLongitude(ExifTag.GPSLatitude, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } else if (tag == 3) // GPSLongitudeRef { return(new ExifEnumProperty <GPSLongitudeRef>(ExifTag.GPSLongitudeRef, (GPSLongitudeRef)value[0])); } else if (tag == 4) // GPSLongitude { return(new GPSLatitudeLongitude(ExifTag.GPSLongitude, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } else if (tag == 5) // GPSAltitudeRef { return(new ExifEnumProperty <GPSAltitudeRef>(ExifTag.GPSAltitudeRef, (GPSAltitudeRef)value[0])); } else if (tag == 7) // GPSTimeStamp { return(new GPSTimeStamp(ExifTag.GPSTimeStamp, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } else if (tag == 9) // GPSStatus { return(new ExifEnumProperty <GPSStatus>(ExifTag.GPSStatus, (GPSStatus)value[0])); } else if (tag == 10) // GPSMeasureMode { return(new ExifEnumProperty <GPSMeasureMode>(ExifTag.GPSMeasureMode, (GPSMeasureMode)value[0])); } else if (tag == 12) // GPSSpeedRef { return(new ExifEnumProperty <GPSSpeedRef>(ExifTag.GPSSpeedRef, (GPSSpeedRef)value[0])); } else if (tag == 14) // GPSTrackRef { return(new ExifEnumProperty <GPSDirectionRef>(ExifTag.GPSTrackRef, (GPSDirectionRef)value[0])); } else if (tag == 16) // GPSImgDirectionRef { return(new ExifEnumProperty <GPSDirectionRef>(ExifTag.GPSImgDirectionRef, (GPSDirectionRef)value[0])); } else if (tag == 19) // GPSDestLatitudeRef { return(new ExifEnumProperty <GPSLatitudeRef>(ExifTag.GPSDestLatitudeRef, (GPSLatitudeRef)value[0])); } else if (tag == 20) // GPSDestLatitude { return(new GPSLatitudeLongitude(ExifTag.GPSDestLatitude, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } else if (tag == 21) // GPSDestLongitudeRef { return(new ExifEnumProperty <GPSLongitudeRef>(ExifTag.GPSDestLongitudeRef, (GPSLongitudeRef)value[0])); } else if (tag == 22) // GPSDestLongitude { return(new GPSLatitudeLongitude(ExifTag.GPSDestLongitude, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } else if (tag == 23) // GPSDestBearingRef { return(new ExifEnumProperty <GPSDirectionRef>(ExifTag.GPSDestBearingRef, (GPSDirectionRef)value[0])); } else if (tag == 25) // GPSDestDistanceRef { return(new ExifEnumProperty <GPSDistanceRef>(ExifTag.GPSDestDistanceRef, (GPSDistanceRef)value[0])); } else if (tag == 29) // GPSDateStamp { return(new ExifDate(ExifTag.GPSDateStamp, ExifBitConverter.ToDateTime(value, false))); } else if (tag == 30) // GPSDifferential { return(new ExifEnumProperty <GPSDifferential>(ExifTag.GPSDifferential, (GPSDifferential)conv.ToUInt16(value, 0))); } } else if (ifd == IFD.Interop) { if (tag == 1) // InteroperabilityIndex { return(new ExifAscii(ExifTag.InteroperabilityIndex, ExifBitConverter.ToAscii(value, Encoding.ASCII), Encoding.ASCII)); } else if (tag == 2) // InteroperabilityVersion { return(new ExifVersion(ExifTag.InteroperabilityVersion, ExifBitConverter.ToAscii(value, Encoding.ASCII))); } } else if (ifd == IFD.First) { if (tag == 0x103) // Compression { return(new ExifEnumProperty <Compression>(ExifTag.ThumbnailCompression, (Compression)conv.ToUInt16(value, 0))); } else if (tag == 0x106) // PhotometricInterpretation { return(new ExifEnumProperty <PhotometricInterpretation>(ExifTag.ThumbnailPhotometricInterpretation, (PhotometricInterpretation)conv.ToUInt16(value, 0))); } else if (tag == 0x112) // Orientation { return(new ExifEnumProperty <Orientation>(ExifTag.ThumbnailOrientation, (Orientation)conv.ToUInt16(value, 0))); } else if (tag == 0x11c) // PlanarConfiguration { return(new ExifEnumProperty <PlanarConfiguration>(ExifTag.ThumbnailPlanarConfiguration, (PlanarConfiguration)conv.ToUInt16(value, 0))); } else if (tag == 0x213) // YCbCrPositioning { return(new ExifEnumProperty <YCbCrPositioning>(ExifTag.ThumbnailYCbCrPositioning, (YCbCrPositioning)conv.ToUInt16(value, 0))); } else if (tag == 0x128) // ResolutionUnit { return(new ExifEnumProperty <ResolutionUnit>(ExifTag.ThumbnailResolutionUnit, (ResolutionUnit)conv.ToUInt16(value, 0))); } else if (tag == 0x132) // DateTime { return(new ExifDateTime(ExifTag.ThumbnailDateTime, ExifBitConverter.ToDateTime(value))); } } if (type == 1) // 1 = BYTE An 8-bit unsigned integer. { if (count == 1) { return(new ExifByte(etag, value[0])); } else { return(new ExifByteArray(etag, value)); } } else if (type == 2) // 2 = ASCII An 8-bit byte containing one 7-bit ASCII code. { return(new ExifAscii(etag, ExifBitConverter.ToAscii(value, encoding), encoding)); } else if (type == 3) // 3 = SHORT A 16-bit (2-byte) unsigned integer. { if (count == 1) { return(new ExifUShort(etag, conv.ToUInt16(value, 0))); } else { return(new ExifUShortArray(etag, ExifBitConverter.ToUShortArray(value, (int)count, byteOrder))); } } else if (type == 4) // 4 = LONG A 32-bit (4-byte) unsigned integer. { if (count == 1) { return(new ExifUInt(etag, conv.ToUInt32(value, 0))); } else { return(new ExifUIntArray(etag, ExifBitConverter.ToUIntArray(value, (int)count, byteOrder))); } } else if (type == 5) // 5 = RATIONAL Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator. { if (count == 1) { return(new ExifURational(etag, ExifBitConverter.ToURational(value, byteOrder))); } else { return(new ExifURationalArray(etag, ExifBitConverter.ToURationalArray(value, (int)count, byteOrder))); } } else if (type == 7) // 7 = UNDEFINED An 8-bit byte that can take any value depending on the field definition. { return(new ExifUndefined(etag, value)); } else if (type == 9) // 9 = SLONG A 32-bit (4-byte) signed integer (2's complement notation). { if (count == 1) { return(new ExifSInt(etag, conv.ToInt32(value, 0))); } else { return(new ExifSIntArray(etag, ExifBitConverter.ToSIntArray(value, (int)count, byteOrder))); } } else if (type == 10) // 10 = SRATIONAL Two SLONGs. The first SLONG is the numerator and the second SLONG is the denominator. { if (count == 1) { return(new ExifSRational(etag, ExifBitConverter.ToSRational(value, byteOrder))); } else { return(new ExifSRationalArray(etag, ExifBitConverter.ToSRationalArray(value, (int)count, byteOrder))); } } else { throw new ArgumentException("Unknown property type."); } }
public ExifEnumProperty(ExifTag tag, T value) : this(tag, value, false) { ; }
public static string GetTagTitle (ExifTag tag) { return ""; }
public ExifRectangularSubjectArea(ExifTag tag, ushort x, ushort y, ushort w, ushort h) : base(tag, new ushort[] { x, y, w, h }) { ; }
internal static extern IntPtr exif_content_get_entry (_ExifContent *ptr, ExifTag tag);
public GPSLatitudeLongitude(ExifTag tag, float d, float m, float s) : base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(d), new MathEx.UFraction32(m), new MathEx.UFraction32(s) }) { ; }
public string Lookup (ExifTag tag) { if (values == null) Assemble (); return (string) values [tag]; }
/// <summary> /// Gets or sets the Exif property with the given key. /// </summary> /// <param name="key">The Exif tag associated with the Exif property.</param> public ExifProperty this[ExifTag key] { get { return(Properties[key]); } set { Properties[key] = value; } }
public static string GetTagDescription (ExifTag tag) { return ""; }
public ExifByteArray(ExifTag tag, byte[] value) : base(tag) =>
public string Lookup (ExifTag tag) { return null; }
public ExifProperty(ExifTag tag) { mTag = tag; mIFD = ExifTagFactory.GetTagIFD(tag); }
unsafe internal _ExifEntry * Search (ExifTag tag) { return null; }
public ExifAscii(ExifTag tag, string value, Encoding encoding) : base(tag) { mValue = value; Encoding = encoding; }
public ExifAscii(ExifTag tag, string value) : base(tag) { mValue = value; }
public ExifByte(ExifTag tag, byte value) : base(tag) =>
public ExifEncodedString(ExifTag tag, string value, Encoding encoding) : base(tag) { mValue = value; mEncoding = encoding; }
public ExifDate(ExifTag tag, DateTime value) : base(tag) { mValue = value; }
public VersionID(ExifTag tag, byte[] value) : base(tag, value) { }
public ExifEnumProperty(ExifTag tag, T value, bool isbitfield) : base(tag) { mValue = value; mIsBitField = isbitfield; }
public ExifPointSubjectArea(ExifTag tag, ushort[] value) : base(tag, value) { ; }
public ExifValue GetValue(ExifTag tag) { object result; try { result = _Instance.CallMethod("GetValue", new Type[] {Types.ExifTag}, tag); } catch (Exception ex) { throw ExceptionHelper.Create(ex); } return (result == null ? null : new ExifValue(result)); }
public ExifPointSubjectArea(ExifTag tag, ushort x, ushort y) : base(tag, new ushort[] { x, y }) { ; }
public void SetValue(ExifTag tag, Object value) { try { _Instance.CallMethod("SetValue", new Type[] {Types.ExifTag, typeof(Object)}, tag, GraphicsMagick.ExifProfile.GetInstance(value)); } catch (Exception ex) { throw ExceptionHelper.Create(ex); } }
public ExifCircularSubjectArea(ExifTag tag, ushort x, ushort y, ushort d) : base(tag, new ushort[] { x, y, d }) { ; }