~ubuntu-branches/ubuntu/maverick/digikam/maverick

« back to all changes in this revision

Viewing changes to utilities/queuemanager/batchtool.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Luka Renko
  • Date: 2009-12-22 21:38:14 UTC
  • mfrom: (1.2.26 upstream)
  • Revision ID: james.westby@ubuntu.com-20091222213814-dtgz0u1068y5rql7
Tags: 2:1.0.0-1ubuntu1
* Merge with Debian, remaining changes:
  - Export .pot name and copy to plugins in debian/rules
  - Build-depend on libkipi7-dev, libkexiv2-8-dev and 
    libkdcraw8-dev (KDE 4.3 -> 4.4)
* Build-depend on liblqr-1-0-dev: now in main (LP: #493508)

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
    BatchToolPriv()
52
52
    {
53
 
        settingsWidget     = 0;
54
 
        exifSetOrientation = true;
55
 
        cancel             = false;
56
 
        last               = false;
57
 
        observer           = 0;
 
53
        settingsWidget         = 0;
 
54
        exifResetOrientation   = false;
 
55
        exifCanEditOrientation = true;
 
56
        cancel                 = false;
 
57
        last                   = false;
 
58
        observer               = 0;
58
59
    }
59
60
 
60
 
    bool                       exifSetOrientation;
 
61
    bool                       exifResetOrientation;
 
62
    bool                       exifCanEditOrientation;
61
63
    bool                       cancel;
62
64
    bool                       last;
63
65
 
74
76
 
75
77
    DImg                       image;
76
78
 
 
79
    DRawDecoding               rawDecodingSettings;
 
80
 
77
81
    BatchToolSettings          settings;
78
82
 
79
83
    BatchToolObserver*         observer;
215
219
    return d->image;
216
220
}
217
221
 
218
 
void BatchTool::setExifSetOrientation(bool set)
219
 
{
220
 
    d->exifSetOrientation = set;
221
 
}
222
 
 
223
 
bool BatchTool::getExifSetOrientation() const
224
 
{
225
 
    return d->exifSetOrientation;
 
222
void BatchTool::setNeedResetExifOrientation(bool set)
 
223
{
 
224
    d->exifResetOrientation = set;
 
225
}
 
226
 
 
227
bool BatchTool::getNeedResetExifOrientation() const
 
228
{
 
229
    return d->exifResetOrientation;
 
230
}
 
231
 
 
232
void BatchTool::setResetExifOrientationAllowed(bool set)
 
233
{
 
234
    d->exifCanEditOrientation = set;
 
235
}
 
236
 
 
237
bool BatchTool::getResetExifOrientationAllowed() const
 
238
{
 
239
    return d->exifCanEditOrientation;
 
240
}
 
241
 
 
242
void BatchTool::setRawDecodingSettings(const DRawDecoding& settings)
 
243
{
 
244
    d->rawDecodingSettings = settings;
 
245
}
 
246
 
 
247
DRawDecoding BatchTool::getRawDecodingSettings() const
 
248
{
 
249
    return d->rawDecodingSettings;
226
250
}
227
251
 
228
252
void BatchTool::setWorkingUrl(const KUrl& workingUrl)
289
313
{
290
314
    if (!d->image.isNull()) return true;
291
315
 
292
 
    return d->image.load(inputUrl().toLocalFile(), d->observer);
 
316
    return d->image.load(inputUrl().toLocalFile(), d->observer, getRawDecodingSettings());
293
317
}
294
318
 
295
319
bool BatchTool::savefromDImg()
301
325
    {
302
326
        // In case of output support is not set for ex. with all tool which do not convert to new format.
303
327
        DImg::FORMAT format = (DImg::FORMAT)(d->image.attribute("detectedFileFormat").toInt());
304
 
        d->image.updateMetadata(DImg::formatToMimeType(format), QString(), getExifSetOrientation());
 
328
        d->image.updateMetadata(DImg::formatToMimeType(format), QString(),
 
329
                                getResetExifOrientationAllowed() && getNeedResetExifOrientation());
305
330
        return( d->image.save(outputUrl().toLocalFile(), format, d->observer) );
306
331
    }
307
332
 
308
 
    d->image.updateMetadata(frm, QString(), getExifSetOrientation());
 
333
    d->image.updateMetadata(frm, QString(), getResetExifOrientationAllowed() && getNeedResetExifOrientation());
309
334
    bool b   = d->image.save(outputUrl().toLocalFile(), frm, d->observer);
310
335
    d->image = DImg();
311
336
    return b;