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中func_get_args(),func_get_arg(),func_num_args()的区别

复制代码 代码如下:<?php     function jb51(){     &nbs...

PHP自定义大小验证码的方法详解

复制代码 代码如下:<?phpfunction vCode($num=4,$size=20, $width=0,$height=0){    &nbs...

CodeIgniter生成网站sitemap地图的方法

1.建立了一个名为sitemap的控制器复制代码 代码如下:<?phpif (!defined('BASEPATH')) exit ('No direct script...

删除无限分类并同时删除它下面的所有子分类的方法

复制代码 代码如下: $act = isset ($_GET['act']) ? trim ($_GET['act']) : "; if ($act == 'del') { $sort_...

PHP删除HTMl标签的三种解决方法

方法1:直接取出想要取出的标记复制代码 代码如下:<?php    //取出br标记    function strip...