/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
læse comment fra jpg-filer
Fra : Thomas Smedebøl


Dato : 22-07-04 17:33

Jeg vil gerne udtage comment fra en række jpeg-billeder. Indtil videre har
jeg fundet nedenstående funktion, som kan bruges til at udtage dimensionerne
på jpg-billedet, men jeg er sikker på det må kunne bruges til at tage
comment ud med. Jeg har også fundet ud af at markeren for comment er FFFE.

Men hvordan kommer jeg videre?

Mvh Thomas




Comment marker (FFFE)

a.. The first two bytes, the length, after the marker indicate the number
of bytes, including the two length bytes, that this header contains




Function GetJPGDimensions(sFile)

Set fso = CreateObject("Scripting.FileSystemObject")

Set f = fso.OpenTextFile(sFile)

Z = Hex(Asc(f.Read(1)))

Z = Z & Hex(Asc(f.Read(1)))

If Z = "FFD8" Then

While Not blExit

Do Until Z = "FF"

Z = Hex(Asc(f.Read(1)))

Loop

Z = Hex(Asc(f.Read(1)))

If Z >= "C0" And Z <= "C3" Then

Z = Asc(f.Read(1))

Z = Asc(f.Read(1))

Z = Asc(f.Read(1))

a = Asc(f.Read(1))

b = Asc(f.Read(1))

c = Asc(f.Read(1))

d = Asc(f.Read(1))

ImgHeight = CInt(a * 256 + b)

ImgWidth = CInt(c * 256 + D)

blExit = True

Else

If Z = "DA" Then

blExit = True

Else

E = Asc(f.Read(1))

x = Asc(f.Read(1))

MarkerLen = (E * 256 + x) - 2

Dim marker, i

i = 0

Do Until i = MarkerLen

marker = marker & 0

i = i + 1

Loop

Z = f.Read(marker)

End If

End If

Wend

End If

f.Close

Set fso = Nothing

End Function



 
 
Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408527
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste