diff --git a/MetadataExtractor/Directory.cs b/MetadataExtractor/Directory.cs index b31043f30..00cf6b0dd 100644 --- a/MetadataExtractor/Directory.cs +++ b/MetadataExtractor/Directory.cs @@ -47,7 +47,7 @@ protected Directory(Dictionary? tagNameMap) /// Attempts to find the name of the specified tag. /// The tag to look up. /// The found name, if any. - /// true if the tag is known and was set, otherwise false. + /// if the tag is known and was set, otherwise . protected virtual bool TryGetTagName(int tagType, [NotNullWhen(returnValue: true)] out string? tagName) { if (_tagNameMap is null) @@ -90,7 +90,7 @@ protected void SetDescriptor(ITagDescriptor descriptor) /// Gets a value indicating whether this directory has one or more errors. /// Error messages are accessible via . - /// true if the directory contains errors, otherwise false + /// if the directory contains errors, otherwise public bool HasError => _errorList.Count > 0; /// Used to iterate over any error messages contained in this directory. diff --git a/MetadataExtractor/DirectoryExtensions.cs b/MetadataExtractor/DirectoryExtensions.cs index 19583f8fa..2572da84b 100644 --- a/MetadataExtractor/DirectoryExtensions.cs +++ b/MetadataExtractor/DirectoryExtensions.cs @@ -671,7 +671,7 @@ public static DateTime GetDateTime(this Directory directory, int tagType /*, Tim /// otherwise it will be . /// /// - /// true if a DateTime was returned, otherwise false. + /// if a DateTime was returned, otherwise . [Pure] public static bool TryGetDateTime(this Directory directory, int tagType /*, TimeZoneInfo? timeZone = null*/, out DateTime dateTime) { diff --git a/MetadataExtractor/Formats/Bmp/BmpHeaderDirectory.cs b/MetadataExtractor/Formats/Bmp/BmpHeaderDirectory.cs index e3f6233b0..9aee1ef57 100644 --- a/MetadataExtractor/Formats/Bmp/BmpHeaderDirectory.cs +++ b/MetadataExtractor/Formats/Bmp/BmpHeaderDirectory.cs @@ -69,76 +69,76 @@ public BmpHeaderDirectory() : base(_tagNameMap) /// public enum BitmapType : int { - /** "BM" - Windows or OS/2 bitmap */ + /// "BM" - Windows or OS/2 bitmap Bitmap = 0x4D42, - /** "BA" - OS/2 Bitmap array (multiple bitmaps) */ + /// "BA" - OS/2 Bitmap array (multiple bitmaps) OS2BitmapArray = 0x4142, - /** "IC" - OS/2 Icon */ + /// "IC" - OS/2 Icon OS2Icon = 0x4349, - /** "CI" - OS/2 Color icon */ + /// "CI" - OS/2 Color icon OS2ColorIcon = 0x4943, - /** "CP" - OS/2 Color pointer */ + /// "CP" - OS/2 Color pointer OS2ColorPointer = 0x5043, - /** "PT" - OS/2 Pointer */ + /// "PT" - OS/2 Pointer OS2Pointer = 0x5450 } public enum Compression : int { - /** 0 = None */ + /// 0 = None Rgb = 0, - /** 1 = RLE 8-bit/pixel */ + /// 1 = RLE 8-bit/pixel Rle8 = 1, - /** 2 = RLE 4-bit/pixel */ + /// 2 = RLE 4-bit/pixel Rle4 = 2, - /** 3 = Bit fields (not OS22XBITMAPHEADER (size 64)) */ + /// 3 = Bit fields (not OS22XBITMAPHEADER (size 64)) BitFields = 3, - /** 3 = Huffman 1D (if OS22XBITMAPHEADER (size 64)) */ + /// 3 = Huffman 1D (if OS22XBITMAPHEADER (size 64)) Huffman1D = 3, - /** 4 = JPEG (not OS22XBITMAPHEADER (size 64)) */ + /// 4 = JPEG (not OS22XBITMAPHEADER (size 64)) Jpeg = 4, - /** 4 = RLE 24-bit/pixel (if OS22XBITMAPHEADER (size 64)) */ + /// 4 = RLE 24-bit/pixel (if OS22XBITMAPHEADER (size 64)) Rle24 = 4, - /** 5 = PNG */ + /// 5 = PNG Png = 5, - /** 6 = RGBA bit fields */ + /// 6 = RGBA bit fields AlphaBitFields = 6, - /** 11 = CMYK */ + /// 11 = CMYK Cmyk = 11, - /** 12 = CMYK RLE-8 */ + /// 12 = CMYK RLE-8 CmykRle8 = 12, - /** 13 = CMYK RLE-4 */ + /// 13 = CMYK RLE-4 CmykRle4 = 13 } public enum RenderingHalftoningAlgorithm : int { - /** No halftoning algorithm */ + /// No halftoning algorithm None = 0, - /** Error Diffusion Halftoning */ + /// Error Diffusion Halftoning ErrorDiffusion = 1, - /** Processing Algorithm for Noncoded Document Acquisition */ + /// Processing Algorithm for Noncoded Document Acquisition Panda = 2, - /** Super-circle Halftoning */ + /// Super-circle Halftoning SuperCircle = 3 } @@ -149,34 +149,34 @@ public enum ColorEncoding : int public enum ColorSpaceType : long { - /** 0 = Calibrated RGB */ + /// 0 = Calibrated RGB LcsCalibratedRgb = 0L, - /** "sRGB" = sRGB Color Space */ + /// "sRGB" = sRGB Color Space LcsSRgb = 0x73524742L, - /** "Win " = System Default Color Space, sRGB */ + /// "Win " = System Default Color Space, sRGB LcsWindowsColorSpace = 0x57696E20L, - /** "LINK" = Linked Profile */ + /// "LINK" = Linked Profile ProfileLinked = 0x4C494E4BL, - /** "MBED" = Embedded Profile */ + /// "MBED" = Embedded Profile ProfileEmbedded = 0x4D424544L } public enum RenderingIntent : long { - /** Graphic, Saturation */ + /// Graphic, Saturation LcsGmBusiness = 1, - /** Proof, Relative Colorimetric */ + /// Proof, Relative Colorimetric LcsGmGraphics = 2, - /** Picture, Perceptual */ + /// Picture, Perceptual LcsGmImages = 4, - /** Match, Absolute Colorimetric */ + /// Match, Absolute Colorimetric LcsGmAbsColorimetric = 8 } } diff --git a/MetadataExtractor/Formats/Eps/EpsReader.cs b/MetadataExtractor/Formats/Eps/EpsReader.cs index caac70424..7cdebdba9 100644 --- a/MetadataExtractor/Formats/Eps/EpsReader.cs +++ b/MetadataExtractor/Formats/Eps/EpsReader.cs @@ -280,25 +280,6 @@ private static byte[] ReadUntil(SequentialReader reader, ReadOnlySpan sent return bytes.ToArray(); } - /** - * EPS files can contain hexadecimal-encoded ASCII blocks, each prefixed with "% ". - * This method reads such a block and returns a byte[] of the decoded contents. - * Reading stops at the first invalid line, which is discarded (it's a terminator anyway). - *

