[C#]
string theFile = Server.MapPath("rez/iptc.jpg");
XImageLoadOptions loadOptions = new XImageLoadOptions();
loadOptions.ReadIPTC = true;
XImage image = XImage.FromFile(theFile, loadOptions);
if (image.IPTC != null) {
image.IPTC.Add("Headline", true).Text = "Oxford University Ball";
image.IPTC.Add("Caption", true).Text = "What a laugh!";
image.IPTC.Embed(theFile);
}
[Visual Basic]
Dim theFile As String = Server.MapPath("rez/iptc.jpg")
Dim loadOptions As New XImageLoadOptions()
loadOptions.ReadIPTC = True
Dim image As XImage = XImage.FromFile(theFile, loadOptions)
If image.IPTC IsNot Nothing Then
image.IPTC.Add("Headline", True).Text = "Oxford University Ball"
image.IPTC.Add("Caption", True).Text = "What a laugh!"
image.IPTC.Embed(theFile)
End If
The code reads the IPTC information from a JPEG file. It then
changes the headline and caption and embeds the changed information
into the original file.
|