-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ogg] Support for METADATA_BLOCK_PICTURE #70
Comments
Good initiative ! |
Thanks for the input! I'm also wondering about the classes representing pictures. Aside from a few extra properties in TagLib.FLAC.Picture (width, height, color depth, and indexed color count), TagLib.Picture and TagLib.FLAC.Picture have a lot in common. But Tag.Pictures being of type IPicture[] this calls for some weird "if (picture is TagLib.FLAC.Picture)" code. Implementations for 2.i and 2.ii, to see what it looks like: |
It seems like 2.ii. still stores both What I mean, is that with current approach, I always find this a bit confusing: |
Sorry, my mistake, the branches were swapped, this is fixed now. 👍 for the initial parsing of the Detecting user changes to the target fields is easy as all field access methods are already implemented (if The |
Implemented lazy approach in vtavernier:metadata-block-picture-lazy |
Hey ! That would be really cool ! Great idea ! |
This would be very interesting in order to reduce the memory stress while scanning a lot of files. Running a memory profiler on taglib-sharp reveals a lot of allocations of |
According to the xiph.org wiki, the currently recommended way to store pictures as part of an Ogg Vorbis file is through the
METADATA_BLOCK_PICTURE
field. Values of this field are base64 encoded values following the FLAC specification for embedded pictures.The wiki also mentions the existence of the deprecated and unofficial
COVERART
field, which is supported by the current code in taglib-sharp. I can see several approaches to support the newer field, for taglib-sharp to be compatible with other projects.All following approaches refer to changing the
Pictures
propertyCOVERART
: replaceCOVERART
withMETADATA_BLOCK_PICTURE
, andTagLib.Picture
withTagLib.Flac.Picture
. Most direct way, although breaks compatibility with older versions.COVERART
andMETADATA_BLOCK_PICTURE
: in the getter, read cover arts from bothCOVERART
andMETADATA_BLOCK_PICTURE
and return corresponding picture objects. In the setter, two approaches are possible:TagLib.Picture
objects are stored in theCOVERART
field, andTagLib.FLAC.Picture
objects are stored in theMETADATA_BLOCK_PICTURE
. Obviously the ordering of a file with mixedCOVERART
andMETADATA_BLOCK_PICTURE
pictures would be undefined.TagLib.Picture
objects from theCOVERART
field toTagLib.FLAC.Picture
, and store everything inMETADATA_BLOCK_PICTURE
. This would however enforce migrating to the new format.I think 2.i. is the most versatile way, however I'm open to suggestions before sending a PR.
The text was updated successfully, but these errors were encountered: