欢迎光临
我们一直在努力

用JPEG文件EXIF信息ASP版本(5)-ASP教程,ASP应用

建站超值云服务器,限时71元/月

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 11))

for j = 0 to ifddirectory(k)(ifd_idx_components) – 1

ifddirectory(k)(ifd_idx_value) = ifddirectory(k)(ifd_idx_value) & chr(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + j))

next

end if

case m_short, m_sshort

bytespercomponent = 2

if ifddirectory(k)(ifd_idx_components) * bytespercomponent <= 4 then

ifddirectory(k)(ifd_idx_value) = _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 8)) * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 9)) + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 10)) * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 11))

else

ifddirectory(k)(ifd_idx_offsettovalue) = _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 8)) * 256 * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 9)) * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 10)) * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 11))

for j = ifddirectory(k)(ifd_idx_components) – 1 to 0 step -1

ifddirectory(k)(ifd_idx_value) = ifddirectory(k)(ifd_idx_value) & exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + j)

next

end if

case m_long, m_slong

bytespercomponent = 4

if ifddirectory(k)(ifd_idx_components) * bytespercomponent <= 4 then

ifddirectory(k)(ifd_idx_value) = _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 8)) * 256 * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 9)) * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 10)) * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 11))

else

ifddirectory(k)(ifd_idx_offsettovalue) = _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 8)) * 256 * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 9)) * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 10)) * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 11))

for j = 0 to ifddirectory(k)(ifd_idx_components) – 1

ifddirectory(k)(ifd_idx_value) = ifddirectory(k)(ifd_idx_value) & exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + j)

next

end if

case m_rational, m_srational

bytespercomponent = 8

ifddirectory(k)(ifd_idx_offsettovalue) = _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 8)) * 256 * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 9)) * 256 * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 10)) * 256 + _

hextodec(exiftemp((offset + 2) + ((i – 1) * 12) + 11))

ifddirectory(k)(ifd_idx_value) = _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 0)) * 256 * 256 * 256 + _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 1)) * 256 * 256 + _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 2)) * 256 + _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 3)) & _

"/" & _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 4)) * 256 * 256 * 256 + _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 5)) * 256 * 256 + _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 6)) * 256 + _

hextodec(exiftemp(offset_to_tiff + ifddirectory(k)(ifd_idx_offsettovalue) + 7))

end select

end if

if ifddirectory(k)(ifd_idx_tag_no) = makernote then

offset_to_makernote = ifddirectory(k)(ifd_idx_offsettovalue)

end if

if ifddirectory(k)(ifd_idx_tag_no) = exifoffset then

offset_to_exifsubifd = clng(ifddirectory(k)(ifd_idx_value))

debug.print "offset_to_exifsubifd: " & offset_to_exifsubifd

end if

ifddirectory(k)(ifd_idx_tag_name) = lookupexiftag(ifddirectory(k)(ifd_idx_tag_no))

next

if isintel then

if not processed_exifsubifd then

offset_to_next_ifd = _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 3)) * 256 * 256 * 256 + _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 2)) * 256 * 256 + _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 1)) * 256 + _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 0))

debug.print "offset_to_next_ifd: " & offset_to_next_ifd

else

offset_to_next_ifd = 0

end if

else

if not processed_exifsubifd then

offset_to_next_ifd = _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 0)) * 256 * 256 * 256 + _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 1)) * 256 * 256 + _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 2)) * 256 + _

hextodec(exiftemp(offset + 2 + (no_of_entries * 12) + 3))

debug.print "offset_to_next_ifd: " & offset_to_next_ifd

else

offset_to_next_ifd = 0

end if

end if

if offset_to_next_ifd = 0 and processed_exifsubifd = false then

offset_to_next_ifd = offset_to_exifsubifd

processed_exifsubifd = true

end if

offset = offset_to_tiff + offset_to_next_ifd

loop while offset_to_next_ifd <> 0

if offset_to_makernote <> 0 then

processmakernote offset_to_makernote + offset_to_tiff

end if

end sub

function hextodec(strhex)

dim lngresult

dim intindex

dim strdigit

dim intdigit

dim intvalue

lngresult = 0

for intindex = len(strhex) to 1 step -1

strdigit = mid(strhex, intindex, 1)

intdigit = instr("0123456789abcdef", ucase(strdigit))-1

if intdigit >= 0 then

intvalue = intdigit * (16 ^ (len(strhex)-intindex))

lngresult = lngresult + intvalue

else

lngresult = 0

intindex = 0 stop the loop

end if

next

hextodec = lngresult

end function

function hex2ascii(strhex)

dim i

for i = 1 to len(strhex) step 2

hex2ascii = hex2ascii & chr(eval("&h" & mid(strhex, i, 2)))

next

end function

function makesenseofmeaninglessvalues()

dim x

for x = 0 to ubound(ifddirectory) – 1

select case ifddirectory(x)(ifd_idx_tag_name)

case "orientation"

dim orientationtagvalues

orientationtagvalues = array("undefined","normal","flip horizontal", "rotate 180", "flip vertical", "transpose", "rotate 90", "transverse", "rotate 270")

if ifddirectory(x)(ifd_idx_value)>=0 and ifddirectory(x)(ifd_idx_value)<ubound(orientationtagvalues) then

ifddirectory(x)(ifd_idx_value_desc) = orientationtagvalues(ifddirectory(x)(ifd_idx_value))

end if

end select

next

end function

function hextobinary(bthex)

function converts a single hex value into its binary equivalent

written by: mark jager

written date: 8/10/2000

free to distribute as long as code is not modified, and header is kept intact

select case bthex

case "0"

hextobinary = "0000"

case "1"

hextobinary = "0001"

case "2"

hextobinary = "0010"

case "3"

hextobinary = "0011"

case "4"

hextobinary = "0100"

case "5"

hextobinary = "0101"

case "6"

hextobinary = "0110"

case "7"

hextobinary = "0111"

case "8"

hextobinary = "1000"

case "9"

hextobinary = "1001"

case "a"

hextobinary = "1010"

case "b"

hextobinary = "1011"

case "c"

hextobinary = "1100"

case "d"

hextobinary = "1101"

case "e"

hextobinary = "1110"

case "f"

hextobinary = "1111"

case else

hextobinary = "2222"

end select

end function

function hexblocktobinary(strhex)

function converts a 8 digit/32 bit hex value to its 32 bit binary equivalent

written by: mark jager

written date: 8/10/2000

free to distribute as long as code is not modified, and header is kept intact

dim intpos

dim strtemp

for intpos = 1 to len(strhex)

strtemp = strtemp & hextobinary(mid(strhex, cint(intpos), 1))

next

hexblocktobinary = strtemp

end function

%>

调用格式

<!–#include file="functions_exif.asp"–>

<%= getexifbyname("date time") %>

<%= getexifbyname("exif image width") %>

<%= getexifbyname("exif image height") %>

组件版到http://dazhou.net/下载

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用JPEG文件EXIF信息ASP版本(5)-ASP教程,ASP应用
分享到: 更多 (0)