Exemplo n.º 1
0
 public void Test()
 {
     ImageTest.Run("sample_olympus_corrupt_mn.jpg",
                   false,
                   new JpegOlympusCorruptMNTestInvariantValidator()
                   );
 }
Exemplo n.º 2
0
        public void Test()
        {
            // This file is originally created with GIMP and the metadata was modified
            // by exiftool.
            // The test is to test some properties of ImageTag
            ImageTest.Run("sample_gimp_exiftool.jpg",
                          true,
                          new JpegPropertyTestInvariantValidator(),
                          NoModificationValidator.Instance,
                          new PropertyModificationValidator <string> ("Creator", "Isaac Newton", "Albert Einstein"),
                          new PropertyModificationValidator <string> ("Copyright", "Free to Copy", "Place something here"),
                          new PropertyModificationValidator <string> ("Comment", "This is an image Comment", "And here comes another image comment"),
                          new PropertyModificationValidator <string> ("Title", "Sunrise", "Eclipse"),
                          new PropertyModificationValidator <string> ("Software", "Exiftool", "Unit tests"),
                          new PropertyModificationValidator <string[]> ("Keywords", new string [] { "keyword 1", "keyword 2" }, new string [] { "keyword a", "keyword b", "keyword 2" }),
                          new PropertyModificationValidator <uint?> ("Rating", 5, 2),

                          new TagPropertyModificationValidator <string> ("Creator", null, "Albert Einstein", TagTypes.TiffIFD, true),
                          new TagPropertyModificationValidator <string> ("Copyright", "Free to Copy", "Place something here", TagTypes.TiffIFD, true),
                          new TagPropertyModificationValidator <string> ("Comment", null, "And here comes another image comment", TagTypes.TiffIFD, true),
                          new TagPropertyModificationValidator <string> ("Software", "Exiftool", "Unit tests", TagTypes.TiffIFD, true),

                          new TagPropertyModificationValidator <string> ("Creator", "Isaac Newton", "Albert Einstein", TagTypes.XMP, true),
                          new TagPropertyModificationValidator <string> ("Copyright", null, "Place something here", TagTypes.XMP, true),
                          new TagPropertyModificationValidator <string> ("Comment", "This is an image Comment", "And here comes another image comment", TagTypes.XMP, true),
                          new TagPropertyModificationValidator <string> ("Title", "Sunrise", "Eclipse", TagTypes.XMP, true),
                          new TagPropertyModificationValidator <string> ("Software", null, "Unit tests", TagTypes.XMP, true),
                          new TagPropertyModificationValidator <string[]> ("Keywords", new string [] { "keyword 1", "keyword 2" }, new string [] { "keyword a", "keyword b", "keyword 2" }, TagTypes.XMP, true),
                          new TagPropertyModificationValidator <uint?> ("Rating", 5, 2, TagTypes.XMP, true),

                          new TagPropertyModificationValidator <string> ("Comment", "This is an image Comment", "And here comes another image comment", TagTypes.JpegComment, true)
                          );
        }
Exemplo n.º 3
0
 public void Test()
 {
     ImageTest.Run("sample_badifdentrytype.jpg",
                   false,
                   new InvalidIFDEntryTypeTestInvariantValidator()
                   );
 }
 public void Test()
 {
     ImageTest.Run("sample_null_orientation.jpg",
                   new NullOrientationInvariantValidator(),
                   NoModificationValidator.Instance
                   );
 }
Exemplo n.º 5
0
        public void Lenna_is_perfectly_reconstructed_after_5_steps()
        {
            Laplacian2D <YuvD> transform = new Laplacian2D <YuvD>(new DigitalFilter(new Dirichlet(3), 2), new DigitalFilter(new Dirichlet(2), 2));
            Image <YuvD>       lenna     = Image <YuvD> .Load("Lenna.png");

            ImageTest.AssertEquals(transform.Inverse(transform.Forward(lenna, 5)), lenna);
        }
Exemplo n.º 6
0
 public void Test()
 {
     ImageTest.Run("sample_bgo631333.jpg",
                   new BGO631333TestInvariantValidator(),
                   NoModificationValidator.Instance
                   );
 }
Exemplo n.º 7
0
 public void Test()
 {
     ImageTest.Run("sample_invalidifdoffset.jpg",
                   false,
                   new InvalidIFDOffsetTestInvariantValidator()
                   );
 }
Exemplo n.º 8
0
 public void Test()
 {
     ImageTest.Run("raw-samples/RAW", "RAW_LEICA_DIGILUX2_SRGB.RAW",
                   false,
                   new RawLeicaDigilux2TestInvariantValidator()
                   );
 }
