Log in

View Full Version : Inconsistant parameter handling


Zarxrax
19th May 2011, 17:23
Today I was quite surprised when I noticed that I couldn't get a very simple command to work.

Crop(left=16,top=16,right=-16,bottom=-16)

I also experienced failure with
Crop(left=16,top=16,-right=-16,-bottom=-16)
Crop(left=16,top=16,width=16,height=16)

Of course, Crop(16,16,-16,-16) works perfectly.
It seems that manually specifying the parameter names causes it to break. At least with version 2.58 of Avisynth.
I do seem to recall using the parameter names with success, years ago though.

It's not just Crop though.
Spline36Resize(target_width=640,target_height=480)
SSRC(samplerate=48000)
Trim (first_frame=0, last_frame=100)
These all don't work. And maybe many more.

Of course, no one ever uses the parameter names for any of these, so it doesn't really matter, I suppose.
But, how is one to know which parameters can be specifically assigned, and which cant? What's the reason for this odd behavior?
I haven't tested any other avisynth versions besides 2.58. Does anyone know if it persists in 2.6?

Gavino
19th May 2011, 17:34
Mandatory parameters cannot be passed by name.

Zarxrax
19th May 2011, 17:59
Ah I see.
Has this always been the case though? Because I do seem to remember using the crop parameters in the past.

Gavino
19th May 2011, 19:45
As far as I know, it has always been like that.
Internally, mandatory parameters do not have an associated name in the stored function definition.

Perhaps you were thinking of the additional (optional) cropping parameters on the resizers?