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

相关文章

shopex中集成的站长统计功能的代码简单分析

复制代码 代码如下: <?php //我们的域名,这里可以不唯一的 $domain = 'localhost'; //这个应该是CNZZ授权给shopex的加密密钥,如果错了就不能...

curl 出现错误的调试方法(必看)

实例如下: private function httpGet($url) { $curl = curl_init(); curl_setopt($curl,...

php正则表达式获取内容所有链接

方法一: function get_all_url($code){ preg_match_all('/<as+href=["|']?([^>"' ]+)...

phpmyadmin中禁止外网使用的方法

本文实例讲述了phpmyadmin中禁止外网使用的方法。分享给大家供大家参考。具体方法如下: 首先,在phpmyadmin文件夹中找到 phpmyadmin.conf 在文件中能看到如下...

浅析PHP原理之变量分离/引用(Variables Separation)

首先我们回顾一下zval的结构:复制代码 代码如下:struct _zval_struct {       &nbs...