Bug 263347 - print wizard ignores selected paper size, reverts to A4
Summary: print wizard ignores selected paper size, reverts to A4
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-PrintCreator (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-16 19:40 UTC by Oliver Henshaw
Modified: 2018-06-19 10:28 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Henshaw 2011-01-16 19:40:39 UTC
Version:           1.6.0 (using KDE 4.5.4) 
OS:                Linux

The original bug was encountered when trying to print passport photos onto 4x6" photo paper - I used one of the passport photo templates the print assistant assembles the pictures on the page but the printed result is all wrong - the individual photos are too big and the whole set no longer fit on one page. I also tried with the custom template and with the template in bug #257636. I tried to print to pdf instead (setting a custom size), but this also fails - okular's pdf properties reports that the page size is 209x297mm.

I can also reproduce this with a single image and a simple template, printing to pdf, as follows:

1. Start the print assistant from gwenview or digikam
2. "Print to PDF"
3. Page Settings -> A5 (this is 148x210mm)
4. Stay with one copy of the image and go -> Next
5. Choose the "Full page" layout
6. Next -> Finish
7. Name output file -> Print
8. Open the file in okular
9. View File -> Properties

Actual results:

209x297mm page size.

Expected results:

148x210mm page size


Note 1:

If I amend step 7 to add "enter print properties, see A5 listed as paper size, press OK" then the resulting pdf has the correct paper size. 

Note 2:

If I amend step 3 so that I choose a custom 4x6" page size and enter print properties at the end (as in the amended step 7 from Note 1) the page size is wildly off (33x47").


Packages affected:

kipi-plugins-1.6.0-1.fc13.1.x86_64 (*)
kdegraphics-4.5.4-1.fc13.x86_64

This is the f13 kipi-plugins rebuilt with patches from trunk in the hope that they would solve this problem (svn r1204438, 1204439, 1211416, 1211747, 1212175)

Reproducible: Always
Comment 1 caulier.gilles 2011-01-16 20:37:37 UTC
Can you test with kipi-plugins 1.7.0 ?

Gilles Caulier
Comment 2 Angelo Naselli 2011-01-17 10:10:59 UTC
hmm i've just tried your steps with kipi-plugins 1.6.0 and works here.
Since your version contains patches i've added after 1.6.0 (so Gilles your test 
should be unnecessary) maybe it's a regression, but i can't test it here at the 
moment. What is odd is that i didn't touch print assistant code but only
printimages one.

I will check it anyway later.
Comment 3 Oliver Henshaw 2011-01-17 19:15:22 UTC
Testing with F15 rawhide, I don't see any problems apart from that mentioned in note 2, with an extra complication now I've tested it again. If I choose a Custom 4x6" layout then the printed pdf is the right size on  F15 (or A4 on the F13 1.6.0  system from the original report) but the page size is still wildly wrong if I examine  the print properties in step 7 (on both systems).

kipi-plugins-1.7.0-3.fc15.x86_64
kdegraphics-4.5.95-1.fc15.x86_64
Comment 4 Angelo Naselli 2011-01-17 22:07:57 UTC
Note 2 has been reproduced here :) I will investigate, thanks for the report.
Comment 5 Oliver Henshaw 2011-01-18 19:10:32 UTC
I still have the original problem on my f13 system, now upgraded to kipi-plugins 1.7.0. But I can't reproduce this on a F14 test system, either with en_US or en_GB locale. So maybe it's something to do with the configuration?

I tested with .kde/share/config/kipirc removed and still have the original problem. I'm not sure where to look next.

F13 packages:
kipi-plugins-1.7.0-1.fc13.x86_64
kdegraphics-4.5.4-1.fc13.x86_64


