sumawo13
8th September 2009, 22:30
I am writing my own function to crop and resize to mod16. My problem is that if I don't specifiy anything for the crop values, it spits out an error, even though I have set defaults. Below is my script.
function aspectratio(clip clip, int aspect_x, int aspect_y, int crop_l, int crop_t, int crop_r, int crop_b)
{
crop_l=default(crop_l,0)
crop_t=default(crop_t,0)
crop_r=default(crop_r,0)
crop_b=default(crop_b,0)
a=clip.width()
b=a/(aspect_x/aspect_y)
y=a%16
z=b%16
wid=y > 0 ? a-y : a
hit=z > 0 ? b-z : b
spline16resize(clip,wid,hit,crop_l,crop_t,crop_r,crop_b)
}
function aspectratio(clip clip, int aspect_x, int aspect_y, int crop_l, int crop_t, int crop_r, int crop_b)
{
crop_l=default(crop_l,0)
crop_t=default(crop_t,0)
crop_r=default(crop_r,0)
crop_b=default(crop_b,0)
a=clip.width()
b=a/(aspect_x/aspect_y)
y=a%16
z=b%16
wid=y > 0 ? a-y : a
hit=z > 0 ? b-z : b
spline16resize(clip,wid,hit,crop_l,crop_t,crop_r,crop_b)
}