diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-05-25 05:49:22 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-05-25 05:49:22 +0000 |
commit | 79316acb81fe9215b09ec41918b9a402560e7bef (patch) | |
tree | 9a71adc5d6dd297e3f39976796e380be10f19a4e /lib/album.lib.php | |
parent | 035b273ff529a34e1d2cb52bd61c653c6bff8250 (diff) | |
download | ampache-79316acb81fe9215b09ec41918b9a402560e7bef.tar.gz ampache-79316acb81fe9215b09ec41918b9a402560e7bef.tar.bz2 ampache-79316acb81fe9215b09ec41918b9a402560e7bef.zip |
fixed find album art, including a fix from Karl Hungus... seriously I am not making that name up
Diffstat (limited to 'lib/album.lib.php')
-rw-r--r-- | lib/album.lib.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/album.lib.php b/lib/album.lib.php index 94ee1726..ef0c7124 100644 --- a/lib/album.lib.php +++ b/lib/album.lib.php @@ -52,6 +52,23 @@ function get_image_from_source($data) { fclose($handle); return $image_data; } + + // Check to see if it is embedded in id3 of a song + if (isset($data['song'])) { + // If we find a good one, stop looking + $getID3 = new getID3(); + $id3 = $getID3->analyze($data['song']); + + if ($id3['format_name'] == "WMA") { + return $id3['asf']['extended_content_description_object']['content_descriptors']['13']['data']; + } + elseif (isset($id3['id3v2']['APIC'])) { + // Foreach incase they have more then one + foreach ($id3['id3v2']['APIC'] as $image) { + return $image['data']; + } + } + } // if data song return false; |