Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/PixelTypeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PixelTypeInfo
/// </summary>
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
/// <param name="alpha">Tthe pixel alpha transparency behavior.</param>
internal PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null)
public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonfirsov I'm wondering whether we should avoid the nullable parameter here and either provide an overload or break things for V2.

I'm not overly concerned about the implications of making this public because I'd like to do a thorough review for V3 to make sure we capture everything we should.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be refactored into 2 constructors for now. In long term, I would explore init-only setters for such API-s.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the V3 API concern: I think minor breaking changes are fine in advanced API-s.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that keeps with our pattern for avoiding nullable parameters when possible. @jz5 Could you please update the PixelTypeInfo constructor to use separate overloads with and without the PixelAlphaRepresentation (not nullable) parameter. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it. How about this?

{
this.BitsPerPixel = bitsPerPixel;
this.AlphaRepresentation = alpha;
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Metadata/ImageMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public sealed class ImageMetadata : IDeepCloneable<ImageMetadata>
/// <summary>
/// Initializes a new instance of the <see cref="ImageMetadata"/> class.
/// </summary>
internal ImageMetadata()
public ImageMetadata()
{
this.horizontalResolution = DefaultHorizontalResolution;
this.verticalResolution = DefaultVerticalResolution;
Expand Down