1
/* ============================================================
3
* This file is a part of kipi-plugins project
4
* http://www.kipi-plugins.org
7
* Description : a command line tool to test PGF scaled to QImage
9
* Copyright (C) 2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
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.
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.
21
* ============================================================ */
37
using namespace Digikam;
39
int main(int argc, char** argv)
43
kDebug() << "pgfscaled - Load scaled version of PGF image and save to PNG";
44
kDebug() << "Usage: <pgffile>";
52
QString fname(argv[1]);
55
if ( !file.open(QIODevice::ReadOnly) )
57
kDebug() << "Cannot open PGF file to read...";
61
// PGF => QImage conversion
63
if (!loadPGFScaled(img, file.fileName(), 1280))
65
kDebug() << "loadPGFScaled failed...";
69
img.save(file.fileName()+QString("-scaled.png"), "PNG");