From 593f69a861f9f46785f54ee6d8663497e600d4de Mon Sep 17 00:00:00 2001 From: Vladislav Tarakanov Date: Mon, 17 Feb 2025 20:46:11 +0400 Subject: [PATCH] QCupsPrintEnginePrivate: Use "true" for "landscape" option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CUPS treats the "landscape" option as a boolean value (IPP_TAG_BOOLEAN). In this case, all values ​​other than "true", "on" and "yes" are considered as false. As a result, using an empty string as the value for the "landscape" option results in the print area still being portrait. Currently, the problem with printing landscape images (png, jpeg, etc.) in Qt programs (e.g. Okular, Gwenview) occurs on Fedora 41 and other distributions using cups-filters v2.0+. The patch adds passing the value "true" instead of an empty string for the "landscape" option, as CUPS expects for changing the orientation. Pick-to: 6.8 Change-Id: Ib7ad1e2debcfff10e673757c97ef5614fb59a6ca Reviewed-by: Albert Astals Cid Reviewed-by: Lars Knoll (cherry picked from commit a77173486aaf9d2e4107f6e1120ac2316ae1c96f) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/printsupport/cups/qcupsprintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/printsupport/cups/qcupsprintengine.cpp b/src/plugins/printsupport/cups/qcupsprintengine.cpp index e534874dad8..97e51b17b04 100644 --- a/src/plugins/printsupport/cups/qcupsprintengine.cpp +++ b/src/plugins/printsupport/cups/qcupsprintengine.cpp @@ -215,7 +215,7 @@ void QCupsPrintEnginePrivate::closePrintDevice() } if (m_pageLayout.orientation() == QPageLayout::Landscape) - options.emplace_back("landscape", ""); + options.emplace_back("landscape", "true"); QStringList::const_iterator it = cupsOptions.constBegin(); Q_ASSERT(cupsOptions.size() % 2 == 0);