Give a slightly better error whn trying to add a KDM using add-file (#1035).
[dcpomatic.git] / src / lib / render_subtitles.cc
index fa1cf4766906e3e48840e79a94081d6d4d1a6be0..9426427fd507385a12973e0b02823af4c15b19da 100644 (file)
@@ -65,7 +65,8 @@ marked_up (list<SubtitleString> subtitles, int target_height, float fade_factor)
                        out += "underline=\"single\" ";
                }
                out += "size=\"" + dcp::raw_convert<string>(i.size_in_pixels(target_height) * 72 * 1024 / 96) + "\" ";
-               out += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65535))) + "\" ";
+               /* Between 1-65535 inclusive, apparently... */
+               out += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65534)) + 1) + "\" ";
                out += "color=\"#" + i.colour().to_rgb_string() + "\">";
                out += i.text ();
                out += "</span>";
@@ -276,7 +277,6 @@ render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp:
        }
 
        if (subtitles.front().effect() == dcp::BORDER) {
-               cout << "border it " << (subtitles.front().outline_width * target.width) << " " << fade_factor << ".\n";
                /* Border effect; stroke the subtitle with a large (arbitrarily chosen) line width */
                set_source_rgba (context, subtitles.front().effect_colour(), fade_factor);
                context->set_line_width (subtitles.front().outline_width * target.width / 2048.0);