SUMMARY All PDFs are shown in stretched a few percent in y-axis STEPS TO REPRODUCE 1. Open a PDF. Compare it to e.g. firefox rendering 2. 3. OBSERVED RESULT Correct aspect ratio EXPECTED RESULT Stretched aspect ratio - a few percent in y-axis SOFTWARE/OS VERSIONS PDF Backend Version 0.6.5
Created attachment 155827 [details] A PDF with a circle
Created attachment 155828 [details] A screenshot how okular shows the circe as an ellipsis I added two images which demonstrate the bug.
Your monitor is broken and reports wrong DPI. I guess we should add a "My monitor is broken please ignore DPI" checkbox given how many people keep reporting issues like this
Come on! I am not joking. Nice try :-) When I open the PDF with Firefox or Gnome PDF viewer it is displayed perfectly round.
Regarding your DPI idea: Even if there was a problem with DPI, the screenshot would "revert" this issue because a screenshot is not done on the monitor but on the graphics layer. Your assumption would only be correct if I had taken the picture with my smartphone. This is definitely a bug within Okular or its backend.
Well, even if it is, it must be something subtle, because most people see a rendering of the circle in just the way it should be. Albert and me, for example. Is your setup a laptop with a built-in screen? Can you reproduce the problem if you use another screen? Another computer?
Most bugs all over the world are issued by special circumstances. I use two tower computers with two monitors. Both have Kubuntu 22.10 but only one is displaying it wrong - the other one is displaying it as a circle. The computer with the wrong displaying is using ppa-backports - the other one with the correct display has no ppa-backports. Is there some logfile maybe where I can look into deep?
What happens when you swap the monitors?
You mean swapping left and right? Or swapping the computers? Okular shows it as an ellipsis on both monitors. And Firefox e.g. shows it as a circle on booth monitors. I can also go virtually on the monitor with rdesktop (which avoids he real monitor) and also see an ellipsis on this virtual screen. So I guess it is really drawn wrong on the graphics card rendering engine.
Maybe deleting of some .local/config/share/pdf-backend-settings helps? Do you know, which folders contain stuff which might be interfering somehow? I could backup those files and search for differences?
> I am not joking. Neither am I. Either the DPI of your monitor is borked or you're using a different resolution aspect ratio than the native resolution of your monitor.
(In reply to Albert Astals Cid from comment #11) > > I am not joking. > > Neither am I. Either the DPI of your monitor is borked or you're using a > different resolution aspect ratio than the native resolution of your monitor. And what is your explanation that Firefox and other PDF viewers show a circle on the same monitor? Can Firefox change the DPI in it's specific firefox-window-area? I told this now many times that only Okular has the problem and all other viewers (Firefox, LibreOffice, GIMP, ..) are all well rendering a circle.
Relax. This is just very difficult to debug without being able to reproduce it locally. Access to dpi information is gathered in the method `realDpi` in the file `utils.cpp`. Are you able to build your own Okular (it is not very difficult)? If so, this is the place to start looking.
First off, THANKS for your always fast reply on my issue! Compiling should not be a problem for me. Can you give me a hint, where to load the sources? But I guess, when I compile my own okular, it will display a circle - murphy's law :-) But maybe, should I try to purge okular and reinstall it completely? Are there some hidden files with okular settings in my home directory? Maybe its gone then? But then we will never find the source of the issue...
Building Okular is described at https://okular.kde.org/build-it/ > But I guess, when I compile my own okular, it will display a circle - murphy's law :-) That's possible. But then you will have free time to fix some other Okular bug if you are interested. There are lot's. :-) BTW, have you checked whether your issue persists if you change from X11 to Wayland or vice versa? I don't think hidden config files have anything to do with this, but I may be wrong.
Hi, I nearly get my git clone compiled. But I get the following error when linking: /usr/bin/ld: /lib/x86_64-linux-gnu/libKF5GuiAddons.so.5: undefined reference to `QWaylandClientExtension::~QWaylandClientExtension()@Qt_5' I use Qt 5.15.12 and actually have all (necessary) development packages in my kubuntu system. I also checked that installed libkf5guiaddons-dev on my system - yes it is! What could might the solution to link it? Or can I somehow deactivate wayland in the cmake process (I use X11 and not Wayland on my system) to avoid the linking against wayland?
Does no one have a hint for me? I hoped for Kubuntu 23.04 but the bug is still there. I want to get rid of that scaling problem in every PDF :^)
I also set up up a very new kubuntu system from stick and the stretching is still the same: circles as vertical ovals…
Maybe it is because of the resolution of the monitors. They are both 1860 x 1050 pixels which is not so often the case in industry. Could that lead to an stretched display of PDFs?
(In reply to pietz from comment #19) > Maybe it is because of the resolution of the monitors. They are both 1860 x > 1050 pixels which is not so often the case in industry. Could that lead to > an stretched display of PDFs? Sorry, it was a mistyping in the previous post. It is 1680 x 1050 (16:10 aspect ratio). Could that lead to the issue with the wrong display of all PDFs?
Did you get Okular to build and link on your computer in the meantime? My apologies, but I am not the one who can help with linker problems.
Created attachment 159866 [details] Showing the difference of PNG vs PDF (same content) (In reply to Oliver Sander from comment #21) > Did you get Okular to build and link on your computer in the meantime? My > apologies, but I am not the one who can help with linker problems. Not yet. But I have additional and HELPFUL information: I have two monitors with a "not so often appearing" aspect ratio. They are both 16:10 (1680x1050). Maybe this has something to do with it? Because the oval or ellipse is EXACTLY what a 16:9 ratio is doing. When I screenshot the ellipse and stretch it by a value of (10 / 9) I get exactly a circle (I tried it with a screenshot and stretching width from 9 untis to 10 units in GIMP). It also appears that it ONLY happens to PDFs. I transformed my PDF with GIMP to a PNG and this is displayed as a circle. I attached a new screenshot with both files next to each other. So my guess there is some calculation fixed to 16:9 monitors somehow?
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/781
I would still be interested to see what your Utils::realDpi method does. Have you been able to get your local Okular to link yet? Looking at the code again I see that if the system reports different dpi for x and y (which are then ignored) it issues a warning: qCDebug(OkularCoreDebug) << "QScreen calculation returned a non square dpi." << res << ". Falling back"; Do you see this message when you enable Okular debug output with kdebugdialog5? (KDE gurus: please correct me if something else is needed to enable the warning).
I have an interesting update. The bug (or the scaling issue) only exists, when you open a PDF through a click in dolphin or when you open a file in okular directly. But when you drag a PDF into an already opened instance of okular, the aspect ratio is CORRECT! So, the circle.pdf in the attachment shows an ellipsis when opened directly and it is shown as a real circle when you drop the PDF file in the middle of the okular window. Maybe we can nail it down somehow with this new interesting fact?
Oh, its even more easy: When I press F5 for reload, the circle draws round when the whole PDF is redrawn. So it has to do something with the FIRST loading of the PDF...
Since Okular Version 23.08.5 (fresh install of Kubuntu 24.04) the "hack" with a reload doesn't work anymore. It is now always stretched... Can no one else reproduce this?