Browse Source

moving images again

af/merge-core
Anton Firszov 9 years ago
parent
commit
60e0b7f04b
  1. 4
      .gitignore
  2. 22
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs
  3. 12
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs
  4. 0
      tests/Images/Input/Bmp/Car.bmp
  5. 0
      tests/Images/Input/Bmp/F.bmp
  6. 0
      tests/Images/Input/Bmp/neg_height.bmp
  7. 0
      tests/Images/Input/Gif/cheers.gif
  8. 0
      tests/Images/Input/Gif/giphy.gif
  9. 0
      tests/Images/Input/Gif/rings.gif
  10. 0
      tests/Images/Input/Gif/trans.gif
  11. 0
      tests/Images/Input/Jpg/baseline/Calliphora.jpg
  12. 0
      tests/Images/Input/Jpg/baseline/ExifUndefType.jpg
  13. 0
      tests/Images/Input/Jpg/baseline/Floorplan.jpg
  14. 0
      tests/Images/Input/Jpg/baseline/Hiyamugi.jpg
  15. 0
      tests/Images/Input/Jpg/baseline/Lake.jpg
  16. 0
      tests/Images/Input/Jpg/baseline/Snake.jpg
  17. 0
      tests/Images/Input/Jpg/baseline/badeof.jpg
  18. 0
      tests/Images/Input/Jpg/baseline/cmyk.jpg
  19. 0
      tests/Images/Input/Jpg/baseline/exif.jpg
  20. 0
      tests/Images/Input/Jpg/baseline/gamma_dalai_lama_gray.jpg
  21. 0
      tests/Images/Input/Jpg/baseline/jpeg400jfif.jpg
  22. 0
      tests/Images/Input/Jpg/baseline/jpeg420exif.jpg
  23. 0
      tests/Images/Input/Jpg/baseline/jpeg444.jpg
  24. 0
      tests/Images/Input/Jpg/baseline/testimgint.jpg
  25. 0
      tests/Images/Input/Jpg/baseline/testorig.jpg
  26. 0
      tests/Images/Input/Jpg/baseline/turtle.jpg
  27. 0
      tests/Images/Input/Jpg/baseline/ycck.jpg
  28. 0
      tests/Images/Input/Jpg/progressive/BadEofProgressive.jpg
  29. 0
      tests/Images/Input/Jpg/progressive/Festzug.jpg
  30. 0
      tests/Images/Input/Jpg/progressive/fb.jpg
  31. 0
      tests/Images/Input/Jpg/progressive/progress.jpg
  32. 0
      tests/Images/Input/Png/CalliphoraPartial.png
  33. 0
      tests/Images/Input/Png/blur.png
  34. 0
      tests/Images/Input/Png/chunklength1.png
  35. 0
      tests/Images/Input/Png/chunklength2.png
  36. 0
      tests/Images/Input/Png/cross.png
  37. 0
      tests/Images/Input/Png/filter0.png
  38. 0
      tests/Images/Input/Png/filter1.png
  39. 0
      tests/Images/Input/Png/filter2.png
  40. 0
      tests/Images/Input/Png/filter3.png
  41. 0
      tests/Images/Input/Png/filter4.png
  42. 0
      tests/Images/Input/Png/filterVar.png
  43. 0
      tests/Images/Input/Png/indexed.png
  44. 0
      tests/Images/Input/Png/interlaced.png
  45. 0
      tests/Images/Input/Png/pd.png
  46. 0
      tests/Images/Input/Png/pl.png
  47. 0
      tests/Images/Input/Png/pp.png
  48. 0
      tests/Images/Input/Png/rgb-48bpp-interlaced.png
  49. 0
      tests/Images/Input/Png/rgb-48bpp.png
  50. 0
      tests/Images/Input/Png/splash-interlaced.png
  51. 0
      tests/Images/Input/Png/splash.png
  52. 0
      tests/Images/Input/Png/versioning-1_1.png
  53. 0
      tests/Images/Input/Png/versioning-1_2.png
  54. 0
      tests/Images/Input/Png/vim16x16_1.png
  55. 0
      tests/Images/Input/Png/vim16x16_2.png

4
.gitignore

@ -202,8 +202,8 @@ FakesAssemblies/
**/node_modules
**/node_modules/*
**/TestImages/ActualOutput
**/TestImages/ReferenceOutput
**/Images/ActualOutput
**/Images/ReferenceOutput
# ASP.NET 5
project.lock.json

22
tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

