[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.Delete("Headline");
image.IPTC.Delete("2:110"); // Credit
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.Delete("Headline")
image.IPTC.Delete("2:110")
' Credit
image.IPTC.Embed(theFile)
End If
The code reads the IPTC information from a JPEG file. It deletes
the headline and credit and updates the file.
|