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实现的文件浏览器功能简单示例

本文实例讲述了PHP实现的文件浏览器功能。分享给大家供大家参考,具体如下: <?php if(isset($_GET['path'])){ echo $path =...

php运行时动态创建函数的方法

本文实例讲述了php运行时动态创建函数的方法。分享给大家供大家参考。具体分析如下: 一般的语言函数必须定义了在运行,而php支持在运行时动态创建函数,下面是一个简单的范例,在运动时根据不...

php Redis函数用法实例总结【附php连接redis单例类】

本文实例总结了php Redis函数用法。分享给大家供大家参考,具体如下: 一直在拿PHP使用Redis,但是总感觉不牢靠,索性借这个时间空余一气呵成, 把PHP中所有操作到的Redis...

php中OR与|| AND与&amp;&amp;的区别总结

php中OR与|| AND与&amp;&amp;的区别总结

本身没有区别,习惯问题 ,但是有时候牵涉到运算符优先级的问题,结果会不同,记录下。 例如: 复制代码 代码如下:$p = 6 or 0; var_dump($p);//int(6) $p...

PHP sprintf()函数用例解析

复制代码 代码如下: <?php //sprintf()函数,返回值为格式化后的字符串 string sprintf ( string $format [, mixed $args...