@ -31,13 +31,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
{ "RobidouxSharp", new RobidouxSharpResampler() },
{ "Welch", new WelchResampler() }
};
public static readonly TheoryData<string, IResampler> JustBicubicResampler =
new TheoryData<string, IResampler>
{
{ "Bicubic", new BicubicResampler() },
};
[Theory]
[WithFile(TestImages.Gif.Giphy, DefaultPixelType)]
public void ResizeShouldApplyToAllFrames<TPixel>(TestImageProvider<TPixel> provider)
@ -51,20 +45,17 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
}
[Theory]
[WithTestPatternImages(nameof(AllReSamplers), 100, 100, DefaultPixelType, 50)]
[WithFileCollection(nameof(ResizeFiles), nameof(AllReSamplers), DefaultPixelType, 50)]
[WithFileCollection(nameof(ResizeFiles), nameof(AllReSamplers), DefaultPixelType, 30)]
public void ResizeFullImage<TPixel>(TestImageProvider<TPixel> provider, string name, IResampler sampler, int percents)
[WithTestPatternImages(nameof(AllReSamplers), 100, 100, DefaultPixelType, 0.5f)]
[WithFileCollection(nameof(ResizeFiles), nameof(AllReSamplers), DefaultPixelType, 0.5f)]
[WithFileCollection(nameof(ResizeFiles), nameof(AllReSamplers), DefaultPixelType, 0.3f)]
public void ResizeFullImage<TPixel>(TestImageProvider<TPixel> provider, string name, IResampler sampler, float ratio)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())
{
float ratio = (float)percents / 100.0F;
SizeF newSize = image.Size() * ratio;
image.Mutate(x => x.Resize((Size)newSize, sampler, false));
string details = $"{name}-{percents}%";
string details = $"{name}-{ratio}";
image.DebugSave(provider, details);
}
}
@ -77,7 +68,6 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Resize(image.Size() / 2, true));
image.DebugSave(provider);
}
}

12
tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

