Pictures from FLAC metadata

From version 4.0.6, the FLAC library includes support for extracting pictures embedded in FLAC file metadata. To use it, create a subclass of FlacDecoder that implements the PictureTarget interface.

You can take FlacPictures as an example of what you can do. That’s a utility program which is included in the full Klipspringer installation as the command flacpics. I decided to just do it that way instead of displaying metadata pictures in the Klipspringer hub interface because, first, there is no natural way to keep images for the current track available to the client (because a major point with the whole system design is that it should seamlessly flow ahead to the next track) and, second, most of the images contained in the FLAC files I have are just the front cover of the album anyway (repeated in each track), which I have in the album data subdirectory, so they are already displayed in the playback interface. By default, flacpics uses the SHA-1 hash of the file contents for the file name, to avoid keeping duplicates of the same image under different file names (just like Git does).

Going through all my FLAC files with flacpics revealed that there were pictures embedded in many tracks bought online, but mostly just a more compressed version the cover image that came with the release. Only one release, the Marcus Strickland Quartets’ Twi-Life revealed anything new: two images, which I uploaded to accompany the release on Discogs.

The FlacPictures implementation uses a feature that was added in JDK 17, which prompted me to change the required version of Java from 16 to 17 (which makes sense anyway, since 17 is an LTS version).

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.