moviepy
moviepy copied to clipboard
Fix resize func for https://github.com/Zulko/moviepy/issues/2049
Fixes https://github.com/Zulko/moviepy/issues/2049
- [ ] I have provided code that clearly demonstrates the bug and that only works correctly when applying this fix
- [x] I have added suitable tests demonstrating a fixed bug or new/changed feature to the test suite in
tests/
Sorry - I couldn't get precommit to work without the first commit in my PR, feel free to drop that if you choose to merge.
From issue:
I added a little change to fix but it raises a few questions on how should we cater to this case.
Should we:
- leave as is - because if you want a specific resolution, you should specify it completely.
- use the target dimension as specified, calculate the other. and/or
- use proper rounding functions? perhaps use
ceil
or at the very least round even?
One could argue that if a result comes to " 12.2 pixels" (or in the example case 223.9999) then it should be
ceil
'd so that we have a pixel to cover that extra little bit that should be there.
But on the whole, I would expect that if i said "I want target height to be 100" it should come out as 100.