<guilabel>Cache thumbnails</guilabel>\r
</term>\r
<listitem>\r
- <para>\r
- Enable this to save thumbnails to disk, subsequent requests for a thumbnail will be faster. Thumbnails are cached into:\r
- <programlisting>$XDG_CACHE_HOME/geeqie/thumbnails/</programlisting>\r
- <programlisting>($~/.cache/geeqie/thumbnails/)</programlisting>\r
- Refer to\r
- <link linkend="GuideReferenceThumbnails">Thumbnails Reference</link>\r
- for additional details.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
- </variablelist>\r
- <variablelist>\r
- <varlistentry>\r
- <term>\r
- <guilabel>Use shared thumbnail cache</guilabel>\r
- </term>\r
- <listitem>\r
- <para>\r
- This will use a thumbnail caching method that is compatible with applications that use the standard thumbnail specification. When this option is enabled thumbnails will be stored in\r
- <programlisting>$HOME/.thumbnails</programlisting>\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
- </variablelist>\r
- <variablelist>\r
- <varlistentry>\r
- <term>\r
- <guilabel>Cache thumbnails into .thumbnails</guilabel>\r
- </term>\r
- <listitem>\r
- <para>\r
- When enabled, Geeqie attempts to store cached thumbnails closer to the source image. This way multiple users can benefit from a single cache, thereby reducing wasted disk space. The resulting location is the source image's folder, in a sub folder with the name\r
- <programlisting>.thumbnails</programlisting>\r
- When the image source folder cannot be written, Geeqie falls back to saving the thumbnail in the user's home folder.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
- </variablelist>\r
- <variablelist>\r
- <varlistentry>\r
- <term>\r
- <guilabel>Faster jpeg thumbnailing</guilabel>\r
- </term>\r
- <listitem>\r
- <para>This will speed up thumbnails generation in some cases, but may reduce the quality</para>\r
+ <para>Enable this to save thumbnails to disk. Subsequent requests for a thumbnail will be faster.</para>\r
+ <variablelist>\r
+ <varlistentry>\r
+ <term>\r
+ <guilabel>Use Geeqie thumbnail style and cache</guilabel>\r
+ </term>\r
+ <listitem>\r
+ <para>Thumbnails are stored in a folder hierachy that mirrors the location of the source images. Thumbnails have the same name as the original appended by the file extension .png.</para>\r
+ <para>\r
+ The root of the hierachy is:\r
+ <para>\r
+ <programlisting>$XDG_CACHE_HOME/geeqie/thumbnails/</programlisting>\r
+ or, if $XDG_CACHE_HOME is not defined:\r
+ <programlisting>$HOME/.cache/geeqie/thumbnails/</programlisting>\r
+ </para>\r
+ </para>\r
+ </listitem>\r
+ </varlistentry>\r
+ </variablelist>\r
+ <variablelist>\r
+ <varlistentry>\r
+ <term>\r
+ <guilabel>Store thumbnails local to image folder (non-standard)</guilabel>\r
+ </term>\r
+ <listitem>\r
+ <para>\r
+ When enabled, Geeqie attempts to store cached thumbnails closer to the source image. This way multiple users can benefit from a single cache, thereby reducing wasted disk space.\r
+ <para />\r
+ Thumbnails have the same name as the original appended by the file extension .png.\r
+ <para />\r
+ The resulting location is the source image's folder, in a sub folder with the name\r
+ <programlisting>.thumbnails</programlisting>\r
+ <para />\r
+ When the image source folder cannot be written, Geeqie falls back to saving the thumbnail in the user's home folder.\r
+ </para>\r
+ </listitem>\r
+ </varlistentry>\r
+ </variablelist>\r
+ <variablelist>\r
+ <varlistentry>\r
+ <term>\r
+ <guilabel>Use standard thumbnail style and cache, shared with other applications</guilabel>\r
+ </term>\r
+ <listitem>\r
+ <para>\r
+ This will use a thumbnail caching method that is compatible with applications that use the standard thumbnail specification. When this option is enabled thumbnails will be stored in:\r
+ <para>\r
+ <programlisting>$XDG_CACHE_HOME/thumbnails/</programlisting>\r
+ or, if $XDG_CACHE_HOME is not defined:\r
+ <programlisting>$HOME/.cache/thumbnails/</programlisting>\r
+ </para>\r
+ <para>\r
+ All thumbnails are stored in the same folder, with computer-generated filenames. Refer to\r
+ <link linkend="GuideReferenceThumbnails">Thumbnails Reference</link>\r
+ for additional details.\r
+ </para>\r
+ </para>\r
+ </listitem>\r
+ </varlistentry>\r
+ </variablelist>\r
</listitem>\r
</varlistentry>\r
</variablelist>\r
</listitem>\r
</varlistentry>\r
</variablelist>\r
- <variablelist>\r
- <varlistentry>\r
- <term>\r
- <guilabel>Use xvpics thumbnails when found</guilabel>\r
- </term>\r
- <listitem>\r
- Refer to\r
- <link linkend="GuideOptionsHidden" endterm="titleGuideOptionsHidden" />\r
- .\r
- </listitem>\r
- </varlistentry>\r
- </variablelist>\r
</section>\r
<section id="Slideshow">\r
<title>Slide show</title>\r
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceLua.xml" />\r
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceConfig.xml" />\r
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceLIRC.xml" />\r
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceStandards.xml" />\r
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceTags.xml" />\r
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceSupportedFormats.xml" />\r
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceDecodeLatLong.xml" />\r
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReferenceStandards.xml" />\r
<para />\r
</chapter>\r
<guilabel>Clear cache</guilabel>\r
</term>\r
<listitem>\r
- <para>\r
- Removes all thumbnails and data stored in the user's home folder:\r
- <programlisting>$HOME/.cache/.geeqie/thumbnails</programlisting>\r
- </para>\r
+ <para>Removes all thumbnails and data stored in the designated folder.</para>\r
</listitem>\r
</varlistentry>\r
</variablelist>\r
<guilabel>Clear cache</guilabel>\r
</term>\r
<listitem>\r
- <para>\r
- Removes all thumbnails stored in the user's home folder:\r
- <programlisting>$HOME/.thumbnails</programlisting>\r
- </para>\r
+ <para>Removes all thumbnails stored in the designated folder.</para>\r
</listitem>\r
</varlistentry>\r
</variablelist>\r
Pango mark up:\r
<ulink url="https://developer.gnome.org/pango/stable/PangoMarkupFormat.html" />\r
</para>\r
+ <para>\r
+ Thumbnails:\r
+ <ulink url="https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html" />\r
+ </para>\r
</section>\r
<section id="GuideReferenceThumbnails">\r
<title>Thumbnails</title>\r
<note>\r
- <para>This page only refers the Geeqie thumbnail caching mechanism, the shared thumbnail cache mechanism is not explained here.</para>\r
+ <para>\r
+ This page only refers the Geeqie thumbnail caching mechanism, the shared thumbnail cache mechanism is described in\r
+ <link linkend="GuideReferenceStandards">Thumbnail Standards</link>\r
+ .\r
+ </para>\r
</note>\r
<para />\r
<section id="Format">\r
#include "md5-util.h"
#include "secure_save.h"
+#include "thumb_standard.h"
#include "ui_fileops.h"
#include <utime.h>
if (USE_XDG)
{
- thumbnails_cache_dir = g_build_filename(xdg_cache_home_get(), GQ_APPNAME_LC, GQ_CACHE_THUMB, NULL);
+ thumbnails_cache_dir = g_build_filename(xdg_cache_home_get(),
+ GQ_APPNAME_LC, GQ_CACHE_THUMB, NULL);
}
else
{
return thumbnails_cache_dir;
}
+const gchar *get_thumbnails_standard_cache_dir(void)
+{
+ static gchar *thumbnails_standard_cache_dir = NULL;
+
+ if (thumbnails_standard_cache_dir) return thumbnails_standard_cache_dir;
+
+ thumbnails_standard_cache_dir = g_build_filename(xdg_cache_home_get(),
+ THUMB_FOLDER_GLOBAL, NULL);
+
+ return thumbnails_standard_cache_dir;
+}
+
const gchar *get_metadata_cache_dir(void)
{
static gchar *metadata_cache_dir = NULL;
gchar *cache_find_location(CacheType type, const gchar *source);
const gchar *get_thumbnails_cache_dir(void);
+const gchar *get_thumbnails_standard_cache_dir(void);
const gchar *get_metadata_cache_dir(void);
#endif
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(cd->progress), _("running..."));
}
- path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, THUMB_FOLDER_NORMAL, NULL);
+ path = g_build_filename(get_thumbnails_standard_cache_dir(), THUMB_FOLDER_NORMAL, NULL);
dir_fd = file_data_new_dir(path);
filelist_read(dir_fd, &list, NULL);
cd->list = list;
file_data_unref(dir_fd);
g_free(path);
- path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, THUMB_FOLDER_LARGE, NULL);
+ path = g_build_filename(get_thumbnails_standard_cache_dir(), THUMB_FOLDER_LARGE, NULL);
dir_fd = file_data_new_dir(path);
filelist_read(dir_fd, &list, NULL);
cd->list = g_list_concat(cd->list, list);
file_data_unref(dir_fd);
g_free(path);
- path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, THUMB_FOLDER_FAIL, NULL);
+ path = g_build_filename(get_thumbnails_standard_cache_dir(), THUMB_FOLDER_FAIL, NULL);
dir_fd = file_data_new_dir(path);
filelist_read(dir_fd, &list, NULL);
cd->list = g_list_concat(cd->list, list);
sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- group = pref_group_new(gd->vbox, FALSE, _("Thumbnail cache"), GTK_ORIENTATION_VERTICAL);
+ group = pref_group_new(gd->vbox, FALSE, _("Geeqie thumbnail cache"), GTK_ORIENTATION_VERTICAL);
cache_manager_location_label(group, get_thumbnails_cache_dir());
group = pref_group_new(gd->vbox, FALSE, _("Shared thumbnail cache"), GTK_ORIENTATION_VERTICAL);
- path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, NULL);
+ path = g_build_filename(get_thumbnails_standard_cache_dir(), NULL);
cache_manager_location_label(group, path);
g_free(path);
return vbox;
}
+static void cache_standard_cb(GtkWidget *widget, gpointer data)
+{
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+ {
+ c_options->thumbnails.spec_standard =TRUE;
+ c_options->thumbnails.cache_into_dirs = FALSE;
+ }
+ else
+ {
+ c_options->thumbnails.spec_standard =FALSE;
+ }
+ DEBUG_0("standard %d",c_options->thumbnails.spec_standard);
+}
+
+static void cache_geeqie_cb(GtkWidget *widget, gpointer data)
+{
+ if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+ {
+ c_options->thumbnails.spec_standard =TRUE;
+ c_options->thumbnails.cache_into_dirs = FALSE;
+ }
+ else
+ {
+ c_options->thumbnails.spec_standard =FALSE;
+ }
+ DEBUG_0("geeqie %d",c_options->thumbnails.spec_standard);
+}
+
+static void cache_local_cb(GtkWidget *widget, gpointer data)
+{
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+ {
+ c_options->thumbnails.cache_into_dirs = TRUE;
+ c_options->thumbnails.spec_standard =FALSE;
+ }
+ else
+ {
+ c_options->thumbnails.cache_into_dirs = FALSE;
+ }
+}
+
/* general options tab */
static void config_tab_general(GtkWidget *notebook)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *group;
+ GtkWidget *group_frame;
GtkWidget *subgroup;
GtkWidget *button;
GtkWidget *ct_button;
subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
pref_checkbox_link_sensitivity(ct_button, subgroup);
- button = pref_checkbox_new_int(subgroup, _("Use standard thumbnail cache, shared with other applications"),
- options->thumbnails.spec_standard, &c_options->thumbnails.spec_standard);
-
- subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
- pref_checkbox_link_sensitivity_swap(button, subgroup);
-
- pref_checkbox_new_int(subgroup, _("Store thumbnails in '.thumbnails' folder, local to image folder (non-standard)"),
- options->thumbnails.cache_into_dirs, &c_options->thumbnails.cache_into_dirs);
+ group_frame = pref_frame_new(subgroup, TRUE, _("Use Geeqie thumbnail style and cache"),
+ GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
+ button = pref_radiobutton_new(group_frame, NULL, get_thumbnails_cache_dir(),
+ !options->thumbnails.spec_standard,
+ G_CALLBACK(cache_geeqie_cb), NULL);
+
+ group_frame = pref_frame_new(subgroup, TRUE,
+ _("Store thumbnails local to image folder (non-standard)"),
+ GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
+ pref_radiobutton_new(group_frame, button, "*/.thumbnails",
+ options->thumbnails.cache_into_dirs,
+ G_CALLBACK(cache_local_cb), NULL);
+
+ group_frame = pref_frame_new(subgroup, TRUE,
+ _("Use standard thumbnail style and cache, shared with other applications"),
+ GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
+ pref_radiobutton_new(group_frame, button, get_thumbnails_standard_cache_dir(),
+ options->thumbnails.spec_standard,
+ G_CALLBACK(cache_standard_cb), NULL);
pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"),
options->thumbnails.use_exif, &c_options->thumbnails.use_exif);
#include "main.h"
#include "thumb_standard.h"
+#include "cache.h"
#include "image-load.h"
#include "md5-util.h"
#include "pixbuf_util.h"
}
else
{
- result = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, cache_subfolder, name, NULL);
+ result = g_build_filename(get_thumbnails_standard_cache_dir(),
+ cache_subfolder, name, NULL);
}
g_free(name);
tl->source_size = st.st_size;
tl->source_mode = st.st_mode;
- if (!thumb_cache) thumb_cache = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, NULL);
+ if (!thumb_cache)
+ {
+ thumb_cache = g_strdup(get_thumbnails_standard_cache_dir());
+ }
+
if (strncmp(tl->fd->path, thumb_cache, strlen(thumb_cache)) != 0)
{
gchar *pathl;
#if GLIB_CHECK_VERSION (2, 34, 0)
-#define THUMB_FOLDER_GLOBAL ".cache/thumbnails"
+#define THUMB_FOLDER_GLOBAL "thumbnails"
#else
#define THUMB_FOLDER_GLOBAL ".thumbnails"
#endif