libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 89369052448046f08dfb682d6e967bdf07a64d45
parent cd944dc34ea50c73bfec66d3e75cc82aab3c1c28
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 14 Aug 2005 01:50:12 +0000

po-update

Diffstat:
MChangeLog | 5+++++
MREADME | 30+++++++++++++++---------------
Mconfigure.ac | 21+++++++++++++++++++--
Mpo/POTFILES.in | 16+---------------
Mpo/de.po | 14+++++++-------
Mpo/libextractor.pot | 14+++++++-------
Mpo/ro.po | 14+++++++-------
Mpo/rw.po | 14+++++++-------
Msrc/include/extractor.h | 2+-
Msrc/main/extractor.c | 8+++++++-
Msrc/plugins/Makefile.am | 6+++++-
Msrc/plugins/manextractor.c | 1-
Msrc/plugins/ole2/Makefile.am | 7++++---
Msrc/plugins/oo/ooextractor.c | 2--
Msrc/plugins/thumbnail/Makefile.am | 25++++++++++---------------
Msrc/plugins/thumbnail/thumbnailextractor.c | 7-------
16 files changed, 95 insertions(+), 91 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +Sat Aug 13 18:41:02 PDT 2005 + Fixed problems with ole2 extractor. Also removed + requirement for static version of glib (!). + Releasing libextractor 0.5.3. + Fri Aug 12 23:53:54 PDT 2005 Fixed bug in OO extractor that made it not work. Fixed bug in exiv2 extractor that killed keywords diff --git a/README b/README @@ -4,7 +4,7 @@ libextractor libextractor is a simple library for keyword extraction. libextractor does not support all formats but supports a simple plugging mechanism such that you can quickly add extractors for additional formats, even -without recompiling libextractor. libextractor typically ships with a +without recompiling libextractor. libextractor typically ships with a dozen helper-libraries that can be used to obtain keywords from common file-types. @@ -33,17 +33,10 @@ include: * glib 2.6 * gtk 2.6 (for thumbnails, gdk-pixbuf) -You need the _static_, relocatable version of glib and gtk -here, so make sure you have a libgobject-2.0.a installed. -Alternatively, compile with --without-glib (disables some -plugins) - When building libextractor binaries, please make sure all of these dependencies are available. Otherwise the build system may automatically build only a subset of libextractor. -Note however that the build will fail at compile time if only the -shared library of glib/gtk is installed. Writing plugins @@ -58,19 +51,21 @@ with this signature: KeywordList * <libraryname>_extract(const char * filename, char * data, size_t size, - KeywordList * prev); + KeywordList * prev, + const char * options); where <libraryname> is the name of the library file that you will tell libExtractor to load, minus the suffix. For example, if you link your extractor into a file called 'myextractor.so', the method above should be called 'myextractor_extract'. -The filename is the name of the file, data is a pointer to the -contents of the file and size is the size of the file. The extract -method must prepend keywords that it finds to the linked list 'prev' -and return the new head. The library must allocate (malloc) the entry -in the keyword list and the memory for the filename since both will be -free'ed by libExtractor once the application calls freeKeywords. +The filename is the name of the file and maybe NULL, data is a pointer +to the contents of the file and size is the size of the file. The +extract method must prepend keywords that it finds to the linked list +'prev' and return the new head. The library must allocate (malloc) +the entry in the keyword list and the memory for the filename since +both will be free'ed by libextractor once the application calls +freeKeywords. An example implementation can be found in mp3extractor.c. @@ -89,3 +84,8 @@ problems compiling one of the extractors. GCC 3.3 and 2.95.2 are known to work well; as such, libextractor will first look for 3.3 (by attempting to run gcc-3.3, cpp-3.3, and g++-3.3) and then 2.95.2 (by attempting to run gcc2 and g++2). + +exiv2 requires G++ 3.0 or higher. With older GCC versions (and other +broken C++ compilers), you have to manually disable exiv2 by passing +"--disable-exiv2" to "configure" in order to avoid compilation +problems. diff --git a/configure.ac b/configure.ac @@ -1,8 +1,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([libextractor], [0.5.2], [bug-libextractor@gnu.org]) +AC_INIT([libextractor], [0.5.3], [bug-libextractor@gnu.org]) AC_REVISION($Revision: 1.67 $) -AM_INIT_AUTOMAKE([libextractor], [0.5.2]) +AM_INIT_AUTOMAKE([libextractor], [0.5.3]) AM_CONFIG_HEADER(src/include/config.h) AH_TOP([#define _GNU_SOURCE 1]) @@ -247,6 +247,23 @@ AC_ARG_ENABLE(printable, printable=1]) AM_CONDITIONAL(HAVE_PRINTABLE, test x$printable != x0) +exiv2=1 +AC_MSG_CHECKING([whether to enable exiv2 extractor]) +AC_ARG_ENABLE(printable, + [AC_HELP_STRING([--enable-exiv2],[Enable exiv2 support]) + AC_HELP_STRING([--disable-exiv2],[Disable exiv2 support])], + [case "$enableval" in + no) AC_MSG_RESULT(no) + exiv2=0 + ;; + *) AC_MSG_RESULT(yes) + exiv2=1 + ;; + esac], + [ AC_MSG_RESULT(yes) + exiv2=1]) +AM_CONDITIONAL(HAVE_EXIV2, test x$exiv2 != x0) +AC_DEFINE_UNQUOTED([HAVE_EXIV2], $exiv2, [We use EXIV2]) AC_SUBST(CPPFLAGS) diff --git a/po/POTFILES.in b/po/POTFILES.in @@ -23,11 +23,8 @@ src/plugins/printable/pees.c src/plugins/printable/no.c src/plugins/printable/peno.c src/plugins/ole2/gsf-infile-msole.c -src/plugins/ole2/gsf-input.c src/plugins/ole2/gsf-utils.c -src/plugins/ole2/gsf-input-memory.c -src/plugins/ole2/gsf-infile.c -src/plugins/ole2/gsf-shared-memory.c +src/plugins/ole2/gsf-input.c src/plugins/ole2/ole2extractor.c src/plugins/oo/ioapi.c src/plugins/oo/unzip.c @@ -73,17 +70,6 @@ src/plugins/hash/sha1.h src/plugins/hash/md5.h src/plugins/printable/sha1.h src/plugins/printable/bloomfilter.h -src/plugins/ole2/gsf.h -src/plugins/ole2/gsf-shared-memory.h -src/plugins/ole2/gsf-msole-impl.h -src/plugins/ole2/gsf-infile-msole.h -src/plugins/ole2/gsf-input-impl.h -src/plugins/ole2/gsf-impl-utils.h -src/plugins/ole2/gsf-input.h -src/plugins/ole2/gsf-utils.h -src/plugins/ole2/gsf-input-memory.h -src/plugins/ole2/gsf-infile-impl.h -src/plugins/ole2/gsf-infile.h src/plugins/pdf/Error.h src/plugins/pdf/StdFontInfo.h src/plugins/pdf/Stream.h diff --git a/po/de.po b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: libextractor 0.5.0\n" "Report-Msgid-Bugs-To: libextractor@gnu.org\n" -"POT-Creation-Date: 2005-07-16 23:06+0200\n" +"POT-Creation-Date: 2005-08-13 18:55-0700\n" "PO-Revision-Date: 2005-06-22 15:05+0200\n" "Last-Translator: Karl Eichwalder <ke@gnu.franken.de>\n" "Language-Team: German <de@li.org>\n" @@ -877,12 +877,12 @@ msgstr "extract [OPTIONEN] [DATEINAME]*" msgid "Extract metadata from files." msgstr "Metadaten aus den Dateien extrahieren." -#: src/main/extract.c:198 src/main/extractor.c:805 +#: src/main/extract.c:198 src/main/extractor.c:876 #, c-format msgid "%s - (binary)\n" msgstr "%s - (binär)\n" -#: src/main/extract.c:204 src/main/extractor.c:810 +#: src/main/extract.c:204 src/main/extractor.c:881 #, c-format msgid "INVALID TYPE - %s\n" msgstr "UNGÜLTIGE ART - %s\n" @@ -1263,24 +1263,24 @@ msgstr "" msgid "orientation" msgstr "Seitenausrichtung" -#: src/main/extractor.c:213 +#: src/main/extractor.c:219 #, c-format msgid "Initialization of plugin mechanism failed: %s!\n" msgstr "Initialisierung des Plugin-Mechanismus' ist fehlgeschlagen: %s.\n" -#: src/main/extractor.c:360 +#: src/main/extractor.c:366 #, c-format msgid "" "Resolving symbol '%s' in library '%s' failed, so I tried '%s', but that " "failed also. Errors are: '%s' and '%s'.\n" msgstr "" -#: src/main/extractor.c:389 +#: src/main/extractor.c:395 #, c-format msgid "Loading '%s' plugin failed: %s\n" msgstr "Laden des »%s«-Plugins ist fehlgeschlagen: %s\n" -#: src/main/extractor.c:594 +#: src/main/extractor.c:600 #, c-format msgid "Unloading plugin '%s' failed!\n" msgstr "Entladen des »%s«-Erweiterung ist fehlgeschlagen.\n" diff --git a/po/libextractor.pot b/po/libextractor.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: libextractor@gnu.org\n" -"POT-Creation-Date: 2005-07-16 23:06+0200\n" +"POT-Creation-Date: 2005-08-13 18:55-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -858,12 +858,12 @@ msgstr "" msgid "Extract metadata from files." msgstr "" -#: src/main/extract.c:198 src/main/extractor.c:805 +#: src/main/extract.c:198 src/main/extractor.c:876 #, c-format msgid "%s - (binary)\n" msgstr "" -#: src/main/extract.c:204 src/main/extractor.c:810 +#: src/main/extract.c:204 src/main/extractor.c:881 #, c-format msgid "INVALID TYPE - %s\n" msgstr "" @@ -1240,24 +1240,24 @@ msgstr "" msgid "orientation" msgstr "" -#: src/main/extractor.c:213 +#: src/main/extractor.c:219 #, c-format msgid "Initialization of plugin mechanism failed: %s!\n" msgstr "" -#: src/main/extractor.c:360 +#: src/main/extractor.c:366 #, c-format msgid "" "Resolving symbol '%s' in library '%s' failed, so I tried '%s', but that " "failed also. Errors are: '%s' and '%s'.\n" msgstr "" -#: src/main/extractor.c:389 +#: src/main/extractor.c:395 #, c-format msgid "Loading '%s' plugin failed: %s\n" msgstr "" -#: src/main/extractor.c:594 +#: src/main/extractor.c:600 #, c-format msgid "Unloading plugin '%s' failed!\n" msgstr "" diff --git a/po/ro.po b/po/ro.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: libextractor 0.4.2\n" "Report-Msgid-Bugs-To: libextractor@gnu.org\n" -"POT-Creation-Date: 2005-07-16 23:06+0200\n" +"POT-Creation-Date: 2005-08-13 18:55-0700\n" "PO-Revision-Date: 2005-02-25 12:00-0500\n" "Last-Translator: Laurentiu Buzdugan <lbuz@rolix.org>\n" "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n" @@ -880,12 +880,12 @@ msgstr "extract [OP msgid "Extract metadata from files." msgstr "Extrage metadata din fiºiere." -#: src/main/extract.c:198 src/main/extractor.c:805 +#: src/main/extract.c:198 src/main/extractor.c:876 #, c-format msgid "%s - (binary)\n" msgstr "%s - (binar)\n" -#: src/main/extract.c:204 src/main/extractor.c:810 +#: src/main/extract.c:204 src/main/extractor.c:881 #, c-format msgid "INVALID TYPE - %s\n" msgstr "TIP INVALID - %s\n" @@ -1265,12 +1265,12 @@ msgstr "" msgid "orientation" msgstr "orientare paginã" -#: src/main/extractor.c:213 +#: src/main/extractor.c:219 #, c-format msgid "Initialization of plugin mechanism failed: %s!\n" msgstr "iniþializare mecanismului de plugin a eºuat: %s!\n" -#: src/main/extractor.c:360 +#: src/main/extractor.c:366 #, c-format msgid "" "Resolving symbol '%s' in library '%s' failed, so I tried '%s', but that " @@ -1279,12 +1279,12 @@ msgstr "" "Rezolvarea simbolului '%s' în biblioteca '%s' a eºuat, aºa cã am încercat '%" "s', dar ºi acesta a eºuat. Erorile sunt: '%s' ºi '%s'.\n" -#: src/main/extractor.c:389 +#: src/main/extractor.c:395 #, c-format msgid "Loading '%s' plugin failed: %s\n" msgstr "Încãrcarea plugin-ului '%s' a eºuat: %s\n" -#: src/main/extractor.c:594 +#: src/main/extractor.c:600 #, c-format msgid "Unloading plugin '%s' failed!\n" msgstr "Descãrcarea plugin-ului '%s' a eºuat!\n" diff --git a/po/rw.po b/po/rw.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: libextractor 0.3.11\n" "Report-Msgid-Bugs-To: libextractor@gnu.org\n" -"POT-Creation-Date: 2005-07-16 23:06+0200\n" +"POT-Creation-Date: 2005-08-13 18:55-0700\n" "PO-Revision-Date: 2005-04-04 10:55-0700\n" "Last-Translator: Steven Michael Murphy <murf@e-tools.com>\n" "Language-Team: Kinyarwanda <translation-team-rw@lists.sourceforge.net>\n" @@ -899,12 +899,12 @@ msgstr "" msgid "Extract metadata from files." msgstr "Bivuye Idosiye" -#: src/main/extract.c:198 src/main/extractor.c:805 +#: src/main/extract.c:198 src/main/extractor.c:876 #, c-format msgid "%s - (binary)\n" msgstr "" -#: src/main/extract.c:204 src/main/extractor.c:810 +#: src/main/extract.c:204 src/main/extractor.c:881 #, c-format msgid "INVALID TYPE - %s\n" msgstr "" @@ -1368,24 +1368,24 @@ msgstr "" msgid "orientation" msgstr "Ipaji Icyerekezo" -#: src/main/extractor.c:213 +#: src/main/extractor.c:219 #, fuzzy, c-format msgid "Initialization of plugin mechanism failed: %s!\n" msgstr "Bya Byanze" -#: src/main/extractor.c:360 +#: src/main/extractor.c:366 #, fuzzy, c-format msgid "" "Resolving symbol '%s' in library '%s' failed, so I tried '%s', but that " "failed also. Errors are: '%s' and '%s'.\n" msgstr "IKIMENYETSO in Isomero Byanze Byanze Na" -#: src/main/extractor.c:389 +#: src/main/extractor.c:395 #, fuzzy, c-format msgid "Loading '%s' plugin failed: %s\n" msgstr "Byanze" -#: src/main/extractor.c:594 +#: src/main/extractor.c:600 #, fuzzy, c-format msgid "Unloading plugin '%s' failed!\n" msgstr "Byanze" diff --git a/src/include/extractor.h b/src/include/extractor.h @@ -29,7 +29,7 @@ extern "C" { * 0.2.6-1 => 0x00020601 * 4.5.2-0 => 0x04050200 */ -#define EXTRACTOR_VERSION 0x00050202 +#define EXTRACTOR_VERSION 0x00050300 #include <stdio.h> diff --git a/src/main/extractor.c b/src/main/extractor.c @@ -138,6 +138,12 @@ static const char *keywordTypes[] = { #define WITH_OGG 1 #endif +#if HAVE_EXIV2 +#define EXSO "libextractor_exiv2:" +#else +#define EXSO "" +#endif + #if WITH_OGG #define OGGSO "libextractor_ogg:" #else @@ -187,7 +193,7 @@ libextractor_elf:\ libextractor_oo:\ libextractor_asf" -#define DEFAULT_LIBRARIES OLESO OGGSO QTSO DEFSO +#define DEFAULT_LIBRARIES EXSO OLESO OGGSO QTSO DEFSO const char * EXTRACTOR_getDefaultLibraries() { return DEFAULT_LIBRARIES; diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am @@ -17,7 +17,11 @@ if HAVE_PRINTABLE printdir=printable endif -SUBDIRS = . oo $(printdir) hash $(oledir) rpm pdf $(thumbdir) exiv2 +if HAVE_EXIV2 + exiv2dir=exiv2 +endif + +SUBDIRS = . oo $(printdir) hash $(oledir) rpm pdf $(thumbdir) $(exiv2dir) PLUGINFLAGS = -export-dynamic -avoid-version -module diff --git a/src/plugins/manextractor.c b/src/plugins/manextractor.c @@ -224,7 +224,6 @@ libextractor_man_extract(const char * filename, struct EXTRACTOR_Keywords * prev) { z_stream strm; char * buf; - int len; memset(&strm, 0, diff --git a/src/plugins/ole2/Makefile.am b/src/plugins/ole2/Makefile.am @@ -1,4 +1,6 @@ -INCLUDES = -I$(top_srcdir)/src/include +INCLUDES = \ + -I$(top_srcdir)/src/include + LIBS = \ @LTLIBINTL@ @LIBS@ @@ -19,8 +21,7 @@ libextractor_ole2_la_LIBADD = \ $(LIBADD) $(GLIB_LIBS) -lgobject-2.0 \ $(top_builddir)/src/main/libextractor.la libextractor_ole2_la_LDFLAGS = \ - -export-dynamic -avoid-version -module -# Note that we're NOT using PLUGINFLAGS here to avoid -export-dynamic! + $(PLUGINFLAGS) libextractor_ole2_la_SOURCES = \ ole2extractor.c \ gsf-utils.c \ diff --git a/src/plugins/oo/ooextractor.c b/src/plugins/oo/ooextractor.c @@ -80,7 +80,6 @@ static char *libextractor_oo_getmimetype(unzFile uf) { unz_file_info file_info; char * buf = NULL; size_t buf_size = 0; - size_t ziperror = 0; if (UNZ_OK == unzLocateFile(uf, "mimetype", @@ -188,7 +187,6 @@ static long Eseek_file_func(voidpf opaque, static int Eclose_file_func(voidpf opaque, voidpf stream) { - Ecls * e = opaque; return 0; } diff --git a/src/plugins/thumbnail/Makefile.am b/src/plugins/thumbnail/Makefile.am @@ -8,24 +8,19 @@ LIBS = \ # install plugins under: plugindir = $(libdir)/libextractor -SUBDIRS = . - -AM_CFLAGS = $(GLIB_CFLAGS) +PLUGINFLAGS = -export-dynamic -avoid-version -module plugin_LTLIBRARIES = \ libextractor_thumbnail.la -libextractor_thumbnail_la_SOURCES = \ - thumbnailextractor.c - -# Ok, linking this one is complicated, see Mantis #787. -libextractor_thumbnail_la_LDFLAGS = \ - $(top_builddir)/src/main/libextractor.la \ - -Wl,-Bstatic -Wl,-lgobject-2.0 -Wl,-lglib-2.0 -Wl,-Bdynamic \ - -Wl,-Bsymbolic -avoid-version -module +AM_CFLAGS = $(GLIB_CFLAGS) +libextractor_thumbnail_la_CFLAGS = \ + $(GLIB_CFLAGS) libextractor_thumbnail_la_LIBADD = \ - @GTK_LIBS@ - - - + $(LIBADD) -lgobject-2.0 @GTK_LIBS@ \ + $(top_builddir)/src/main/libextractor.la +libextractor_thumbnail_la_LDFLAGS = \ + $(PLUGINFLAGS) +libextractor_thumbnail_la_SOURCES = \ + thumbnailextractor.c diff --git a/src/plugins/thumbnail/thumbnailextractor.c b/src/plugins/thumbnail/thumbnailextractor.c @@ -87,16 +87,9 @@ struct EXTRACTOR_Keywords * libextractor_thumbnail_extract(const char * filename unsigned long width; unsigned long height; char * binary; - size_t pos; - size_t end; - size_t wpos; - size_t i; - unsigned int markers[8]; /* 256 bits */ - unsigned char marker; const char * mime; int j; char * format; - GError *err = NULL; /* if the mime-type of the file is not whitelisted do not run the thumbnail extactor! */