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脚本

译者注:本文的原名是《Creating a Multi-File Upload Script in PHP》。我个个觉得这文章...

php动态生成版权所有信息的方法

本文实例讲述了php动态生成版权所有信息的方法。分享给大家供大家参考。具体实现方法如下: function copyright($start, $owner) { $date = d...

php !function_exists("T7FC56270E7A70FA81A5935B72EACBE29"))代码解密

复制代码 代码如下: < ?php if (!function_exists("T7FC56270E7A70FA81A5935B72EACBE29")) { function T7...

PHP中array_keys和array_unique函数源码的分析

性能分析 从运行性能上分析,看看下面的测试代码: $test=array(); for($run=0; $run<10000; $run++) $test[]=rand(0,1...

ADODB结合SMARTY使用~超级强

Smarty实例教学实例篇(三、使用ADODB连接数据库) 前两个月因为工作上的原因一直很忙,所以没有及时完成这个教程,正好今天周六不用加班,抽个空完成它吧! 在开始新的的教程...