⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 z_exif.asp

📁 一个网络相册
💻 ASP
📖 第 1 页 / 共 3 页
字号:
				Else
					IFDDirectory(x)(IFD_IDX_Value_Desc) = "开"
				End If
				TagValues = IFDDirectory(x)(IFD_IDX_Value) \ 2
				If (TagValues Mod 4) = 2 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[无选通返回]"
				ElseIf (TagValues Mod 4) = 3 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[带选通返回]"
				End If
				TagValues = TagValues \ 4
				If (TagValues Mod 4) = 1 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[强制闪光]"
				ElseIf (TagValues Mod 4) = 2 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[强制关闭]"
				ElseIf (TagValues Mod 4) = 3 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[自动闪光]"
				End If
				TagValues = TagValues \ 4
				If (TagValues Mod 2) = 1 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[无闪光灯]"
				End If
				TagValues = TagValues \ 2
				If (TagValues Mod 2) = 1 Then
					IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "[去红眼]"
				End If
			Case "Exposure Bias Value"
				TagValues = Split(IFDDirectory(x)(IFD_IDX_Value),"/")
				If UBound(TagValues) = 1 Then
					If CLng(TagValues(1))<>0 Then
						If CLng(TagValues(0)) > 0 Then 
							IFDDirectory(x)(IFD_IDX_Value_Desc) = "+ "
						ElseIf CLng(TagValues(0)) = 0 then
							IFDDirectory(x)(IFD_IDX_Value_Desc) = "0"
						Else
							IFDDirectory(x)(IFD_IDX_Value_Desc) = "- "
						End If
						If TagValues(0)<>0 Then
							If CLng(Abs(TagValues(0))) < CLng(Abs(TagValues(1))) And CLng(TagValues(0)) <> 0 Then IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "0"
							IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & Round(CLng(Abs(TagValues(0))) / CLng(Abs(TagValues(1))),1)
						End If
						IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & "EV"
					End If
				End if
			Case "Focal Length"
				TagValues = Split(IFDDirectory(x)(IFD_IDX_Value),"/")
				If UBound(TagValues) = 1 Then
					If CLng(TagValues(1))<>0 Then
						IFDDirectory(x)(IFD_IDX_Value_Desc) = Round(CLng(TagValues(0)) / CLng(TagValues(1)),1)
					End If
				End If
				IFDDirectory(x)(IFD_IDX_Value_Desc) = IFDDirectory(x)(IFD_IDX_Value_Desc) & " 毫米"
			End Select
		Next
	End Function 
	
	Public Function ExifAllInfo3()
			ExifAllInfo3 = "<BR>Offset_to_IFD0=" & Offset_to_IFD0
			ExifAllInfo3 = ExifAllInfo3 & "<BR>Offset_to_APP1=" & Offset_to_APP1
			ExifAllInfo3 = ExifAllInfo3 & "<BR>Offset_to_TIFF=" & Offset_to_TIFF
			ExifAllInfo3 = ExifAllInfo3 & "<BR>Length_of_APP1=" & Length_of_APP1
			ExifAllInfo3 = ExifAllInfo3 & "<BR>Offset_to_Next_IFD=" & Offset_to_Next_IFD
			ExifAllInfo3 = ExifAllInfo3 & "<BR>UBound(IFDDirectory)=" & UBound(IFDDirectory)
			ExifAllInfo3 = ExifAllInfo3 & "<BR>Offset_to_ExifSubIFD=" & Offset_to_ExifSubIFD
			ExifAllInfo3 = ExifAllInfo3 & "<BR>ImageFileName=" & ImageFileName
			ExifAllInfo3 = ExifAllInfo3 & "<BR>IsLoaded=" & IsLoaded
			ExifAllInfo3 = ExifAllInfo3 & "<BR>UBound(ExifTemp)=" & UBound(ExifTemp) & "<BR>"
	End Function
	
	Public Function ExifAllInfo()
		ExifAllInfo="<table border=1><tr><th nowrap>#</td><th nowrap>Tag HEX</td><th nowrap>Tag Name</td><th nowrap>Format</td><th nowrap>Size</td><th nowrap>Offset</td><th nowrap>Value</td><th nowrap>Value Described</td></tr>"
		dim x
		for x = 0 to ubound(IFDDirectory) - 1
			ExifAllInfo=ExifAllInfo& "<tr>"
			ExifAllInfo=ExifAllInfo& "<td>" & x & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_Tag_No) & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_Tag_Name) & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_Data_Format) & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_Components) & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_OffsetToValue) & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_Value) & "</td>"
			ExifAllInfo=ExifAllInfo& "<td>" & IFDDirectory(x)(IFD_IDX_Value_Desc) & "</td></tr>"
		next
		ExifAllInfo=ExifAllInfo& "</table>"
	End Function

	Public Function ExifAllInfo2()
		ExifAllInfo2="<BR>"
		dim x
		for x = 0 to ubound(ExifTemp)
			ExifAllInfo2=ExifAllInfo2& ExifTemp(x)&" "
		next
	End Function
