当前位置: 首页 > 图文教程 > 网络编程 > ASP > 判断gif图像尺寸的方法

ASP
将Recordset作为XML保存
在ASP中过滤用户输入 提高安全性
改进 ASP 应用程序中的字符串处理性能
在ASP中使用事务控制
在access中增加农历支持模块
用ADODB.Stream代替FSO读取文本文件
处理运行时间长的脚本以及内容大的主页
用ASP编程实现快速查找
Asp中代码与页面的分离
通过ASP自动解压RAR文件
如何正确处理数据库中的Null
采用XML数据来填充ASP表单
ASP整合的一个SQL语句类
在基于Mozilla的浏览器中使用XMLHttpRequest对象
巧用in关键字实现数据的批量删除
ASP中函数调用对参数的影响
加密处理使密码更安全[CFS编码加密]
ASP错误的几种常规处理方式
在ASP程序中执行SQL语句的安全性问题
ASP实用技巧28则

ASP 中的 判断gif图像尺寸的方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 40 ::
收藏到网摘: n/a

  这里是我根据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 )
    

%>