vanilla-music / vanilla

Vanilla Music Player for Android
GNU General Public License v3.0
1.18k stars 295 forks source link

Show album art stored in individual songs (enhancement request) #713

Open bastianilso opened 6 years ago

bastianilso commented 6 years ago

I have a lot of music which despite being listed in the same album, have unique individual cover arts embedded in them. It would be really nice if Vanilla music would give priority to show these individual covers in the Now playing screen.

adrian-bl commented 6 years ago

The main issue with this is (besides that we require about 20x more storage for covers and CPU time): How do we get the individual covers?

We currently pick up image files located in the same folder OR query androids media database. However: Android only has a single cover per album (= acts the same as we do) and AFAIK there is no way to extract embedded covers using the media framework on Android.

bastianilso commented 6 years ago

Good question.. Somehow, my HUAWEI Music system app does show individual song covers, but I don't know if they are using the Android media framework..

abn-volk commented 6 years ago

Actually, Androud's MediaMetadataRetriever has a getEmbeddedBitmap() method that can do this: https://developer.android.com/reference/android/media/MediaMetadataRetriever.html#getEmbeddedPicture()

So I think it is completely possible. All that is needed is setting the correct data source and scale large bitmaps manually to prevent OOMs: https://developer.android.com/topic/performance/graphics/load-bitmap.html

adrian-bl commented 6 years ago

abn-volk: oh yeah, you are right. I must have missed that last time i looked at it.

So i think we could have this as an option to activate: It will have a significant impact on the initial cover loading (and the amount of covers we can cache), so i wouldn't want to have it enabled by default.

Kaned1as commented 6 years ago

@adrian-bl sounds good to me, > 5.x devices are quite capable for this task anyway

cosmicdan commented 6 years ago

Has any preliminary work been done on this issue? Love Vanilla Music as a replacement for the obsolete PowerAMP, but the "wrong" album art appearing for a whole lot of my tracks is a little bit annoying 😀

adrian-bl commented 6 years ago

I dont think that anyone took a stab at this so far.

But the implementation should not be too hard.

cosmicdan commented 6 years ago

But the implementation should not be too hard.

Indeed, I might take a crack at it (I have holidays coming up) though I'm a bit rusty with Android-specific Java. I'll do a PR if I get it working.