欢迎光临
我们一直在努力

判断gif图像尺寸的方法

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

这里是我根据gif图像格式想出来的判断gif图像尺寸的方法,请大家给点意见

up.htm

<html>

<body>

<form action="up.asp" enctype="multipart/form-data" method="post">

<table border=0 width=100% cellspacing="0">

<tr>

<td width="30%">请选择您要上传的gif图片:</td>

<td width="70%"><input type="file" name="pic" style="font-size:10pt;"></td>

</tr>

</table>

<p align="center"><input type="submit" value="提交" style="font-size:9pt;background-color:#54b060;color:white;">

</form>

</body>

</html>

up.asp

<%

formsize = request.totalbytes

formdata = request.binaryread( formsize )

bncrlf=chrb(13) & chrb(10)

divider=leftb(formdata,instrb(formdata,bncrlf)-1)

datastart=instrb(formdata,bncrlf & bncrlf)+4

dataend=instrb(datastart+1,formdata,divider)-datastart

image=midb(formdata,datastart,dataend)

head_version = ascb( midb( image,1,3 ) )

head_subversion = ascb( midb( image,4,3 ) )

head_width_l = ascb( midb( image,7,1 ) )

head_width_h = ascb( midb( image,8,1 ) )

head_height_l = ascb( midb( image,9,1 ) )

head_height_h = ascb( midb( image,10,1 ) )

head_colors = ascb( midb( image, 11, 1 ) )

head_width_h = head_width_h * 256

head_height_h = head_height_h * 256

head_colors = head_colors and &h07

response.write "图像大小为" & head_width_h + head_width_l & "x" & head_height_h + head_height_l _

& "x" & 2^( head_colors + 1 )

%>

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