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.