PHP获取Exif缩略图的方法

yipeiwu_com6年前PHP代码库

本文实例讲述了PHP获取Exif缩略图的方法。分享给大家供大家参考。具体实现方法如下:

// file to read
$file = 'test.jpg';
$image = exif_thumbnail($file, $width, $height, $type);
// width, height and type get filled with data
// after calling "exif_thumbnail"
if ($image) {
  // send header and image data to the browser:
  header('Content-type: ' .image_type_to_mime_type($type));
  print $image;
}
else {
  // there is no thumbnail available, handle the error:
  print 'No thumbnail available';
}

希望本文所述对大家的php程序设计有所帮助。

相关文章

PHP中Notice错误常见解决方法

对于初学者,肯定会遇到不同的错误提示,比如:警告,致命,等等,其中NOTICE错误等级最低,页面中,好多类似 Notice: Use of undefined constant titl...

php+redis在实际项目中HTTP 500: Internal Server Error故障排除

问题描述 用户量快速增长,访问量在短时间内翻倍,由于前期容量规划做得比较好,硬件资源可以支撑,可是软件系统方面出现了大问题: 40% 的请求都会返回 HTTP 500: Internal...

深入解析PHP的Laravel框架中的event事件操作

 有时候当我们单纯的看 Laravel 手册的时候会有一些疑惑,比如说系统服务下的授权和事件,这些功能服务的应用场景是什么,其实如果没有经历过一定的开发经验有这些疑惑是很正常的...

php和javascript之间变量的传递实现代码

PHP variable to Javascript variable: 复制代码 代码如下: <?php $myvar=10; ?> <script type="te...

dedecms防止FCK乱格式化你的代码的修改方法

默认的情况下,FCK开启了XHTML格式化的选项,因此,有些人用可视化编辑更改完整的HTML文件的时候,Head部份可能会被改得不像人样,解决办法如下: 打开 include/...