SUMMARY The maximum zoom is 1600%, but the documents I need to view contain text that at 1600% is still only a few pixels large and needs much more zoom. STEPS TO REPRODUCE 1. Have a document with really really tiny text 2. Try to zoom in far enough to allow you to read the text 3. Be stopped by Okular at 1600% 4. Notice that the text is still only a few pixel high and thus way to small to be read OBSERVED RESULT Zooming stops at 1600% EXPECTED RESULT Zooming should be infinite at best I would not mind if scrolling at this zoom would be ultra slow or Okular would use gibibytes of memory, if only I could read the document. SOFTWARE/OS VERSIONS Operating System: Fedora 32 KDE Plasma Version: 5.18.5 KDE Frameworks Version: 5.68.0 Qt Version: 5.13.2 Kernel Version: 5.6.11-300.fc32.x86_64 OS Type: 64-bit Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz Memory: 62,5 GiB of RAM
pageview.cpp:4203 hardwires the limit: const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; I haven't tried whether anything bad happens (besides possibly large memory/CPU consumption) if that limit is increased further.
(In reply to Oliver Sander from comment #1) > pageview.cpp:4203 hardwires the limit: > > const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; > > I haven't tried whether anything bad happens (besides possibly large > memory/CPU consumption) if that limit is increased further. Works fine on a relatively slow machine (Core2 Duo, 2.6GHz, 6GB of RAM) for 100x with the following patch. It is hard to say if it is worth implementing this for a regular user though. diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 938aa5039..f184886e9 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -104,7 +104,7 @@ static const int pageflags = PagePainter::Accessibility | PagePainter::EnhanceLi PagePainter::EnhanceImages | PagePainter::Highlights | PagePainter::TextSelection | PagePainter::Annotations; -static const std::array<float, 13> kZoomValues { 0.12, 0.25, 0.33, 0.50, 0.66, 0.75, 1.00, 1.25, 1.50, 2.00, 4.00, 8.00, 16.00 }; +static const std::array<float, 14> kZoomValues { 0.12, 0.25, 0.33, 0.50, 0.66, 0.75, 1.00, 1.25, 1.50, 2.00, 4.00, 8.00, 16.00, 100.00 }; // This is the length of the text that will be shown when the user is searching for a specific piece of text. static const int searchTextPreviewLength = 21; @@ -2774,7 +2774,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) double nX = (double)(selRect.left() + selRect.right()) / (2.0 * (double)contentAreaWidth()); double nY = (double)(selRect.top() + selRect.bottom()) / (2.0 * (double)contentAreaHeight()); - const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; + const float upperZoomLimit = d->document->supportsTiles() ? 100.0 : 4.0; if ( d->zoomFactor <= upperZoomLimit || zoom <= 1.0 ) { d->zoomFactor *= zoom; @@ -4200,7 +4200,7 @@ void PageView::updateZoom( ZoomMode newZoomMode ) d->zoomFactor = -1; break; } - const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; + const float upperZoomLimit = d->document->supportsTiles() ? 100.0 : 4.0; if ( newFactor > upperZoomLimit ) newFactor = upperZoomLimit; if ( newFactor < 0.1 ) @@ -4253,7 +4253,7 @@ void PageView::updateZoomText() bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio int zoomValueCount = 11; if ( d->document->supportsTiles() ) - zoomValueCount = 13; + zoomValueCount = 14; while ( idx < zoomValueCount || !inserted ) { float value = idx < zoomValueCount ? kZoomValues[ idx ] : newFactor;
Thanks for testing! > It is hard to say if it is worth implementing this for a regular user though. I'd say "definitely": People do request it, and people who don't need it are not bothered by it. Would you mind opening a merge request? - zoomValueCount = 13; + zoomValueCount = 14; If 100 is the new highest zoom level, then 14 is probably not enough.
(In reply to Oliver Sander from comment #3) > I'd say "definitely": People do request it, and people who don't need it are > not bothered by it. Would you mind opening a merge request? https://invent.kde.org/kde/okular/-/merge_requests/165
Git commit 7eb37c99c9cd27bfd918dffe2dca7b9ec22ab5fb by Oliver Sander, on behalf of Yuri Chornoivan. Committed on 15/05/2020 at 17:44. Pushed by sander into branch 'master'. Add more scale factors M +5 -5 ui/pageview.cpp https://invent.kde.org/kde/okular/commit/7eb37c99c9cd27bfd918dffe2dca7b9ec22ab5fb
Zooming farther than 2000% using middle-click-drag zoom is laggy on my Thinkpad X240 (Core i5 4300, 8GB). Additionaly the console reports: Running out of memory on page 2 (26436x25245 px); Apparently tiling does not work correctly there, such a big pixmap would indeed not fit in the memory.