diff --git a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs
index c2a94e5b0a..07b6b73606 100644
--- a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs
+++ b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs
@@ -6,6 +6,7 @@ using System.Buffers.Binary;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
+using SixLabors.ImageSharp.Metadata.Profiles.IPTC;
namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc
{
@@ -265,7 +266,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc
{
// Envelope Record.
this.Data[i++] = IptcTagMarkerByte;
- this.Data[i++] = 1; // Envelope
+ this.Data[i++] = (byte)IptcRecordNumber.Envelope;
this.Data[i++] = IptcEnvelopeCodedCharacterSet;
this.Data[i++] = (byte)(CodedCharacterSetUtf8Value.Length >> 8);
this.Data[i++] = (byte)CodedCharacterSetUtf8Value.Length;
@@ -293,7 +294,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc
// | | | octet 4(most significant bit) always will be 0. |
// +-----------+----------------+---------------------------------------------------------------------------------+
this.Data[i++] = IptcTagMarkerByte;
- this.Data[i++] = 2; // Application
+ this.Data[i++] = (byte)IptcRecordNumber.Application;
this.Data[i++] = (byte)value.Tag;
this.Data[i++] = (byte)(value.Length >> 8);
this.Data[i++] = (byte)value.Length;
@@ -327,7 +328,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc
bool isValidRecordNumber = recordNumber is >= 1 and <= 9;
var tag = (IptcTag)this.Data[offset++];
bool isValidEntry = isValidTagMarker && isValidRecordNumber;
- bool isApplicationRecord = recordNumber == 0x02;
+ bool isApplicationRecord = recordNumber == (byte)IptcRecordNumber.Application;
uint byteCount = BinaryPrimitives.ReadUInt16BigEndian(this.Data.AsSpan(offset, 2));
offset += 2;
diff --git a/src/ImageSharp/Metadata/Profiles/IPTC/IptcRecordNumber.cs b/src/ImageSharp/Metadata/Profiles/IPTC/IptcRecordNumber.cs
new file mode 100644
index 0000000000..52e4c47a45
--- /dev/null
+++ b/src/ImageSharp/Metadata/Profiles/IPTC/IptcRecordNumber.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Six Labors.
+// Licensed under the Six Labors Split License.
+
+namespace SixLabors.ImageSharp.Metadata.Profiles.IPTC
+{
+ ///
+ /// Enum for the different record types of a IPTC value.
+ ///
+ internal enum IptcRecordNumber : byte
+ {
+ ///
+ /// A Envelope Record.
+ ///
+ Envelope = 0x01,
+
+ ///
+ /// A Application Record.
+ ///
+ Application = 0x02
+ }
+}
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.Metadata.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.Metadata.cs
index 60f45664d3..23b2f749d8 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.Metadata.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.Metadata.cs
@@ -38,8 +38,10 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
// arrange
using var input = new Image(1, 1);
- input.Metadata.IptcProfile = new IptcProfile();
- input.Metadata.IptcProfile.SetValue(IptcTag.Byline, "unit_test");
+ var expectedProfile = new IptcProfile();
+ expectedProfile.SetValue(IptcTag.Country, "ESPAÑA");
+ expectedProfile.SetValue(IptcTag.City, "unit-test-city");
+ input.Metadata.IptcProfile = expectedProfile;
// act
using var memStream = new MemoryStream();
@@ -50,7 +52,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
using var output = Image.Load(memStream);
IptcProfile actual = output.Metadata.IptcProfile;
Assert.NotNull(actual);
- IEnumerable values = input.Metadata.IptcProfile.Values;
+ IEnumerable values = expectedProfile.Values;
Assert.Equal(values, actual.Values);
}