EXIF Title Tag in PHP with with exif_read_data()

非 Y 不嫁゛ 提交于 2020-01-04 14:28:13

问题


I have some struggles to get the "Title" tag from a jpg file with PHP. I guess I'm looking through the wrong EXIF Group.

I'm using following code

$exif = exif_read_data( $image['temp_name'], 0, true);
$exif_description = $exif['IFD0']['ImageDescription'];
$exif_title = $exif['WINXP']['Title'];
$exif_iso = $exif['EXIF']['ISOSpeedRatings'];

I looked through some spec lists of EXIF tags, but I always come up with XPTitle as the title. I'm not using Windows. It's hard to believe that its the only available tag to store the Title of the Image as it involves changing the encoding. Can someone point me to get the proper Title?

edit:

I figured out it is included in the ITCP which can be read following:

output_iptc_data($bild);

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>';
            }
        }
    }
}

If someone has a hint to improve this or figure it out through a different way, please feel free to give a hint or two :P

来源:https://stackoverflow.com/questions/8466440/exif-title-tag-in-php-with-with-exif-read-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!