Bug 463382

Summary: "Replace Clip" on an image in the Project Bin can result in bad clip timing on timeline
Product: [Applications] kdenlive Reporter: TheMogMiner <therealmogminer>
Component: User Interface & MiscellaneousAssignee: Jean-Baptiste Mardelle <jb>
Status: RESOLVED FIXED    
Severity: minor CC: erjiang
Priority: NOR    
Version First Reported In: 22.08.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 22.12.1
Sentry Crash Report:
Attachments: Before replacement.
After clip replacement.

Description TheMogMiner 2022-12-23 08:53:29 UTC
Created attachment 154775 [details]
Before replacement.

SUMMARY
If the user replaces an image clip in the Project Bin with another image clip, and the clip is currently in-use on the timeline with a duration that does not match the default duration for image clips in the user's settings, any uses of that clip on the timeline will have their duration reset to the default duration.

STEPS TO REPRODUCE
1. Create two image assets of identical format and size. For the sake of matching the attached screenshots, I will call them tv_icon.png and music_icon.png, both 32-bit 64x64 PNGs with no compression.
2. Create an empty Kdenlive project.
3. Add one image to the Project Bin.
4. Drag the image clip into the Timeline.
5. Drag the length of the clip to be greater or less than the current default length for image clips.
6. Right-click on the clip in the Project Bin.
7. Select "Replace Clip".
8. Replace the current clip contents with the second image asset created in step 1.
9. Observe that the length of the clip on the Timeline will be reset to the default length for image clips.

OBSERVED RESULT
Image clips that are in-use on the Timeline will have their length reset to the user's current default length for image clips.

EXPECTED RESULT
Clips currently present on the Timeline should have their lengths unaltered, particularly as the same image may have a variety of lengths applied in separate uses on the Timeline.

SOFTWARE/OS VERSIONS
Windows: Windows 10 Pro, 64-bit, 21H2, 19044.1826
Comment 1 TheMogMiner 2022-12-23 08:54:15 UTC
Created attachment 154776 [details]
After clip replacement.
Comment 2 erjiang 2023-01-02 07:00:16 UTC
Confirmed on latest master that image clips longer than the default length are shortened to the default length. However, was not able to reproduce image clips shorter than the default length being reset.
Comment 3 Jean-Baptiste Mardelle 2023-01-02 12:06:12 UTC
Git commit a58689dbb4b58906525ae5d06451db714f08d1f5 by Jean-Baptiste Mardelle.
Committed on 02/01/2023 at 12:06.
Pushed by mardelle into branch 'release/22.12'.

Fix replacing image clip discards its duration.
FIXED-IN: 22.12.1

M  +14   -3    src/bin/projectclip.cpp

https://invent.kde.org/multimedia/kdenlive/commit/a58689dbb4b58906525ae5d06451db714f08d1f5