Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.08k stars 1.51k forks source link

Fix resize func for https://github.com/Zulko/moviepy/issues/2049 #2093

Open Dotrar opened 5 months ago

Dotrar commented 5 months ago

Fixes https://github.com/Zulko/moviepy/issues/2049

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:

  1. leave as is - because if you want a specific resolution, you should specify it completely.
  2. use the target dimension as specified, calculate the other. and/or
  3. 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.