F14 test packages:
kipi-plugins-1.7.0-1.fc14.x86_64
kdegraphics-4.5.5-1.fc14.x86_64
Comment 6 Angelo Naselli 2011-01-18 22:19:37 UTC
Well it's not easy to understand where the problem lies. I can test and investigate the Note 2 though. And i can say it's more a qt problem than a print assistant one. 
So maybe on fc13 it's related to qt/kde version also.
Note 2 can probably avoid (i haven't tested yet) with your note 1, as well.
What i understood is that page is correctly chosen using the dialog (step 3.) and the output page layout is correctly created, when you get last print dialog though, custom size is completely changed despite of first settings.

Custom size though is very hard to control, for instance my old HP drivers used 
custom page layout (30) to get some photo card size, and i had to select that 
page layout twice, one from step 3 and latter using printer setting into last 
print dialog.

I could try to fix pdf custom page layout, but i think it's hard to manage custom layout in other cases using nowadays qt interface.
Comment 7 Oliver Henshaw 2011-01-18 22:32:08 UTC
F13 has qt 4.6, F14+ has qt 4.7 so that might be it (both have kde 4.5.x).
Comment 8 caulier.gilles 2011-12-20 17:17:45 UTC
Angelo,

This file still valid using kipi-plugins 2.4 ?

Gilles Caulier
Comment 9 Oliver Henshaw 2012-01-10 17:41:57 UTC
Much to my surprise, I can still reproduce this (note 1 and note 2 included).

kipi-plugins-2.4.1-1.fc16.x86_64
kdegraphics-4.7.4-1.fc16.noarch
qt-4.8.0-0.29.rc1.fc16.x86_64
Comment 10 Angelo Naselli 2012-01-28 19:12:11 UTC
Note (1) is the only workaround to this QT problem. Gilles i can explain and give you all you need to help me in fixing by coding, but at the moment i can't do anything.

If i use my printer (as said 30 is custom page) and choose 10x15 cm (4x6") photo page i *need* to enter it again in printer properties otherwise QPrintDialog changes my QPrinter settings (e.g. the ones the user chose step by step).
Here a kDebug output of our QPrinter paper page after Custom setup as 4x6":
KIPIPrintImagesPlugin::Wizard::accept: (1) paper page  30

QPrinter got from QPrintDialog as soon as it's been created:
KIPIPrintImagesPlugin::Wizard::accept: (2) paper page  30

QPrinter got from QPrintDialog after accept() (without using properties):
KIPIPrintImagesPlugin::Wizard::accept: (3) paper page  0

Trying to revert using setPaperSize():
QPrinter::setPaperSize: Illegal paper size 30

So the output is:
KIPIPrintImagesPlugin::Wizard::accept: (4) paper page  0

If i use standard page size however the problem persists because if i set it again the output page is wrong.

Gilles have you got anything to suggest?
Comment 11 caulier.gilles 2012-01-29 22:44:10 UTC
I'm not a specialist of Qt4 print classes, but looking in code, it sound like you pass your QPrinter instance to KDEprint when printer properties dialog is create.

QPrinter values are altered by dialog properties depending of options selected in settings. For paper size, i see this option disabled by default in properties.

Perhaps, as size is already selected in assistant before to open properties dialog of printer, you need to force Qprinter options relevant to be sure that KDEprint create properly all settings of printer.

Q: is KDEprint is the only solution to create printer properties dialog ? How Qt4 only applications do the same ? QT4 do not provide a dedicated way to create printer properties dialog ? Perhaps there is a bug into KDEPrint ???

Gilles Caulier
Comment 12 Angelo Naselli 2012-01-30 16:50:32 UTC
(In reply to comment #11)
> I'm not a specialist of Qt4 print classes, but looking in code, it sound like
> you pass your QPrinter instance to KDEprint when printer properties dialog is
> create.
Correct and that is important to give the QPrintDialog settings previously choose by user.

> QPrinter values are altered by dialog properties depending of options selected
> in settings. For paper size, i see this option disabled by default in
> properties.
Yes it could/should, because if you change printer properties you (B&W or quality for instance) it should be appended to our previous setting. I know that could be override it instead, but i can't manage all the settings before, and i need some first (e.g page size for instance).
 
> Perhaps, as size is already selected in assistant before to open properties
> dialog of printer, you need to force Qprinter options relevant to be sure that
> KDEprint create properly all settings of printer.
KdePrint iirc the code inside, is just a wrapper to new QPrintDialog(...), i tested it with the same result (read problems), so the issue is not there.
If you read my last commit i print 4 times the QPrinter papersize attribute, and only after pressing ok that is changed (and without using properties button). 

> Q: is KDEprint is the only solution to create printer properties dialog ? How
> Qt4 only applications do the same ? 
iirc as said new QPrintDialog() with the same parameters.

> QT4 do not provide a dedicated way to
> create printer properties dialog ? Perhaps there is a bug into KDEPrint ???
> 
IMO the bug is in QPrintDialog
Comment 13 caulier.gilles 2012-02-05 22:29:28 UTC
>IMO the bug is in QPrintDialog

Well, in this case, this file must be moved into Qt section of KDE bugzilla.

Gilles Caulier
Comment 14 Angelo Naselli 2012-02-17 22:41:03 UTC
Gilles can you do that? thanks.
Comment 15 caulier.gilles 2012-02-18 04:29:37 UTC
See Comment #12 for Qt assignement...

Gilles Caulier
Comment 16 Maik Qualmann 2017-11-01 07:08:05 UTC
*** Bug 386402 has been marked as a duplicate of this bug. ***
Comment 17 Maik Qualmann 2017-11-01 07:09:15 UTC
*** Bug 340644 has been marked as a duplicate of this bug. ***
Comment 18 Maik Qualmann 2017-11-01 07:10:58 UTC
This bug is a design issue in Qt. See Qt-Bug and 
discussion in the mailing list.

https://bugreports.qt.io/browse/QTBUG-58733

http://digikam.1695700.n4.nabble.com/Problem-with-Batch-Queue-multi-core-processing-tp4703974p4703980.html

MaiK
Comment 19 Maik Qualmann 2018-06-18 17:22:36 UTC
This bugfix is now officially included in Qt-5.11. DigiKam must be compiled against Qt-5.11. For digiKam-6.0.0 I close the bug now.

Maik
Comment 20 Maik Qualmann 2018-06-19 10:28:59 UTC
*** Bug 395557 has been marked as a duplicate of this bug. ***