Home  >  Article  >  Backend Development  >  PHP获取photoshop写入图片文字信息的方法_PHP

PHP获取photoshop写入图片文字信息的方法_PHP

WBOY
WBOYOriginal
2016-05-30 14:59:28751browse

本文实例讲述了PHP获取photoshop写入图片文字信息的方法。分享给大家供大家参考。具体分析如下:

有些摄影师喜欢把图片的标题,内容,关键词等用photoshop直接写入图片文件里面。 用以下代码可以读取。

$image_info = array();
$size = getimagesize('图片文件.jpg', $info);
if(isset($info['APP13']))
{
  $iptc = iptcparse($info['APP13']);
  foreach (array_keys($iptc) as $s)
  {      
    $c = count ($iptc[$s]);
    for ($i=0; $i <$c; $i++)
    {
      @$image_info[$s] .= $iptc[$s][$i];
    } 
  }
}
print_r($image_info);

希望本文所述对大家的php程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn