mirror of https://github.com/SixLabors/ImageSharp
committed by
GitHub
14 changed files with 609 additions and 164 deletions
@ -1,12 +1,14 @@ |
|||||
// Copyright (c) Six Labors and contributors.
|
// Copyright (c) Six Labors and contributors.
|
||||
// Licensed under the Apache License, Version 2.0.
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
using System; |
||||
|
|
||||
namespace SixLabors.ImageSharp |
namespace SixLabors.ImageSharp |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// Encapsulates the properties and methods that describe an image.
|
/// Encapsulates the properties and methods that describe an image.
|
||||
/// </summary>
|
/// </summary>
|
||||
public interface IImage : IImageInfo |
public interface IImage : IImageInfo, IDisposable |
||||
{ |
{ |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
namespace SixLabors.ImageSharp.Tests |
||||
|
{ |
||||
|
using SixLabors.ImageSharp.Formats.Jpeg; |
||||
|
using SixLabors.ImageSharp.PixelFormats; |
||||
|
using SixLabors.ImageSharp.Processing; |
||||
|
using SixLabors.Primitives; |
||||
|
|
||||
|
using Xunit; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Might be useful to catch complex bugs
|
||||
|
/// </summary>
|
||||
|
public class ComplexIntegrationTests |
||||
|
{ |
||||
|
[Theory] |
||||
|
[WithFile(TestImages.Jpeg.Baseline.Snake, PixelTypes.Rgba32, 75, JpegSubsample.Ratio420)] |
||||
|
[WithFile(TestImages.Jpeg.Baseline.Lake, PixelTypes.Rgba32, 75, JpegSubsample.Ratio420)] |
||||
|
[WithFile(TestImages.Jpeg.Baseline.Snake, PixelTypes.Rgba32, 75, JpegSubsample.Ratio444)] |
||||
|
[WithFile(TestImages.Jpeg.Baseline.Lake, PixelTypes.Rgba32, 75, JpegSubsample.Ratio444)] |
||||
|
public void LoadResizeSave<TPixel>(TestImageProvider<TPixel> provider, int quality, JpegSubsample subsample) |
||||
|
where TPixel : struct, IPixel<TPixel> |
||||
|
{ |
||||
|
using (Image<TPixel> image = provider.GetImage(x => x.Resize(new ResizeOptions { Size = new Size(150, 100), Mode = ResizeMode.Max }))) |
||||
|
{ |
||||
|
|
||||
|
image.MetaData.ExifProfile = null; // Reduce the size of the file
|
||||
|
JpegEncoder options = new JpegEncoder { Subsample = subsample, Quality = quality }; |
||||
|
|
||||
|
provider.Utility.TestName += $"{subsample}_Q{quality}"; |
||||
|
provider.Utility.SaveTestOutputFile(image, "png"); |
||||
|
provider.Utility.SaveTestOutputFile(image, "jpg", options); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1 +1 @@ |
|||||
Subproject commit 376605e05bb704d425b2d17bf5b310f5376da22e |
Subproject commit b3be1178d4e970efc624181480094e50b0d57a90 |
||||
Loading…
Reference in new issue