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实现的简单网络硬盘。分享给大家供大家参考。具体如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transi...

php使用GD库创建图片缩略图的方法

本文实例讲述了php使用GD库创建图片缩略图的方法。分享给大家供大家参考。具体分析如下: 上传页面的静态html代码: <html> <head> <...

深入php list()函数的详解

list()( PHP 4中, PHP 5中) list-指定变量,好象他们是一个数组描述void list ( mixed $varname [, mixed $... ] )像阵列(...

php判断目录存在的简单方法

PHP判断文件或目录是否存在 file_exists:判断文件是否存在 $file = "check.txt"; if(file_exists($file)) { echo...

php计算多维数组中所有值总和的方法

本文实例讲述了php计算多维数组中所有值总和的方法。分享给大家供大家参考。具体实现方法如下: php 内置函数 array_sum() 函数返回数组中所有值的总和,只能返回一维数组的总和...