"attached_picture" is only for ID3v2.
For a generalized solution you shouldn't look at specific tag data, but rely on CopyTagsToComments to give you unified data in the top-level [comments] key. This applies for any common tag data (title, artist, album, etc), as well as attached pictures.
This short example will list the attached pictures for any supported file format:
Code: Select all
require_once('getid3.php');
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($FullFileName);
getid3_lib::CopyTagsToComments($ThisFileInfo);
if (!empty($ThisFileInfo['comments']['picture'])) {
echo 'Found '.count($ThisFileInfo['comments']['picture']).' pictures:<br>';
foreach ($ThisFileInfo['comments']['picture'] as $key => $details) {
echo '* $ThisFileInfo[comments][picture]['.$key.'] :: '.$details['picturetype'].' ('.$details['image_width'].'x'.$details['image_height'].','.$details['image_mime'].') = '.number_format($details['datalength']).' bytes<br>';
}
}
I would also suggest making use of /demos/demo.browse.php (open in your browser and browse to the file in question) to see what data is returned where for any file.