After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 137439 - Big PDF files are too long to open because of thumbnails creation
Big PDF files are too long to open because of thumbnails creation
Status: RESOLVED WONTFIX
Product: gpdf
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Rémi Cohen-Scali
Rémi Cohen-Scali
Depends on:
Blocks:
 
 
Reported: 2004-03-17 00:24 UTC by Rémi Cohen-Scali
Modified: 2006-01-29 21:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Patch for rought change of idle usage at thumb generation (11.13 KB, patch)
2004-05-09 08:54 UTC, Rémi Cohen-Scali
none Details | Review
Thumbs & bookmarks idle fix + a bookmarks fix (33.19 KB, patch)
2004-05-09 19:45 UTC, Rémi Cohen-Scali
none Details | Review
Bookmarks & Thumbs idle fix + a Bookmarks fix (all apply smoothly on 2-6) (33.02 KB, patch)
2004-05-09 19:59 UTC, Rémi Cohen-Scali
none Details | Review
Bookmarks & Thumbs idle fix + two Bookmarks fix + light user feedback (for gnome-2-6) (38.15 KB, patch)
2004-05-10 21:29 UTC, Rémi Cohen-Scali
none Details | Review

Description Rémi Cohen-Scali 2004-03-17 00:24:15 UTC
When a bug file is opened, the opening/displayed delay is too long and do
not reflect the pdf feature for quick document display (no need to read the
whole file). Thumbnails should be adapted to only be created at will, when
really needed.
Comment 1 Martin Kretzschmar 2004-03-17 09:31:43 UTC
A thought for 2.6.1:

The thumbnails are all created in one big loop in one single idle
iteration. Can we change that to do, like 10 thumbnails in one idle
iteration, then 10 in the next idle iteration? Or is there code that
might break if not all thumbnails are ready from the start?

And, of course, is your idea just as easy to implement as what I wrote
above? Then (because your idea is obviously more elegant) ignore what
I wrote ;-)
Comment 2 Rémi Cohen-Scali 2004-03-17 17:09:55 UTC
All following should be really easy to implement
Imagine: 
open a document with sidebar invisible -> no thumbnail creation at all
Ask for thumbnail view to be visible -> just need to fill the visible
scroll region of the thumbnail sidebar with empty images (from 5 to
20)  all in one idle.
Then continue with images generation, current page in main thread and
other visibles each in one idle.

For 2.6 I think we should adopt something like eog thumbnailer
architecture (independant component managing threads queues for thumbs
generation)
Comment 3 Rémi Cohen-Scali 2004-05-03 00:54:05 UTC
Taking ownership. 
Gonna prototype it in dev branch
Comment 4 Rémi Cohen-Scali 2004-05-09 08:22:57 UTC
Martin
I commited a simple change in head to fix this bug.
It is a first step for fixing this bug but the visual result is pretty good and
it let use the display pretty quickly.
I'd like to commit this also on 2-6 (really a great enhancement for users) ...
Can you have a look at head

2004-05-09  Remi Cohen-Scali  <rcoscali@cvs.gnome.org>

	First step for fixing Bug #137439

	* xpdf/gpdf-thumbnails-view.cc: 
	Add a counter for keeping track of current thumb generated.
	(gpdf_thumbnails_view_set_scroll_region): 
	While setting scroll region, the loop is now between page 1
	and last generated one (current_gen_thumb) to be able to relayout
	while generating thumbs.
	(gpdf_thumbnails_view_create_thumbnail): 
	Added thumb coords. Computation while creating is based on a guess.
	The layout may be not perfect but it will be correctly relayout
	as soon as finished.
	(gpdf_thumbnails_view_populate_idle): 
	Changed idle logic in order to only generate one thumb for each 
	call. This way we never freeze display.	
	(gpdf_thumbnails_view_set_pdf_doc): 
	Moved thumb generation inits from idle. Set guess for page
	width/height to have a semi correct layout.
Comment 5 Rémi Cohen-Scali 2004-05-09 08:54:23 UTC
Created attachment 27498 [details] [review]
Patch for rought change of idle usage at thumb generation

Here is a patch for gnome-2-6 branch
Comment 6 Rémi Cohen-Scali 2004-05-09 19:44:02 UTC
I also changed bookmarks to have the same behavior.
Now I open a 1000 pages document in 1 or 2 seconds !!!!
May I commit on 2-6 (no string changes) ?

P.S.: The patch seems huge but most of it is just some code displacement and
indentation changes
Comment 7 Rémi Cohen-Scali 2004-05-09 19:45:30 UTC
Created attachment 27512 [details] [review]
Thumbs & bookmarks idle fix + a bookmarks fix
Comment 8 Rémi Cohen-Scali 2004-05-09 19:59:35 UTC
Created attachment 27513 [details] [review]
Bookmarks & Thumbs idle fix + a Bookmarks fix (all apply smoothly on 2-6)
Comment 9 Martin Kretzschmar 2004-05-10 17:19:30 UTC
I haven't read the patch yet, but there seams to be some infinite loop or
similar. With a one page pdf (without embedded thumbnails) my processor goes
100% and doesn't go down again.

But for large docs, the speedup is great!
Comment 10 Rémi Cohen-Scali 2004-05-10 19:49:41 UTC
Yes I found it. Already fixed. Was because of the bookmarks. When no bookmarks
the idle was never finished (always returned TRUE).
I just commited the fix, with some feedback for users.
A light version (without string change) could be commited for 2.6. 
Don't you think so ?
Comment 11 Rémi Cohen-Scali 2004-05-10 21:29:34 UTC
Created attachment 27570 [details] [review]
Bookmarks & Thumbs idle fix + two Bookmarks fix + light user feedback (for gnome-2-6)

The light version without string to translate
Comment 12 Martin Kretzschmar 2004-07-19 10:47:44 UTC
All these patches are in CVS now, aren't they? If yes, please close the bug.
Comment 13 Rémi Cohen-Scali 2004-07-20 22:12:19 UTC
The current implementation in CVS is only a quick fix. The next version should :
1) compute/display in the background
2) only compute display the visibles thumbnails
3) have the ability to not store thumbnails, but compute then when needed (gpdf
sometimes reach some 200 Mb size for a 10 Mb document)

The 1) is in CVS. The 2) & 3) are not but should.
Comment 14 Pablo Rodríguez 2004-11-25 09:52:02 UTC
I think that the thumbnail generation/extraction should be optional and it
should be a preference (either in GConf or in the program itself). So opening
many pdf documents at the same time would be faster and it wouldn't require so
much memory.
Comment 15 Olav Vitters 2006-01-29 01:09:30 UTC
Gpdf is no longer maintained, closing WONTFIX. Please use Evince for your pdf
viewing needs.

http://www.gnome.org/projects/evince/
Comment 16 Zack Weinberg 2006-01-29 21:56:51 UTC
evince has a bad habit of rendering pages in sequence even when you've warped way forward, and of rendering the thumbnails before the currently visible page.  This wouldn't matter if it rendered everything instantly, but it doesn't (and probably never will).  I think this bug will do nicely as a report of that problem.  Reopen, reassign to evince.