Skip to content

Commit a61926c

Browse files
Update WebpChunkParsingUtils.cs
1 parent acb6d5a commit a61926c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/ImageSharp/Formats/Webp/WebpChunkParsingUtils.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public static void ParseOptionalChunks(BufferedReadStream stream, WebpChunkType
344344
WebpThrowHelper.ThrowImageFormatException("Could not read enough data for the EXIF profile");
345345
}
346346

347-
if (metadata.ExifProfile != null)
347+
if (metadata.ExifProfile == null)
348348
{
349349
ExifProfile exifProfile = new(exifData);
350350

@@ -371,10 +371,7 @@ public static void ParseOptionalChunks(BufferedReadStream stream, WebpChunkType
371371
WebpThrowHelper.ThrowImageFormatException("Could not read enough data for the XMP profile");
372372
}
373373

374-
if (metadata.XmpProfile != null)
375-
{
376-
metadata.XmpProfile = new XmpProfile(xmpData);
377-
}
374+
metadata.XmpProfile ??= new XmpProfile(xmpData);
378375

379376
break;
380377
default:

0 commit comments

Comments
 (0)