<?xml version="1.0" encoding="utf-8"?>
<section id="GuideReferenceManagement">
  <title id="titleGuideReferenceManagement">Cache and Data Maintenance</title>
  <para>
    Thumbnails and other cached data can be maintained from the dialog accessible by selecting
    <menuchoice>
      <guimenu>Edit</guimenu>
      <guimenuitem>Cache maintenance</guimenuitem>
    </menuchoice>
    .
  </para>
  <para />
  <section id="Geeqiethumbnailcache">
    <title>Geeqie thumbnail and sim. cache</title>
    <para>
      The utilities listed here operate on the Geeqie caching mechanism. This also includes the data cached for the
      <link linkend="GuideImageSearchSearch">search</link>
      and
      <link linkend="GuideImageSearchFindingDuplicates">find duplicates</link>
      utilities.
    </para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>Clean up</guilabel>
        </term>
        <listitem>
          <para>Removes thumbnails, sim. files, and data for which the source image is no longer present, or has been modified since the thumbnail was generated.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Clear cache</guilabel>
        </term>
        <listitem>
          <para>Removes all thumbnails, sim. files, and data stored in the designated folder.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>
  <section id="Sharedthumbnailcache">
    <title>Shared thumbnail cache</title>
    <para>The utilities listed here operate on the shared thumbnail mechanism.</para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>Clean up</guilabel>
        </term>
        <listitem>
          <para>Removes thumbnails for which the source image is no longer present, or has been modified since the thumbnail was generated.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Clear cache</guilabel>
        </term>
        <listitem>
          <para>Removes all thumbnails stored in the designated folder.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>
  <section id="Createthumbnails">
    <title>Create thumbnails</title>
    <para>
      This utility will render thumbnails using the current thumbnail caching mechanism, as determined in
      <link linkend="GuideOptionsGeneral">Preferences</link>
      .
    </para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>Render</guilabel>
        </term>
        <listitem>
          <para>Pre-render thumbnails for a specific folder, the utility has the following options:</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Include subfolders</guilabel>
        </term>
        <listitem>
          <para>Enable to include all images contained in the subfolders of folder.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <guilabel>Store thumbnails local to source images</guilabel>
        </term>
        <listitem>
          <para>The generated thumbnails will be stored local to the source images, if you have the permissions to write to the folder containing the images.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>
  <section id="CreateSimFiles">
    <title>Create file similarity cache</title>
    <para>
      Some file operations, such as
      <link linkend="GuideImageSearchSearch">search</link>
      and
      <link linkend="GuideImageSearchFindingDuplicates">find duplicates</link>
      , are speeded up if similarity data files for the images have been created. This utility will create sim. files recursively under the specified folder.
      <para />
      The sim. files contain some or all of the following fields:
      <variablelist>
        <varlistentry>
          <term>
            <guilabel>Dimensions</guilabel>
          </term>
          <listitem>
            <para>width x height</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <guilabel>Date</guilabel>
          </term>
          <listitem>
            <para>Exif date in time_t format</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <guilabel>checksum</guilabel>
          </term>
          <listitem>
            <para>MD5sum 32 character ascii text digest</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <guilabel>SimilarityGrid</guilabel>
          </term>
          <listitem>
            <para>[32 x 32] = 3072 bytes of data (1024 pixels in RGB format, 1 pixel is 24bits)</para>
          </listitem>
        </varlistentry>
      </variablelist>
    </para>
  </section>
  <section id="Metadata">
    <title>Metadata</title>
    <para>
      This utility operates on the data store for
      <link linkend="MetadataWritingProcess">Metadata</link>
      located in the folder:
      <programlisting>$HOME/.local/share/Geeqie/metadata</programlisting>
    </para>
    <variablelist>
      <varlistentry>
        <term>
          <guilabel>Clean up</guilabel>
        </term>
        <listitem>
          <para>Removes keywords and comments for which the source image is no longer present.</para>
          <para />
          <para />
        </listitem>
      </varlistentry>
    </variablelist>
  </section>
  <section id="BackgroundCacheMaintenance">
    <title>Background Cache Maintenance</title>
    <para>
      This facility will run the command line program described below as a stand-alone background job.
    </para>
  </section>
  <section id="CacheMaintenance">
    <title>Command line program</title>
    <para>
      Geeqie can be run as a command line program: <code>geeqie --cache-maintenance &lt;path&gt;</code>. It will recursively remove orphaned thumbnails and .sim files, and create thumbnails and similarity data for all images found.
    <para/>
      It may also be called from <code>cron</code> or <code>anacron</code> thus enabling automatic updating of the cached data for all your images.
    </para>
  </section>
</section>
