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经典设计模式之依赖注入定义与用法详解

本文实例讲述了PHP经典设计模式之依赖注入定义与用法。分享给大家供大家参考,具体如下: 依赖注入的实质就是把一个类不可能更换的部分和可更换的部分分离开来,通过注入的方式来使用,从而达到解...

IStream与TStream之间的相互转换

   procedure TForm1.Button1Click(Sender: TObject);    ...

PHP检测字符串是否为UTF8编码的常用方法

本文实例总结了PHP检测字符串是否为UTF8编码的常用方法。分享给大家供大家参考。具体实现方法如下: 检测字符串编码可以有很多种方法,如利用ord获得字符的进制然后进入判断,或利用mb_...

PHP判断远程url是否有效的几种方法小结

PHP判断远程url是否有效的几种方法小结

解决办法: 使用PHP解决 使用file_get_contents函数,不过优缺点如果url无法访问,会出现终止程序问题 使用curl返回,然后判断是否正确执行 使用get_header...

PHP处理postfix邮件内容的方法

本文实例讲述了PHP处理postfix邮件内容的方法。分享给大家供大家参考。具体如下: <?php //从输入读取到所有的邮件内容 $email = ""; $fd =...