1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-09-11 04:46:09 +03:00

Fix case-insensitive format for renderBase64 (#14361)

This commit is contained in:
Elias Winberg 2016-08-04 08:47:29 +02:00 committed by Ariya Hidayat
parent fc6ac9c33e
commit 95fdce45b9

View File

@ -1071,7 +1071,7 @@ QString WebPage::renderBase64(const QByteArray& format)
{
QByteArray nformat = format.toLower();
if (format != "pdf" && !QImageWriter::supportedImageFormats().contains(nformat)) {
if (nformat != "pdf" && !QImageWriter::supportedImageFormats().contains(nformat)) {
// Return an empty string in case an unsupported format was provided
return "";
}
@ -1081,7 +1081,7 @@ QString WebPage::renderBase64(const QByteArray& format)
QBuffer buffer(&bytes);
buffer.open(QIODevice::WriteOnly);
if (format == "pdf") {
if (nformat == "pdf") {
QPdfWriter pdfWriter(&buffer);
if (!renderPdf(pdfWriter)) {