At Tracker (core component of Nokia N9‘s MeeGo Harmattan’s Content Framework) we extract album art out of music files like MP3s, and we do a heuristic scan in the same directory of the music files for files like cover.jpg.
Right now we use the media art storage spec which we at a Boston Summit a few years ago, together with the Banshee guys, came up with. This specification allows for artist + album media art.
This is a bit problematic now on the N9 because (embedded) album art is getting increasingly bigger. We’ve seen music stores with album art of up to 2MB. The storage space for this kind of data isn’t unlimited on the device. In particular is it a problem that for an album with say 20 songs by 20 different artists, with each having embedded album art, 20 times the same album art is stored. Just each time for a different artist-album combination.
To fix this we’re working on a solution that compares the MD5 of the image data of the file album-md5(space)-md5(album).jpg with the MD5 of the image data of the file album-md5(artist)-md5(album).jpg. If the contents are the same we will make a symlink from the latter to the former instead of creating a normal new album art file.
When none exist yet, we first make album-md5(space)-md5(album).jpg and then symlink album-md5(artist)-md5(album).jpg to it. And when the contents aren’t the same we create a normal file called album-md5(artist)-md5(album).jpg.
Consumers of the album art can now choose between using a space for artist if they are only interested in ‘just album’ album art, or filling in both artist and album for artist-album album art.
This is a first idea to solve this issue, we have some other ideas in mind for in case this solution comes with unexpected problems.
I usually blog about unfinished stuff. Also this time. You can find the work in progress here.
Out of interest, does Harmattan’s Media Player better follow the Media Art Storage Spec you reference?
Fremantle had an annoying bug where the artist wasn’t actually used (in violation of the spec, AFAICT) to “solve” the case of compilation albums; unfortunately breaking “Greatest Hits” albums in the process.
https://bugs.maemo.org/show_bug.cgi?id=7263
It does. Afaik it at this moment still makes its own thumbnails from the album-art, instead of using the platform ‘s thumbnailer, but I think that this is being fixed.
However, I do think that the music player teams plans to also only use albums. Right now it uses both album and artist, but I think they want to start using the album part only. Just like on Fremantle.
Perhaps you can influence their decision on this? Tracker doesn’t mind and stores both the album-only and album-artist (if album-artist is different than album-only, a new file is used. When both are the same a symbolic link is created to the album-only file. So music player can use both).
Why symlinking in the code, instead of just doing hardlinking ? Is it using a file system that doesn’t support hardlinks?
For no particular reason