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