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中$GLOBALS与global的区别详解

PHP中$GLOBALS和global都可以实现全局变量的功能,所以很多人都认为global和$GLOBALS[]只是写法上面的差别,其实不然。$GLOBALS 是一个超级全局变量,其实...

基于PHP array数组的教程详解

定义数组数组array是一组有序的变量,其中每个变量被叫做一个元素。一、定义数组 可以用 array() 语言结构来新建一个数组。它接受一定数量用逗号分隔的 key => valu...

解析获取优酷视频真实下载地址的PHP源代码

复制代码 代码如下:<?php //--调用方法/demo.php?url=http://v.youku.com/v_show/id_XMzkyODA2NTEy.html echo...

PHP中利用substr_replace将指定两位置之间的字符替换为*号

复制代码 代码如下: $username = "zongzi"; echo substr_replace($username,'**','1','2');...

Centos 6.5下PHP 5.3安装ffmpeg扩展的步骤详解

本文的内容主要是为了解决在Centos6.5下PHP5.3安装ffmpeg扩展的问题,下面话不多说,来看看详细的步骤吧。 安装步骤如下: 安装必须的环境yasm wget htt...