summaryrefslogtreecommitdiffstats
path: root/lib/album.lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/album.lib.php')
-rw-r--r--lib/album.lib.php17
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;