Home >Backend Development >PHP Tutorial >How to get the text information written by photoshop in PHP, _PHP tutorial

How to get the text information written by photoshop in PHP, _PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:58:48973browse

How PHP obtains the text information written in pictures by Photoshop,

The example in this article describes the method by which PHP obtains the text information written in pictures by Photoshop. Share it with everyone for your reference. The specific analysis is as follows:

Some photographers like to write the title, content, keywords, etc. of the picture directly into the picture file using Photoshop. It can be read with the following code.

$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);

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/976694.htmlTechArticleHow PHP obtains the text information written by photoshop into pictures. This article describes how PHP obtains the text information written into pictures by photoshop. method. Share it with everyone for your reference. The specific analysis is as follows:...
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