Open EsbernTK opened 8 months ago
I added a little change to fix but it raises a few questions on how should we cater to this case.
Should we:
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.
Expected Behavior
I have a video file with frame size width: 4480 height: 3096, and i am doing a resize of (224, None) The expected resized frame would be (224, 324)
Actual Behavior
The actual frame i get back is (223, 324), and it is caused by the integer conversion on this line The ratio calculation resolves to 0.07235142118863049 which when multiplied with 3096 gives 223.99999999999997 and is thus rounded down to 223 by the integer conversion. It would be lovely if the shape calculation forced the given axis to be the same as the requested shape, instead of recalculating it using the ratio calculation which is prone to error.
Steps to Reproduce the Problem
Specifications