|
[C#]
XImageLoadOptions loadOptions = new XImageLoadOptions();
loadOptions.ReadExif = true;
XImage image = XImage.FromFile(Server.MapPath("rez/exif.jpg"), loadOptions);
if (image.Exif != null) {
ASCIIEncoding AE = new ASCIIEncoding();
Byte[] exifd = image.Exif["model"].Data;
char[] exifc = AE.GetChars(exifd);
int l = exifc.Length;
string txt = "";
for (int i = 0; i < l; i++)
txt += exifc[i];
txt += "\r\n";
}
[Visual Basic]
Dim loadOptions As New XImageLoadOptions()
loadOptions.ReadExif = True
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/exif.jpg"), loadOptions)
If image.Exif IsNot Nothing Then
Dim AE As New ASCIIEncoding()
Dim exifd As [Byte]() = image.Exif("model").Data
Dim exifc As Char() = AE.GetChars(exifd)
Dim l As Integer = exifc.Length
Dim txt As String = ""
For i As Integer = 0 To l - 1
txt += exifc(i)
Next
txt += vbCr & vbLf
End If
The code gets the raw exif data representing the model of the
camera and outputs it to a string.
A more useful (but more complex) usage of the Data property is
to extract and parse specific camera maker notes.
|