<!--
SPDX-FileCopyrightText: 2003-2006 Jesper K. Pedersen <jesper.pedersen@kdab.com>
SPDX-FileCopyrightText: 2012 Miika Turkia <miika.turkia@gmail.com>
SPDX-FileCopyrightText: 2012 Yuri Chornoivan <yurchor@ukr.net>

SPDX-License-Identifier: GFDL-1.2-only
-->

<chapter id="chp-viewer">
  <title>The Viewer</title>
  <para>The reason for you to put all your images into &kphotoalbum;, and
spending hours after hours describing them, is of course that you at some
point want to look at them. For that purpose &kphotoalbum; has an viewer
capable of showing your images and videos. You open the viewer from the
thumbnail view as described in <xref
      linkend="chp-thumbnail-view"/>.</para>

  <para>The viewer can be seen in <xref linkend="fig-viewer"/>. The viewer
does of course show you the image, but in addition to that it also shows
you the information you specified for each image, including, who is on the
 images, where and when it was takes, &etc;
</para>

  <figure id="fig-viewer">
    <title>The Viewer</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="viewer.png" format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

  <para>In case the info box is located on top of part of the images you actually
want to see, you can simply grab it with the mouse, and move it elsewhere
on the image. It is possible to configure what should be shown in the
info box, and of course whether it should be shown at all. All these
options are available by right clicking your mouse on the viewer. The
context menu can be seen in <xref linkend="fig-viewer-contextmenu"/>
below.</para>

  <figure id="fig-viewer-contextmenu">
    <title>The viewer's context menu</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="viewer-contextmenu.png" format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

  <para>Some of the words in the info box is underlines. If you click the
mouse on one of these words the browser (see <xref linkend="chp-browsing"/>)
will go into scope of that item. Thus if you click on <literal>Anne
Helene</literal> the browser will show you all images of Anne Helene, just
as it would have done if you selected <literal>People</literal> from the
root of the browser, and next selected <literal>Anne
Helene</literal>.</para>

<para>In the info box you can see a small button with the &kphotoalbum;
logo. Pressing that button will get you to the thumbnail viewer. The
thumbnail view will display all images, and the image you just had in the
viewer will be selected. The idea behind this is the following: you browse
to a given person, and look at the images of that
person. One of the images is from say your high school time, and now you
want to see images from that period of time. Using the <guilabel>Jump to
Context</guilabel> button, you are brought to the thumbnail view showing
all images, with the current one being in focus, and likely all your high
school pictures around it.</para>

  <para>In case you have loaded several images into the viewer, you can go
forth and back using <keycap>Page Up</keycap> and <keycap>Page
Down</keycap>. You can go to the first and last images
using <keycap>Home</keycap> and <keycap>End</keycap>. These functions
are of course also available from the context menu.</para>

  <para>If several images was loaded into the viewer, you can ask it to run
them as a slide show, which means that &kphotoalbum; loads a new image every few
second. How often it loads a new image is configure by pressing the control
key and respective plus (for go faster) or minus
(go slower). Starting and stopping the slide show is
done simply by pressing <keycombo>&Ctrl;<keycap>S</keycap></keycombo>.</para>

  <para>A very useful feature of the &kphotoalbum; viewer is it ability to go into
full screen mode. In this mode, the viewer is using the complete screen
space, simply press the return key to make it go into and out of full screen
mode.</para>

  <para>Using the viewer, you may zoom in and out of your image, simply by
dragging out a rectangle with the mouse. Pressing the minus key will zoom
out again. Pressing the plus key will zoom in at the center of the image. <xref
      linkend="fig-marking-zoom-rectangle"/> below shows how a zoom
rectangle is marked, and <xref linkend="fig-zoomed-view"/> shows the result of
the zoom.</para>

<para>Pressing the period key, lets you reset zooming, so the
image is shown un-zoomed. Pressing the equal sign will set the zoom level so
each pixel on the screen correspond to a pixel in the image.</para>