Exemplo n.º 9
0
 public void Test()
 {
     ImageTest.Run("raw-samples/DNG", "RAW_LEICA_M8.DNG",
                   false,
                   new DngLeicaM8InvariantValidator()
                   );
 }
Exemplo n.º 10
0
 public void Test()
 {
     ImageTest.Run("sample_bgo493530.jpg",
                   false,
                   new BGO493530TestInvariantValidator()
                   );
 }
Exemplo n.º 11
0
 public void Test()
 {
     ImageTest.Run("sample_recursive_ifd.jpg",
                   false,
                   new RecursiveIFDTestInvariantValidator()
                   );
 }
Exemplo n.º 12
0
        public void Test()
        {
            // This file is originally created with GIMP and was modified with png crush:
            ImageTest.Run("sample_gimp_pngcrush.png",
                          true,
                          new PngGimpPngcrushTestInvariantValidator(),
                          NoModificationValidator.Instance,

                          new PropertyModificationValidator <string> ("Comment", "Modified with pngcrush", "$% ¬ Test Comment äö "),
                          new PropertyModificationValidator <string> ("Creator", "Isaac Newton", "Albert Einstein"),
#if HAVE_SHARPZIPLIB
                          new PropertyModificationValidator <string> ("Title", "Sunrise", "Eclipse"),
#endif
                          new TagPropertyModificationValidator <string> ("Comment", "Modified with pngcrush", "$% ¬ Test Comment äö ", TagTypes.Png, true),
                          new TagPropertyModificationValidator <string> ("Creator", "Isaac Newton", "Albert Einstein", TagTypes.Png, true),
#if HAVE_SHARPZIPLIB
                          new TagPropertyModificationValidator <string> ("Title", "Sunrise", "Eclipse", TagTypes.Png, true),
#endif
                          new TagPropertyModificationValidator <string> ("Comment", null, "$% ¬ Test Comment äö ", TagTypes.XMP, false),
                          new TagPropertyModificationValidator <string> ("Creator", null, "Albert Einstein", TagTypes.XMP, false),
                          new TagPropertyModificationValidator <string> ("Title", null, "Eclipse", TagTypes.XMP, false),
                          new TagKeywordsModificationValidator(TagTypes.XMP, false),
                          new RemoveMetadataValidator(TagTypes.Png)
                          );
        }
Exemplo n.º 13
0
 public void Test()
 {
     ImageTest.Run("sample_bgo625367.jpg",
                   false,
                   new BGO625367TestInvariantValidator()
                   );
 }
Exemplo n.º 14
0
 public void Test()
 {
     ImageTest.Run("sample_canon_bibble5.jpg",
                   new JpegCanonBibble5TestInvariantValidator(),
                   NoModificationValidator.Instance
                   );
 }
Exemplo n.º 15
0
        public void Forward_transform_produces_correct_downsampled_image()
        {
            Image <double> expected = new Image <double>(new[, ] {
                { 2, 9.5, 25.5 }, { 2, 9.5, 25.5 }
            });

            ImageTest.AssertEquals(laplacian.Forward(source)[0], expected);
        }
Exemplo n.º 16
0
 public void Test()
 {
     ImageTest.Run("sample_gimp_lzw.tiff",
                   ImageTest.CompareLargeImages,
                   new TiffGimp1TestInvariantValidator(),
                   NoModificationValidator.Instance
                   );
 }
Exemplo n.º 17
0
        public void Convolute_with_scale_2_results_in_blurred_image()
        {
            Image expected = new Image(new[, ] {
                { 2.0, 4.5, 9.5, 16.5, 25.5, 32.33333333333333 }, { 2.0, 4.5, 9.5, 16.5, 25.5, 32.33333333333333 },
                { 1.5, 3.375, 7.125, 12.375, 19.125, 24.25 }, { 0.6666666666666666, 1.5, 3.166666666666666, 5.5, 8.5, 10.77777777777777 }
            });

            ImageTest.AssertEquals(linear2.Convolute(source), expected);
        }
Exemplo n.º 18
0
        public void Deny_Unrestricted()
        {
            ImageTest unit = new ImageTest();

            unit.DefaultProperties();
            unit.NullProperties();
            unit.CleanProperties();
            unit.Render();
        }
