~ubuntu-branches/ubuntu/maverick/kdegraphics/maverick-proposed

« back to all changes in this revision

Viewing changes to libs/libkexiv2/test/erasetag.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 14:03:43 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20091202140343-2732gbkj69g89arq
Tags: 4:4.3.80-0ubuntu1
* New upstream beta release:
  - Add build-depend on shared-desktop-ontologies for nepomuk integration
  - Bump .so versions for libkexiv, libkdcraw and libkipi
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of kipi-plugins project
 
4
 * http://www.kipi-plugins.org
 
5
 *
 
6
 * Date        : 2009-06-11
 
7
 * Description : a command line tool to tag from photo
 
8
 *
 
9
 * Copyright (C) 2009 by Gilles Caulier <caulier dot gilles at gmail dot com> 
 
10
 *
 
11
 * This program is free software; you can redistribute it
 
12
 * and/or modify it under the terms of the GNU General
 
13
 * Public License as published by the Free Software Foundation;
 
14
 * either version 2, or (at your option) any later version.
 
15
 *
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 *
 
21
 * ============================================================ */
 
22
 
 
23
// Qt includes.
 
24
 
 
25
#include <QString>
 
26
#include <QFile>
 
27
 
 
28
// KDE includes.
 
29
 
 
30
#include "kdebug.h"
 
31
 
 
32
// Local includes.
 
33
 
 
34
#include "kexiv2.h"
 
35
 
 
36
using namespace KExiv2Iface;
 
37
 
 
38
int main (int argc, char **argv)
 
39
{
 
40
    if(argc != 2) 
 
41
    {
 
42
        kDebug(51003) << "erasetag - erase tag from from image" << endl;
 
43
        kDebug(51003) << "Usage: <image>" << endl;
 
44
        return -1;
 
45
    }
 
46
 
 
47
    QString filePath(argv[1]);
 
48
 
 
49
    KExiv2 meta;
 
50
    meta.load(filePath);
 
51
    meta.setWriteRawFiles(true);
 
52
    bool b = meta.removeExifTag("Exif.OlympusIp.BlackLevel", false);
 
53
    kDebug() << "Exif.OlympusIp.BlackLevel found = " << b;
 
54
 
 
55
    QByteArray ba = meta.getExifTagData("Exif.OlympusIp.BlackLevel");
 
56
    kDebug() << "Exif.OlympusIp.BlackLevel removed = " << ba.isEmpty();
 
57
 
 
58
    if (b)
 
59
    {
 
60
        meta.applyChanges();
 
61
    }
 
62
 
 
63
    return 0;
 
64
}