<para>Notice, for technical the only zooming operation that works when watching videos are  zoom in and out
(the plus and minus key).</para>

  <figure id="fig-marking-zoom-rectangle">
    <title>Zooming in the viewer</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="marking-zoom-rectangle.png"
          format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

  <figure id="fig-zoomed-view">
    <title>Zooming in the viewer</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="zoomed-view.png"
          format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

  <para>Choosing the rotate operations from the context menu, you may
rotate the image (Does not work for videos). You can annotate the current
image, simply by choosing <guimenuitem>Annotate</guimenuitem> in the context menu.</para>





<sect1 id="annotating-from-the-viewer">
<title>Annotating images from the viewer</title>
<para>Traditionally the main way for tagging images has been though <link linkend="chp-typingIn">the annotation dialog</link>.
Over the years a few different attempts have been made at integrating tagging into the viewer, first attempt was by assigning tokens in the viewer, a later
attempt was by making it possible to tag directly by typing part of a category item. In addition category items could be assigned to function keys on the keyboard.
The code for all of this have now been modernized to make the work flow much more intuitive and discover-able.</para>

<para>There are three modes to annotating images in the viewer:</para>
<itemizedlist>
    <listitem><para><emphasis>Locked</emphasis> - This is the default mode when starting the viewer - in here no annotating or tokenizing will happen. This ensure you do not accidentally annotates images when viewing them.</para></listitem>
    <listitem><para><emphasis>Assign Tokens</emphasis> - This allows you to set tokens on images, by simply pressing a key from A-Z on the keyboard.</para></listitem>
    <listitem><para><emphasis>Assign Tags</emphasis> - This allows you to assign macros to a keyboard key. As an example, <emphasis>L</emphasis> could mean set the item <emphasis>Las Vegas</emphasis> in the <emphasis>Location</emphasis> category. In addition to that, it also allows you to set any tag on an image.</para></listitem>
</itemizedlist>
<para>
The modes are selected from the context menu as can be seen in <xref linkend="fig-ctxmenu-for-mode-selection"/>.
</para>
<para>
The two modes are described in details below.
</para>

  <figure id="fig-ctxmenu-for-mode-selection">
    <title>Selecting annotation mode from the viewer</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="annotation-mode.png"
          format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

</sect1>




<sect1 id="tokens">
<title>Setting Tokens from the Viewer</title>
<para>Imagine you want to sent a number of images
to a printer to get them developed on paper. To see which you want, you
start the viewer on the images, and tag them as <emphasis>good</emphasis>, <emphasis>bad</emphasis>, or <emphasis>maybe</emphasis>, while inspecting each one.</para>

<para>You may of course create a few new items (say <emphasis>Good</emphasis>, <emphasis>Bad</emphasis>, <emphasis>Maybe</emphasis>) for an existing category, say the category <emphasis>Album</emphasis>.
However, given that you likely do not need these tags once you've send the images to the printer, there is an easier way, namely by simply setting tokens on the images. Tokens are named from A to Z, and you set a token
simply by pressing its letter. In <xref linkend="fig-images-with-tokens"/>
you may see an image where the tokens A, B and C are set.</para>

  <figure id="fig-images-with-tokens">
    <title>An Image with Tokens</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="images-with-tokens.png"
          format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

  <para>For this to work, you need to be in the <emphasis>Assign Tokens</emphasis> mode. See <xref linkend="fig-ctxmenu-for-mode-selection"/></para>

<para>Once you've set tokens on your images, they will be available for
regular browsing in the browser, as can be seen in <xref
linkend="fig-tokens-in-browser"/>. So when you've marked images that
needs to be edited, printed, or whatever, simply browse to the images, and process the set from there, e.g. by using <emphasis>copy images to...</emphasis> from the context menu.</para>

  <figure id="fig-tokens-in-browser">
    <title>Tokens seen in the Browser</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="tokens-in-browser.png"
          format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>

