Jack Poulson
Jack Poulson

Reputation: 1355

Creating a PNG with Qt5 without a display server

Since Qt5's QPixmap::save function supports saving into various image formats, such as PNG, I have added support into a library which is often used on large clusters. Unfortunately, these machines typically don't have display servers running, but I would still like to use Qt5's ability to save images.

Is it possible to use Qt5's simplified interface to libpng and friends when no display server is running? The advice given in this question suggests launching with the -platform offscreen command-line option, but that simply results in a segfault with Qt-5.1.1 when I attempt to write to a QPixmap. Creating a QCoreApplication instead of a QApplication is unfortunately also inadequate.

Upvotes: 2

Views: 259

Answers (2)

peppe
peppe

Reputation: 22744

Use QImage, QGuiApplication and the offscreen platform plugin.

Upvotes: 2

Boris Ivanov
Boris Ivanov

Reputation: 4254

You can always run graphic application in Framebuffer on Linux. FrameBuffer

Upvotes: 0

Related Questions