PHP获取Exif缩略图的方法

yipeiwu_com5年前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单元测试PHPUnit简单用法示例

本文实例讲述了PHP单元测试PHPUnit简单用法。分享给大家供大家参考,具体如下: windows开发环境下,PHP使用单元测试可以使用PHPUnit。 安装 首先下载PHPUnit,...

php防止sql注入简单分析

本文实例分析了php防止sql注入简单方法。分享给大家供大家参考。具体如下: 这里只说一个简单的方法 防止Sql注入的方法有很多,这里要说的其实就是漏洞演练平台Dvwa里的一种方式 直接...

PHP中soap用法示例【SoapServer服务端与SoapClient客户端编写】

本文实例讲述了PHP中soap用法。分享给大家供大家参考,具体如下: 一、首先要设置服务器环境 修改php.ini 得添加extension=php_soap.dll (加载soap 内...

php使用Jpgraph绘制3D饼状图的方法

php使用Jpgraph绘制3D饼状图的方法

本文实例讲述了php使用Jpgraph绘制3D饼状图的方法。分享给大家供大家参考。具体实现方法如下: <?php include ("src/jpgraph.php"...

php 网址url转迅雷thunder资源下载地址的方法函数

其实迅雷的地址就是:原url前面带AA,后面带ZZ之后再base64_encode编码即可即:  thunder:// + base64_encode("AA" +&nb...