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 525705 - skip thumbnailing entirely on files with insufficient read permissions
skip thumbnailing entirely on files with insufficient read permissions
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-04-02 06:45 UTC by Sven Neumann
Modified: 2013-11-23 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dont-thumbnail-non-readable-files-2008-06-06.patch (6.36 KB, patch)
2008-06-06 08:22 UTC, Martin Nordholts
needs-work Details | Review
dont-thumbnail-non-readable-files2-2008-06-06.patch (6.79 KB, patch)
2008-06-06 17:07 UTC, Martin Nordholts
needs-work Details | Review
dont-thumbnail-non-readable-files-2008-06-09.patch (16.09 KB, patch)
2008-06-09 06:34 UTC, Martin Nordholts
rejected Details | Review
alternative approach w/o changing libgimpthumb (3.04 KB, patch)
2008-06-09 07:17 UTC, Sven Neumann
rejected Details | Review

Description Sven Neumann 2008-04-02 06:45:02 UTC
As discussed on xdg-list, we should change the thumbnailing implementation to skip 
thumbnailing entirely on files with insufficient read permissions, so no failed thumbnail is read or written.
Comment 1 Martin Nordholts 2008-06-03 04:58:30 UTC
Sven, could you link to the discussion please?
Comment 3 Martin Nordholts 2008-06-06 08:22:52 UTC
Created attachment 112260 [details] [review]
dont-thumbnail-non-readable-files-2008-06-06.patch

This patch seems to do the job. Can someone review this please and see if they find a use-case where this patch doesn't work properly?
Comment 4 Martin Nordholts 2008-06-06 13:09:32 UTC
I found some problems...
Comment 5 Martin Nordholts 2008-06-06 17:07:26 UTC
Created attachment 112287 [details] [review]
dont-thumbnail-non-readable-files2-2008-06-06.patch

There we go. (It doesn't make sense to show the thumbnail even if it exists, if the file is not readable.)
Comment 6 Michael Natterer 2008-06-08 11:33:02 UTC
You can't extend an existing public enum in the middle.
Comment 7 Martin Nordholts 2008-06-09 06:34:41 UTC
Created attachment 112395 [details] [review]
dont-thumbnail-non-readable-files-2008-06-09.patch

Oops, that completely slipped my mind. Attaching patch with that addressed.
Comment 8 Martin Nordholts 2008-06-09 06:39:07 UTC
Damnit, I forgot to reorder the switch cases etc along with reordering the enum constant. That will be addressed before commiting.
Comment 9 Sven Neumann 2008-06-09 06:40:13 UTC
Extending the state enum also breaks the libgimpthumb API since it is part of the public API and any code that used to correctly deal with all possible states would break after your changes. I actually planned to do this internally without any API/ABI changes. I will try to come up with a patch for this. If this approach fails, we can still resort to Martin's approach.
Comment 10 Sven Neumann 2008-06-09 07:17:33 UTC
Created attachment 112397 [details] [review]
alternative approach w/o changing libgimpthumb

Here's an alternative approach, but it also has issues that I want to consider before this is committed. The problem is that with this patch the core would start to do file queries using GIO and that means we would also have to deal with things like authentication. We might want to delay this until the code is fully ported to GIO and all file plug-ins also use it.
Comment 11 Sven Neumann 2008-06-09 08:23:41 UTC
The only proper place to do a file check would be in the plug-in that actually opens the file (or the core in case of XCF files). The reason is that we don't know how the plug-in accesses the file, so we can also not determine if it will be readable or not. So what we actually need here is a way for the file plug-in to tell the core that the image to be thumbnailed could not be read because of insufficient read permissions. The core should then not write a failure thumbnail. We can't implement this for 2.6, so let's bump it to 2.8 and hope that we will find time to  improve the file plug-in API until then.
Comment 12 Martin Nordholts 2010-01-23 10:25:15 UTC
With the current estimates, we won't have time. Moving to Future.
Comment 13 Michael Natterer 2011-09-24 00:06:44 UTC
Can't we simply call g_file_is_native() or g_file_get_path() to
check if we got a local file that can be at least checked without
remote authentication issues?
Comment 14 Michael Natterer 2013-11-23 17:07:43 UTC
Fixed in master:

commit 174dee3427a6ca89637fc4cf7d4e368c9dd4bb66
Author: Michael Natterer <mitch@gimp.org>
Date:   Sat Nov 23 18:05:55 2013 +0100

    Bug 525705 - skip thumbnailing entirely on files with insufficient...
    
    ...read permissions
    
    Apply modified patch from Sven Neumann which implements just that.

 app/core/gimpimagefile.c   | 31 +++++++++++++++++++++++++++++++
 app/widgets/gimpthumbbox.c | 15 +--------------
 2 files changed, 32 insertions(+), 14 deletions(-)