Exemplo n.º 19
0
        public void Forward_transform_produces_correct_difference_image()
        {
            Image <double> expected = new Image <double>(new[, ] {
                { -2.5555555555555555, -3.6666666666666666, -3.6666666666666666, -7.3333333333333333, -9.0, 13.3333333333333333 },
                { -1.6666666666666666, -1.7500000000000000, -0.5000000000000000, -1.5000000000000000, -0.5, 19.0000000000000000 },
                { -1.6666666666666666, -1.7500000000000000, -0.5000000000000000, -1.5000000000000000, -0.5, 19.0000000000000000 },
                { -0.7777777777777777, +0.1666666666666666, +2.6666666666666666, +4.3333333333333333, +8.0, 24.6666666666666666 }
            });

            ImageTest.AssertEquals(laplacian.Forward(source)[1], expected);
        }
Exemplo n.º 20
0
 public void Test()
 {
     ImageTest.Run("sample_nikon1_bibble5.jpg",
                   new JpegNikon1Bibble5TestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new CommentModificationValidator(string.Empty),
                   new TagCommentModificationValidator(null, TagTypes.TiffIFD, true),
                   new TagCommentModificationValidator(null, TagTypes.XMP, true),
                   new TagKeywordsModificationValidator(new string[] { }, TagTypes.XMP, true)
                   );
 }
Exemplo n.º 21
0
 public void Test()
 {
     ImageTest.Run("sample_no_metadata.jpg",
                   new JpegNoMetadataTestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new NoModificationValidator(),
                   new TagCommentModificationValidator(TagTypes.TiffIFD, false),
                   new TagCommentModificationValidator(TagTypes.XMP, false),
                   new TagKeywordsModificationValidator(TagTypes.XMP, false)
                   );
 }
Exemplo n.º 22
0
 public void Test()
 {
     ImageTest.Run("sample_xap.jpg",
                   new XapTestInvariantValidator(),
                   new NoModificationValidator(),
                   new CommentModificationValidator("Communications"),
                   new TagCommentModificationValidator("Communications", TagTypes.TiffIFD, true),
                   new TagCommentModificationValidator("Communications", TagTypes.XMP, true),
                   new KeywordsModificationValidator(new string [] { "Communications" }),
                   new TagKeywordsModificationValidator(new string [] { "Communications" }, TagTypes.XMP, true)
                   );
 }
Exemplo n.º 23
0
        /// <summary>
        /// Following are the functions that contain the logic that is executed once a button is pressed
        /// </summary>
        #region Buttons Logic
        private void SyncTest()
        {
            TotalTimeWatch.Start();

            //Initialize instances of Progress class that are later used to trigger
            //the events that update UI
            Progress <ImageTestReportModel> imageTestProgress = new Progress <ImageTestReportModel>();

            imageTestProgress.ProgressChanged += ImageTestProgressEvent;
            Progress <PNumTestReportModel> pNumTestProgress = new Progress <PNumTestReportModel>();

            pNumTestProgress.ProgressChanged += PNumTestProgressEvent;
            Progress <WebsitesTestReportModel> websitesTestProgress = new Progress <WebsitesTestReportModel>();

            websitesTestProgress.ProgressChanged += WebsitesTestProgressEvent;

            //Start executing each test sequentially
            ImageTestWatch.Start();
            ImageTest.StartSync(imageTestProgress);
            ImageTestWatch.Stop();
            ImageTestCheckmarkVisibility = Visibility.Visible;

            PNumTestWatch.Start();
            PrimeNumbersTest.StartSync(pNumTestProgress, pNumRangeTest, pNumNthTest);
            PNumTestWatch.Stop();
            PNumTestCheckmarkVisibility = Visibility.Visible;

            WebsitesTestWatch.Start();
            try
            {
                WebsitesTest.StartSync(websitesTestProgress);
                WebsitesTestCheckmarkVisibility = Visibility.Visible;
            }
            catch (WebException)
            {
                WebsitesTestProgressBarColour   = new SolidColorBrush(Colors.Red);
                WebsitesTestCrossmarkVisibility = Visibility.Visible;
            }
            WebsitesTestWatch.Stop();

            //Enable Reset button to let the user observe the results
            //and then reset UI before next run
            SyncBtnIsEnabled  = ParallelBtnIsEnabled = false;
            ResetBtnIsEnabled = true;

            //Stop Total timer and update all timers
            TotalTimeWatch.Stop();
            UpdateTimers(this, new EventArgs());

            //Push the results of execution to the results manager
            ResultsDataManager.SetResults("Synchronous", ImageTestTimerText, PNumTestTimerText, WebsitesTestTimerText, TotalTimeText, true);
        }
