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 /*PHP图片加文字水印类库 QQ:3697578482 伤心的歌 该类库...

php include的妙用,实现路径加密

1、中转程序include.inc 复制代码 代码如下: <? include_once 'include/Base.php'; $path = ''; $url = isBase...

php使用sql server验证连接数据库的方法

本文实例讲述了php使用sql server验证连接数据库的方法。分享给大家供大家参考。具体分析如下: 当您连接到 SQL Server 时,SQL Server Driver for...

php判断上传的Excel文件中是否有图片及PHPExcel库认识

需要借助PHPExcel这个库复制代码 代码如下:$excelPath = 'Test.xls'; $objReader = PHPExcel_IOFactory::createRead...

PHP整合PayPal支付

简单整理一下PHP项目整合PayPal支付功能。 一、表单的构建: <form method="post" name="form" action="https://www.pa...