Ticket #12424: 0002-Orient-before-resize.patch

File 0002-Orient-before-resize.patch, 2.0 KB (added by Roger Siddons <dizygotheca@…>, 5 years ago)

Patch 2

  • mythtv/libs/libmythui/mythuiimage.cpp

    From 9ac269fffc88682ea487c3d9efecc07ce3d72417 Mon Sep 17 00:00:00 2001
    From: Roger Siddons <dizygotheca@ntlworld.com>
    Date: Tue, 3 Feb 2015 00:04:39 +0000
    Subject: [PATCH 2/4] Orient before resize
    
    An image is currently re-sized before being orientated. This results in the bottom of portrait-orientated pics going off-screen.
    This patch orientates an image before re-sizing it.
    
    diff --git a/mythtv/libs/libmythui/mythuiimage.cpp b/mythtv/libs/libmythui/mythuiimage.cpp
    index 03dcc80..e6d321e 100644
    a b class ImageLoader 
    318318
    319319        if (image && !bFoundInCache)
    320320        {
     321            if (imProps.isReflected)
     322                image->Reflect(imProps.reflectAxis, imProps.reflectShear,
     323                               imProps.reflectScale, imProps.reflectLength,
     324                               imProps.reflectSpacing);
     325
     326            if (imProps.isGreyscale)
     327                image->ToGreyscale();
     328
     329            if (imProps.isOriented)
     330                image->Orientation(imProps.orientation);
     331
    321332            // Even if an explicit size wasn't defined this image may still need
    322333            // to be scaled because of a difference between the theme resolution
    323334            // and the screen resolution. We want to avoid scaling twice.
    class ImageLoader 
    359370                image->setAlphaChannel(mask.alphaChannel());
    360371            }
    361372
    362             if (imProps.isReflected)
    363                 image->Reflect(imProps.reflectAxis, imProps.reflectShear,
    364                                imProps.reflectScale, imProps.reflectLength,
    365                                imProps.reflectSpacing);
    366 
    367             if (imProps.isGreyscale)
    368                 image->ToGreyscale();
    369 
    370             if (imProps.isOriented)
    371                 image->Orientation(imProps.orientation);
    372 
    373373            if (!imageReader)
    374374                GetMythUI()->CacheImage(cacheKey, image);
    375375        }