Skip to content

Commit 01421e7

Browse files
committed
Use constant
1 parent 81cac99 commit 01421e7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

MetadataExtractor/Formats/Iptc/IptcReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public sealed class IptcReader : IJpegSegmentMetadataReader
3535
public static final int POST_DATA_RECORD = 9;
3636
*/
3737

38-
private const byte IptcMarkerByte = 0x1c;
38+
internal const byte IptcMarkerByte = 0x1c;
3939

4040
ICollection<JpegSegmentType> IJpegSegmentMetadataReader.SegmentTypes { get; } = new[] { JpegSegmentType.AppD };
4141

MetadataExtractor/Formats/Png/PngMetadataReader.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,14 @@ IEnumerable<Directory> ProcessTextChunk(string keyword, byte[] textBytes)
414414
// this is unfortunate, but the "IPTC" profile may be stored as either
415415
// IPTC IIM or a Photoshop IRB resource, so we must test for this.
416416
// Check if the first byte matches IptcReader.IptcMarkerByte (0x1c)
417-
if (byteCount > 0 && textBytes[0] == 0x1c)
417+
if (byteCount > 0 && textBytes[0] == IptcReader.IptcMarkerByte)
418+
{
418419
yield return new IptcReader().Extract(new SequentialByteArrayReader(textBytes), byteCount);
420+
}
419421
else
420422
{
421423
foreach (var psDirectory in new Photoshop.PhotoshopReader().Extract(new SequentialByteArrayReader(textBytes), byteCount))
422424
yield return psDirectory;
423-
424425
}
425426
}
426427
else

0 commit comments

Comments
 (0)