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实现json编码的方法

本文实例讲述了php实现json编码的方法。分享给大家供大家参考。具体如下: <?php /* * json */ $books = array('key1'=&g...

PHP基于面向对象封装的分页类示例

本文实例讲述了PHP基于面向对象封装的分页类。分享给大家供大家参考,具体如下: <?php class Page { protected $num;//...

php基于session实现数据库交互的类实例

本文实例讲述了php基于session实现数据库交互的类。分享给大家供大家参考。具体如下: <?php /** * session 数据库存储类 */ class...

PHP 图像尺寸调整代码

复制代码 代码如下: /********************** *@filename - path to the image *@tmpname - temporary path...

PHP 验证码不显示只有一个小红叉的解决方法

PHP 验证码不显示只有一个小红叉的解决方法

最近想自学PHP ,做了个验证码,但不知道怎么搞的,总出现一个如下图的小红叉,但验证码就是显示不出来,原因如下 未修改之前,出现如下错误;  (1)修改步骤如下,原因如下,原因...