aacbb751986921ea821ae6971e384704a06e7041
[geeqie.git] / doc / docbook / GuideOptionsAdvanced.xml
1 <?xml version="1.0" encoding="utf-8"?>
2   <section id="GuideOptionsAdvanced">
3 <title>Advanced</title>
4   <section id="ExternalPreviewExtraction">
5      <title>External preview extraction</title>
6  <para>
7     The intention of this feature is to give the user the possibility to display image previews of files
8     that the standard libraries cannot decode.
9     <para />
10     An example is the .dng files produced by LG V30 cameras. Neither
11     <code>exiv2</code>
12     nor
13     <code>libraw</code>
14     can
15     extract a preview, but the command line program
16     <code>dcraw</code>
17     can.
18     <para />
19     This feature allows a work-around until the standard libraries provide a solution.
20     <para />
21     Two command files are required: one to identify which files to process, and one to extract or decode the preview image.
22     <para />
23     The format for the identification tool is:
24     <para />
25     <pre>
26       <programlisting xml:space="preserve">
27         Parameter 1: (input) full path name to the current image.
28         <para />
29         Returns: 0 for file match, any other value for no match.
30       </programlisting>
31     </pre>
32     <para />
33     The format for the extraction tool is:
34     <para />
35     <pre>
36       <programlisting xml:space="preserve">
37         Parameter 1: (input) full path name to the current image.
38         <para />
39         Parameter 2: (output) a temporary file name generated by Geeqie. The tool should load this file with the decoded image.
40         <para />
41         Returns: not used.
42       </programlisting>
43     </pre>
44     <para />
45     This is an example of an identification tool using a shell script:
46     <para />
47     <pre>
48       <programlisting xml:space="preserve">#! /bin/bash
49
50         filename=$(basename -- "$1")
51         extension="${filename##*.}"
52
53         shopt -s nocasematch
54         if [[ $extension == "DNG" ]]
55         then
56             cameramodel=$(exiv2 -K Exif.Image.UniqueCameraModel -Pt "$1" )
57             if [[ $cameramodel  == "LG-H930" ]]
58             then
59                 exit 0
60             else
61                 exit 1
62             fi
63         else
64             exit 1
65         fi</programlisting>
66     </pre>
67   </para>
68   <para>
69     This is an example of an extraction/decode tool using a shell script:
70     <pre>
71       <programlisting xml:space="preserve">#! /bin/bash
72         dcraw -e -c   "$1" > "$2"</programlisting>
73     </pre>
74     <para />
75     Alternatively:
76     <pre>
77       <programlisting xml:space="preserve">#! /bin/bash
78         gm convert "$1" "$2"</programlisting>
79     </pre>
80   </para>
81   <para>
82     If the decode tool requires an output file with a particular extension, use this method:
83     <pre>
84       <programlisting xml:space="preserve">#! /bin/bash
85         tmpfile=$(mktemp --tmpdir=$tempdir geeqie_tmp_XXXXXX.jpg)
86         gm convert "$1" $tmpfile
87         mv $tmpfile "$2"</programlisting>
88     </pre>
89   </para>
90 </section>
91 <section id="ThreadPools">
92     <title>Thread Pools</title>
93     <para>This option will limit the number of threads (cores) that are used when performing a duplicate image search. A value of <code>0</code> means use all available threads. This will give the fastest processing time, but will slow other processes including user input response time.</para> 
94 </section>
95 </section>