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 671944 - Preview images in file chooser dialog are too large
Preview images in file chooser dialog are too large
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: GNOME3.4
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-12 21:10 UTC by Adrian Zgorzałek
Modified: 2012-03-14 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing issue (1.27 KB, patch)
2012-03-12 21:13 UTC, Adrian Zgorzałek
reviewed Details | Review

Description Adrian Zgorzałek 2012-03-12 21:10:11 UTC
Current policy is not sufficient in handling files with not yet generated thumbnails. Even simple screenshot of my desktop is PNG file with size smaller than 100KB but of large resolution 1440x900. Therefore when I click it preview is generated and it is much too large.

I see two possible solutions. First is too query loaded pixbuf for its dimensions and then judge if preview should be generated. Second is to enforce generating thumbnails for files which don't have yet. I suppose that the second solution is bad choice since it affects users precious time so I implemented draft of the first.

Basically, what is left is choosing arbitrary size of thumbnails or let it be customized (I prefer the first).
Comment 1 Adrian Zgorzałek 2012-03-12 21:13:54 UTC
Created attachment 209546 [details] [review]
Patch fixing issue

Bounds 300x300 to be fixed.
Comment 2 Felix Riemann 2012-03-14 18:01:22 UTC
This feels strange.
IIRC the code was built to load no thumb at all if one wasn't created before like here. Strangely the image itself is determined to be the path of its thumbnail and thus loaded. It's also not happening for all images. :/
Comment 3 Felix Riemann 2012-03-14 18:07:14 UTC
Uhm, nevermind. Slight debugging mixup on my side.
Comment 4 Felix Riemann 2012-03-14 18:17:12 UTC
Review of attachment 209546 [details] [review]:

Well, this is a viable workaround. But I think real fix is different.

We should probably still display the image in this case but use an appropriately scaled variant of it (which means we really thumbnail it).

The longterm fix (for 3.6 or later) could be to follow the approach GIMP takes. Generate missing thumbnails up to a specific size (I think 2 or 3 MB),
and show a placeholder for larger images that can be clicked to still generate the thumbnail on request.

::: src/eog-file-chooser.c
@@ +373,1 @@
 			have_preview = (pixbuf != NULL);

This shouldn't become TRUE in case the image isn't displayed, otherwise one will see an empty preview area.
Comment 5 Adrian Zgorzałek 2012-03-14 18:29:29 UTC
That sounds nice. As I see Eog has a bunch of functions dealing with generating thumbnails, so I could work over it for 3.6. The idea with enabling previews on demand for big files will absolutely solve this issue.
Comment 6 Felix Riemann 2012-03-14 19:42:29 UTC
(In reply to comment #5)
> That sounds nice. As I see Eog has a bunch of functions dealing with generating
> thumbnails, so I could work over it for 3.6. The idea with enabling previews on
> demand for big files will absolutely solve this issue.

Nice, I'll open a follow-up bug.


Fixed this one by using the GnomeThumbnailFactory the dialog already carries around.

commit 57116d58a1bc7447bd02991ae7902d06a239dbed
Author: Felix Riemann <>
Date:   Wed Mar 14 20:35:50 2012 +0100

    EogFileChooser: Use GnomeThumbnailFactory to create preview image
    
    Do this if no thumbnail exists yet. Avoids displaying too large thumbs
    for images that have yet to be thumbnailed, breaking the file open dialog.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671944
---
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 7 Felix Riemann 2012-03-14 20:04:46 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > That sounds nice. As I see Eog has a bunch of functions dealing with generating
> > thumbnails, so I could work over it for 3.6. The idea with enabling previews on
> > demand for big files will absolutely solve this issue.
> 
> Nice, I'll open a follow-up bug.
> 

See bug 672092.