Releases: benrr101/node-taglib-sharp
v6.0.1
This is a patch release that fixes an issue with ID3v2 tag reading.
Fixes
- Improve handling of corrupt ID3v2 tags
- As brought up by @stuartambient, entire MP3 files can load incorrectly if ID3v2 tags are corrupted (as often happens with ID3v2.4 tags generated by iTunes)
- Improves error handling such that corrupt ID3v2 tags are read up until the corrupt frame.
- Valid frames are still readable
- MPEG header reading will begin at the end of the ID3v2 tag regardless of corruption status
- ID3v2 tags can be rewritten successfully even if the tag is corrupted
Special Thanks
- @stuartambient for supplying test files to expose corruption
📦 NPM Link: https://www.npmjs.com/package/node-taglib-sharp/v/6.0.1
v6.0.0 MP3 VBR Header Improvements, Msc Bug Fixes
In what appears to be a disappointing trend, I'm once again super slow at releasing this new version.. But here it is, and I can say it's a big improvement. There are some technically breaking changes in this release, hence the major version bump. Let's go through changes:
New Features / Fixes
- MP3 Audio Header Improvements
- This code has basically been rewritten to rework how MPEG audio headers are read, especially fixing how VBR headers are treated.
- Xing VBR headers now properly consider
Info
headers that indicate a a file is CBR - Xing VBR headers now read into the optional LAME header extension to get encoder delays to give even more accurate duration calculations
- Calculation of duration and bitrate is now calculated with fallbacks such that we really will give it a best shot to calculate these values before giving up and returning 0.
- Headers with reserved bitrates or sample rates are ignored
- MPEG4 Fix - There was a bug when writing MPEG4 tags that often resulted in corruption of the tags. This has been fixed!
- APE Tag Fixes
- Integration test for APE file reading was fixed (test file was being duplicated and read as MP3, which was silently passing prior to fixing MP3 headers)
- When reading attached pictures, more bytes than expected could be read if the picture was not the last item in the tag. This has been fixed.
- Combined tag ReplayGain, IsCompilation behavior
- Combined tags are designed to check all tags within for a value to return. Falsy values and "default" values would be skipped.
- For ReplayGain, NaN is the default value. However, NaN cannot be checked for equality with
===
, so it was being treated by CombinedTag as a "truey" value. This has been fixed, so numeric values are the only ones returned. - For IsCompilation, undefined was being used as the default value. This has been changed to be false.
- In the next release, I will be exploring returning undefined for all unset tag values. This should make it clearer which tags are set and which are not set.
- Updated dependencies that had vulnerabilities (really only affects dev)
Breaking Changes
MpegAudioHeader
xingHeader
andvbriHeader
properties are removed and replaced with a singlevbrHeader
property of typeVbrHeader
.- If no VBR header was found,
VbrHeader
will beundefined
VbrHeader
abstract class added with concrete instancesVbriHeader
andXingHeader
.bitrate
andduration
properties were added and return a truthy value if the values can be calculated with the header (basically only applies to Xing headers in which total frames and total bytes is optional)Unknown
static instances have been removed. If a header doesn't exist, thevbrHeader
property will beundefined
Special Thanks:
- Special thanks for @ion-dev for fixing the big bug in MPEG4 tag writing! I'd still be looking into it if you hadn't fixed it
📦 NPM Link: https://www.npmjs.com/package/node-taglib-sharp/v/6.0.0
v5.2.3 Id3v2 GEOB Frame Fix
Fixes
- This release exclusively fixes a bug in GEOB frame parsing where reading GEOB frames encoded with Latin1 would throw an argument out of range error.
Note: with this change, non-picture attachment frames will be visible in file.tag.pictures
. This was the expected behavior all along, but may be an unexpected change. Filtering base on IPicture.pictureType
can be used as a workaround
v5.2.2 ID3v2 Non-Standard Frame Identifier Hotfix
This release adds a fix for a bug that prevented ID3v2 frames with non-standard identifiers from being loaded. It also caused affected files to fail to load.
Fixes
- Fix the above bug by treating non-standard frame identifiers as
UnknownFrame
s
Special Thanks
- @stuartambient & @digimezzo for reporting the issue and testing solutions
v5.2.1 MPEG4 Support Readme Fix
Tiny fix in README. See feature changes in v5.2.0
v5.2.0 MPEG4 Support
At extremely long last, MPEG4 audio and video support has been added! A massive massive thank you to @digimezzo for contributing this feature!! (and massive shame on me for not releasing it sooner)
New Features/Fixes
- MPEG4 support - Read/write support for M4A, M4B, M4V, M4P, and MP4 files (again big thanks to @digimezzo!)
- Fixed static settings classes that were missed from the index (thanks to @stuartambient for reporting)
MpegAudioFileSettings
(MPEG1/2)MpegVideoFileSettings
(MPEG1/2)AviFileSettings
(RIFF)WaveFileSettings
(RIFF)
- Fixed APE MusicBrainz Release Artist ID backing field
Not Really Breaking Changes
- Ogg page header absolute granular positions have been changed to simply be
ByteVectors
- Absolute granular positions are used to calculate duration for Ogg files
- According to the Ogg docs, this value means something different to each codec, the only requirement is that it is monotonically increasing. As such, we can just read it as raw bytes and let the codec classes interpret the meaning of the value.
- This eliminates issues with the number being too big or having special cased values (ie, -1)
v5.1.0 Matroska/WebM Read-Only Support
At long last, some semblance of support for Matroska/WebM files. Unfortunately, this is release took forever to develop and even then it's only read-only support. The primary reason for the delay is that the original .NET implementation was very difficult to comprehend and required a lot of rewriting. What's worse is that the Matroska tagging format is very open ended, but in such a way as to make it very complicated to derive a "unified" tagging interface. Please provide feedback if you find the unified tagging interface is not satisfactory.
New Features/Fixes
- Matroska/WebM read-only support
- If you try to write a mkv/webm file, it'll throw an error
Not Really Breaking Changes, But Stuff You Should Be Aware Of
- Official builds are now done using Node 14.21.x. I still plan to target 12.16.1 as the minimum version.
v5.0.1 Ogg 0xFFFFFFFFFFFFFFFF Granule Support
New Features/Fixes
- Fixing a bug where the special
0xFFFFFFFFFFFFFFF
granule position on Ogg pages would throw exceptions. Thanks to @digimezzo for reporting this and testing the fix!
v5.0.0 Ogg Support (and other sundry items)
Ogg support had been sitting around ready to go for a while, might as well release it since matroska/webm support is going to be a while longer...
New Features/Fixes
- Support for Ogg files (Vorbis, Theora, Opus)
- Large rewrite of
ByteVector
class to reduce needless copying of bytes.ByteVector
s are now copy-on-write and use node's buffer views to implement subarray processing without a copying the entire contents. This greatly improves performance!fromBase64String
andtoBase64String
have been added- see breaking changes notes below for stuff that's been broken
Breaking Changes
- The interface for working with
ByteVector
s has changed significantlyfromByteVector
has been removed, usetoByteVector
on an existing object to make the copy-on-write copyByteVector
construction methods no longer takeisReadOnly
as an argument, instead usemakeReadOnly()
on the new object to make it read only.fromString
no longer has a defaulttype
, default behavior was to useStringType.UTF8
fromU*
andtoU*
methods were renamed to be consistently named - eg,fromUShort
is nowfromUshort
lastUtf16Encoding
property has moved into theEncoding
class which now handles all encoding and decoding- Direct access to the backing Uint8Array via
data
has been removed. The alternative is to usetoByteArray()
. Try to avoid using this as much as you can since it has the potential to break copy-on-write. It only exists for the the handful of instances where it is more performant to directly use the buffer for IO operations. get hashCode
has been removed, callget checksum
insteadget isView
is added (mostly as a diagnostic/debugging tool) to indicate if theByteVector
is backed by a buffer view over another buffer or if it is backed by the buffer.- Check for read-only now happens after checking the arguments for their proper type
containsAt
no longer accepts apatternOffset
or apatternLength
. If a subset of the pattern needs to be checked, usesub
on the pattern. It's super cheap now!find
no longer takes an offset. Iffind
needs to start at an offset in theByteVector
, use the shortcutoffsetFind
insertByte
,insertByteArray
, andinsertByteVector
have all been removed. (it behaves the same as splice for JS arrays)mid
is renamed tosubarray
(to better match JS array method names)removeAtIndex
andremoveRange
have been removed, usesplice
instead (it behaves the same as splice for JS arrays)resize
no longer returns the object, it is a pure function.rFind
no longer accepts an offset, userFind
on the result ofsubarray
if offset is neededtoFloat
now handlesByteVectors
of size <4 gracefully instead of throwing an errortoStrings
no longer accepts anoffset
parameter, usesubarray
to get an offsetByteVector
, then calltoStrings
- Lots of static readonly members have been renamed to SCREAMING_SNAKE_CASE. If you're using one and it shows up as not defined, try using the SCREAMING_SNAKE_CASE version. (eg,
AacAudioHeader.unknown
=>AacAudioHeader.UNKNOWN
)
v4.0.2 - AIFF Hotfix
This has been released officially on npm for months now, but somehow I forgot to write the github release
New Features/Fixes
- Fix a bug in AIFF implementation that doesn't correctly update the file size when writing the tag (#49)
Breaking Changes
None