Ticket #12278: 0001-MythGallery-generate-thumb-with-correct-rotation.patch

File 0001-MythGallery-generate-thumb-with-correct-rotation.patch, 1.1 KB (added by angela.schmid@…, 5 years ago)
  • mythplugins/mythgallery/mythgallery/thumbgenerator.cpp

    From 214e0b97b59e90db95fffdef486234e4288e9803 Mon Sep 17 00:00:00 2001
    From: angelaschmid <angela.schmid@wolke7.net>
    Date: Sat, 20 Sep 2014 01:25:20 +0200
    Subject: [PATCH] MythGallery: generate thumb with rotation angle from EXIF
    
    ---
     mythplugins/mythgallery/mythgallery/thumbgenerator.cpp | 8 ++++++++
     1 file changed, 8 insertions(+)
     mode change 100644 => 100755 mythplugins/mythgallery/mythgallery/thumbgenerator.cpp
    
    diff --git a/mythplugins/mythgallery/mythgallery/thumbgenerator.cpp b/mythplugins/mythgallery/mythgallery/thumbgenerator.cpp
    index bf3fff0..b520fb3
    a b void ThumbGenerator::loadFile(QImage& image, const QFileInfo& fi) 
    368368#endif
    369369
    370370        image.load(fi.absoluteFilePath());
     371
     372        int rotateangle = GalleryUtil::GetNaturalRotation(fi.absoluteFilePath());
     373        if (rotateangle != 0)
     374        {
     375            QMatrix matrix;
     376            matrix.rotate(rotateangle);
     377            image = image.transformed(matrix, Qt::SmoothTransformation);
     378        }
    371379    }
    372380}
    373381