"hoffmcs" wrote:
There is no way to determine this from the SDK. Most photo providers give this information in their APIs.
Function GetJpegDimensions(jpeg as Object) as Dynamic
if jpeg[0] <> &HFF or jpeg[1] <> &HD8 then return invalid
i = 2
w = 0
h = 0
len = jpeg.Count()
while true
soi1 = jpeg[i]
soi2 = jpeg[i+1]
if soi1 = &HFF and (soi2 = &HC0 or soi2 = &HC2) then
h = jpeg[i+5]*256 + jpeg[i+6]
w = jpeg[i+7]*256 + jpeg[i+8]
exit while
end if
cnt = jpeg[i+2]*256 + jpeg[i+3]
i = i + cnt + 2
if i >= len then
print "Could not find jpeg dimensions!!!"
return invalid
end if
end while
return {w:w,h:h}
End Function
"renojim" wrote:
For jpegs, pass an roByteArray: