From 5401cb9a916c975094f019ea85394b8c5073a2b3 Mon Sep 17 00:00:00 2001 From: dockes Date: Fri, 8 Jun 2007 12:32:35 +0000 Subject: [PATCH] rcljpeg --- src/filters/rcljpeg | 91 +++++++++++++++++++++++++++++++++++++++++ src/sampleconf/mimeconf | 10 +++-- 2 files changed, 97 insertions(+), 4 deletions(-) create mode 100755 src/filters/rcljpeg diff --git a/src/filters/rcljpeg b/src/filters/rcljpeg new file mode 100755 index 00000000..b03effa0 --- /dev/null +++ b/src/filters/rcljpeg @@ -0,0 +1,91 @@ +#! /bin/sh +# +# set variables +LANG=C ; export LANG +LC_ALL=C ; export LC_ALL +progname="rcljpeg" +decoder=exiftool +#decoder=ps2ascii +filetype=jpeg + +#RECFILTCOMMONCODE +############################################################################## +# !! Leave the previous line unmodified!! Code imported from the +# recfiltcommon file + +# Utility code common to all shell filters. This could be sourced at run +# time, but it's slightly more efficient to include the code in the +# filters at build time (with a sed script). + +# Describe error in a way that can be interpreted by our caller +senderror() +{ + echo RECFILTERROR $* + # Also alert on stderr just in case + echo ":2:$progname::: $*" 1>&2 + exit 1 +} + +iscmd() +{ + cmd=$1 + case $cmd in + */*) + if test -x $cmd ; then return 0; else return 1; fi ;; + *) + oldifs=$IFS; IFS=":"; set -- $PATH; IFS=$oldifs + for d in $*;do test -x $d/$cmd && return 0;done + return 1 ;; + esac +} + +checkcmds() +{ + for cmd in $*;do + if iscmd $cmd + then + a=1 + else + senderror HELPERNOTFOUND $cmd + fi + done +} + +# show help message +if test $# -ne 1 -o "$1" = "--help" +then + echo "Convert a $filetype file to HTML text for Recoll indexing." + echo "Usage: $progname [infile]" + exit 1 +fi + +infile="$1" + +# check the input file existence (may be '-' for stdin) +if test "X$infile" != X- -a ! -f "$infile" +then + senderror INPUTNOSUCHFILE "$infile" +fi + +############################################################################## +# !! Leave the following line unmodified ! +#ENDRECFILTCOMMONCODE + +checkcmds $decoder + +echo ' + + + + + + + +' +exiftool -q -q -m -IPTC:all "$infile" | sed -e 's/$/
/' + +echo ' + + +' + diff --git a/src/sampleconf/mimeconf b/src/sampleconf/mimeconf index a4bd6ba7..94bf24ba 100644 --- a/src/sampleconf/mimeconf +++ b/src/sampleconf/mimeconf @@ -1,4 +1,4 @@ -# @(#$Id: mimeconf,v 1.25 2007-02-06 18:01:16 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: mimeconf,v 1.26 2007-06-08 12:32:35 dockes Exp $ (C) 2004 J.F.Dockes # Recoll : associations of mime types to processing filters. # There are different sections for decompression, 'interning' for indexing @@ -21,9 +21,10 @@ application/x-compress = uncompress rcluncomp gunzip %f %t application/x-bzip2 = uncompress rcluncomp bunzip2 %f %t ## ################################### -# Filters for indexing and internal preview. -# The external (exec) filters output the document in simple html format, -# have a look at the scripts. +# Filters for indexing and internal preview. +# The "internal" filters are hardwired in the c++ code. +# The external "exec" filters are typically scripts. They output the +# document in simple html format, have a look at the scripts. [index] application/msword = exec rcldoc application/pdf = exec rclpdf @@ -45,6 +46,7 @@ application/x-lyx = exec rcllyx application/x-scribus = exec rclscribus audio/mpeg = exec rclmedia image/vnd.djvu = exec rcldjvu +image/jpeg = exec rcljpeg message/rfc822 = internal text/html = internal text/plain = internal