From 12870d90ad995d6704288690125c07bb0d8bedd9 Mon Sep 17 00:00:00 2001 From: Vitaly Slobodin Date: Thu, 6 Nov 2014 18:08:37 +0300 Subject: [PATCH] Fix JPG image rendering. To pass QString as a const char* we should call .toLocal8Bit().constData(). https://github.com/ariya/phantomjs/issues/12684 --- src/webpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index 4d02cf36..ff1d43e9 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -934,7 +934,7 @@ bool WebPage::render(const QString &fileName, const QVariantMap &option) const char *f = 0; // 0 is QImage#save default if( format != "" ){ - f = format.toUtf8().constData(); + f = format.toLocal8Bit().constData(); } retval = rawPageRendering.save(outFileName, f, quality);