End Class

Function GetImageExifInfo(PicURL)
	Dim TempStr, TempSplit
	Dim ExifInfo

	set ExifInfo = new Cls_Exif
	On Error Resume Next
	ExifInfo.ImageFile = Server.MapPath(PicURL)
	If Err<>0 Then
		Err.Clear
		On Error Goto 0
		Set ExifInfo = Nothing
		GetImageExifInfo = ""
		Exit Function
	Else
		On Error Goto 0
	End if
	if ExifInfo.hasExifInfo() and ExifInfo.GetExifByName("Camera Make")<>"" then
		TempStr = ExifInfo.GetExifByName("Camera Make")
		GetImageExifInfo = ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Camera Model")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Date Time Original")
		If Left(TempStr, 4) = "0000" Then
			TempStr = ExifInfo.GetExifByName("Date Time Digitized")
		End If
		If Left(TempStr, 4) = "0000" Then
			TempStr = ExifInfo.GetExifByName("Date Time")
		End If
		If Left(TempStr, 4) = "0000" Then
			TempStr = ""
		End If
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Exif Image Width")
		TempSplit = ExifInfo.GetExifByName("Exif Image Height")
		if TempStr <> "" and TempSplit<>"" then
			TempStr = TempStr & " * " & TempSplit
		else
			TempStr = ""
		end if
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Software")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("ISO Speed Ratings")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("FStop")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Exposure Time")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Flash")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Exposure Bias Value")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Focal Length")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
		TempStr = ExifInfo.GetExifByName("Metering Mode")
		GetImageExifInfo = GetImageExifInfo & "|" & ExifItem(TempStr)
	else
		GetImageExifInfo = ""
	end if
	Set ExifInfo = Nothing
End Function

Function ExifItem(ItemValue)
	if ItemValue <> "" then
		ExifItem = ExifItem & Server.HtmlEnCode(ItemValue)
	else
		ExifItem = ExifItem & "未知"
	end if
End Function

