public void ReadTag(ushort tag, ExifHeader headerType, ExifPhoto photo) { var currentPos = _jpegFileReader.BaseStream.Position; var fieldtype = (ExifFieldType)_binaryReader.ReadUInt16(); var length = _binaryReader.ReadUInt32(); var value = _binaryReader.ReadUInt32(); switch (fieldtype) { case ExifFieldType.AsciiStrings: SeekToTiffHeaderRelativeOffset(value); photo.SetMatchingProperty(tag, headerType, _binaryReader.ReadString((int)length)); break; case ExifFieldType.UnsignedRational: SeekToTiffHeaderRelativeOffset(value); photo.SetMatchingProperty(tag, headerType, _binaryReader.ReadUnsignedRational()); break; case ExifFieldType.UnsignedLong: photo.SetMatchingProperty(tag, headerType, value); break; } _jpegFileReader.BaseStream.Seek(currentPos + 2 + 4 + 4, SeekOrigin.Begin); }