Bug 457878 - Kdenlive ignores more than one space in the subtitles.
Summary: Kdenlive ignores more than one space in the subtitles.
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Effects & Transitions (show other bugs)
Version: 22.04.3
Platform: PCLinuxOS Linux
: NOR normal
Target Milestone: ---
Assignee: erjiang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-14 11:27 UTC by qla0
Modified: 2022-09-05 06:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qla0 2022-08-14 11:27:49 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. create some project
2. add some subtitles - example:
subtitle 1      subtitle 2                subtitle 3                           subtitle 4
3. save project
4. close kdenlive
5. open project

OBSERVED RESULT
The subtitles are displayed like this:

subtitle 1 subtitle 2 subtitle 3 subtitle 4

EXPECTED RESULT

subtitle 1      subtitle 2                subtitle 3                           subtitle 4

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
kdenlive ver.  22.04.3   and    kdenlive-master-309-linux-64-gcc.AppImage too
Comment 1 erjiang 2022-08-15 00:09:49 UTC
Confirmed on latest master (74ef83e0): when adding subs with many spaces, kdenlive saves all of the spaces into the srt file. When opening the kdenlive project again, the spaces are lost and the srt file is overwritten, losing the spaces.
Comment 2 Bug Janitor Service 2022-08-16 03:57:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/kdenlive/-/merge_requests/340
Comment 3 qla0 2022-08-22 08:50:23 UTC
kdenlive:
ver. 22.08.0
ver. 22.11.70 (rev. 448dc5b73)

Still many spaces is ignored!.
Comment 4 erjiang 2022-08-23 05:38:34 UTC
The merge request linked above has not been merged yet. If/when it has been merged, you would be able to test it in a nightly build or another later build that contains it.
Comment 5 erjiang 2022-08-23 07:22:51 UTC
Git commit 61c735cd77b191440533a967511bb14749e16017 by Eric Jiang.
Committed on 23/08/2022 at 05:50.
Pushed by mardelle into branch 'master'.

Don't remove consecutive spaces in SRT subtitles

The Kdenlive UI allows you to add multiple spaces between words in
subtitles. This displays correctly in the UI and is preserved when
saving the SRT file, but the spaces are removed when opening the SRT
file.

Changing line.simplified() to line.trimmed() seems to fix the round-trip
issue.

M  +1    -1    src/bin/model/subtitlemodel.cpp
A  +4    -0    tests/dataset/multiple-spaces.srt
M  +8    -0    tests/subtitlestest.cpp

https://invent.kde.org/multimedia/kdenlive/commit/61c735cd77b191440533a967511bb14749e16017
Comment 6 Jean-Baptiste Mardelle 2022-09-05 06:43:49 UTC
Git commit 6e6d06dd2d010ea88160783bc89f751c25a868cd by Jean-Baptiste Mardelle, on behalf of Eric Jiang.
Committed on 05/09/2022 at 06:37.
Pushed by mardelle into branch 'release/22.08'.

Don't remove consecutive spaces in SRT subtitles

The Kdenlive UI allows you to add multiple spaces between words in
subtitles. This displays correctly in the UI and is preserved when
saving the SRT file, but the spaces are removed when opening the SRT
file.

Changing line.simplified() to line.trimmed() seems to fix the round-trip
issue.

M  +1    -1    src/bin/model/subtitlemodel.cpp
A  +4    -0    tests/dataset/multiple-spaces.srt

https://invent.kde.org/multimedia/kdenlive/commit/6e6d06dd2d010ea88160783bc89f751c25a868cd