From abaa16799944a7267cc732c3215809e335dff02a Mon Sep 17 00:00:00 2001 From: denisivan0v Date: Fri, 19 Jan 2018 14:18:01 +0700 Subject: [PATCH] changes on code review --- src/ImageSharp/Formats/Bmp/BmpDecoder.cs | 2 +- src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs | 4 +- src/ImageSharp/Formats/Gif/GifDecoder.cs | 2 +- src/ImageSharp/Formats/Gif/GifDecoderCore.cs | 6 +- src/ImageSharp/Formats/IImageInfoDetector.cs | 6 +- .../Jpeg/GolangPort/OrigJpegDecoder.cs | 2 +- .../Jpeg/GolangPort/OrigJpegDecoderCore.cs | 6 +- src/ImageSharp/Formats/Jpeg/JpegDecoder.cs | 2 +- .../Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs | 2 +- src/ImageSharp/Formats/PixelTypeInfo.cs | 2 +- src/ImageSharp/Formats/Png/PngDecoder.cs | 2 +- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 6 +- src/ImageSharp/Image/IImage.cs | 26 +- src/ImageSharp/Image/IImageInfo.cs | 31 +++ src/ImageSharp/Image/Image.Decode.cs | 4 +- src/ImageSharp/Image/Image.FromStream.cs | 12 +- src/ImageSharp/Image/ImageFrameCollection.cs | 4 +- src/ImageSharp/Image/ImageInfo.cs | 16 +- src/ImageSharp/Image/Image{TPixel}.cs | 18 +- src/ImageSharp/ImageSharp.csproj | 236 +++++++++--------- .../Processors/Transforms/ResizeProcessor.cs | 2 +- .../SystemDrawingReferenceDecoder.cs | 5 +- 22 files changed, 208 insertions(+), 188 deletions(-) create mode 100644 src/ImageSharp/Image/IImageInfo.cs diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoder.cs b/src/ImageSharp/Formats/Bmp/BmpDecoder.cs index e252e63406..78a9de6c45 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoder.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoder.cs @@ -34,7 +34,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp } /// - public IImage Identify(Configuration configuration, Stream stream) + public IImageInfo Identify(Configuration configuration, Stream stream) { Guard.NotNull(stream, "stream"); diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index cb510ac05a..e552ac1042 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -141,10 +141,10 @@ namespace SixLabors.ImageSharp.Formats.Bmp } /// - /// Reads the image base information from the specified stream. + /// Reads the raw image information from the specified stream. /// /// The containing image data. - public IImage Identify(Stream stream) + public IImageInfo Identify(Stream stream) { this.ReadImageHeaders(stream, out _, out _); return new ImageInfo(new PixelTypeInfo(this.infoHeader.BitsPerPixel), this.infoHeader.Width, this.infoHeader.Height, new ImageMetaData()); diff --git a/src/ImageSharp/Formats/Gif/GifDecoder.cs b/src/ImageSharp/Formats/Gif/GifDecoder.cs index ccb6cf92c5..c81c51e8b4 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoder.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoder.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Formats.Gif } /// - public IImage Identify(Configuration configuration, Stream stream) + public IImageInfo Identify(Configuration configuration, Stream stream) { Guard.NotNull(stream, "stream"); diff --git a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs index 7a08b4194e..3c22518057 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs @@ -165,10 +165,10 @@ namespace SixLabors.ImageSharp.Formats.Gif } /// - /// Reads the image base information from the specified stream. + /// Reads the raw image information from the specified stream. /// /// The containing image data. - public IImage Identify(Stream stream) + public IImageInfo Identify(Stream stream) { try { @@ -425,7 +425,7 @@ namespace SixLabors.ImageSharp.Formats.Gif if (previousFrame == null) { // This initializes the image to become fully transparent because the alpha channel is zero. - image = new Image(this.configuration, new PixelTypeInfo(this.logicalScreenDescriptor.BitsPerPixel), imageWidth, imageHeight, this.metaData); + image = new Image(this.configuration, imageWidth, imageHeight, this.metaData); this.SetFrameMetaData(image.Frames.RootFrame.MetaData); diff --git a/src/ImageSharp/Formats/IImageInfoDetector.cs b/src/ImageSharp/Formats/IImageInfoDetector.cs index 4e1dfc84f6..37bc0866fa 100644 --- a/src/ImageSharp/Formats/IImageInfoDetector.cs +++ b/src/ImageSharp/Formats/IImageInfoDetector.cs @@ -6,16 +6,16 @@ using System.IO; namespace SixLabors.ImageSharp.Formats { /// - /// Used for detecting the image base information without decoding it. + /// Used for detecting the raw image information without decoding it. /// public interface IImageInfoDetector { /// - /// Reads the image base information from the specified stream. + /// Reads the raw image information from the specified stream. /// /// The configuration for the image. /// The containing image data. /// The object - IImage Identify(Configuration configuration, Stream stream); + IImageInfo Identify(Configuration configuration, Stream stream); } } \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoder.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoder.cs index 7b082a3d6a..ecebe9480d 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoder.cs @@ -29,7 +29,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort } /// - public IImage Identify(Configuration configuration, Stream stream) + public IImageInfo Identify(Configuration configuration, Stream stream) { Guard.NotNull(stream, "stream"); diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs index ef7a4234f8..d788b65c4b 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs @@ -198,10 +198,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort } /// - /// Reads the image base information from the specified stream. + /// Reads the raw image information from the specified stream. /// /// The containing image data. - public IImage Identify(Stream stream) + public IImageInfo Identify(Stream stream) { this.ParseStream(stream, true); return new ImageInfo(new PixelTypeInfo(this.BitsPerPixel), this.ImageWidth, this.ImageHeight, this.MetaData); @@ -789,7 +789,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort { using (var postProcessor = new JpegImagePostProcessor(this)) { - var image = new Image(this.configuration, new PixelTypeInfo(this.BitsPerPixel), this.ImageWidth, this.ImageHeight, this.MetaData); + var image = new Image(this.configuration, this.ImageWidth, this.ImageHeight, this.MetaData); postProcessor.PostProcess(image.Frames.RootFrame); return image; } diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs index ee7d7e6996..91835b5d71 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs @@ -31,7 +31,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg } /// - public IImage Identify(Configuration configuration, Stream stream) + public IImageInfo Identify(Configuration configuration, Stream stream) { Guard.NotNull(stream, "stream"); diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs index c93adac2d4..211c24d208 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs @@ -159,7 +159,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort this.QuantizeAndInverseAllComponents(); - var image = new Image(this.configuration, null, this.ImageWidth, this.ImageHeight, metadata); + var image = new Image(this.configuration, this.ImageWidth, this.ImageHeight, metadata); this.FillPixelData(image.Frames.RootFrame); this.AssignResolution(image); return image; diff --git a/src/ImageSharp/Formats/PixelTypeInfo.cs b/src/ImageSharp/Formats/PixelTypeInfo.cs index a2a2ce9ce2..cdb6db8d9f 100644 --- a/src/ImageSharp/Formats/PixelTypeInfo.cs +++ b/src/ImageSharp/Formats/PixelTypeInfo.cs @@ -1,7 +1,7 @@ namespace SixLabors.ImageSharp.Formats { /// - /// Stores information about pixel. + /// Stores the raw image pixel type information. /// public class PixelTypeInfo { diff --git a/src/ImageSharp/Formats/Png/PngDecoder.cs b/src/ImageSharp/Formats/Png/PngDecoder.cs index 8e110732ee..9bde4f8cc3 100644 --- a/src/ImageSharp/Formats/Png/PngDecoder.cs +++ b/src/ImageSharp/Formats/Png/PngDecoder.cs @@ -54,7 +54,7 @@ namespace SixLabors.ImageSharp.Formats.Png } /// - public IImage Identify(Configuration configuration, Stream stream) + public IImageInfo Identify(Configuration configuration, Stream stream) { var decoder = new PngDecoderCore(configuration, this); return decoder.Identify(stream); diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index e4c554437e..5c9b753e58 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -279,10 +279,10 @@ namespace SixLabors.ImageSharp.Formats.Png } /// - /// Reads the image base information from the specified stream. + /// Reads the raw image information from the specified stream. /// /// The containing image data. - public IImage Identify(Stream stream) + public IImageInfo Identify(Stream stream) { var metadata = new ImageMetaData(); this.currentStream = stream; @@ -426,7 +426,7 @@ namespace SixLabors.ImageSharp.Formats.Png private void InitializeImage(ImageMetaData metadata, out Image image) where TPixel : struct, IPixel { - image = new Image(this.configuration, new PixelTypeInfo(this.CalculateBitsPerPixel()), this.header.Width, this.header.Height, metadata); + image = new Image(this.configuration, this.header.Width, this.header.Height, metadata); this.bytesPerPixel = this.CalculateBytesPerPixel(); this.bytesPerScanline = this.CalculateScanlineLength(this.header.Width) + 1; this.bytesPerSample = 1; diff --git a/src/ImageSharp/Image/IImage.cs b/src/ImageSharp/Image/IImage.cs index 58e5d50e51..afd00105e6 100644 --- a/src/ImageSharp/Image/IImage.cs +++ b/src/ImageSharp/Image/IImage.cs @@ -1,31 +1,9 @@ -using SixLabors.ImageSharp.Formats; -using SixLabors.ImageSharp.MetaData; - -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp { /// /// Represents the base image abstraction. /// - public interface IImage + public interface IImage : IImageInfo { - /// - /// Gets information about pixel. - /// - PixelTypeInfo PixelType { get; } - - /// - /// Gets the width. - /// - int Width { get; } - - /// - /// Gets the height. - /// - int Height { get; } - - /// - /// Gets the meta data of the image. - /// - ImageMetaData MetaData { get; } } } \ No newline at end of file diff --git a/src/ImageSharp/Image/IImageInfo.cs b/src/ImageSharp/Image/IImageInfo.cs new file mode 100644 index 0000000000..b8dd59cc72 --- /dev/null +++ b/src/ImageSharp/Image/IImageInfo.cs @@ -0,0 +1,31 @@ +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.MetaData; + +namespace SixLabors.ImageSharp +{ + /// + /// Represents raw image information. + /// + public interface IImageInfo + { + /// + /// Gets the raw image pixel type information. + /// + PixelTypeInfo PixelType { get; } + + /// + /// Gets the width. + /// + int Width { get; } + + /// + /// Gets the height. + /// + int Height { get; } + + /// + /// Gets the meta data of the image. + /// + ImageMetaData MetaData { get; } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Image/Image.Decode.cs b/src/ImageSharp/Image/Image.Decode.cs index 8f379cb109..6af61f9f4a 100644 --- a/src/ImageSharp/Image/Image.Decode.cs +++ b/src/ImageSharp/Image/Image.Decode.cs @@ -86,9 +86,9 @@ namespace SixLabors.ImageSharp /// The stream. /// the configuration. /// - /// The or null if suitable info detector not found. + /// The or null if suitable info detector not found. /// - private static IImage InternalIdentity(Stream stream, Configuration config) + private static IImageInfo InternalIdentity(Stream stream, Configuration config) { var detector = DiscoverDecoder(stream, config, out IImageFormat _) as IImageInfoDetector; return detector?.Identify(config, stream); diff --git a/src/ImageSharp/Image/Image.FromStream.cs b/src/ImageSharp/Image/Image.FromStream.cs index 0233efb208..680e15aa7d 100644 --- a/src/ImageSharp/Image/Image.FromStream.cs +++ b/src/ImageSharp/Image/Image.FromStream.cs @@ -37,22 +37,22 @@ namespace SixLabors.ImageSharp } /// - /// By reading the header on the provided stream this reads the image base information. + /// By reading the header on the provided stream this reads the raw image information. /// /// The image stream to read the header from. /// /// Thrown if the stream is not readable nor seekable. /// /// - /// The or null if suitable info detector not found. + /// The or null if suitable info detector not found. /// - public static IImage Identify(Stream stream) + public static IImageInfo Identify(Stream stream) { return Identify(null, stream); } /// - /// By reading the header on the provided stream this reads the image base information. + /// By reading the header on the provided stream this reads the raw image information. /// /// The configuration. /// The image stream to read the header from. @@ -60,9 +60,9 @@ namespace SixLabors.ImageSharp /// Thrown if the stream is not readable nor seekable. /// /// - /// The or null if suitable info detector not found. + /// The or null if suitable info detector not found. /// - public static IImage Identify(Configuration config, Stream stream) + public static IImageInfo Identify(Configuration config, Stream stream) { return WithSeekableStream(stream, s => InternalIdentity(s, config ?? Configuration.Default)); } diff --git a/src/ImageSharp/Image/ImageFrameCollection.cs b/src/ImageSharp/Image/ImageFrameCollection.cs index ececcea895..3e9bb03435 100644 --- a/src/ImageSharp/Image/ImageFrameCollection.cs +++ b/src/ImageSharp/Image/ImageFrameCollection.cs @@ -129,7 +129,7 @@ namespace SixLabors.ImageSharp this.frames.Remove(frame); - return new Image(this.parent.GetConfiguration(), this.parent.PixelType, this.parent.MetaData.Clone(), new[] { frame }); + return new Image(this.parent.GetConfiguration(), this.parent.MetaData.Clone(), new[] { frame }); } /// @@ -137,7 +137,7 @@ namespace SixLabors.ImageSharp { ImageFrame frame = this[index]; ImageFrame clonedFrame = frame.Clone(); - return new Image(this.parent.GetConfiguration(), this.parent.PixelType, this.parent.MetaData.Clone(), new[] { clonedFrame }); + return new Image(this.parent.GetConfiguration(), this.parent.MetaData.Clone(), new[] { clonedFrame }); } /// diff --git a/src/ImageSharp/Image/ImageInfo.cs b/src/ImageSharp/Image/ImageInfo.cs index 0d8daaf1a8..a315ee0ed5 100644 --- a/src/ImageSharp/Image/ImageInfo.cs +++ b/src/ImageSharp/Image/ImageInfo.cs @@ -3,8 +3,18 @@ using SixLabors.ImageSharp.MetaData; namespace SixLabors.ImageSharp { - internal sealed class ImageInfo : IImage + /// + /// Stores the raw image information. + /// + internal sealed class ImageInfo : IImageInfo { + /// + /// Initializes a new instance of the class. + /// + /// The raw image pixel type information. + /// The width of the image in pixels. + /// The height of the image in pixels. + /// The images metadata. public ImageInfo(PixelTypeInfo pixelType, int width, int height, ImageMetaData metaData) { this.PixelType = pixelType; @@ -13,12 +23,16 @@ namespace SixLabors.ImageSharp this.MetaData = metaData; } + /// public PixelTypeInfo PixelType { get; } + /// public int Width { get; } + /// public int Height { get; } + /// public ImageMetaData MetaData { get; } } } \ No newline at end of file diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 9b20e3dfab..be38b41f24 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Formats; -using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; @@ -33,7 +33,7 @@ namespace SixLabors.ImageSharp /// The width of the image in pixels. /// The height of the image in pixels. public Image(Configuration configuration, int width, int height) - : this(configuration, null, width, height, new ImageMetaData()) + : this(configuration, width, height, new ImageMetaData()) { } @@ -55,14 +55,13 @@ namespace SixLabors.ImageSharp /// /// The configuration providing initialization code which allows extending the library. /// - /// The information about pixel of the image. /// The width of the image in pixels. /// The height of the image in pixels. /// The images metadata. - internal Image(Configuration configuration, PixelTypeInfo pixelType, int width, int height, ImageMetaData metadata) + internal Image(Configuration configuration, int width, int height, ImageMetaData metadata) { this.configuration = configuration ?? Configuration.Default; - this.PixelType = pixelType; + this.PixelType = new PixelTypeInfo(Unsafe.SizeOf() * 8); this.MetaData = metadata ?? new ImageMetaData(); this.frames = new ImageFrameCollection(this, width, height); } @@ -72,13 +71,12 @@ namespace SixLabors.ImageSharp /// with the height and the width of the image. /// /// The configuration providing initialization code which allows extending the library. - /// The information about pixel of the image. /// The images metadata. /// The frames that will be owned by this image instance. - internal Image(Configuration configuration, PixelTypeInfo pixelType, ImageMetaData metadata, IEnumerable> frames) + internal Image(Configuration configuration, ImageMetaData metadata, IEnumerable> frames) { this.configuration = configuration ?? Configuration.Default; - this.PixelType = pixelType; + this.PixelType = new PixelTypeInfo(Unsafe.SizeOf() * 8); this.MetaData = metadata ?? new ImageMetaData(); this.frames = new ImageFrameCollection(this, frames); @@ -145,7 +143,7 @@ namespace SixLabors.ImageSharp public Image Clone() { IEnumerable> clonedFrames = this.frames.Select(x => x.Clone()); - return new Image(this.configuration, this.PixelType, this.MetaData.Clone(), clonedFrames); + return new Image(this.configuration, this.MetaData.Clone(), clonedFrames); } /// @@ -163,7 +161,7 @@ namespace SixLabors.ImageSharp where TPixel2 : struct, IPixel { IEnumerable> clonedFrames = this.frames.Select(x => x.CloneAs()); - var target = new Image(this.configuration, this.PixelType, this.MetaData.Clone(), clonedFrames); + var target = new Image(this.configuration, this.MetaData.Clone(), clonedFrames); return target; } diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 8c22237cf7..1d22e59cb2 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -1,120 +1,120 @@  - - A cross-platform library for the processing of image files; written in C# - SixLabors.ImageSharp - $(packageversion) - 0.0.1 - Six Labors and contributors - netstandard1.1;netstandard1.3;netstandard2.0 - true - true - SixLabors.ImageSharp - SixLabors.ImageSharp - Image Resize Crop Gif Jpg Jpeg Bitmap Png Core - https://raw.githubusercontent.com/SixLabors/ImageSharp/master/build/icons/imagesharp-logo-128.png - https://github.com/SixLabors/ImageSharp - http://www.apache.org/licenses/LICENSE-2.0 - git - https://github.com/SixLabors/ImageSharp - false - false - false - false - false - false - false - false - false - full - portable - True - IOperation - - - - - - - - - All - - - - - - - - - - - - - ..\..\ImageSharp.ruleset - SixLabors.ImageSharp - - - true - - - - TextTemplatingFileGenerator - Block8x8F.Generated.cs - - - TextTemplatingFileGenerator - Block8x8F.Generated.cs - - - TextTemplatingFileGenerator - PixelOperations{TPixel}.Generated.cs - - - TextTemplatingFileGenerator - Rgba32.PixelOperations.Generated.cs - - - PorterDuffFunctions.Generated.cs - TextTemplatingFileGenerator - - - DefaultPixelBlenders.Generated.cs - TextTemplatingFileGenerator - - - - - - - - True - True - Block8x8F.Generated.tt - - - True - True - Block8x8F.Generated.tt - - - True - True - PixelOperations{TPixel}.Generated.tt - - - True - True - Rgba32.PixelOperations.Generated.tt - - - True - True - DefaultPixelBlenders.Generated.tt - - - True - True - PorterDuffFunctions.Generated.tt - - + + A cross-platform library for the processing of image files; written in C# + SixLabors.ImageSharp + $(packageversion) + 0.0.1 + Six Labors and contributors + netstandard1.1;netstandard1.3;netstandard2.0 + true + true + SixLabors.ImageSharp + SixLabors.ImageSharp + Image Resize Crop Gif Jpg Jpeg Bitmap Png Core + https://raw.githubusercontent.com/SixLabors/ImageSharp/master/build/icons/imagesharp-logo-128.png + https://github.com/SixLabors/ImageSharp + http://www.apache.org/licenses/LICENSE-2.0 + git + https://github.com/SixLabors/ImageSharp + false + false + false + false + false + false + false + false + false + full + portable + True + IOperation + + + + + + + + + All + + + + + + + + + + + + + ..\..\ImageSharp.ruleset + SixLabors.ImageSharp + + + true + + + + TextTemplatingFileGenerator + Block8x8F.Generated.cs + + + TextTemplatingFileGenerator + Block8x8F.Generated.cs + + + TextTemplatingFileGenerator + PixelOperations{TPixel}.Generated.cs + + + TextTemplatingFileGenerator + Rgba32.PixelOperations.Generated.cs + + + PorterDuffFunctions.Generated.cs + TextTemplatingFileGenerator + + + DefaultPixelBlenders.Generated.cs + TextTemplatingFileGenerator + + + + + + + + True + True + Block8x8F.Generated.tt + + + True + True + Block8x8F.Generated.tt + + + True + True + PixelOperations{TPixel}.Generated.tt + + + True + True + Rgba32.PixelOperations.Generated.tt + + + True + True + DefaultPixelBlenders.Generated.tt + + + True + True + PorterDuffFunctions.Generated.tt + + \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index f1fb0086ff..17b42c5040 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Processing.Processors // For resize we know we are going to populate every pixel with fresh data and we want a different target size so // let's manually clone an empty set of images at the correct target and then have the base class process them in turn. IEnumerable> frames = source.Frames.Select(x => new ImageFrame(this.Width, this.Height, x.MetaData.Clone())); // this will create places holders - var image = new Image(config, source.PixelType, source.MetaData.Clone(), frames); // base the place holder images in to prevent a extra frame being added + var image = new Image(config, source.MetaData.Clone(), frames); // base the place holder images in to prevent a extra frame being added return image; } diff --git a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs index 719d1b7583..0e967e9278 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs @@ -5,12 +5,11 @@ using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs { - using SixLabors.ImageSharp.MetaData; - public class SystemDrawingReferenceDecoder : IImageDecoder, IImageInfoDetector { public static SystemDrawingReferenceDecoder Instance { get; } = new SystemDrawingReferenceDecoder(); @@ -44,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs } } - public IImage Identify(Configuration configuration, Stream stream) + public IImageInfo Identify(Configuration configuration, Stream stream) { using (var sourceBitmap = new System.Drawing.Bitmap(stream)) {