Exemplo n.º 24
0
 public void Test()
 {
     // This file is originally created with GIMP.
     ImageTest.Run("sample_gimp.png",
                   true,
                   new PngGimpTestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new CommentModificationValidator("Created with GIMP"),
                   new TagCommentModificationValidator("Created with GIMP", TagTypes.Png, true),
                   new TagKeywordsModificationValidator(TagTypes.XMP, false),
                   new RemoveMetadataValidator(TagTypes.Png)
                   );
 }
Exemplo n.º 25
0
 public void Test()
 {
     // This file is originally created with GIMP and the metadata was modified
     // by exiftool.
     ImageTest.Run("sample_exiftool.gif",
                   true,
                   new GifExiftoolTestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new TagKeywordsModificationValidator(new[] { "Keyword 1", "Keyword 2" }, TagTypes.XMP, true),
                   new CommentModificationValidator("Created with GIMP"),
                   new TagCommentModificationValidator("Created with GIMP", TagTypes.GifComment, true),
                   new RemoveMetadataValidator(TagTypes.GifComment | TagTypes.XMP),
                   new RemoveMetadataValidator(TagTypes.GifComment | TagTypes.XMP, TagTypes.GifComment)
                   );
 }
 public void Test()
 {
     // This file is originally created with GIMP and the metadata was modified
     // by exiftool. Furthermore, the file is modified in the following way:
     // (1) the blocks which contain the metadata are moved to the end of the file.
     //     This is allowed and should be handled correctly by taglib.
     // (2) XMP Block is removed.
     ImageTest.Run("sample_exiftool_tangled3.gif",
                   true,
                   new GifExiftoolTangled3TestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new TagKeywordsModificationValidator(new string[] { }, TagTypes.XMP, false),
                   new CommentModificationValidator("Created with GIMP"),
                   new TagCommentModificationValidator("Created with GIMP", TagTypes.GifComment, true),
                   new RemoveMetadataValidator(TagTypes.GifComment)
                   );
 }
Exemplo n.º 27
0
            public async Task <Unit> Handle(Command request, CancellationToken cancellationToken)
            {
                var imagetest = new ImageTest
                {
                    Id     = request.Id,
                    testId = request.testId,
                    file   = request.file
                };

                _context.ImageTest.Add(imagetest);
                var success = await _context.SaveChangesAsync() > 0;

                if (success)
                {
                    return(Unit.Value);
                }
                throw new Exception("Problem saving changes");
            }
 public void Test()
 {
     // This file is originally created with GIMP and the metadata was modified
     // by exiftool. Furthermore, the file is modified in the following way:
     // (1) the version 89a is substituted by 87a, this leads to an invalid 87a
     //     file, but we change the version if we write metadata.
     // (2) the blocks which contain the metadata are moved to the end of the file.
     //     This is allowed and should be handled correctly by taglib.
     // (3) Gif Comment block is removed
     ImageTest.Run("sample_exiftool_tangled2.gif",
                   true,
                   new GifExiftoolTangled2TestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new TagKeywordsModificationValidator(new[] { "Keyword 1", "Keyword 2" }, TagTypes.XMP, true),
                   new CommentModificationValidator(),
                   new TagCommentModificationValidator(null, TagTypes.GifComment, false),
                   new RemoveMetadataValidator(TagTypes.XMP)
                   );
 }
Exemplo n.º 29
0
 public void Test()
 {
     // This file is originally created with GIMP and the metadata was modified
     // by exiftool. A very long comment is added by exiftool because such comments
     // are stored in multiple sub-blocks. This should be handled by taglib.
     ImageTest.Run("sample_exiftool_long_comment.gif",
                   true,
                   new GifExiftoolLongCommentTestInvariantValidator(),
                   NoModificationValidator.Instance,
                   new TagKeywordsModificationValidator(new string[] { }, TagTypes.XMP, true),
                   new CommentModificationValidator(long_comment_orig),
                   new CommentModificationValidator(long_comment_orig, long_comment_test),
                   new TagCommentModificationValidator(long_comment_orig, TagTypes.GifComment, true),
                   new TagCommentModificationValidator(long_comment_orig, long_comment_test, TagTypes.GifComment, true),
                   new RemoveMetadataValidator(TagTypes.GifComment | TagTypes.XMP),
                   new RemoveMetadataValidator(TagTypes.GifComment | TagTypes.XMP, TagTypes.GifComment),
                   new RemoveMetadataValidator(TagTypes.GifComment | TagTypes.XMP, TagTypes.XMP)
                   );
 }
Exemplo n.º 30
0
 public void Test()
 {
     ImageTest.Run(TestPath.GetRawSubDirectory("DNG"), "RAW_LEICA_M8.DNG",
                   false, new DngLeicaM8InvariantValidator());
 }