Menu

#15 'Default' not working

closed
3
2002-08-28
2002-08-26
No

The following script will generate an error:

function NTSC2PALresize(clip clip,int size)
{
s=default(size,576)
return bicubicResize(clip.width,s,0,0.5)
}

a=avisource(ntscvideo.avi)
NTSC2PALresize(a)

In v1.05 it would resize the video from 480 lines to 576
without requiring 2 arguments to the call.

Discussion

  • Håkan König

    Håkan König - 2002-08-26
    • priority: 5 --> 3
     
  • Ioura Batugowski

    Logged In: YES
    user_id=531058

    This is not a bug. It shouldn't work. To make an argument
    optional, you have to surround it with double quotes:

    function NTSC2PALresize(clip clip,int "size")
    {
    s=default(size,576)
    return clip.bicubicResize(clip.width,s,0,0.5)
    }
    a=avisource("ntscvideo.avi")
    NTSC2PALresize(a)

    When quoted, it also becomes a named argument; you can
    also call it like that:
    NTSC2PALresize(a,size=288)

    I didn't know that before reading your report and testing a bit.
    I'll update the doc, as I don't think it's mentionned anywhere.

     
  • Ioura Batugowski

    • assigned_to: nobody --> dividee
    • status: open --> closed
     

Log in to post a comment.