Beispiel #1
0
    public void Test_FromIXPathNavigable()
    {
      using (MagickImage image = new MagickImage(Files.InvitationTif))
      {
        XmpProfile profile = image.GetXmpProfile();
        Assert.IsNotNull(profile);

        IXPathNavigable doc = profile.ToIXPathNavigable();

        ExceptionAssert.Throws<ArgumentNullException>(delegate ()
        {
          XmpProfile.FromIXPathNavigable(null);
        });

        XmpProfile newProfile = XmpProfile.FromIXPathNavigable(doc);
        image.AddProfile(newProfile);

        doc = profile.ToIXPathNavigable();
        TestIXPathNavigable(doc);

        profile = image.GetXmpProfile();
        Assert.IsNotNull(profile);

        doc = profile.ToIXPathNavigable();
        TestIXPathNavigable(doc);

        Assert.AreEqual(profile, newProfile);
      }
    }
    public void Test_SkipProfiles()
    {
      MagickReadSettings settings = new MagickReadSettings()
      {
        Defines = new PngReadDefines()
        {
          SkipProfiles = ProfileTypes.Xmp | ProfileTypes.Exif
        }
      };

      using (MagickImage image = new MagickImage())
      {
        image.Read(Files.FujiFilmFinePixS1ProPNG);
        Assert.IsNotNull(image.GetExifProfile());
        Assert.IsNotNull(image.GetXmpProfile());

        image.Read(Files.FujiFilmFinePixS1ProPNG, settings);
        Assert.IsNull(image.GetExifProfile());
        Assert.IsNull(image.GetXmpProfile());
        Assert.AreEqual("Exif,Xmp", image.Settings.GetDefine("profile:skip"));
      }
    }
Beispiel #3
0
    public void Test_CreateReader()
    {
      using (MagickImage image = new MagickImage(Files.InvitationTif))
      {
        XmpProfile profile = image.GetXmpProfile();
        Assert.IsNotNull(profile);

        using (XmlReader reader = profile.CreateReader())
        {
          XmlDocument doc = new XmlDocument();
          doc.Load(reader);
          TestIXPathNavigable(doc);
        }
      }
    }
Beispiel #4
0
    public void Test_ToXDocument()
    {
      using (MagickImage image = new MagickImage(Files.InvitationTif))
      {
        XmpProfile profile = image.GetXmpProfile();
        Assert.IsNotNull(profile);

        XDocument document = profile.ToXDocument();
        TestXDocument(document);
      }
    }
Beispiel #5
0
    public void Test_ToIXPathNavigable()
    {
      using (MagickImage image = new MagickImage(Files.InvitationTif))
      {
        XmpProfile profile = image.GetXmpProfile();
        Assert.IsNotNull(profile);

        IXPathNavigable doc = profile.ToIXPathNavigable();
        TestIXPathNavigable(doc);
      }
    }