From 79316acb81fe9215b09ec41918b9a402560e7bef Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Fri, 25 May 2007 05:49:22 +0000 Subject: fixed find album art, including a fix from Karl Hungus... seriously I am not making that name up --- lib/album.lib.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/album.lib.php') 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; -- cgit