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经典趣味算法实例代码

1、一群猴子排成一圈,按1,2,…,n依次编号。然后从第1只开始数,数到第m只,把它踢出圈,从它后面再开始数,再数到第m只,在把它踢出去…,如此不停的进行下去,直到最后只剩下一只猴子为止,...

php代码运行时间查看类代码分享

复制代码 代码如下: //date:2011-08-05 class RunTime//页面执行时间类 { private $starttime;//页面开始执行时间 private $...

Linux编译升级php的详细方法

服务器环境:CentOS – 5.4php升级:5.4.14 - 5.5.0升级心得:比较顺利,但是有一点需要说明:eaccelerator无法兼容php5.5.0,好在php在5.5....

php设计模式 Chain Of Responsibility (职责链模式)

复制代码 代码如下: <?php /** * 职责链模式 * * 为解除请求的发送者和接收者之间的耦合,而使用多个对象都用机会处理这个请求,将这些对象连成一条链,并沿着这条链传递该...

如何使用php绘制在图片上的正余弦曲线

以前用actionscript写动态绘制三角函数曲线,其实php输出三角函数曲线也很简单。复制代码 代码如下:<?php define("MAX_WIDTH_PIXEL"...