Example #1
0
    public void WhenWritingABlankCreatedJpegToAValidFileWriteToAValidFile()
    {
        Image emptyImage = Image.Create(10, 10);

        ValidateCreatedImage(emptyImage, 10, 10);
        string tempFilePath = Path.ChangeExtension(Path.GetTempFileName(), ".jpg");

        Jpg.WriteToFile(emptyImage, tempFilePath);
        File.Delete(tempFilePath);
    }
Example #2
0
    public static void WhenAddingANegativeFilterToAJpegGiveAValidGreyScaledImage()
    {
        string filepath = SaveEmbeddedResourceToFile(SquareCatLogicalName);

        Image img1 = Jpg.Load(filepath);

        img1.ApplyMatrixMultiplier(ImageExtensions.NegativeMatrix);
        ValidateImageJpeg(img1, SquareCatLogicalName);
        Jpg.WriteToFile(img1, Path.GetTempPath() + "NegativeCat.jpg");
    }
Example #3
0
    //FIX Write
    private static void WriteFileJpegPerfTest(int numRuns)
    {
        //string dir = Path.GetTempPath();
        Image _thisjpgdog = Jpg.Load(jpegDogPath);

        for (int i = 0; i < numRuns; i++)
        {
            //make sure it's going
            if (i % 100 == 0)
            {
                Console.WriteLine("WriteFileJpegTest :" + i);
            }
            stopwatchSingleThread.Start();
            Jpg.WriteToFile(_thisjpgdog, Path.ChangeExtension(Path.GetTempFileName(), ".jpg"));
            stopwatchSingleThread.Stop();
        }
        _thisjpgdog.ReleaseStruct();
    }