Add support for psd, xcf and exr images (KDE libraries needed for these formats)...
[melted] / src / modules / plus / transition_affine.c
index 186ad8b..aaca097 100644 (file)
@@ -3,19 +3,19 @@
  * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
  * Author: Charles Yates <charles.yates@pandora.be>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include "transition_affine.h"
@@ -392,6 +392,8 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        int normalised_width = mlt_properties_get_int( a_props, "normalised_width" );
        int normalised_height = mlt_properties_get_int( a_props, "normalised_height" );
 
+       double consumer_ar = mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) ;
+
        // Structures for geometry
        struct mlt_geometry_item_s result;
 
@@ -414,15 +416,18 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        b_width = result.w;
        b_height = result.h;
 
+       if ( mlt_properties_get_double( b_props, "aspect_ratio" ) == 0.0 )
+               mlt_properties_set_double( b_props, "aspect_ratio", consumer_ar );
+
        if ( !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
        {
                mlt_properties_set( b_props, "rescale.interp", "nearest" );
-               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "aspect_ratio" ) );
+               mlt_properties_set_double( b_props, "consumer_aspect_ratio", consumer_ar );
        }
        else
        {
                mlt_properties_set( b_props, "rescale.interp", mlt_properties_get( a_props, "rescale.interp" ) );
-               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+               mlt_properties_set_double( b_props, "consumer_aspect_ratio", consumer_ar );
        }
 
        mlt_properties_set_int( b_props, "distort", mlt_properties_get_int( properties, "distort" ) );
@@ -468,9 +473,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
 
                get_affine( &affine, this, ( float )position );
 
-               lower_x -= ( lower_x & 1 );
-               upper_x -= ( upper_x & 1 );
-
                q = *image;
 
                dz = MapZ( affine.matrix, 0, 0 );