amichaeltm / BDSup2SubPlusPlus

Port of the original BDSup2Sub to C++ and Qt.
Apache License 2.0
30 stars 6 forks source link

Bad X coordinates after crop of XML/PNG subtitle #3

Closed amichaeltm closed 6 years ago

amichaeltm commented 6 years ago

From r0lz bug report:

To reproduce it, convert the sample to XML/PNG with BDSup2Sub++. (Do not use a Java version, as the transparency bug will happen.) Then, reload the XML/PNG stream in BDSup2Sub++. Subtitles 3, 4, 7 etc... are not at their right positions any more. That bug happens when the text of the subtitle is embedded in a largwer transparent canvas. When the XML/PNG stream is loaded, BDSup2Sub crops the useless part of the background. Unfortunately, BDSup2Sub++ doesn't compute the new coordinates correctly, and fails. Note also trhat subtitle 2 is apparently correctly placed the first time it is displayed, but if you select another subtitle then subtitle 2 again, it has moved up. Do it several times and finally, the subtitle touches the top border of the screen!

Transparency_and_crop_bug_sample.zip

amichaeltm commented 6 years ago

Fortunately this was easy to resolve. Fixed in ae2c1a96a28d8f63b024a9937e9553a92ed82789.

Image positions no longer drift as you go back and forth between the subtitles.