~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to utilities/queuemanager/basetools/transform/rotate.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        useExif(0),
64
64
        comboBox(0),
65
65
        frSettings(0)
66
 
        {}
 
66
    {}
67
67
 
68
68
    const int             CUSTOM_ANGLE;
69
69
 
77
77
};
78
78
 
79
79
Rotate::Rotate(QObject* parent)
80
 
      : BatchTool("Rotate", TransformTool, parent),
81
 
        d(new RotatePriv)
 
80
    : BatchTool("Rotate", TransformTool, parent),
 
81
      d(new RotatePriv)
82
82
{
83
83
    setToolTitle(i18n("Rotate"));
84
84
    setToolDescription(i18n("A tool to rotate images."));
180
180
        if (useExif)
181
181
        {
182
182
            if (!exifTransform(inputUrl().toLocalFile(), inputUrl().fileName(), outputUrl().toLocalFile(), Auto))
 
183
            {
183
184
                return false;
 
185
            }
184
186
        }
185
187
        else
186
188
        {
187
 
            switch(rotation)
 
189
            switch (rotation)
188
190
            {
189
191
                case DImg::ROT90:
190
192
                    return (exifTransform(inputUrl().toLocalFile(), inputUrl().fileName(), outputUrl().toLocalFile(), Rotate90));
196
198
                    return (exifTransform(inputUrl().toLocalFile(), inputUrl().fileName(), outputUrl().toLocalFile(), Rotate270));
197
199
                    break;
198
200
                default:      // Custom value
199
 
                              // there is no loss less methode to turn JPEG image with a custom angle.
200
 
                    if (!loadToDImg()) return false;
 
201
 
 
202
                    // there is no loss less methode to turn JPEG image with a custom angle.
 
203
                    if (!loadToDImg())
 
204
                    {
 
205
                        return false;
 
206
                    }
 
207
 
201
208
                    FreeRotationFilter fr(&image(), 0L, prm);
202
209
                    fr.startFilterDirectly();
203
210
                    DImg trg = fr.getTargetImage();
210
217
 
211
218
    // Non-JPEG image: DImg
212
219
 
213
 
    if (!loadToDImg()) return false;
 
220
    if (!loadToDImg())
 
221
    {
 
222
        return false;
 
223
    }
214
224
 
215
225
    if (useExif)
216
226
    {
217
227
        DMetadata meta(inputUrl().toLocalFile());
218
 
        switch(meta.getImageOrientation())
 
228
 
 
229
        switch (meta.getImageOrientation())
219
230
        {
220
231
            case DMetadata::ORIENTATION_HFLIP:
221
232
                image().flip(DImg::HORIZONTAL);
256
267
    }
257
268
    else
258
269
    {
259
 
        switch(rotation)
 
270
        switch (rotation)
260
271
        {
261
272
            case DImg::ROT90:
262
273
                image().rotate(DImg::ROT90);