File indexing completed on 2025-01-05 03:58:13

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 28/08/2021
0007  * Description : a command line tool to write focus points metadata with ExifTool
0008  *
0009  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2021 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 // Qt includes
0017 
0018 #include <QString>
0019 #include <QCoreApplication>
0020 
0021 // Local includes
0022 
0023 #include "digikam_debug.h"
0024 #include "focuspoints_writer.h"
0025 
0026 using namespace Digikam;
0027 
0028 int main(int argc, char** argv)
0029 {
0030     QCoreApplication app(argc, argv);
0031 
0032     if (argc != 2)
0033     {
0034         qCDebug(DIGIKAM_TESTS_LOG) << "afpointwrite - CLI tool to write focus points metadata with ExifTool in image";
0035         qCDebug(DIGIKAM_TESTS_LOG) << "Usage: <image to write>";
0036         return -1;
0037     }
0038 
0039     FocusPointsWriter* const fpwriter = new FocusPointsWriter(qApp, QString::fromUtf8(argv[1]));
0040 
0041     FocusPoint point =
0042     {
0043         0.5,
0044         0.5,
0045         0.5,
0046         0.5
0047     };
0048 
0049     fpwriter->writeFocusPoint(point);
0050 
0051     delete fpwriter;
0052 
0053     return 0;
0054 }