OpusGang / awsmfunc

awesome VapourSynth functions
MIT License
17 stars 4 forks source link

zresize with preset option should calculate AR based on dimensions after cropping #9

Closed cnzqy1 closed 2 years ago

cnzqy1 commented 2 years ago

I believe https://github.com/OpusGang/awsmfunc/blob/41cf38e69f09d9a08f3698ec71e5b534c07cb0e2/awsmfunc/base.py#L789 needs to be changed to include cropping in the calculation. Right now resize = awf.zr(hbd, preset=720, top=1, bottom=1) with 1920x1080 input gives 1282x720.

cnzqy1 commented 2 years ago

Changing the line to if (clip.width - left - right) / (clip.height - top - bottom) > ar: should solve the issue.