This commit is contained in:
dockes 2007-06-08 12:32:35 +00:00
parent 0b12b5a64c
commit 5401cb9a91
2 changed files with 97 additions and 4 deletions

91
src/filters/rcljpeg Executable file
View File

@ -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 '
<html>
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
'
exiftool -q -q -m -IPTC:all "$infile" | sed -e 's/$/<br>/'
echo '
</body>
</html>
'

View File

@ -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