Function Dv_UbbCode_Exif(strText,PostUserGroup,Flag,MaxLoopCount,FileTypeImage,abgcolor)
	Dim re
	Dim Test
	Dim LoopCount
	Dim s
	Dim ExifInfo,ExifSplit
	Dim TemplateHTML_1,TemplateHTML_2
	
	If abgcolor="" Or IsNull(abgcolor) Then abgcolor="TableBody1"
	TemplateHTML_1="<Table border='0' cellspacing='1' cellpadding='2' class='tableborder1' style='width:90%;'><tr height='18'>" & _
		"<td class='{$abgcolor}' align='right'>相机品牌:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$CameraMake}</b></td>" & _
		"<td class='{$abgcolor}' align='right'>相机型号:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$CameraModel}</b></td>" & _
		"</tr><tr height='18'>" & _
		"<td class='{$abgcolor}' align='right'>拍摄时间:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$DateTime}</b></td>" & _
		"<td class='{$abgcolor}' align='right'>照片尺寸:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$ImageDimension}</b></td>" & _
		"</tr><tr height='18'>" & _
		"<td class='{$abgcolor}' align='right'>编辑工具:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$Software}</b></td>" & _
		"<td class='{$abgcolor}' align='right'>ISO速度:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$ISOSpeed}</b></td>" & _
		"</tr><tr height='18'>" & _
		"<td class='{$abgcolor}' align='right'>光圈:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$FStop}</b></td>" & _
		"<td class='{$abgcolor}' align='right'>曝光时间:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$ExposureTime}</b></td>" & _
		"</tr><tr height='18'>" & _
		"<td class='{$abgcolor}' align='right'>闪光灯:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$Flash}</b></td>" & _
		"<td class='{$abgcolor}' align='right'>曝光补偿:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$ExposureBias}</b></td>" & _
		"</tr><tr height='18'>" & _
		"<td class='{$abgcolor}' align='right'>焦距:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$FocalLength}</b></td>" & _
		"<td class='{$abgcolor}' align='right'>测距模式:</td><td class='{$abgcolor}' align='left'>&nbsp;<b>{$MeteringMode}</b></td>" & _
		"</tr></table>"
	TemplateHTML_2="相机品牌:{$CameraMake}" & DvbbsCrLf & _
		"相机型号:{$CameraModel}" & DvbbsCrLf & _
		"拍摄时间:{$DateTime}" & DvbbsCrLf & _
		"照片尺寸:{$ImageDimension}" & DvbbsCrLf & _
		"编辑工具:{$Software}" & DvbbsCrLf & _
		"ISO速度:{$ISOSpeed}" & DvbbsCrLf & _
		"光圈:{$FStop}" & DvbbsCrLf & _
		"曝光时间:{$ExposureTime}" & DvbbsCrLf & _
		"闪光灯:{$Flash}" & DvbbsCrLf & _
		"曝光补偿:{$ExposureBias}" & DvbbsCrLf & _
		"焦距:{$FocalLength}" & DvbbsCrLf & _
		"测距模式:{$MeteringMode}"
	
	If Instr(1,"," & ExifBoardList & ",", "," & Dvbbs.BoardID & ",") <= 0 Then
		Dv_UbbCode_Exif = strText
		Exit Function
	End If
	Set re=new RegExp
	re.IgnoreCase =True
	re.Global=True
	s=strText
	re.Pattern="\[UPLOAD=jpg\]UploadFile/"
	s=re.replace(s, chr(1) & "UPLOAD=jpg" & chr(2))
	re.Pattern="\[\/UPLOAD\]"
	s=re.replace(s, chr(1) & "/UPLOAD" & chr(2))
	re.Pattern="\x01UPLOAD=jpg\x02\x01\/UPLOAD\x02"
	s=re.Replace(s,"")
	LoopCount=0
	re.Pattern="(^.*)(\x01UPLOAD=jpg\x02)(.[^\x01]*)(\x01\/UPLOAD\x02)(.*)"
	Test=re.Test(s)
	if Test then
		do while true
			if Flag = 1 or PostUserGroup<4 then
				re.Pattern="(^.*)(\x01UPLOAD=jpg\x02)(.[^\x01]*)(\x01\/UPLOAD\x02)(.*)"
				Test=re.Test(s)
				if not Test then 
					re.Pattern="\x02"
					s=re.replace(s, "]")
					re.Pattern="\x01"
					s=re.replace(s, "[")
					exit do
				else
					ExifInfo=GetExifFromUpfile(re.Replace(s,"$3"))
					If ExifInfo="" And ExifOldUpload=1 Then ExifInfo=GetImageExifInfo(re.Replace(s,Dvbbs.Forum_Setting(76)&"$3"))
					If ExifInfo<>"" Then
						ExifSplit=Split(ExifInfo,"|")
						If ExifShowMode <> 0 Then
							ExifInfo=TemplateHTML_1
						Else
							ExifInfo=TemplateHTML_2
						End If
						ExifInfo=Replace(ExifInfo,"{$abgcolor}",abgcolor)
						ExifInfo=Replace(ExifInfo,"{$CameraMake}",ExifSplit(0))
						ExifInfo=Replace(ExifInfo,"{$CameraModel}",ExifSplit(1))
						ExifInfo=Replace(ExifInfo,"{$DateTime}",ExifSplit(2))
						ExifInfo=Replace(ExifInfo,"{$ImageDimension}",ExifSplit(3))
						ExifInfo=Replace(ExifInfo,"{$Software}",ExifSplit(4))
						ExifInfo=Replace(ExifInfo,"{$ISOSpeed}",ExifSplit(5))
						ExifInfo=Replace(ExifInfo,"{$FStop}",ExifSplit(6))
						ExifInfo=Replace(ExifInfo,"{$ExposureTime}",ExifSplit(7))
						ExifInfo=Replace(ExifInfo,"{$Flash}",ExifSplit(8))
						ExifInfo=Replace(ExifInfo,"{$ExposureBias}",ExifSplit(9))
						ExifInfo=Replace(ExifInfo,"{$FocalLength}",ExifSplit(10))
						ExifInfo=Replace(ExifInfo,"{$MeteringMode}",ExifSplit(11))
					End If
					If Dvbbs.Forum_Setting(75)="0" Then 
						If Flag = 1 or PostUserGroup<4 Then
							if ExifInfo<>"" then
								if ExifShowMode <> 0 Then
									s=re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0>此主题相关图片如下:<br><A HREF="""&Dvbbs.Forum_Setting(76)&"$3"" TARGET=_blank id=""ImgSpan""><IMG SRC="""&Dvbbs.Forum_Setting(76)&"$3"" border=0 alt=""按此在新窗口浏览图片"" style=""FILTER:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=5);""></A><BR>该图片EXIF信息如下:<br>"&ExifInfo&"<br>$5")
								else
									s=re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0>此主题相关图片如下:<br><A HREF="""&Dvbbs.Forum_Setting(76)&"$3"" TARGET=_blank id=""ImgSpan""><IMG SRC="""&Dvbbs.Forum_Setting(76)&"$3"" border=0 alt=""该图片EXIF信息如下:"&DvbbsCrLf&ExifInfo&DvbbsCrLf&"按此在新窗口浏览图片"" style=""FILTER:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=5);""></A>$5")
								End If
							else
								s=re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0>此主题相关图片如下:<br><A HREF="""&Dvbbs.Forum_Setting(76)&"$3"" TARGET=_blank id=""ImgSpan""><IMG SRC="""&Dvbbs.Forum_Setting(76)&"$3"" border=0 alt=""该图片EXIF信息如下:"&DvbbsCrLf&ExifInfo&DvbbsCrLf&"按此在新窗口浏览图片"" style=""FILTER:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=5);""></A>$5")
							end if
						Else
							s= re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0 ><A HREF="""&Dvbbs.Forum_Setting(76)&"$3"" TARGET=_blank>"&Dvbbs.Forum_Setting(76)&"$3</A>$5")
						End If 
					Else
						If Flag = 1 or PostUserGroup<4 Then
							if ExifInfo<>"" then
								if ExifShowMode <> 0 Then
									s=re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0>此主题相关图片如下:<br><A HREF=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" TARGET=_blank id=""ImgSpan"" ><IMG SRC=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" border=0 alt=""按此在新窗口浏览图片"" style=""FILTER:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=5);""></A><BR>该图片EXIF信息如下:<br>"&ExifInfo&"<br>$5")
								else
									s=re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0>此主题相关图片如下:<br><A HREF=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" TARGET=_blank id=""ImgSpan"" ><IMG SRC=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" border=0 alt=""该图片EXIF信息如下:"&DvbbsCrLf&ExifInfo&DvbbsCrLf&"按此在新窗口浏览图片"" style=""FILTER:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=5);""></A>$5")
								End If
							else
								s=re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0>此主题相关图片如下:<br><A HREF=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" TARGET=_blank id=""ImgSpan"" ><IMG SRC=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" border=0 alt=""按此在新窗口浏览图片"" style=""FILTER:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=5></A>$5")
							end if
						Else
							s= re.Replace(s,"$1<br><IMG SRC="""&FileTypeImage&""" border=0 ><A HREF=""showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3"" TARGET=_blank>showimg.asp?BoardID="&Dvbbs.BoardID&"&filename=$3</A>$5")
						End If
					End If
				end if
			else
				re.Pattern="\x01UPLOAD=jpg\x02(.[^\x01]*)\x01\/UPLOAD\x02"
				Test=re.Test(s)
				if not Test then 
					re.Pattern="\x02"
					s=re.replace(s, "]")
					re.Pattern="\x01"
					s=re.replace(s, "[")
					exit do
				else
					s= re.Replace(s,"<br><IMG SRC="""&FileTypeImage&""" border=0><A HREF=""$1"" TARGET=_blank>$1</A>")
				end if
			end if
			LoopCount=LoopCount+1
			If LoopCount>MaxLoopCount Then Exit Do
		loop
	end if
	re.Pattern="\x02"
	s=re.replace(s, "]")
	re.Pattern="\x01"
	s=re.replace(s, "[")
	Dv_UbbCode_Exif=s
End Function

Function GetExifFromUpfile(F_FileName)
	Dim Rs

	Set Rs=Dvbbs.Execute("SELECT TOP 1 F_DownUser FROM DV_Upfile WHERE F_FileName='"&F_FileName&"'")
	If Rs.Eof Or Rs.Bof Then
		GetExifFromUpfile=""
	Else
		GetExifFromUpfile=Rs(0)
	End If
	Rs.Close
	Set Rs=Nothing
End Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -