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 shell命令合并图片的代码

复制代码 代码如下: #!/usr/local/bin/php -q author:freemouse <?php // 下面是说明. print ("本程序用于合并2张 640x...

PHP call_user_func和call_user_func_array函数的简单理解与应用分析

本文实例讲述了PHP call_user_func和call_user_func_array函数的简单理解与应用。分享给大家供大家参考,具体如下: call_user_func():调用...

Laravel中扩展Memcached缓存驱动实现使用阿里云OCS缓存

Laravel 是我最近用得非常多而且越用就越喜欢的一款PHP框架,由于没有向下兼容的历史包袱,完全面向对象的风格,借助 Facades 优雅的IoC Container 实现,采用 C...

php表单加入Token防止重复提交的方法分析

php表单加入Token防止重复提交的方法分析

本文实例讲述了php表单加入Token防止重复提交的方法。分享给大家供大家参考,具体如下: Token浅谈 Token,就是令牌,最大的特点就是随机性,不可预测。一般黑客或软件无法猜测出...

PHP伪造referer实例代码

这里就直接给出完整的程序吧,具体的应用可以自己修改。 我这里给出的例子是很简单的,其实可以从这个例子中发展出很多的应用。比如隐藏真实的URL地址……嘿嘿,具体的就自己分析去吧 这里新建一...