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:
parent
fc6ac9c33e
commit
95fdce45b9
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user