Zooming in doesn't work with on certain files. One has to zoom out first and only then zooming in further works. Reproducible: Always Steps to Reproduce: 1. Open attached pdf 2. Try to zoom in (doesn't work) 3. Zoom out and then zoom in (this works fine)
File is too big. Please find it here: trippelsdorf.de/foo.pdf
No, it's not there.
Created attachment 87241 [details] small testcase (In reply to comment #2) > No, it's not there. Yes. I've deleted the file after a few days, because it contained copyrighted material. Here's a smaller example.
Can you define "Try to zoom in (doesn't work)" ?
(In reply to comment #4) > Can you define "Try to zoom in (doesn't work)" ? Sure. Pressing Ctrl-+ or hitting the "Zoom in" button. Okular just doesn't react to these inputs. (My default zoom level is set to: "Fit Width")
I understand you've compiled 0.19.60 from git. Can you compile 0.19.2 and see if you still have the same problem?
(In reply to comment #6) > I understand you've compiled 0.19.60 from git. Can you compile 0.19.2 and > see if you still have the same problem? Yes. Same issue with 0.19.2. (and poppler-0.26.1-21-g1b705331019b)
Can you enable all okular debug in kdebugdialog and attach the debug output when running okular from a terminal?
okular(21821) Okular::Utils::realDpiY: Pix: 1680 MM: 441 okular(21821) Okular::Utils::realDpiX: Pix: 1050 MM: 276 okular(21821) Okular::DocumentPrivate::openDocumentInternal: Output DPI: QSizeF(96.6304, 96.7619) okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x824@0 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x789@1 okular(21821)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1d40468 1044x824@0 async == true isTile == false okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x824@0 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x789@1 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x824@0 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x789@1 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1c2efe8 80x63@0 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x789@1 okular(21821)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1c2efe8 80x63@0 async == true isTile == false okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x789@1 okular(21821)/okular (app) Okular::Document::requestPixmaps: request observer=0x1d40468 1044x789@1 okular(21821)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1d40468 1044x789@1 async == true isTile == false
Nothing of interest here. Do you think you could record the desktop and host it somewhere so we can see what's going on?
Created attachment 87303 [details] screen capture
Oh damn, i was able to reproduce something similar one time and then when i went to add debug it went away :/ Do i understand that you know how to compile okular? Would you be able to add some extra debug lines and give me the output so i can try to figure out what's going on?
(In reply to comment #12) > Oh damn, i was able to reproduce something similar one time and then when i > went to add debug it went away :/ > > Do i understand that you know how to compile okular? Would you be able to > add some extra debug lines and give me the output so i can try to figure out > what's going on? Yes, I could give it a try.
BTW if I observed correctly it only happens in documents that contain a "rotated" page in them. An example is a document which consists of almost only "portrait" pages, but contains one "landscape" page.
What is the status of this bug? If I understand it correctly, some debug lines were to be added?
(In reply to Christoph Feck from comment #15) > What is the status of this bug? If I understand it correctly, some debug > lines were to be added? Yes, but Albert never posted a patch...
Created attachment 88313 [details] Please try this patch and attach the output you get
markus@x4 tmp % okular out.pdf (open document) PageView::updateZoom 6 PageView::updateZoom2 6 1.02034 PageView::updateZoom 1 PageView::updateZoom2 1 1.02034 PageView::updateZoom 1 PageView::updateZoom2 1 1.02034 (zoom in attempt, not working) PageView::updateZoom 4 PageView::updateZoom2 4 1.02034 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.06228, 1.06228, 1.25, 1.5, 2, 4, 8, 16) 1.06228 PageView::updateZoom4 (zoom out) PageView::updateZoom 5 PageView::updateZoom2 5 1.02034 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.06228, 1.06228, 1.25, 1.5, 2, 4, 8, 16) 1 PageView::updateZoom6 (zoom in) PageView::updateZoom 4 PageView::updateZoom2 4 1 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.06228, 1.06228, 1.25, 1.5, 2, 4, 8, 16) 1.06228 PageView::updateZoom4 PageView::updateZoom 1 PageView::updateZoom2 1 1.06228 (zoom in) PageView::updateZoom 4 PageView::updateZoom2 4 1.06228 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.06228, 1.06228, 1.25, 1.5, 2, 4, 8, 16) 1.25 PageView::updateZoom6
The following hack fixes the issue for me: diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 48d5d8df191c..eb1bd25226ae 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -55,6 +55,7 @@ // system includes #include <math.h> #include <stdlib.h> +#include <algorithm> // local includes #include "formwidgets.h" @@ -3667,6 +3668,7 @@ void PageView::updateZoom( ZoomMode newZoomMode ) } else { + newFactor=*std::lower_bound(zoomValue.begin(), zoomValue.end(),newFactor ); i = qUpperBound(zoomValue.begin(), zoomValue.end(), newFactor); } const float tmpFactor = *i;
Posted the wrong patch. This one fixes the issue for me: diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 48d5d8df191c..025163466894 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -3667,7 +3667,7 @@ void PageView::updateZoom( ZoomMode newZoomMode ) } else { - i = qUpperBound(zoomValue.begin(), zoomValue.end(), newFactor); + i = qLowerBound(zoomValue.begin(), zoomValue.end(), newFactor); } const float tmpFactor = *i; if ( tmpFactor == zoomFactorFitWidth )
This one is the actually working fix. Sorry for the noise. diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 48d5d8df191c..383e5e4d2f8a 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -3667,6 +3667,7 @@ void PageView::updateZoom( ZoomMode newZoomMode ) } else { + newFactor = *qLowerBound(zoomValue.begin(), zoomValue.end(), newFactor); i = qUpperBound(zoomValue.begin(), zoomValue.end(), newFactor); } const float tmpFactor = *i;
Created attachment 88316 [details] Patch that fixes the issue.
Created attachment 88318 [details] Testcase for another issue Another bug caused by the same commit fad9c4e6fd532e0: Trying to zoom in the title-page of the attached testcase results in an endless loop : "Fit Width" -> "150%" -> "200%" -> "Fit Width" -> etc. markus@x4 tmp % okular out2.pdf PageView::updateZoom 6 PageView::updateZoom2 6 1.44576 PageView::updateZoom 1 PageView::updateZoom2 1 1.44576 PageView::updateZoom 1 PageView::updateZoom2 1 1.44576 PageView::updateZoom 4 PageView::updateZoom2 4 1.44576 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.25, 1.5, 2, 2.60237, 2.60237, 4, 8, 16) 1.5 PageView::updateZoom6 PageView::updateZoom 4 PageView::updateZoom2 4 1.5 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.25, 1.5, 2, 2.60237, 2.60237, 4, 8, 16) 2 PageView::updateZoom6 PageView::updateZoom 4 PageView::updateZoom2 4 2 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.25, 1.5, 2, 2.60237, 2.60237, 4, 8, 16) 2.60237 PageView::updateZoom4 PageView::updateZoom 1 PageView::updateZoom2 1 2.60237 PageView::updateZoom 4 PageView::updateZoom2 4 1.44576 PageView::updateZoom3 QVector(0.12, 0.25, 0.33, 0.5, 0.66, 0.75, 1, 1.25, 1.5, 2, 2.60237, 2.60237, 4, 8, 16) 1.5 PageView::updateZoom6
Created attachment 88319 [details] screen capture2
The problem actually may not be in the function Markus modified. The problem lies in the function double PageView::zoomFactorFitMode( ZoomMode mode ); Each time you click zoom in, the values of zoomFactorFitWidth and zoomFactorFitPage are computed from this function. I assumed that those values would remain the same when the document portion of the window remains the same. However, I just did a quick check and found that the value returned from viewport()->height() is changing even though the window size remains the same. Is it a designed behaviour?
Well, have a look at the code, it depends on the current page and some more stuff, it's just 24 lines of code ;)
Created attachment 88329 [details] New patch for both issues The attached patch fixes both issues. Please review.
Can you please use https://git.reviewboard.kde.org/ for patches? It is so much easier to keep track and discuss patches over there.
Quick question, does converting float zoomFactor; to double zoomFactor; solve your problem?
No, that's not going to do anything
Can you guys review https://git.reviewboard.kde.org/r/119894/ ?
Git commit 3dfd172375cab9352fe73713df11219cb03ed199 by Albert Astals Cid. Committed on 24/08/2014 at 20:37. Pushed by aacid into branch 'KDE/4.14'. Only update zoomFactor for current page REVIEW: 119894 FIXED-IN: 4.14.1 Reviewed by Fabio and Markus Trippelsdorf M +10 -7 ui/pageview.cpp http://commits.kde.org/okular/3dfd172375cab9352fe73713df11219cb03ed199