weizhenye / ass-compiler

Parses and compiles ASS subtitle format to easy-to-use data structure
https://ass.js.org/ass-compiler/
MIT License
107 stars 18 forks source link

[BUG] Style decompiler is case sensitive #8

Closed Deathspike closed 3 years ago

Deathspike commented 3 years ago

I encountered the following .ass style header in production:

Format: Name,Fontname,Fontsize,PrimaryColour,SecondaryColour,OutlineColour,BackColour,Bold,Italic,Underline,Strikeout,ScaleX,ScaleY,Spacing,Angle,BorderStyle,Outline,Shadow,Alignment,MarginL,MarginR,MarginV,Encoding

The Strikeout property in this style header is not written as StrikeOut. When using ass-compiler to decompile this, StrikeOut will be undefined. And when serializing again, StrikeOut is undefined, making the .ass invalid.

The parsing of headers should be using case-insensitive comparisons. I'd be happy to e-mail you the .ass file if that helps.

weizhenye commented 3 years ago

fixed in v0.1.4

Deathspike commented 3 years ago

Works perfectly. Thanks!