@@ -31,14 +31,14 @@ public sealed class IptcReader : IJpegSegmentMetadataReader
31
31
32
32
internal const byte IptcMarkerByte = 0x1c ;
33
33
34
- ICollection < JpegSegmentType > IJpegSegmentMetadataReader . SegmentTypes { get ; } = new [ ] { JpegSegmentType . AppD } ;
34
+ ICollection < JpegSegmentType > IJpegSegmentMetadataReader . SegmentTypes { get ; } = [ JpegSegmentType . AppD ] ;
35
35
36
36
public IEnumerable < Directory > ReadJpegSegments ( IEnumerable < JpegSegment > segments )
37
37
{
38
38
// Ensure data starts with the IPTC marker byte
39
39
return segments
40
40
. Where ( segment => segment . Bytes . Length != 0 && segment . Bytes [ 0 ] == IptcMarkerByte )
41
- . Select ( segment => ( Directory ) Extract ( new SequentialByteArrayReader ( segment . Bytes ) , segment . Bytes . Length ) ) ;
41
+ . Select ( segment => Extract ( new SequentialByteArrayReader ( segment . Bytes ) , segment . Bytes . Length ) ) ;
42
42
}
43
43
44
44
/// <summary>Reads IPTC values and returns them in an <see cref="IptcDirectory"/>.</summary>
@@ -166,7 +166,6 @@ private static void ProcessTag(SequentialReader reader, Directory directory, int
166
166
if ( tagByteCount == 2 )
167
167
{
168
168
var shortValue = reader . GetUInt16 ( ) ;
169
- reader . Skip ( tagByteCount - 2 ) ;
170
169
directory . Set ( tagIdentifier , shortValue ) ;
171
170
return ;
172
171
}
@@ -208,7 +207,7 @@ private static void ProcessTag(SequentialReader reader, Directory directory, int
208
207
209
208
if ( directory . ContainsTag ( tagIdentifier ) )
210
209
{
211
- // this fancy string[] business avoids using an ArrayList for performance reasons
210
+ // We already have a value for this tag. Append this value to any prior value(s).
212
211
var oldStrings = directory . GetStringValueArray ( tagIdentifier ) ;
213
212
214
213
StringValue [ ] newStrings ;
0 commit comments