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下删除7天前日志的代码(php+shell)

PHP版本: 复制代码 代码如下: /** * 删除7天前的日志 * @param $logPath */ function del7daysAgoLog($logPath) { if(...

php学习笔记之字符串常见操作总结

本文实例讲述了php字符串常见操作。分享给大家供大家参考,具体如下: 字符串的定义 可以用单引号或双引号来定义字符串 <?php $str = "hello"; $st...

php json_encode值中大括号与花括号区别

1.当array是一个从0开始的连续数组时,json_encode出来的结果是一个由[]括起来的字符串 而当array是不从0开始或者不连续的数组时,json_encode出来的结果是一...

PHP 错误之引号中使用变量

当看到错误提示 syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE...

php编程实现获取excel文档内容的代码实例

1、readexcel.system.php 复制代码 代码如下: <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softt...