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程序设计有所帮助。

相关文章

基于wordpress主题制作的具体实现步骤

复制代码 代码如下:<?php/*在根目录 -> wp-content -> themes 下创建mytheme文件夹用来存放创建新主题模板 在mytheme目录下创建...

PHP实现适用于自定义的验证码类

PHP实现适用于自定义的验证码类

本文实例为大家分享了PHP验证码类,利用对象来实现的验证码类,供大家参考,具体内容如下 <?php /* * To change this license he...

PHP实现的防止跨站和xss攻击代码【来自阿里云】

本文实例讲述了PHP实现的防止跨站和xss攻击代码。分享给大家供大家参考,具体如下: 文档说明: 1.将waf.php传到要包含的文件的目录 2.在页面中加入防护,有两种做法,根据情况二...

PHP7实现和CryptoJS的AES加密方式互通示例【AES-128-ECB加密】

本文实例讲述了PHP7实现和CryptoJS的AES加密方式互通。分享给大家供大家参考,具体如下: PHP类: class AES { /** * * @param...

php去除重复字的实现代码

方法一: 复制代码 代码如下: $text = '数组aabbccdd'; $text_filter = ''; $filter = array(); $len = mb_strlen(...