Skip to content

Commit c074763

Browse files
authored
Merge pull request #1778 from CastagnaIT/ttml_images
[CodecHandler][TTML] Print warning for backgroundImage attribute
2 parents d8e2a9b + efe4b68 commit c074763

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/codechandler/ttml/TTML.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ void TTML2SRT::ParseTagBody(pugi::xml_node nodeTT)
163163
// Parse <body> <div> child tags
164164
for (xml_node nodeDiv : nodeBody.children("div"))
165165
{
166+
// Subtitles that make use of images to show text are not supported
167+
if (nodeDiv.attribute("smpte:backgroundImage") || nodeDiv.attribute("tts:backgroundImage"))
168+
{
169+
LOG::LogF(LOGWARNING,
170+
"The \"backgroundImage\" attribute to show subtitles images is not supported.");
171+
}
172+
166173
// Parse <body> <div> <p> child tags
167174
for (xml_node nodeP : nodeDiv.children("p"))
168175
{
@@ -276,6 +283,13 @@ TTML2SRT::Style TTML2SRT::ParseStyle(pugi::xml_node node)
276283
style.id = XML::GetAttrib(node, "xml:id");
277284
style.color = XML::GetAttrib(node, "tts:color");
278285

286+
// Subtitles that make use of images to show text are not supported
287+
if (node.attribute("tts:backgroundImage"))
288+
{
289+
LOG::LogF(LOGWARNING,
290+
"The \"backgroundImage\" attribute to show subtitles images is not supported.");
291+
}
292+
279293
std::string styleVal;
280294
if (XML::QueryAttrib(node, "tts:textDecoration", styleVal))
281295
{

0 commit comments

Comments
 (0)