1
#include <QApplication>
3
#include <QtCore/QString>
5
#include <QtSvg/QSvgRenderer>
12
int main(int argc, char **argv)
14
// Initialize Qt application, otherwise for some svg files it can segfault with:
15
// ASSERT failure in QFontDatabase: "A QApplication object needs to be
16
// constructed before FontConfig is used."
17
QApplication app(argc, argv);
21
cout << "Usage : ksvgtopng width height svgfilename outputfilename" << endl;
22
cout << "Please use full path name for svgfilename" << endl;
26
int width = atoi(argv[1]);
27
int height = atoi(argv[2]);
29
QImage img(width, height, QImage::Format_ARGB32_Premultiplied);
32
QSvgRenderer renderer(QString::fromLocal8Bit(argv[3]));
33
if(renderer.isValid())
38
// Apply icon sharpening
50
*img = KImageEffect::sharpen(*img, factor); // use QImageBlitz::sharpen()
54
img.save(argv[4], "PNG");