[C#]
XImageLoadOptions loadOptions = new XImageLoadOptions();
loadOptions.ReadIPTC = true;
XImage image = XImage.FromFile(Server.MapPath("rez/iptc.tif"), loadOptions);
if (image.IPTC != null) {
Response.Write(image.IPTC.Value("Headline"));
Response.Write("<br>");
Response.Write(image.IPTC.Value("Caption"));
Response.Write("<br>");
}
[Visual Basic]
Dim loadOptions As New XImageLoadOptions()
loadOptions.ReadIPTC = True
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/iptc.tif"), loadOptions)
If image.IPTC IsNot Nothing Then
Response.Write(image.IPTC.Value("Headline"))
Response.Write("<br>")
Response.Write(image.IPTC.Value("Caption"))
Response.Write("<br>")
End If
This example writes the Headline and Caption from a TIFF file.
No error will be raised if the IPTC data does not contain a
headline or caption.
|