Results 1 to 6 of 6

Thread: Jpeg header info[resolved]

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    Jpeg header info[resolved]

    Hi can anybody tell me how to get Jpeg header data added by a digital video camera?

    i really only need the Photo taken on property

    below is 3 posts of code i found for vb6 but cant seem to make it work in .net
    VB Code:
    1. '------------------------------------------------------------------------------------------------------------
    2. '- EXIF Meta Tag reader
    3. '- author: Chavdar Jordanov
    4. '- based on the Exif format description at [url]http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html[/url]
    5. '------------------------------------------------------------------------------------------------------------
    6. Option Explicit
    7.  
    8. Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
    9.  
    10. Private Type tIDF 'main structure, containg tag parameters
    11.     ID As Long
    12.     Name As String
    13.     Format As Long
    14.     Length As Long
    15.     Data As Variant
    16.     StringData As String
    17. End Type
    18.  
    19. Public Enum enTAG 'enumerator containing the most common metatag names and their respective IDs
    20.     ImageDescription = 270
    21.     Make = 271
    22.     Model = 272
    23.     Orientation = 274
    24.     XResolution = 282
    25.     YResolution = 283
    26.     ResolutionUnit = 296
    27.     Software = 305
    28.     DateTime = 306
    29.     WhitePoint = 318
    30.     PrimaryChromaticities = 319
    31.     YCbCrCoefficients = 529
    32.     YCbCrPositioning = 531
    33.     ReferenceBlackWhite = 532
    34.     Copyright = 33432
    35.     ExifOffset = 34665
    36.     Exposuretime = 33434
    37.     FNumber = 33437
    38.     ExposureProgram = 34850
    39.     ISOSpeedRatings = 34855
    40.     ExifVersion = 36864
    41.     DateTimeOriginal = 36867
    42.     DateTimeDigitized = 36868
    43.     ComponentsConfiguration = 37121
    44.     CompressedBitsPerPixel = 37122
    45.     ShutterSpeedValue = 37377
    46.     ApertureValue = 37378
    47.     BrightnessValue = 37379
    48.     ExposureBiasValue = 37380
    49.     MaxApertureValue = 37381
    50.     SubjectDistance = 37382
    51.     MeteringMode = 37383
    52.     LightSource = 37384
    53.     Flash = 37385
    54.     FocalLength = 37386
    55.     MakerNote = 37500
    56.     UserComment = 37510
    57.     SubsecTime = 37520
    58.     SubsecTimeOriginal = 37521
    59.     SubsecTimeDigitized = 37522
    60.     FlashPixVersion = 40960
    61.     ColorSpace = 40961
    62.     ExifImageWidth = 40962
    63.     ExifImageHeight = 40963
    64.     RelatedSoundFile = 40964
    65.     ExifInteroperabilityOffset = 40965
    66.     FocalPlaneXResolution = 41486
    67.     FocalPlaneYResolution = 41487
    68.     FocalPlaneResolutionUnit = 41488
    69.     ExposureIndex = 41493
    70.     SensingMethod = 41495
    71.     FileSource = 41728
    72.     SceneType = 41729
    73.     CFAPattern = 41730
    74. End Enum
    75.  
    76. Private Enum enFormat
    77.     unsignedByte = 1
    78.     asciiString = 2
    79.     unsignedShort = 3
    80.     unsignedLong = 4
    81.     unsignedRationale = 5
    82.     signedByte = 6
    83.     undefined = 7
    84.     signedShort = 8
    85.     signedLong = 9
    86.     signedRationale = 10
    87.     singleFloat = 11
    88.     doubleFloat = 12
    89. End Enum
    90.  
    91. Private m_ImageFile As String 'path to the file on the disk
    92. Private m_Intel As Boolean    'flag containing the byte alignment of the record
    93. Private m_IniFile As String   'path to the exif.ini file containing description of the codes
    94.  
    95. Private DataLen 'array containing the byte length of each data format
    96. Private IDName  'array containing tag names
    97. Private IDNo    'array containing tag IDs
    98. Private bParsed As Byte 'flag that the file has been parsed succesfuly
    99. Private IFD() As tIDF 'array containing all metatags
    100. '======== Interface part ==========
    101.  
    102. '-- file containing the jpeg image --
    103. Public Property Get ImageFile() As Variant
    104.     ImageFile = m_ImageFile
    105. End Property
    106.  
    107. Public Property Let ImageFile(ByVal vNewValue As Variant)
    108.     m_ImageFile = vNewValue
    109.     bParsed = ReadMetaInfo(m_ImageFile)
    110. End Property
    111.  
    112. '-- returns the byte alignment order for the file --
    113. Public Property Get IntelByteAlignment() As Boolean
    114.     IntelByteAlignment = m_Intel
    115. End Property
    116.  
    117. '-- method, which returns the numeric and string values for a single metatag ---
    118. Public Function MetaInfo(ByVal l_ID As enTAG, ByRef StringData As String) As Long
    119.     Dim i As Integer
    120.     If bParsed = 0 Then
    121.         For i = 1 To UBound(IFD)
    122.             If IFD(i).ID = l_ID Then
    123.                 StringData = IFD(i).StringData
    124.                 MetaInfo = IFD(i).Data
    125.                 Exit Function
    126.             End If
    127.         Next i
    128.         StringData = "Tag " + CStr(l_ID) + " not found."
    129.     ElseIf bParsed = 1 Then
    130.         Err.Raise 10, "MetaInfo", "File is not in EXIF format."
    131.     ElseIf bParsed = 2 Then
    132.         Err.Raise 11, "MetaInfo", "Error parsing the file."
    133.     End If
    134. End Function
    135.  
    136. '-- returns Exif tag name based on its ID --
    137. Function GetTagName(ByVal lID As enTAG) As String
    138.     Dim i As Integer
    139.     For i = 0 To UBound(IDNo)
    140.         If lID = IDNo(i) Then
    141.             GetTagName = IDName(i)
    142.             Exit Function
    143.         End If
    144.     Next
    145.     'tag name unknown; return tag ID
    146.     GetTagName = "Tag #" + CStr(lID)
    147. End Function
    148.  
    149. '--- Lists all metatags found in the header ---
    150. Function ListInfo() As String
    151.     Dim i As Integer
    152.     If bParsed = 0 Then
    153.         For i = 1 To UBound(IFD)
    154.             ListInfo = ListInfo + IFD(i).Name + ": " + IFD(i).StringData + vbCrLf
    155.         Next i
    156.     ElseIf bParsed = 1 Then
    157.         ListInfo = "File is not in EXIF format."
    158.     ElseIf bParsed = 2 Then
    159.         ListInfo = "Could not open the file."
    160.     End If
    161. End Function
    162.  
    163. '========= PARSING FUNCTIONS ==========
    164.  
    165. '-- parses the jpeg header and extracts all Exif information from it --
    166. Private Function ReadMetaInfo(sFileName As String) As Integer
    167.     Dim sJPEG_Header As String, B() As Byte
    168.     Dim lPos As Long, Offset As Long, HeaderStart As Long
    169.     Dim i As Integer
    170.     Dim NoOfRecs As Integer
    171.     On Error GoTo ErrRead
    172.     sJPEG_Header = ReadFile(sFileName, 4096) 'may be changed to reflect the actual header size
    173.     If sJPEG_Header = "" Then
    174.         Err.Raise 2, "ReadMetaInfo", "File not found."
    175.     Else
    176.         HeaderStart = InStr(1, sJPEG_Header, "Exif" + Chr(0), vbBinaryCompare) 'start of EXIF header
    177.         If HeaderStart = 0 Then ReadMetaInfo = 1: Exit Function
    178.         HeaderStart = HeaderStart + 6 'start of data
    179.         lPos = HeaderStart
    180.         m_Intel = Mid(sJPEG_Header, lPos, 2) = "II" 'byte alignment
    181.         lPos = lPos + 4
    182.         Offset = BVal(sJPEG_Header, lPos, 4, m_Intel) 'offset to the first IFD
    183.         ReDim IFD(0)
    184.         'parse the main IFD directory and get the offset to the IFDSubDir
    185.         Offset = ParseIDF(sJPEG_Header, HeaderStart, Offset, ExifOffset)
    186.         Offset = ParseIDF(sJPEG_Header, HeaderStart, Offset, ExifInteroperabilityOffset)
    187.     End If
    188. ExitRead:
    189.     Exit Function
    190. ErrRead:
    191.     Dim S
    192.     S = Err.Description
    193.     Err.Raise 1, "ReadMetaInfo", S
    194.     ReadMetaInfo = 2
    195. End Function


    any help is great :d
    Last edited by Ultimasnake; Dec 3rd, 2003 at 09:27 AM.
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    the rest of the code (couldnt fit i all in there)

    VB Code:
    1. '-- returns formatted string data from an IFD entry ---
    2. Private Sub GetStringData(sJPEG_Header As String, IFD As tIDF, OffsetStart As Long, CurrPosition As Long)
    3.     Dim vData As String, x As Variant, sFmt As String
    4.     Dim PixOrder, i As Integer
    5.     'extract the data
    6.     If IFD.Length * DataLen(IFD.Format) > 4 Then 'IFD data contains offset to real data
    7.         vData = Mid(sJPEG_Header, OffsetStart + IFD.Data, IFD.Length * DataLen(IFD.Format))
    8.     Else 'IFD record contains the data itself
    9.         vData = Mid(sJPEG_Header, CurrPosition + 8, 4)
    10.     End If
    11.     'check the data format and do some conversions if necessary
    12.     Select Case IFD.Format
    13.     Case enFormat.asciiString  'string
    14.         IFD.StringData = vData
    15.     Case enFormat.unsignedRationale  'unsigned rational
    16.         Select Case IFD.ID
    17.         Case enTAG.ApertureValue, enTAG.MaxApertureValue
    18.             'convert to aperture ratio value
    19.             x = UnsignedRational(vData, IFD.Data)
    20.             IFD.StringData = Format(Sqr(2) ^ IFD.Data, "0.0")
    21.         Case enTAG.FNumber
    22.             x = UnsignedRational(vData, IFD.Data)
    23.             IFD.StringData = Format(IFD.Data, "0.0")
    24.         Case enTAG.FocalPlaneXResolution, enTAG.FocalPlaneYResolution, enTAG.XResolution, enTAG.YResolution, enTAG.FocalLength, enTAG.SubjectDistance
    25.             x = UnsignedRational(vData, IFD.Data)
    26.             IFD.StringData = Format(IFD.Data, "0.0")
    27.         Case enTAG.Exposuretime
    28.             x = UnsignedRational(vData, IFD.Data)
    29.             IFD.StringData = Format(1 / IFD.Data, "0")
    30.         Case Else
    31.             If IFD.Length < 2 Then
    32.                 IFD.StringData = UnsignedRational(vData, IFD.Data)
    33.             Else
    34.                 For i = 1 To IFD.Length
    35.                     Call UnsignedRational(Mid(vData, (i - 1) * 8 + 1, 4), x)
    36.                     IFD.StringData = "/" + IFD.StringData + Format(x, "0.000")
    37.                 Next
    38.                 IFD.StringData = Mid(IFD.StringData, 2)
    39.             End If
    40.         End Select
    41.     Case enFormat.signedRationale  'signed rational
    42.         Select Case IFD.ID
    43.         Case enTAG.ShutterSpeedValue
    44.             'convert to shutter speed value
    45.             x = SignedRational(vData, IFD.Data)
    46.             IFD.StringData = Format(2 ^ IFD.Data, "0")
    47.         Case enTAG.ExposureBiasValue
    48.             x = SignedRational(vData, IFD.Data)
    49.             IFD.StringData = Format(IFD.Data, "0.0")
    50.         Case Else
    51.             If IFD.Length < 2 Then
    52.                 IFD.StringData = SignedRational(vData, IFD.Data)
    53.             Else
    54.                 For i = 1 To IFD.Length
    55.                     Call SignedRational(Mid(vData, (i - 1) * 8 + 1, 4), x)
    56.                     IFD.StringData = "/" + IFD.StringData + Format(x, "0.000")
    57.                 Next
    58.                 IFD.StringData = Mid(IFD.StringData, 2)
    59.             End If
    60.         End Select
    61.     Case enFormat.undefined  'undefined
    62.         Select Case IFD.ID
    63.         Case enTAG.MakerNote
    64.             IFD.StringData = ExtractTextOnly(vData)
    65.         Case enTAG.ComponentsConfiguration
    66.             PixOrder = Array("", "Y", "Cb", "Cr", "R", "G", "B")
    67.             For i = 1 To 4
    68.                 IFD.StringData = IFD.StringData + PixOrder(Asc(Mid(vData, i, 1)))
    69.             Next i
    70.         Case enTAG.FileSource, enTAG.SceneType
    71.             IFD.StringData = CStr(BVal(vData, 1, DataLen(IFD.Format), m_Intel))
    72.         Case enTAG.ExifVersion, enTAG.FlashPixVersion
    73.             IFD.StringData = CStr(Val(Left(vData, 2))) + "." + Right(vData, 2)
    74.         Case Else
    75.             IFD.StringData = vData
    76.         End Select
    77.     Case enFormat.signedByte, enFormat.signedLong, enFormat.signedShort    'signed byte, short & long
    78.         IFD.StringData = CStr(BValS(vData, 1, DataLen(IFD.Format), m_Intel))
    79.     Case Else 'all other data types
    80.         IFD.StringData = CStr(BVal(vData, 1, DataLen(IFD.Format), m_Intel))
    81.     End Select
    82.     IFD.StringData = Replace(IFD.StringData, Chr(0), "") 'remove null characters
    83.     'try to read description of data from the ini file
    84.     vData = GetProfileString(m_IniFile, IFD.Name, IFD.StringData)
    85.     sFmt = GetProfileString(m_IniFile, IFD.Name, "Format")
    86.     'if description is found, use it instead of raw data
    87.     If vData <> "" Then IFD.StringData = vData
    88.     If sFmt <> "" Then IFD.StringData = Replace(sFmt, "@X", IFD.StringData)
    89. End Sub
    90.  
    91. '--- Parses a single EXIF directory record (IFD), returns an offset to the next IFD ---
    92. Private Function ParseIDF(sJPEG_Header As String, HeaderStart As Long, Offset As Long, ClosingTag As enTAG) As Long
    93.     Dim lPos As Long, NoOfRecs As Long, i As Integer, u
    94.     lPos = HeaderStart + Offset 'get the starting offset position
    95.     NoOfRecs = BVal(sJPEG_Header, lPos, 2, m_Intel) 'get the No of records in the IFD
    96.     u = UBound(IFD)
    97.     ReDim Preserve IFD(u + NoOfRecs) 'redimension the IFD array
    98.     lPos = lPos + 2
    99.     'begin retrieving the tags
    100.     For i = u + 1 To u + NoOfRecs
    101.         IFD(i).ID = BVal(sJPEG_Header, lPos, 2, m_Intel) 'first 2 bytes contain the tag ID
    102.         IFD(i).Format = BVal(sJPEG_Header, lPos + 2, 2, m_Intel) 'next 2 bytes contain the tag data format
    103.         IFD(i).Length = BVal(sJPEG_Header, lPos + 4, 4, m_Intel) 'next 4 bytes contain the No of data components
    104.         IFD(i).Data = BVal(sJPEG_Header, lPos + 8, 4, m_Intel) 'next 4 bytes contain the data or an offset to the data
    105.         IFD(i).Name = GetTagName(IFD(i).ID) 'retrieve the tag name in human readable format
    106.         Call GetStringData(sJPEG_Header, IFD(i), HeaderStart, lPos) 'retrieve the data as a string
    107.         lPos = lPos + 12 'get the offset to the next tag
    108.         If IFD(i).ID = ClosingTag Then
    109.             ParseIDF = Val(IFD(i).StringData) 'return offset to the next sub IFD
    110.         End If
    111.     Next
    112. End Function
    113.  
    114.  
    115. '======== byte hadling functions ==========
    116.  
    117. '--- returns calculated unsigned value of a byte sequence ---
    118. Private Function BVal(sData As String, start As Long, ByVal Length As Integer, m_Intel As Boolean) As Variant
    119.     Dim i As Long, st As Long, en As Long, step As Integer, n As Long
    120.    
    121.     If Not m_Intel Then 'Motorola byte alignment
    122.         st = start + Length - 1
    123.         en = start
    124.         step = -1
    125.     Else                 'Intel byte alignment
    126.         st = start
    127.         en = start + Length - 1
    128.         step = 1
    129.     End If
    130.     For i = st To en Step step
    131.         BVal = BVal + Asc(Mid(sData, i, 1)) * 256 ^ n
    132.         n = n + 1
    133.     Next
    134. End Function
    135.  
    136. '--- returns calculated signed value of a byte sequence ---
    137. Private Function BValS(sData As String, start As Long, ByVal Length As Integer, m_Intel As Boolean) As Variant
    138.     Dim dn As Variant
    139.     dn = 2 ^ (8 * Length - 1)
    140.     BValS = BVal(sData, start, Length, m_Intel)
    141.     If BValS > (dn - 1) Then BValS = Not (BValS - dn)
    142. End Function
    143.  
    144. '--- returns a string containing an unsigned rational value in the format Numerator/Denumerator;
    145. '- also calculates its numeric value
    146. Private Function UnsignedRational(ByVal vData As String, ByRef NumValue As Variant) As String
    147.     Dim Num As Double, Denum As Double, Rational As Double
    148.     Num = BVal(vData, 1, 4, m_Intel)
    149.     Denum = BVal(vData, 5, 4, m_Intel)
    150.     If Denum <> 0 Then NumValue = Num / Denum
    151.     UnsignedRational = CStr(Num) + "/" + CStr(Denum)
    152. End Function
    153.  
    154. '--- returns a string containing a signed rational value in the format Numerator/Denumerator;
    155. '- also calculates its numeric value
    156. Private Function SignedRational(ByVal vData As String, ByRef NumValue As Variant) As String
    157.     Dim Num As Double, Denum As Double, Rational As Double
    158.     Num = BValS(vData, 1, 4, m_Intel)
    159.     Denum = BValS(vData, 5, 4, m_Intel)
    160.     If Denum <> 0 Then NumValue = Num / Denum
    161.     SignedRational = CStr(Num) + "/" + CStr(Denum)
    162. End Function
    163.  
    164. '--- Reads and returns a string from a file on the disk ---
    165. Private Function ReadFile(ByVal sFilePath As String, Optional iLen = 0) As String
    166.     Dim F As Long
    167.     Dim S As String
    168.     On Error Resume Next
    169.     If FileLen(sFilePath) < 1 Then
    170.         ReadFile = ""
    171.     Else
    172.         F = FreeFile
    173.         Open sFilePath For Binary Access Read As #F
    174.         If iLen = 0 Then S = Space$(LOF(F)) Else S = Space$(iLen)
    175.         Get #F, , S
    176.         Close #F
    177.         ReadFile = S
    178.         S = ""
    179.     End If
    180. End Function
    181.  
    182. '--- Reads a value from an .INI file ---
    183. Private Function GetProfileString(ByVal sFile As String, ByVal sSection As String, ByVal sKey As String, Optional ByVal DefaultValue = "") As String
    184.     Dim sTmp As String, x As Long
    185.     Const StringSize = 1024
    186.     sTmp = Space$(StringSize)
    187.     x = GetPrivateProfileString(sSection, sKey, "", sTmp, StringSize, sFile)
    188.     sTmp = Trim$(sTmp)
    189.     sTmp = Left(sTmp, Len(sTmp) - 1)
    190.     If sTmp = "" Then sTmp = DefaultValue
    191.     GetProfileString = sTmp
    192. End Function
    193.  
    194. '--- Returns only the ascii characters from a byte sequence ---
    195. Private Function ExtractTextOnly(S As String) As String
    196.     Dim i As Integer, l As Integer, c As String * 1
    197.     l = Len(S)
    198.     For i = 1 To l
    199.         c = Mid(S, i, 1)
    200.         If Asc(c) > 31 And Asc(c) < 128 Then ExtractTextOnly = ExtractTextOnly + c
    201.     Next i
    202. End Function
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  3. #3

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    and YET another small part :|

    VB Code:
    1. '--- initializes arrays and other variables ---
    2. Private Sub Class_Initialize()
    3.     m_IniFile = App.Path
    4.     If Right(m_IniFile, 1) <> "\" Then m_IniFile = m_IniFile + "\"
    5.     m_IniFile = m_IniFile + "exif.ini"
    6.     DataLen = Array(0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8)
    7.     IDNo = Array(270, 271, 272, 274, 282, 283, 296, 305, 306, 318, 319, 529, 531, 532, 33432, 34665, 33434, 33437, 34850, 34855, 36864, 36867, 36868, 37121, 37122, 37377, 37378, 37379, 37380, 37381, 37382, 37383, 37384, 37385, 37386, 37500, 37510, 37520, 37521, 37522, 40960, 40961, 40962, 40963, 40964, 40965, 41486, 41487, 41488, 41493, 41495, 41728, 41729, 41730)
    8.     IDName = Array("ImageDescription", "Make", "Model", "Orientation", "XResolution", "YResolution", "ResolutionUnit", "Software", "DateTime", "WhitePoint", "PrimaryChromaticities", "YCbCrCoefficients", "YCbCrPositioning", "ReferenceBlackWhite", "Copyright", "ExifOffset", _
    9.       "ExposureTime", "FNumber", "ExposureProgram", "ISOSpeedRatings", "ExifVersion", "DateTimeOriginal", "DateTimeDigitized", "ComponentsConfiguration", "CompressedBitsPerPixel", "ShutterSpeedValue", "ApertureValue", "BrightnessValue", "ExposureBiasValue", "MaxApertureValue", "SubjectDistance", "MeteringMode", "LightSource", "Flash", "FocalLength", "MakerNote", "UserComment", "SubsecTime", "SubsecTimeOriginal", "SubsecTimeDigitized", "FlashPixVersion", "ColorSpace", "ExifImageWidth", "ExifImageHeight", "RelatedSoundFile", "ExifInteroperabilityOffset", "FocalPlaneXResolution", "FocalPlaneYResolution", "FocalPlaneResolutionUnit", "ExposureIndex", "SensingMethod", "FileSource", "SceneType", "CFAPattern")
    10. End Sub
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  4. #4
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    how about something like this ...
    VB Code:
    1. [Color=Blue]Dim[/color] img [Color=Blue]As[/color] Image = Image.FromFile("F:\the twins\DCP_0626.jpg")
    2.         [Color=Blue]Dim[/color] propitems [Color=Blue]As[/color] Imaging.PropertyItem() = img.PropertyItems
    3.         [Color=Blue]Dim[/color] pi [Color=Blue]As[/color] Imaging.PropertyItem
    4.         [Color=Blue]Dim[/color] b() [Color=Blue]As[/color] [Color=Blue]Byte
    5.  
    6. [/color]        [Color=Blue]For[/color] [Color=Blue]Each[/color] pi [Color=Blue]In[/color] propitems
    7.  
    8.             [Color=Blue]If[/color] pi.Id = 271 [Color=Blue]Then
    9. [/color]                b = pi.Value
    10.                 MessageBox.Show("Manufacturer of Camera : " & System.Text.Encoding.ASCII.GetString(b) & Environment.NewLine)
    11.             [Color=Blue]ElseIf[/color] pi.Id = 272 [Color=Blue]Then
    12. [/color]                b = pi.Value
    13.                 MessageBox.Show("Make of Camera : " & System.Text.Encoding.ASCII.GetString(b) & Environment.NewLine)
    14.             [Color=Blue]ElseIf[/color] pi.Id = 36867 [Color=Blue]Then
    15. [/color]                b = pi.Value
    16.                 MessageBox.Show("Time Photo Taken : " & System.Text.Encoding.ASCII.GetString(b) & Environment.NewLine)
    17.             [Color=Blue]End[/color] [Color=Blue]If
    18. [/color]        [Color=Blue]Next[/color]
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  5. #5

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    You are a fcking genius
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  6. #6
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    if you just want the date taken .....
    VB Code:
    1. Dim img As Image = Image.FromFile("F:\the twins\DCP_0626.jpg")
    2.         Dim propitem As Imaging.PropertyItem = img.GetPropertyItem(36867)
    3.         MessageBox.Show("Time Photo Taken : " & System.Text.Encoding.ASCII.GetString(propitem.Value))
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width