GNOME Bugzilla – Bug 525705
skip thumbnailing entirely on files with insufficient read permissions
Last modified: 2013-11-23 17:07:43 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.
Sven, could you link to the discussion please?
http://lists.freedesktop.org/archives/xdg/2008-April/009397.html
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?
I found some problems...
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.)
You can't extend an existing public enum in the middle.
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.
Damnit, I forgot to reorder the switch cases etc along with reordering the enum constant. That will be addressed before commiting.
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.
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.
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.
With the current estimates, we won't have time. Moving to Future.
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?
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(-)