最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 图片处理函数 获取类型 扩展名
时间:2022-06-24 20:12:12 编辑:袖梨 来源:一聚教程网
image_type=image_type_to_mime_type(imagetype_png); //获取png的mime类型
echo $image_type; //输出结果
//
$file = '1.jpg';
$image = imagecreatefromjpeg($file);
header('content-type: ' . image_type_to_mime_type(imagetype_wbmp));
$fp=fopen($file,r);
fpassthru($fp);
image2wbmp($image,"1.bmp"); // output the stream directly
//image_type_to_extension. (php教程 5). image_type_to_extension — 取得图像类型的文件 后缀 ... warning. 本函数暂无文档
$file_ext=image_type_to_extension("1.jpg");
echo $file_ext;
//
$filename="1.jpg"; //定义图像文件
$size=getimagesize($filename); //获取图像的大小
$fp=fopen($filename,"rb"); //打开文件
if($size && $fp) //如果成功打开
{
header("content-type: {$size['mime']}"); //输出文件头信息
fpassthru($fp); //输出文件内容
exit; //中止操作
}
else
{
echo "文件打开失败,或者指定的不是图像文件"; //输出错误信息
}
相关文章
- 小小影院电视剧在线观看-热门剧集免费高清播放 01-29
- 王者荣耀王昭君高清美图壁纸-王者荣耀最新王昭君美图无水印分享 01-29
- 大学生英语四六级考试成绩查询官网-四六级考试报名官方入口 01-29
- 螃蟹代售-螃蟹交易网官网登录入口 01-29
- 螃蟹账号平台-官网app下载-螃蟹账号交易平台-网最新官网 01-29
- 麻花豆国产MV在线观看:全网热门资源一站式搜罗 01-29