-
-
Notifications
You must be signed in to change notification settings - Fork 855
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2641 from RobertMut/main
Add JPEG COM marker support
- Loading branch information
Showing
11 changed files
with
259 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
namespace SixLabors.ImageSharp.Formats.Jpeg; | ||
|
||
/// <summary> | ||
/// Represents a JPEG comment | ||
/// </summary> | ||
public readonly struct JpegComData | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="JpegComData"/> struct. | ||
/// </summary> | ||
/// <param name="value">The comment buffer.</param> | ||
public JpegComData(ReadOnlyMemory<char> value) | ||
=> this.Value = value; | ||
|
||
/// <summary> | ||
/// Gets the value. | ||
/// </summary> | ||
public ReadOnlyMemory<char> Value { get; } | ||
|
||
/// <summary> | ||
/// Converts string to <see cref="JpegComData"/> | ||
/// </summary> | ||
/// <param name="value">The comment string.</param> | ||
/// <returns>The <see cref="JpegComData"/></returns> | ||
public static JpegComData FromString(string value) => new(value.AsMemory()); | ||
|
||
/// <inheritdoc/> | ||
public override string ToString() => this.Value.ToString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.