Skip to content
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

Mixing SSA and ASS give weird results #18

Open
latot opened this issue Aug 27, 2018 · 0 comments
Open

Mixing SSA and ASS give weird results #18

latot opened this issue Aug 27, 2018 · 0 comments

Comments

@latot
Copy link

latot commented Aug 27, 2018

Hi, i hope this time get a real issue, and not something of my fault..

Well, if i we insert SSA data in ASS or something like that, the code is not transformed correctly, and in the end we will can't see the subs, or part of the subs, or with other colors, etc, here all the code:

ED.ssa

[Script Info]
Title: karaoke
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
PlayResY: 600

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: OK,Britannic Bold,30,16777215,65535,65535,&H0029464b,0,0,1,2,1,2,10,10,10,0,0

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:05.00,OK,NTP,0000,0000,0000,!Effect,Hi

KED.ass

[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: karaoke
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
PlayResY: 600

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: KED,Arial,20,&H00FFFFFF,&H000088EF,&H00000000,&H00666666,-1,0,0,0,100,100,0,0,1,3,0,8,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:05.00,KED,,0,0,0,fx,Booo

code:

import pysubs2

def merge(ss):
    s1 = ss[0]
    for i_ in range(1, len(ss)):
        i = ss[i_]
        for j in i:
            s1.insert(0, j)
        s1.import_styles(i)
    return s1

a=pysubs2.load("ED.ssa")
b=pysubs2.load("KED.ass")

a=merge([a, b])
a.save("t1.ssa")
a.save("t2.ass")

This is exactly what i run, and if you play any of the two files you will find the subs are not right.

In the t1 case the colors are wrong, in the second case only is displayed KED.ass file.

Bye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant