1 <?xml version="1.0" encoding="utf-8"?>
\r
2 <section id="GuideOptionsAdvanced">
\r
3 <title>External preview extraction</title>
\r
5 The intention of this feature is to give the user the possibility to display image previews of files
\r
6 that the standard libraries cannot decode.
\r
8 An example is the .dng files produced by LG V30 cameras. Neither
\r
13 extract a preview, but the command line program
\r
17 This feature allows a work-around until the standard libraries provide a solution.
\r
19 Two command files are required: one to identify which files to process, and one to extract or decode the preview image.
\r
21 The format for the identification tool is:
\r
24 <programlisting xml:space="preserve">
\r
25 Parameter 1: (input) full path name to the current image.
\r
27 Returns: 0 for file match, any other value for no match.
\r
31 The format for the extraction tool is:
\r
34 <programlisting xml:space="preserve">
\r
35 Parameter 1: (input) full path name to the current image.
\r
37 Parameter 2: (output) a temporary file name generated by Geeqie. The tool should load this file with the decoded image.
\r
43 This is an example of an identification tool using a shell script:
\r
46 <programlisting xml:space="preserve">#! /bin/bash
\r
48 filename=$(basename -- "$1")
\r
49 extension="${filename##*.}"
\r
51 shopt -s nocasematch
\r
52 if [[ $extension == "DNG" ]]
\r
54 cameramodel=$(exiv2 -K Exif.Image.UniqueCameraModel -Pt "$1" )
\r
55 if [[ $cameramodel == "LG-H930" ]]
\r
67 This is an example of an extraction/decode tool using a shell script:
\r
69 <programlisting xml:space="preserve">#! /bin/bash
\r
70 dcraw -e -c "$1" > "$2"</programlisting>
\r
75 <programlisting xml:space="preserve">#! /bin/bash
\r
76 gm convert "$1" "$2"</programlisting>
\r
80 If the decode tool requires an output file with a particular extension, use this method:
\r
82 <programlisting xml:space="preserve">#! /bin/bash
\r
83 tmpfile=$(mktemp --tmpdir=$tempdir geeqie_tmp_XXXXXX.jpg)
\r
84 gm convert "$1" $tmpfile
\r
85 mv $tmpfile "$2"</programlisting>
\r