1
/** ===========================================================
3
* This file is a part of digiKam project
4
* <a href="http://www.digikam.org">http://www.digikam.org</a>
7
* @brief a command line tool to parse metadata dedicated to LensFun
9
* @author Copyright (C) 2010 by Gilles Caulier
10
* <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
12
* This program is free software; you can redistribute it
13
* and/or modify it under the terms of the GNU General
14
* Public License as published by the Free Software Foundation;
15
* either version 2, or (at your option)
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* ============================================================ */
36
#include "lensfuniface.h"
38
using namespace Digikam;
40
int main (int argc, char** argv)
44
kDebug() << "testlensfuniface - test to parse metadata dedicated to LensFun";
45
kDebug() << "Usage: <image>";
49
QString filePath(argv[1]);
52
DMetadata meta(img.getMetadata());
54
LensFunIface::MetadataMatch ret = iface.findFromMetadata(meta);
55
if (ret == LensFunIface::MetadataExactMatch)
57
LensFunFilter filter(&img, 0L, iface.settings());
58
filter.startFilterDirectly();
59
img.putImageData(filter.getTargetImage().bits());
61
Digikam::KExiv2Data data = img.getMetadata();
62
filter.registerSettingsToXmp(data);
63
img.setMetadata(data);
64
return img.save("lensfuniface-output.png", "PNG");