Page 1 of 1

FLAC File Size Problems with Embedded Artwork

Posted: Fri Sep 30, 2011 1:19 pm
by seanbob
I've begun embedding artwork in my FLAC files in Media Monkey and, as expected, the FLAC file size will grow to include the artwork's file size.

But what I didn't expect is that upon removing the embedded artwork from a FLAC file, the FLAC file size remains the same as it did when the artwork was embedded.

For example, a 25MB FLAC file has 1MB artwork added to it and becomes 26MB, but when the artwork is removed, the FLAC remains at 26MB and doesn't shrink back to its original 25MB. With large FLAC libraries, this could obviously become quite an issue.

Does anyone know why this problem is occurring and how it can be addressed?

Re: FLAC File Size Problems with Embedded Artwork

Posted: Fri Sep 30, 2011 4:03 pm
by Peke
Problem with FLAC Files is that by design Metadata info is forced on file begin. So to add 1MB Artwork MM need to rewrite whole file. That is OK when you want to do that single time but when you want to do that on 300MB 5.1/24/96 FLAC over WLAN twice in 10 seconds you are in trouble. So Flac Designer though about PADDING, where once 1MB artwork is deleted FLAC file contain PADDING (reserved empty space) for future updates of 1MB or less Metadata info where any app doing it correctly will use in-line edit to PADDING space instead of rewriting whole file.

To prove.
1. Add 1mb art to 25MB FLAC
2. Delete Art
3. Add 500KB art to flac
4. File will be still 26MB eg. 500KB Art and 500KB of Padding left

Re: FLAC File Size Problems with Embedded Artwork

Posted: Mon Oct 03, 2011 4:43 pm
by seanbob
Thanks for the explanation! :)

I didn't quite understand why someone would choose to implement tagging that potentially uses extra disk space, but it makes some sense now.

If others are looking for a way to remove the extra padding from their FLAC files' metadata -- after removing artwork from the file or after reducing the artwork's size, for example -- I did come across a functional and fairly elegant solution here: http://forums.mp3tag.de/index.php?s=&sh ... st&p=39707