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程序设计有所帮助。

相关文章

Linux系统下PHP-FPM的安装和配置教程

基本安装方法 安装工具包 $ sudo apt-get install python-software-properties 添加ppa源 $ sudo add-a...

解决php使用异步调用获取数据时出现(错误c00ce56e导致此项操作无法完成)

【详细错误】:由于出现错误 c00ce56e 而导致此项操作无法完成 【造成原因】:未指定输出编码格式。 【解决办法】:句首加入header("content-type:text/htm...

PHP array_shift()用法实例分析

本文实例讲述了PHP array_shift()用法。分享给大家供大家参考,具体如下: array_shift()将数组开头的单元移出数组,并作为结果返回,将数组长度减一并将所有其它单元...

基于simple_html_dom的使用小结

复制代码 代码如下:<P>简单范例<?phpinclude "simple_html_dom.php" ;    //加载sim...

php采用file_get_contents代替使用curl实例

本文实例讲述了php采用file_get_contents代替使用curl的方法,分享给大家供大家参考。具体实现方法如下: file_get_contents代替使用curl其实不多见了...