示例#1
0
 public void SharpSharpFileFile()
 {
     using var output = TestFiles.OutputJpg();
     ImagePipeline
     .FromFile(TestFiles.InputJpg)
     .Resize(Width, Height)
     .ToFile(output.Path);
 }
 public DifferenceHashBenchmark()
 {
     ImagePipeline
     .FromFile(TestFiles.InputJpg)
     .Png()
     .ToBuffer(out var b);
     buffer = b;
 }
 public static void read_file_write_stream()
 {
     using var outputFile   = TestFiles.OutputJpg();
     using var outputStream = new FileStream(outputFile.Path, FileMode.Open, FileAccess.Write);
     ImagePipeline
     .FromFile(TestFiles.InputJpg)
     .TestActions()
     .ToStream(outputStream, VerifyImageInfo);
 }
示例#4
0
        private static void Main()
        {
            ImagePipeline
            .FromFile(TestFiles.InputJpg)
            .Png()
            .ToBuffer(out var b);
            var hashLong  = DifferenceHash.HashLong(b);
            var hashShort = DifferenceHash.HashShort(b);

            Console.WriteLine(Reverse(Convert.ToString(hashLong, 2)));
            Console.WriteLine(Reverse(Convert.ToString(hashShort, 2)));
        }
示例#5
0
 private static ImagePipeline TestPipeline() =>
 ImagePipeline
 .FromFile(TestFiles.InputJpg)
 .Resize(320, 240);
示例#6
0
 private static long CalculateExpectedHash(string fileName)
 {
     ImagePipeline.FromFile(fileName).Webp(new WebpOptions(100, 100, true)).ToBuffer(out var expected);
     return(DifferenceHash.HashLong(expected));
 }