我有关键字的图像。我无法使用IPTC提取关键字。有人找到检索关键字短语的方法了吗?如何接近结果?这段代码是我在论坛上找到的。
<?php function output_iptc_data( $image_path ) {
$size = getimagesize ( $image_path, $info);
if(is_array($info)) {
$iptc = iptcparse($info["APP13"]);
foreach (array_keys($iptc) as $s) {
$c = count ($iptc[$s]);
for ($i=0; $i <$c; $i++)
{
echo $s.' = '.$iptc[$s][$i].'<br>';
}
}
} } output_iptc_data('IMGP4053m.jpg'); ?>发布于 2018-08-31 19:55:02
@kuslahne请查看我的库:https://ibudasov.github.io/php7-iptc-manager/
看起来它做了你需要的一切。
// import the Manager class
use iBudasov\Iptc\Manager;
// ... and instantiate it!
$manager = Manager::create();
$manager->loadFile('./IMGP4053m.jpg');
$allTheTagsInTheImage = $manager->getTags();https://stackoverflow.com/questions/9987857
复制相似问题