- * For example: - *


-         * %BeginPhotoshop: 9564
-         * % 3842494D040400000000005D1C015A00031B25471C0200000200041C02780004
-         * % 6E756C6C1C027A00046E756C6C1C025000046E756C6C1C023700083230313630
-         * % 3331311C023C000B3131343335362B303030301C023E00083230313630333131
-         * % 48000000010000003842494D03FD0000000000080101000000000000
-         * %EndPhotoshop
-         * 
- * When calling this method, the reader must be positioned at the start of the first line containing - * hex data, not at the introductory line. - * - * @return The decoded bytes, or null if decoding failed. - */ /// /// EPS files can contain hexadecimal-encoded ASCII blocks, each prefixed with "% ". /// This method reads such a block and returns a byte[] of the decoded contents. @@ -316,7 +297,7 @@ private static byte[] ReadUntil(SequentialReader reader, ReadOnlySpan sent /// When calling this method, the reader must be positioned at the start of the first line containing /// hex data, not at the introductory line. /// - /// The decoded bytes, or null if decoding failed. + /// The decoded bytes, or if decoding failed. private static byte[]? DecodeHexCommentBlock(SequentialReader reader) { var bytes = new MemoryStream(); diff --git a/MetadataExtractor/Formats/Exif/makernotes/PanasonicMakernoteDirectory.cs b/MetadataExtractor/Formats/Exif/makernotes/PanasonicMakernoteDirectory.cs index 579f1387e..23db2c6b9 100644 --- a/MetadataExtractor/Formats/Exif/makernotes/PanasonicMakernoteDirectory.cs +++ b/MetadataExtractor/Formats/Exif/makernotes/PanasonicMakernoteDirectory.cs @@ -599,7 +599,7 @@ private static IEnumerable ParseFaces(byte[]? bytes, int firstRecordOffset /// Attempts to convert the underlying string value (as stored in the directory) into an Age object. /// The tag identifier. - /// The parsed Age object, or null if the tag was empty of the value unable to be parsed. + /// The parsed Age object, or if the tag was empty of the value unable to be parsed. public Age? GetAge(int tag) { var ageString = this.GetString(tag); diff --git a/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs b/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs index 8e77b7d17..0f3bcfaa0 100644 --- a/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs +++ b/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs @@ -43,7 +43,7 @@ public static class Iso2022Converter /// The two other checks are less reliable. /// /// some text as bytes - /// the name of the encoding or null if none could be guessed + /// the name of the encoding or if none could be guessed internal static Encoding? GuessEncoding(byte[] bytes) { // First, give ASCII a shot diff --git a/MetadataExtractor/Formats/Riff/IRiffHandler.cs b/MetadataExtractor/Formats/Riff/IRiffHandler.cs index 85b1d010e..283a2d694 100644 --- a/MetadataExtractor/Formats/Riff/IRiffHandler.cs +++ b/MetadataExtractor/Formats/Riff/IRiffHandler.cs @@ -10,33 +10,33 @@ namespace MetadataExtractor.Formats.Riff public interface IRiffHandler { /// Gets whether the specified RIFF identifier is of interest to this handler. - /// Returning false causes processing to stop after reading only the first twelve bytes of data. + /// Returning causes processing to stop after reading only the first twelve bytes of data. /// The four character code identifying the type of RIFF data /// true if processing should continue, otherwise false bool ShouldAcceptRiffIdentifier(ReadOnlySpan identifier); /// Gets whether this handler is interested in the specific chunk type. /// - /// Returns true if the data should be copied into an array and passed - /// to , or false to avoid + /// Returns if the data should be copied into an array and passed + /// to , or to avoid /// the copy and skip to the next chunk in the file, if any. /// /// the four character code of this chunk - /// true if should be called, otherwise false. + /// if should be called, otherwise . bool ShouldAcceptChunk(string fourCc); /// Gets whether this handler is interested in the specific list type. /// - /// Returns true if the data should be copied into an array and passed - /// to , or false to avoid + /// Returns if the data should be copied into an array and passed + /// to , or to avoid /// the copy and skip to the next chunk in the file, if any. /// /// the four character code of this chunk - /// true if should be called, otherwise false. + /// if should be called, otherwise . bool ShouldAcceptList(string fourCc); /// Perform whatever processing is necessary for the type of chunk with its payload. - /// This is only called if a previous call to with the same fourCC returned true. + /// This is only called if a previous call to with the same fourCC returned . /// the four character code of the chunk /// they payload of the chunk as a byte array void ProcessChunk(string fourCc, byte[] payload); diff --git a/MetadataExtractor/IO/IndexedReader.cs b/MetadataExtractor/IO/IndexedReader.cs index 1a8d91235..0a7e323e9 100644 --- a/MetadataExtractor/IO/IndexedReader.cs +++ b/MetadataExtractor/IO/IndexedReader.cs @@ -22,8 +22,8 @@ public abstract class IndexedReader(bool isMotorolaByteOrder) /// Get the byte order of this reader. /// /// - /// true for Motorola (or big) endianness (also known as network byte order), with MSB before LSB. - /// false for Intel (or little) endianness, with LSB before MSB. + /// for Motorola (or big) endianness (also known as network byte order), with MSB before LSB. + /// for Intel (or little) endianness, with LSB before MSB. /// /// public bool IsMotorolaByteOrder { get; } = isMotorolaByteOrder; @@ -35,6 +35,7 @@ public abstract class IndexedReader(bool isMotorolaByteOrder) public abstract int ToUnshiftedOffset(int localOffset); /// Returns the required number of bytes from the specified index from the underlying source. + /// Byte ordering is not governed by . /// The index from which the bytes begins in the underlying source /// The number of bytes to be returned /// The requested bytes @@ -55,6 +56,9 @@ public byte[] GetBytes(int index, int count) /// /// Copies bytes from the underlying source into . /// + /// + /// Byte ordering is not governed by . + /// /// The index from which the bytes begins in the underlying source /// A span of bytes to copy to. The length of this span determines how many bytes will be copied. public abstract void GetBytes(int index, Span bytes); diff --git a/MetadataExtractor/IO/SequentialReader.cs b/MetadataExtractor/IO/SequentialReader.cs index b39132482..3267e1fc6 100644 --- a/MetadataExtractor/IO/SequentialReader.cs +++ b/MetadataExtractor/IO/SequentialReader.cs @@ -17,26 +17,34 @@ namespace MetadataExtractor.IO /// Drew Noakes https://drewnoakes.com public abstract class SequentialReader(bool isMotorolaByteOrder) { - /// Get and set the byte order of this reader. true by default. + /// Get and set the byte order of this reader. by default. /// /// - /// true for Motorola (or big) endianness (also known as network byte order), with MSB before LSB. - /// false for Intel (or little) endianness, with LSB before MSB. + /// for Motorola (or big) endianness (also known as network byte order), with MSB before LSB. + /// for Intel (or little) endianness, with LSB before MSB. /// /// - /// true for Motorola/big endian, false for Intel/little endian + /// for Motorola/big endian, for Intel/little endian public bool IsMotorolaByteOrder { get; } = isMotorolaByteOrder; + /// + /// Gets the current position in the sequence. + /// public abstract long Position { get; } public abstract SequentialReader WithByteOrder(bool isMotorolaByteOrder); /// Returns the required number of bytes from the sequence. + /// Byte ordering is not governed by . /// The number of bytes to be returned /// The requested bytes /// public abstract byte[] GetBytes(int count); + /// + /// Populates the specified byte span with the next bytes from the sequence. + /// + /// The span of bytes to populate. public abstract void GetBytes(Span bytes); /// Retrieves bytes, writing them into a caller-provided buffer. diff --git a/MetadataExtractor/KeyValuePair.cs b/MetadataExtractor/KeyValuePair.cs index b60da36eb..8baf3c75f 100644 --- a/MetadataExtractor/KeyValuePair.cs +++ b/MetadataExtractor/KeyValuePair.cs @@ -3,7 +3,7 @@ namespace MetadataExtractor { /// - /// Models a key/value pair, where both are non-null objects. + /// Models a key/value pair, where both are non- objects. /// /// Drew Noakes https://drewnoakes.com public readonly struct KeyValuePair(string key, StringValue value) diff --git a/MetadataExtractor/Rational.cs b/MetadataExtractor/Rational.cs index 2185f492c..d3b2d19c2 100644 --- a/MetadataExtractor/Rational.cs +++ b/MetadataExtractor/Rational.cs @@ -104,7 +104,7 @@ public Rational(long numerator, long denominator) /// May incur truncation. public decimal ToDecimal() => Denominator == 0 ? 0M : Numerator / (decimal)Denominator; - /// Returns true if the value is non-zero, otherwise false. + /// Returns if the value is non-zero, otherwise . public bool ToBoolean() => Numerator != 0 && Denominator != 0; #region IConvertible diff --git a/MetadataExtractor/Tag.cs b/MetadataExtractor/Tag.cs index ccc698da5..76bf623ce 100644 --- a/MetadataExtractor/Tag.cs +++ b/MetadataExtractor/Tag.cs @@ -34,8 +34,8 @@ public Tag(int type, Directory directory) /// Get whether this tag has a name. /// - /// If true, it may be accessed via . - /// If false, will return a string resembling "Unknown tag (0x1234)". + /// If , it may be accessed via . + /// If , will return a string resembling "Unknown tag (0x1234)". /// public bool HasName => _directory.HasTagName(Type); diff --git a/MetadataExtractor/TagDescriptor.cs b/MetadataExtractor/TagDescriptor.cs index b553ab10a..1a6bc613d 100644 --- a/MetadataExtractor/TagDescriptor.cs +++ b/MetadataExtractor/TagDescriptor.cs @@ -59,7 +59,7 @@ public TagDescriptor(T directory) /// /// the four version values /// the number of components to be - /// the version as a string of form "2.10" or null if the argument cannot be converted + /// the version as a string of form "2.10" or if the argument cannot be converted [Pure] public static string? ConvertBytesToVersionString(int[]? components, int majorDigits) {