Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I extract information from an image header?

Status
Not open for further replies.

majorbroncosfan

Programmer
Feb 23, 2001
121
0
0
US
I am trying to get information from an image that contains a header with parsable fields. Does anybody know how I can extract information from the header of an image? I have never done this before, but know it can be done.

Thanks in advance!

Jeff
 
This file byte examiner may help:

Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents file1 As System.Web.UI.HtmlControls.HtmlInputFile
Protected WithEvents lit1 As System.Web.UI.WebControls.Literal

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not file1.PostedFile.FileName = Nothing Then
Dim ln As Integer = file1.PostedFile.ContentLength
Dim bytes(ln) As Byte
file1.PostedFile.InputStream.Read(bytes, 0, ln)
Dim sb As New System.Text.StringBuilder
For i As Integer = 0 To bytes.Length - 1
If bytes(i) > -32 And bytes(i) <= 126 Then
'Readable characters
sb.Append("<font class=black>" & Server.HtmlEncode(CStr(Chr(bytes(i)))) & "</font>")
Else
sb.Append(" <font class=red>[" & bytes(i) & "]</font> ")
End If

Next
lit1.Text = sb.ToString
End If
End Sub



End Class

Keeping it Real, Simple!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top