<para>Categories (and esp tokens) may be displayed in the thumbnail
viewer. When Showing the categories in the thumbnail viewer, you may also
add tokens to images, simply by pressing the letter for the token when the
image is selected, this can be seen in
<xref linkend="fig-tokens-in-thumbnail-viewer"/></para>

  <figure id="fig-tokens-in-thumbnail-viewer">
    <title>Tokens seen in the Thumbnail Viewer</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="tokens-in-thumbnail-viewer.png"
          format="PNG"/>
      </imageobject>
    </mediaobject>
  </figure>



</sect1>

<sect1>
    <title>Tagging images from the viewer</title>
<para>Tagging images can be tiresome, even in &kphotoalbum;, at least when you've fallen behind and have thousands or tens of thousands of images in need of proper tagging.
    Fortunately, it is now possible to add tags with the press of a single key when viewing the images. The realization behind this way of working with images is that most images are with the same few people in the same few places, plus a few "guest" appearances from time to time - say the location of your vacation, or some friends who were visiting you for a week.</para>

<para>To tag your images while viewing them, you need to enter the <emphasis>Assign Tags mode</emphasis> - see <xref linkend="fig-ctxmenu-for-mode-selection"/>.
    With this enable, simply press a letter key on your keyboard to either assign or use the assigned tag.</para>

<para>In <xref linkend="fig-assign-macro-step1"/> below, I've just pressed <keycap>s</keycap> while watching images and being in the <emphasis>Assign Tags mode</emphasis>. This brought up the dialog where I can specify what tag to assign to that key.</para>

<figure id="fig-assign-macro-step1">
  <title>Step 1 - assigning a macro to the key <emphasis>s</emphasis></title>
  <mediaobject>
    <imageobject><imagedata fileref="assign-macro-step1.png" format="PNG"/></imageobject>
   </mediaobject>
</figure>

<para>Next, in the line edit I typed <emphasis>sp</emphasis> which suggest "People / Je<emphasis>sp</emphasis>er" and "People / <emphasis>Sp</emphasis>iff".
    Both matched the letters I typed. Pressing arrow down to select <emphasis>Spiff</emphasis> and pressing enter, will assign the letter <emphasis>s</emphasis> to adding the tag <emphasis>People / Spiff</emphasis> to the image viewed.
    This assignment, will be saved for future sessions. To re-assign s to another tag, simply press <keycombo action="simul">&Shift;<keycap>s</keycap></keycombo>.</para>

<figure id="fig-assign-macro-step2">
  <title>Step 2 - assigning a macro - typing <emphasis>sp</emphasis></title>
  <mediaobject>
    <imageobject><imagedata fileref="assign-macro-step2.png" format="PNG"/></imageobject>
   </mediaobject>
</figure>

<para>In <xref linkend="fig-assign-macro-overview"/> below you can see existing keybindings in the right side of the dialog.</para>
<figure id="fig-assign-macro-overview">
  <title>Overview of assigned key bindings</title>
  <mediaobject>
    <imageobject><imagedata fileref="assign-macro-overview.png" format="PNG"/></imageobject>
   </mediaobject>
</figure>

<para>In case the tag you want to assign doesn't already exist in your database, then simply press the <emphasis>Add New</emphasis> button to create it. This can be seen in <xref linkend="fig-assign-macro-add-new-value.png"/> below</para>

<figure id="fig-assign-macro-add-new-value.png">
  <title>Adding a new tag</title>
  <mediaobject>
    <imageobject><imagedata fileref="assign-macro-add-new-value.png" format="PNG"/></imageobject>
   </mediaobject>
</figure>

<para>While tagging images from the viewer, you may want to add a tag, without binding it to a key. To do so simply press <keycombo>&Ctrl;<keycap>a</keycap></keycombo></para>

</sect1>
</chapter>

<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-parent-document: "index.docbook"
End:
-->
