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 interface staff_i1 //接口1 { func...

php根据指定位置和长度获得子字符串的方法

本文实例讲述了php根据指定位置和长度获得子字符串的方法。分享给大家供大家参考。具体分析如下: php的substr函数功能非常强大,不断可以从前往后去子字符串还可以从后往前取字符串...

php验证session无效的解决方法

本文实例讲述了php验证session无效的解决方法。分享给大家供大家参考。具体方法如下: 一、问题 今天在配置 apache+php环境时折腾了很久很久,后来成功了但发现验证码图片可以...

php模拟用户自动在qq空间发表文章的方法

本文实例讲述了php模拟用户自动在qq空间发表文章的方法。分享给大家供大家参考。具体分析如下: 我们这里是一个简单的利用php来模拟登录后再到QQ空间发送文章的一个简单的程序,有需要的朋...

PHP错误提示It is not safe to rely on the system……的解决方法

在php程序开发中有时会出现类似于这样的警告: PHP Warning: date(): It is not safe to rely on the system's timezone...