JPG picture size...(Adobe) *Solved*
How can I find out what size a JPG picture has without opening it up in a Image controll or Picture controll. The picture is saved in Adobe Photo Shop 6.X. If I save it in a PSP or something I can do something like this to find the size.
VB Code:
Public Type ThePicInfo
Type As String
Width As Long
Height As Long
End Type
Private Function CheckPicSpecs(TheFile) As ThePicInfo
Dim TheContent, TheImageInfo As ThePicInfo, TheVar, TheFreeFile
TheFreeFile = FreeFile
Open TheFile For Binary As TheFreeFile
TheContent = Input(10, TheFreeFile)
Close TheFreeFile
If Mid(TheContent, 7, 4) = "JFIF" Then
TheImageInfo.Type = "JPG"
Open TheFile For Binary As TheFreeFile
TheContent = Input(167, TheFreeFile)
Close TheFreeFile
TheImageInfo.Height = Asc(Mid(TheContent, 165, 1)) + 256 * Asc(Mid(TheContent, 164, 1))
TheImageInfo.Width = Asc(Mid(TheContent, 167, 1)) + 256 * Asc(Mid(TheContent, 166, 1))
End If
If Mid(TheContent, 1, 3) = "GIF" Then
TheImageInfo.Type = "GIF"
TheImageInfo.Width = Asc(Mid(TheContent, 7, 1)) + 256 * Asc(Mid(TheContent, 8, 1))
TheImageInfo.Height = Asc(Mid(TheContent, 9, 1)) + 256 * Asc(Mid(TheContent, 10, 1))
End If
CheckPicSpecs = TheImageInfo
End Function
but that want help with the files saved in Adbobe. Any help?
The pictures look like this.
http://www.klubbscenen.com/party_bil...07/ren7_01.jpg
Thanks in advance...
Re: JPG picture size...(Adobe) *Solved*
can anyone translate that to ASP???
Re: JPG picture size...(Adobe) *Solved*
Just as a note if anyone does it. You need to remember to close the file if this line valid to true:
If Header <> "FFD8" Then Exit Function
if not you might get problems. I fixed that later on in my code but didn't think about updating this thread..:)
Re: JPG picture size...(Adobe) *Solved*
Quote:
Originally Posted by NoteMe
Just as a note if anyone does it. You need to remember to close the file if this line valid to true:
If Header <> "FFD8" Then Exit Function
if not you might get problems. I fixed that later on in my code but didn't think about updating this thread..:)
Hi NoteMe
I´m having this kind of problem, I think....
My header come with Header = Header & Hex$(bChar) as 424D, not FFD8.
My pictures size are most from 100K, 200K.....
Now after several hours I found your solution to close the JPG but I need to use it in the image(n).picture.
Could you help to show how to close the file, or how yo solved your problem?
Thanks a lot..
Ivan