On Sat, Aug 26, 2017 at 08:14:57PM +0200, Stephan Witt wrote:
> 
> ATM, I don’t have a solution for this problem. The inclusion of ImageMagick
> as part of the LyX bundle doesn’t look attractive. Much work and not a good
> system design. And definitively not possible for the LyX 2.3.0 release.

I wonder whether a home-made ImageMagick can help. The attached very small
program converts any image format known to Qt5 to the format specified by
the extension of the output file.

-- 
Enrico
/*
set cflags=`env PKG_CONFIG_PATH=/usr/local/qt5/lib/pkgconfig pkg-config 
--cflags Qt5Widgets`
set libs=`env PKG_CONFIG_PATH=/usr/local/qt5/lib/pkgconfig pkg-config --libs 
--static Qt5Widgets`
g++ -std=gnu++11 $cflags qsvg2png.cpp -o qsvg2png $libs
*/
#include <iostream>
#include <QtWidgets>

int main(int argc, char **argv)
{
    if (argc != 3) {
        std::cerr << "Usage: " << argv[0]
                  << " input.svgz output.png" << std::endl;
        return 1;
    }
    QApplication app(argc, argv);
    QPixmap pm;
    if (!pm.load(QString::fromLocal8Bit(argv[1]))) {
        std::cerr << "Cannot load image " << argv[1] << std::endl;
        return 1;
    }
    if (!pm.save(QString::fromLocal8Bit(argv[2]))) {
        std::cerr << "Cannot save converted image to " << argv[2] << std::endl;
        return 1;
    }
    return 0;
}

Reply via email to