~ubuntu-branches/ubuntu/quantal/libkexiv2/quantal

« back to all changes in this revision

Viewing changes to libkexiv2/kexiv2exif.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-05-26 14:27:02 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120526142702-duh6ecr459d92ni9
Tags: 4:4.8.80-0ubuntu1
* New upstream beta release
  - replace libkexiv2-10 with libkexiv2-11 for new ABI version
  - refresh libkexiv2-11.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * @date   2006-09-15
8
8
 * @brief  Exif manipulation methods
9
9
 *
10
 
 * @author Copyright (C) 2006-2011 by Gilles Caulier
 
10
 * @author Copyright (C) 2006-2012 by Gilles Caulier
11
11
 *         <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
12
 
 * @author Copyright (C) 2006-2011 by Marcel Wiesweg
 
12
 * @author Copyright (C) 2006-2012 by Marcel Wiesweg
13
13
 *         <a href="mailto:marcel dot wiesweg at gmx dot de">marcel dot wiesweg at gmx dot de</a>
14
14
 *
15
15
 * This program is free software; you can redistribute it
27
27
 
28
28
#include "kexiv2.h"
29
29
#include "kexiv2_p.h"
 
30
#include "rotationmatrix.h"
30
31
 
31
32
// KDE includes
32
33
 
75
76
    return false;
76
77
}
77
78
 
78
 
QByteArray KExiv2::getExif(bool addExifHeader) const
79
 
{
80
 
    return getExifEncoded(addExifHeader);
81
 
}
82
 
 
83
79
QByteArray KExiv2::getExifEncoded(bool addExifHeader) const
84
80
{
85
81
    try
831
827
 
832
828
bool KExiv2::rotateExifQImage(QImage& image, ImageOrientation orientation) const
833
829
{
834
 
    QMatrix matrix;
835
 
 
836
 
    switch(orientation)
837
 
    {
838
 
        case ORIENTATION_HFLIP:
839
 
            matrix.scale(-1, 1);
840
 
            break;
841
 
 
842
 
        case ORIENTATION_ROT_180:
843
 
            matrix.rotate(180);
844
 
            break;
845
 
 
846
 
        case ORIENTATION_VFLIP:
847
 
            matrix.scale(1, -1);
848
 
            break;
849
 
 
850
 
        case ORIENTATION_ROT_90_HFLIP:
851
 
            matrix.scale(-1, 1);
852
 
            matrix.rotate(90);
853
 
            break;
854
 
 
855
 
        case ORIENTATION_ROT_90:
856
 
            matrix.rotate(90);
857
 
            break;
858
 
 
859
 
        case ORIENTATION_ROT_90_VFLIP:
860
 
            matrix.scale(1, -1);
861
 
            matrix.rotate(90);
862
 
            break;
863
 
 
864
 
        case ORIENTATION_ROT_270:
865
 
            matrix.rotate(270);
866
 
            break;
867
 
 
868
 
        default:
869
 
            break;
870
 
    }
871
 
 
872
 
    if (orientation != ORIENTATION_NORMAL)
 
830
    QMatrix matrix = RotationMatrix::toMatrix(orientation);
 
831
 
 
832
    if (orientation != ORIENTATION_NORMAL || orientation != ORIENTATION_UNSPECIFIED)
873
833
    {
874
834
        image = image.transformed(matrix);
875
835
        return true;