[vlc-devel] [PATCH] Automatically orient JPEG image based on orientation flag, if set

Rémi Denis-Courmont remi at remlab.net
Sun Apr 17 09:23:39 CEST 2016


Le 2016-04-17 05:26, Wayne McDougall a écrit :

> +    if ( b_autoorient )
> +    {
> +        i_otag = jpeg_GetOrientation( &p_sys->p_jpeg );
> +        if ( i_otag > 1 )
> +        {

ORIENT_FROM_EXIF(i_otag);

> +            msg_Info( p_dec, "Orientation is %d", i_otag
> );
> +            switch ( i_otag )
> +            {
> +            case 2:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_TOP_RIGHT;
> +                break;
> +            case 3:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_BOTTOM_RIGHT;
> +                break;
> +            case 4:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_BOTTOM_LEFT;
> +                break;
> +            case 5:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_LEFT_TOP;
> +                break;
> +            case 6:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_ROTATED_90;
> +                break;
> +            case 7:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_RIGHT_BOTTOM;
> +                break;
> +            case 8:
> +            default:
> +                p_dec->fmt_out.video.orientation =
> ORIENT_ROTATED_270;
> +            }
> +        }
> +    }
> +

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list