|
|
|
@ -11,22 +11,36 @@ namespace ImageSharp |
|
|
|
public class DecoderOptions : IDecoderOptions |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Gets the default decoder options
|
|
|
|
/// Initializes a new instance of the <see cref="DecoderOptions"/> class.
|
|
|
|
/// </summary>
|
|
|
|
public static DecoderOptions Default |
|
|
|
public DecoderOptions() |
|
|
|
{ |
|
|
|
get |
|
|
|
this.InitializeWithDefaults(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="DecoderOptions"/> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The decoder options</param>
|
|
|
|
protected DecoderOptions(IDecoderOptions options) |
|
|
|
{ |
|
|
|
if (options == null) |
|
|
|
{ |
|
|
|
return new DecoderOptions() |
|
|
|
{ |
|
|
|
IgnoreMetadata = false |
|
|
|
}; |
|
|
|
this.InitializeWithDefaults(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.IgnoreMetadata = options.IgnoreMetadata; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded.
|
|
|
|
/// </summary>
|
|
|
|
public bool IgnoreMetadata { get; set; } |
|
|
|
|
|
|
|
private void InitializeWithDefaults() |
|
|
|
{ |
|
|
|
this.IgnoreMetadata = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|