X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fgtk2%2Ffilter_rescale.c;h=f9789a6efc254c4d16b37286da2d4b401a2e702f;hb=22048fea8f3365274fc4b1a193bb15d1e482895f;hp=936e0e6d49570dacc43bf2491587c97a32150e81;hpb=34caefec7aa0334f38a649838cf3ab9db7388b27;p=melted diff --git a/src/modules/gtk2/filter_rescale.c b/src/modules/gtk2/filter_rescale.c index 936e0e6..f9789a6 100644 --- a/src/modules/gtk2/filter_rescale.c +++ b/src/modules/gtk2/filter_rescale.c @@ -50,13 +50,6 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * char *interps = mlt_properties_get( properties, "rescale.interp" ); int interp = PIXOPS_INTERP_BILINEAR; - if ( strcmp( interps, "nearest" ) == 0 ) - interp = PIXOPS_INTERP_NEAREST; - else if ( strcmp( interps, "tiles" ) == 0 ) - interp = PIXOPS_INTERP_TILES; - else if ( strcmp( interps, "hyper" ) == 0 ) - interp = PIXOPS_INTERP_HYPER; - // If real_width/height exist, we want that as minimum information if ( mlt_properties_get_int( properties, "real_width" ) ) { @@ -74,12 +67,22 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * { // When no scaling is requested, revert the requested dimensions if possible mlt_properties_set_int( properties, "rescale_width", ( iwidth / 2 ) * 2 ); - mlt_properties_set_int( properties, "rescale_height", ( iheight /2 ) * 2 ); + mlt_properties_set_int( properties, "rescale_height", ( iheight / 2 ) * 2 ); } // Get the image as requested mlt_frame_get_image( this, &input, format, &iwidth, &iheight, writable ); + // Get rescale interpretation again, in case the producer wishes to override scaling + interps = mlt_properties_get( properties, "rescale.interp" ); + + if ( strcmp( interps, "nearest" ) == 0 ) + interp = PIXOPS_INTERP_NEAREST; + else if ( strcmp( interps, "tiles" ) == 0 ) + interp = PIXOPS_INTERP_TILES; + else if ( strcmp( interps, "hyper" ) == 0 ) + interp = PIXOPS_INTERP_HYPER; + if ( input != NULL ) { // If width and height are correct, don't do anything