@ -9,13 +9,13 @@ namespace ImageSharp.Tests
public static class TestEnvironment
{
public const string ImageSharpSolution = "ImageSharp.sln";
private const string ImageSharpSolutionFileName = "ImageSharp.sln";
private const string InputImagesRelativePath = @"tests\TestImages\Input";
private const string InputImagesRelativePath = @"tests\Images\Input";
private const string ActualOutputDirectoryRelativePath = @"tests\TestImages\ActualOutput";
private const string ActualOutputDirectoryRelativePath = @"tests\Images\ActualOutput";
private const string ReferenceOutputDirectoryRelativePath = @"tests\TestImages\ReferenceOutput";
private const string ReferenceOutputDirectoryRelativePath = @"tests\Images\ReferenceOutput";
private static Lazy<string> solutionDirectoryFullPath = new Lazy<string>(GetSolutionDirectoryFullPathImpl);
@ -42,7 +42,7 @@ namespace ImageSharp.Tests
DirectoryInfo directory = assemblyFile.Directory;
while (!directory.EnumerateFiles(ImageSharpSolution).Any())
while (!directory.EnumerateFiles(ImageSharpSolutionFileName).Any())
{
try
{
@ -79,6 +79,6 @@ namespace ImageSharp.Tests
internal static string ReferenceOutputDirectoryFullPath => Path.Combine(SolutionDirectoryFullPath, ReferenceOutputDirectoryRelativePath);
internal static string GetReferenceOutputFileName(string actualOutputFileName) =>
actualOutputFileName.Replace("ActualOutput", "ExpectedOutput");
actualOutputFileName.Replace("ActualOutput", "ReferenceOutput");
}
}

0
tests/TestImages/Input/Bmp/Car.bmp → tests/Images/Input/Bmp/Car.bmp

0
tests/TestImages/Input/Bmp/F.bmp → tests/Images/Input/Bmp/F.bmp

0
tests/TestImages/Input/Bmp/neg_height.bmp → tests/Images/Input/Bmp/neg_height.bmp

0
tests/TestImages/Input/Gif/cheers.gif → tests/Images/Input/Gif/cheers.gif

0
tests/TestImages/Input/Gif/giphy.gif → tests/Images/Input/Gif/giphy.gif

0
tests/TestImages/Input/Gif/rings.gif → tests/Images/Input/Gif/rings.gif

0
tests/TestImages/Input/Gif/trans.gif → tests/Images/Input/Gif/trans.gif

0
tests/TestImages/Input/Jpg/baseline/Calliphora.jpg → tests/Images/Input/Jpg/baseline/Calliphora.jpg

0
tests/TestImages/Input/Jpg/baseline/ExifUndefType.jpg → tests/Images/Input/Jpg/baseline/ExifUndefType.jpg

0
tests/TestImages/Input/Jpg/baseline/Floorplan.jpg → tests/Images/Input/Jpg/baseline/Floorplan.jpg

0
tests/TestImages/Input/Jpg/baseline/Hiyamugi.jpg → tests/Images/Input/Jpg/baseline/Hiyamugi.jpg

0
tests/TestImages/Input/Jpg/baseline/Lake.jpg → tests/Images/Input/Jpg/baseline/Lake.jpg

0
tests/TestImages/Input/Jpg/baseline/Snake.jpg → tests/Images/Input/Jpg/baseline/Snake.jpg

0
tests/TestImages/Input/Jpg/baseline/badeof.jpg → tests/Images/Input/Jpg/baseline/badeof.jpg

0
tests/TestImages/Input/Jpg/baseline/cmyk.jpg → tests/Images/Input/Jpg/baseline/cmyk.jpg

0
tests/TestImages/Input/Jpg/baseline/exif.jpg → tests/Images/Input/Jpg/baseline/exif.jpg

0
tests/TestImages/Input/Jpg/baseline/gamma_dalai_lama_gray.jpg → tests/Images/Input/Jpg/baseline/gamma_dalai_lama_gray.jpg

0
tests/TestImages/Input/Jpg/baseline/jpeg400jfif.jpg → tests/Images/Input/Jpg/baseline/jpeg400jfif.jpg

0
tests/TestImages/Input/Jpg/baseline/jpeg420exif.jpg → tests/Images/Input/Jpg/baseline/jpeg420exif.jpg

0
tests/TestImages/Input/Jpg/baseline/jpeg444.jpg → tests/Images/Input/Jpg/baseline/jpeg444.jpg

0
tests/TestImages/Input/Jpg/baseline/testimgint.jpg → tests/Images/Input/Jpg/baseline/testimgint.jpg

0
tests/TestImages/Input/Jpg/baseline/testorig.jpg → tests/Images/Input/Jpg/baseline/testorig.jpg

0
tests/TestImages/Input/Jpg/baseline/turtle.jpg → tests/Images/Input/Jpg/baseline/turtle.jpg

0
tests/TestImages/Input/Jpg/baseline/ycck.jpg → tests/Images/Input/Jpg/baseline/ycck.jpg

0
tests/TestImages/Input/Jpg/progressive/BadEofProgressive.jpg → tests/Images/Input/Jpg/progressive/BadEofProgressive.jpg

0
tests/TestImages/Input/Jpg/progressive/Festzug.jpg → tests/Images/Input/Jpg/progressive/Festzug.jpg

0
tests/TestImages/Input/Jpg/progressive/fb.jpg → tests/Images/Input/Jpg/progressive/fb.jpg

0
tests/TestImages/Input/Jpg/progressive/progress.jpg → tests/Images/Input/Jpg/progressive/progress.jpg

0
tests/TestImages/Input/Png/CalliphoraPartial.png → tests/Images/Input/Png/CalliphoraPartial.png

0
tests/TestImages/Input/Png/blur.png → tests/Images/Input/Png/blur.png

0
tests/TestImages/Input/Png/chunklength1.png → tests/Images/Input/Png/chunklength1.png

0
tests/TestImages/Input/Png/chunklength2.png → tests/Images/Input/Png/chunklength2.png

0
tests/TestImages/Input/Png/cross.png → tests/Images/Input/Png/cross.png

0
tests/TestImages/Input/Png/filter0.png → tests/Images/Input/Png/filter0.png

0
tests/TestImages/Input/Png/filter1.png → tests/Images/Input/Png/filter1.png

0
tests/TestImages/Input/Png/filter2.png → tests/Images/Input/Png/filter2.png

0
tests/TestImages/Input/Png/filter3.png → tests/Images/Input/Png/filter3.png

0
tests/TestImages/Input/Png/filter4.png → tests/Images/Input/Png/filter4.png

0
tests/TestImages/Input/Png/filterVar.png → tests/Images/Input/Png/filterVar.png

0
tests/TestImages/Input/Png/indexed.png → tests/Images/Input/Png/indexed.png

0
tests/TestImages/Input/Png/interlaced.png → tests/Images/Input/Png/interlaced.png

0
tests/TestImages/Input/Png/pd.png → tests/Images/Input/Png/pd.png

0
tests/TestImages/Input/Png/pl.png → tests/Images/Input/Png/pl.png

0
tests/TestImages/Input/Png/pp.png → tests/Images/Input/Png/pp.png

0
tests/TestImages/Input/Png/rgb-48bpp-interlaced.png → tests/Images/Input/Png/rgb-48bpp-interlaced.png

0
tests/TestImages/Input/Png/rgb-48bpp.png → tests/Images/Input/Png/rgb-48bpp.png

0
tests/TestImages/Input/Png/splash-interlaced.png → tests/Images/Input/Png/splash-interlaced.png

0
tests/TestImages/Input/Png/splash.png → tests/Images/Input/Png/splash.png

0
tests/TestImages/Input/Png/versioning-1_1.png → tests/Images/Input/Png/versioning-1_1.png

0
tests/TestImages/Input/Png/versioning-1_2.png → tests/Images/Input/Png/versioning-1_2.png

0
tests/TestImages/Input/Png/vim16x16_1.png → tests/Images/Input/Png/vim16x16_1.png

0
tests/TestImages/Input/Png/vim16x16_2.png → tests/Images/Input/Png/vim16x16_2.png

Loading…
Cancel
Save