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 634666 - Function to return the thumbnail directory would be useful
Function to return the thumbnail directory would be useful
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2010-11-12 08:37 UTC by comcal116
Modified: 2018-05-24 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description comcal116 2010-11-12 08:37:25 UTC
The GIMP stores thumbnails into the .thumbnails folder in the user's home folder on Windows. This is not where applications should store files on Windows, and can get messy. Instead, applications on Windows should store data into the AppData folder provided. This prevents personal files from getting mixed with other data.

I ask that an #ifdef WIN32 is added and makes GIMP use the Appdata folder to save configuration and thumbnail files.
Comment 1 Michael Natterer 2010-11-28 15:57:44 UTC
This is not something for GIMP to fix. This is supposed to be a desktop-wide
thing, and even on windows also used by e.g. GTK+.

The thumnail spec apparently hasn't changed in a long time, so i'm
going to reassign this to the lowest component in the stack, which
is GIO which also does thumbnail handling and could provide a function
like g_get_thumbnail_dir() to abstract this away.
Comment 2 Tor Lillqvist 2010-11-28 17:51:42 UTC
You can always set the HOME environment variable. On Windows, g_get_home_dir() checks that first, and uses it if set. And GIMP uses the .thumbnails folder in wherever g_get_home_dir() returns.
Comment 3 Allison Karlitskaya (desrt) 2014-06-18 15:05:55 UTC
The thumbnailing spec operates in a very specific way and its scope is limited to freedesktop unix systems.  The possibility of applying the spec on windows isn't even mentioned.  Knowing the correct directory to use for this is a very small part of implementing the spec.

Thumbnail data that does not adhere to the spec should not be stored in this directory.

Similarly, I wouldn't expect that it's useful to store thumbnails in the (spec-)specified format outside of the usual place (which is XDG_CACHE_HOME/thumbnails).

In short, either:

  implement the thumbnail spec yourself (of which concatenating "thumbnails" to the return value of g_get_user_cache_dir() is only a tiny aspect)

or

  use a different directory -- and that's up to you.


In general, g_get_user_cache_dir() will return something meaningful on all platforms -- just create a path based on that.  If you're not using the thumbnail spec, then please try to avoid using the same dir -- maybe put "gimp" in the name.

I'm not closing this because the bug still exists -- but it's a GIMP issue.
Comment 4 Michael Natterer 2014-06-18 23:37:08 UTC
GIMP does adhere to the thumbnail spec, but it's pretty clear that
we can't put the files into either ~/.thumnails or XDG_CACHE_HOME/thumbnails
on both windows nor OS X.

I have not much clue about windows, but at least on OS X which is reasonably
non-brain-damaged, we made up our own "standard" and made the thumbnail
root directory ~/Library/Caches/org.freedesktop.thumbnails/ and follow
the spec inside that dir.

XDG is simply not cross-platform, and I would prefer if not every app
had to make that decision by itself, or is this really what you expect
to happen?
Comment 5 Allison Karlitskaya (desrt) 2014-06-19 00:59:46 UTC
I'm happy for GIMP to choose...  I certainly don't want to get into the business of picking paths like "~/Library/Caches/org.freedesktop.thumbnails" on Mac OS.  As far as GLib is concerned, Mac OS is a UNIX system like any other...
Comment 6 Michael Natterer 2014-06-19 14:06:27 UTC
That may be so, but an application that wants to behave natively on OS X
and come in a proper app bundle would also want GIO to pick the thumnails
from the right location, not only its own thumbnail logic. This needs
support from GLib. You can only say "not GLib's problem" as long as GLib
doesn't behave in a clearly wrong way on the platform :)
Comment 7 Allison Karlitskaya (desrt) 2014-06-19 14:45:14 UTC
(In reply to comment #6)
>                    You can only say "not GLib's problem" as long as GLib
> doesn't behave in a clearly wrong way on the platform :)

No.

As far as GLib is concerned, Mac OS is UNIX.  It would be wrong for us to assume otherwise, and probably contrary to user expectation.

Graphical applications shipped in app bundles are another story, and this is an old conversation: providing a means to override certain "standard" directories, at runtime, if explicitly instructed to do say, may be interesting.  This is a much larger problem though.

Certainly before that point (and maybe even after it) it doesn't make sense to talk about this proposal.
Comment 8 Michael Natterer 2014-06-20 07:12:00 UTC
I can set all XDG variables from GIMP in one small early-called function,
and then use unchanged code on all platforms. I can NOT do this for
the thumbnail directory. I can not change it, and GIO will always use
a hardcoded subdirectory of CACHE, no matter of this is the right choice
for the platform.

I'm only asking for a way to configure it, and get to the folder via
standard API, not for GLib to do it on my behalf.
Comment 9 Allison Karlitskaya (desrt) 2014-06-20 13:42:05 UTC
It sounds like you rather want a function to _set_ the thumbnail path then, not get it...

What's wrong with just pointing XDG_CACHE_HOME at Library/Cache?
Comment 10 Michael Natterer 2014-06-20 14:07:19 UTC
Because that would result in Library/Caches/thumbnails

but whose thumbnails. Following the example of other software, it
should  probably be

Library/Caches/org.freedesktop.thumbnails

So to do it properly, we'de need API to both set and get it.
Comment 11 GNOME Infrastructure Team 2018-05-24 12:53:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/348.