gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r291 - Extractor Extractor/po Extractor/src/include Extract


From: grothoff
Subject: [GNUnet-SVN] r291 - Extractor Extractor/po Extractor/src/include Extractor/src/main Extractor/src/plugins Extractor/src/plugins/thumbnail Extractor-docs/WWW Extractor-docs/WWW/download GNUnet/contrib GNUnet-docs/WWW
Date: Wed, 23 Feb 2005 22:59:43 -0800 (PST)

Author: grothoff
Date: 2005-02-23 22:59:42 -0800 (Wed, 23 Feb 2005)
New Revision: 291

Added:
   Extractor-docs/WWW/download/libextractor-0.4.2.tar.bz2
   Extractor-docs/WWW/download/libextractor-0.4.2.tar.gz
   Extractor/src/plugins/thumbnail/
   Extractor/src/plugins/thumbnail/Makefile.am
   Extractor/src/plugins/thumbnail/thumbnailextractor.c
   GNUnet-docs/WWW/news_20050224.inc
Modified:
   Extractor-docs/WWW/index.php
   Extractor/AUTHORS
   Extractor/ChangeLog
   Extractor/NEWS
   Extractor/TODO
   Extractor/configure.ac
   Extractor/po/de.po
   Extractor/po/libextractor.pot
   Extractor/src/include/extractor.h
   Extractor/src/main/extract.c
   Extractor/src/main/extractor.c
   Extractor/src/plugins/Makefile.am
   Extractor/src/plugins/mp3extractor.c
   GNUnet/contrib/gnunet.user
Log:
libextractor 0.4.2 release

Modified: Extractor/AUTHORS
===================================================================
--- Extractor/AUTHORS   2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/AUTHORS   2005-02-24 06:59:42 UTC (rev 291)
@@ -28,6 +28,7 @@
 id3v2     - core team with Milan <address@hidden>
 hash      - core team using GNU coreutils/textutils and GPL'ed RMD160 code.
 translit  - Nils Durner <address@hidden>
+thumbnail - core team using ImageMagick
 
 General contributors:
 Yuri N. Sedunov <address@hidden>
@@ -56,3 +57,4 @@
 ogg-vorbis - 
 glib       - 
 libltdl    - 
+ImageMagick- 

Modified: Extractor/ChangeLog
===================================================================
--- Extractor/ChangeLog 2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/ChangeLog 2005-02-24 06:59:42 UTC (rev 291)
@@ -1,3 +1,12 @@
+Thu Feb 24 00:32:44 EST 2005
+       Added extractor that extracts binary (!) thumbnails from
+       images using ImageMagick.  Decoder function for the binary
+       string is in the thumbnailextractor.c source.
+       Releasing libextractor 0.4.2.
+
+Wed Feb 23 22:42:08 EST 2005
+       Comment tag was not extracted from ID3 tags.  Fixed.
+       
 Sun Feb 20 16:36:17 EST 2005
        Fixed similar problem in REAL extractor.  Added support
        for new Helix/Real format to REAL extractor.

Modified: Extractor/NEWS
===================================================================
--- Extractor/NEWS      2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/NEWS      2005-02-24 06:59:42 UTC (rev 291)
@@ -1,3 +1,9 @@
+Thu Feb 24 00:34:15 EST 2005
+       Thumbnails work.
+
+Sun Feb 20 16:36:17 EST 2005
+       Helix works (new Real format).
+
 Fri Oct 22 19:18:38 EST 2004
        id3v2.3 and id3v2.4 work.
 

Modified: Extractor/TODO
===================================================================
--- Extractor/TODO      2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/TODO      2005-02-24 06:59:42 UTC (rev 291)
@@ -25,6 +25,8 @@
 * EXE
 * APEv2 (MPC file format, www.personal.uni-jena.de/~pfk/mpp/sv8/apetag.html)
 * PRC (Palm module, http://web.mit.edu/tytso/www/pilot/prc-format.html)
+* KOffice
+* TGA
 
 ==============
 
@@ -43,4 +45,3 @@
 * HTML: to be done
 * OLE2: to be done
 * OO: to be done
-* PDF: to be done

Modified: Extractor/configure.ac
===================================================================
--- Extractor/configure.ac      2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/configure.ac      2005-02-24 06:59:42 UTC (rev 291)
@@ -1,8 +1,8 @@
 # Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.57)
-AC_INIT([libextractor], [0.4.1-cvs], address@hidden)
+AC_INIT([libextractor], [0.4.2], address@hidden)
 AC_REVISION($Revision: 1.67 $)
-AM_INIT_AUTOMAKE([libextractor], [0.4.1-cvs])
+AM_INIT_AUTOMAKE([libextractor], [0.4.2])
 AM_CONFIG_HEADER(src/include/config.h)
 
 # Checks for programs.
@@ -147,6 +147,25 @@
 AC_CHECK_HEADERS([jni.h])
 # jni.h is purely optional!  But if not present => no Java support!
 
+AC_CHECK_HEADERS([wand/magick-wand.h])
+
+AC_PATH_PROG(WAND_CONFIG, Wand-config, no)
+if test "$WAND_CONFIG" = "no" ; then
+  AC_MSG_RESULT([*** All Imagemagick dependent parts will be disabled, 
Wand-config not found. ***])
+else
+  WAND_CFLAGS=`$WAND_CONFIG --cflags`
+  WAND_LDFLAGS=`$WAND_CONFIG --ldflags`
+  WAND_LIBS=`$WAND_CONFIG --libs`
+  have_imagemagick="yes"
+  AC_DEFINE(HAVE_WAND,1,[Define this if you have Imagemagick])
+fi
+
+AM_CONDITIONAL(HAVE_WAND, test x"$have_imagemagick" = "xyes" )
+AC_SUBST(WAND_CFLAGS)
+AC_SUBST(WAND_LDFLAGS)
+AC_SUBST(WAND_LIBS)
+
+
 ##AC_PYTHON_DEVEL
 ##AC_CHECK_HEADERS([python/Python.h])
 
@@ -223,6 +242,7 @@
 src/plugins/rpm/Makefile
 src/plugins/printable/Makefile
 src/plugins/hash/Makefile
+src/plugins/thumbnail/Makefile
 src/test/Makefile
 ])
 

Modified: Extractor/po/de.po
===================================================================
--- Extractor/po/de.po  2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/po/de.po  2005-02-24 06:59:42 UTC (rev 291)
@@ -9,7 +9,7 @@
 msgstr ""
 "Project-Id-Version: libextractor 0.4.0\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2005-01-26 19:50-0500\n"
+"POT-Creation-Date: 2005-02-24 01:28-0500\n"
 "PO-Revision-Date: 2004-12-29 15:40+0100\n"
 "Last-Translator: Karl Eichwalder <address@hidden>\n"
 "Language-Team: German <address@hidden>\n"
@@ -118,77 +118,82 @@
 msgid "Extract metadata from files."
 msgstr "Metadaten aus den Dateien extrahieren."
 
-#: src/main/extract.c:242 src/main/extractor.c:781
+#: src/main/extract.c:208 src/main/extractor.c:755
 #, c-format
+msgid "%s - (binary)\n"
+msgstr ""
+
+#: src/main/extract.c:214 src/main/extractor.c:760
+#, c-format
 msgid "INVALID TYPE - %s\n"
 msgstr "UNGÜLTIGE ART - %s\n"
 
-#: src/main/extract.c:307 src/main/extractor.c:44
+#: src/main/extract.c:280 src/main/extractor.c:44
 msgid "title"
 msgstr "Titel"
 
-#: src/main/extract.c:309 src/main/extractor.c:42
+#: src/main/extract.c:282 src/main/extractor.c:42
 msgid "filename"
 msgstr "Dateiname"
 
-#: src/main/extract.c:314 src/main/extractor.c:45
+#: src/main/extract.c:287 src/main/extractor.c:45
 msgid "author"
 msgstr "Autor"
 
-#: src/main/extract.c:318 src/main/extractor.c:47
+#: src/main/extract.c:291 src/main/extractor.c:47
 msgid "description"
 msgstr "Beschreibung"
 
-#: src/main/extract.c:320 src/main/extractor.c:59
+#: src/main/extract.c:293 src/main/extractor.c:59
 msgid "keywords"
 msgstr "Schlüsselwörter"
 
-#: src/main/extract.c:322 src/main/extractor.c:48
+#: src/main/extract.c:295 src/main/extractor.c:48
 msgid "comment"
 msgstr "Kommentar"
 
-#: src/main/extract.c:326 src/main/extractor.c:49
+#: src/main/extract.c:299 src/main/extractor.c:49
 msgid "date"
 msgstr "Datum"
 
-#: src/main/extract.c:328 src/main/extractor.c:71
+#: src/main/extract.c:301 src/main/extractor.c:71
 msgid "creation date"
 msgstr "Datum der Erstellung"
 
-#: src/main/extract.c:356 src/main/extractor.c:50
+#: src/main/extract.c:329 src/main/extractor.c:50
 msgid "publisher"
 msgstr "Herausgeber"
 
-#: src/main/extract.c:360 src/main/extractor.c:56
+#: src/main/extract.c:333 src/main/extractor.c:56
 msgid "organization"
 msgstr "Organisation"
 
-#: src/main/extract.c:364 src/main/extractor.c:58
+#: src/main/extract.c:337 src/main/extractor.c:58
 msgid "subject"
 msgstr "Gegenstand"
 
-#: src/main/extract.c:368 src/main/extractor.c:75
+#: src/main/extract.c:341 src/main/extractor.c:75
 msgid "page count"
 msgstr "Seitenanzahl"
 
-#: src/main/extract.c:502
+#: src/main/extract.c:475
 #, c-format
 msgid "You must specify an argument for the '%s' option (option ignored).\n"
 msgstr ""
 "Sie müssen ein Argument für die Option »%s« angeben (Option wird "
 "ignoriert).\n"
 
-#: src/main/extract.c:566
+#: src/main/extract.c:539
 #, c-format
 msgid "Use --help to get a list of options.\n"
 msgstr "Verwenden Sie --help, um eine Liste aller Optionen zu sehen.\n"
 
-#: src/main/extract.c:620
+#: src/main/extract.c:593
 #, c-format
 msgid "%% BiBTeX file\n"
 msgstr "%% BibTeX Datei\n"
 
-#: src/main/extract.c:627
+#: src/main/extract.c:600
 #, c-format
 msgid "Keywords for file %s:\n"
 msgstr "Schlüsserwörter für die Datei %s:\n"
@@ -425,24 +430,28 @@
 msgid "contact"
 msgstr "Kontakt"
 
-#: src/main/extractor.c:206
+#: src/main/extractor.c:111
+msgid "binary thumbnail data"
+msgstr ""
+
+#: src/main/extractor.c:207
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Initialisierung des Plugin-Mechanismus' ist fehlgeschlagen: %s.\n"
 
-#: src/main/extractor.c:392
+#: src/main/extractor.c:393
 #, 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:421
+#: src/main/extractor.c:422
 #, c-format
 msgid "Loading '%s' plugin failed: %s\n"
 msgstr "Laden des »%s«-Plugins ist fehlgeschlagen: %s\n"
 
-#: src/main/extractor.c:526
+#: src/main/extractor.c:527
 #, c-format
 msgid "Unloading plugin '%s' failed!\n"
 msgstr "Entladen des »%s«-Erweiterung ist fehlgeschlagen.\n"

Modified: Extractor/po/libextractor.pot
===================================================================
--- Extractor/po/libextractor.pot       2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/po/libextractor.pot       2005-02-24 06:59:42 UTC (rev 291)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2005-01-26 19:50-0500\n"
+"POT-Creation-Date: 2005-02-24 01:28-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <address@hidden>\n"
 "Language-Team: LANGUAGE <address@hidden>\n"
@@ -104,75 +104,80 @@
 msgid "Extract metadata from files."
 msgstr ""
 
-#: src/main/extract.c:242 src/main/extractor.c:781
+#: src/main/extract.c:208 src/main/extractor.c:755
 #, c-format
+msgid "%s - (binary)\n"
+msgstr ""
+
+#: src/main/extract.c:214 src/main/extractor.c:760
+#, c-format
 msgid "INVALID TYPE - %s\n"
 msgstr ""
 
-#: src/main/extract.c:307 src/main/extractor.c:44
+#: src/main/extract.c:280 src/main/extractor.c:44
 msgid "title"
 msgstr ""
 
-#: src/main/extract.c:309 src/main/extractor.c:42
+#: src/main/extract.c:282 src/main/extractor.c:42
 msgid "filename"
 msgstr ""
 
-#: src/main/extract.c:314 src/main/extractor.c:45
+#: src/main/extract.c:287 src/main/extractor.c:45
 msgid "author"
 msgstr ""
 
-#: src/main/extract.c:318 src/main/extractor.c:47
+#: src/main/extract.c:291 src/main/extractor.c:47
 msgid "description"
 msgstr ""
 
-#: src/main/extract.c:320 src/main/extractor.c:59
+#: src/main/extract.c:293 src/main/extractor.c:59
 msgid "keywords"
 msgstr ""
 
-#: src/main/extract.c:322 src/main/extractor.c:48
+#: src/main/extract.c:295 src/main/extractor.c:48
 msgid "comment"
 msgstr ""
 
-#: src/main/extract.c:326 src/main/extractor.c:49
+#: src/main/extract.c:299 src/main/extractor.c:49
 msgid "date"
 msgstr ""
 
-#: src/main/extract.c:328 src/main/extractor.c:71
+#: src/main/extract.c:301 src/main/extractor.c:71
 msgid "creation date"
 msgstr ""
 
-#: src/main/extract.c:356 src/main/extractor.c:50
+#: src/main/extract.c:329 src/main/extractor.c:50
 msgid "publisher"
 msgstr ""
 
-#: src/main/extract.c:360 src/main/extractor.c:56
+#: src/main/extract.c:333 src/main/extractor.c:56
 msgid "organization"
 msgstr ""
 
-#: src/main/extract.c:364 src/main/extractor.c:58
+#: src/main/extract.c:337 src/main/extractor.c:58
 msgid "subject"
 msgstr ""
 
-#: src/main/extract.c:368 src/main/extractor.c:75
+#: src/main/extract.c:341 src/main/extractor.c:75
 msgid "page count"
 msgstr ""
 
-#: src/main/extract.c:502
+#: src/main/extract.c:475
 #, c-format
 msgid "You must specify an argument for the '%s' option (option ignored).\n"
 msgstr ""
 
-#: src/main/extract.c:566
+#: src/main/extract.c:539
 #, c-format
 msgid "Use --help to get a list of options.\n"
 msgstr ""
 
-#: src/main/extract.c:620
+#: src/main/extract.c:593
 #, c-format
 msgid "%% BiBTeX file\n"
 msgstr ""
 
-#: src/main/extract.c:627
+#: src/main/extract.c:600
 #, c-format
 msgid "Keywords for file %s:\n"
 msgstr ""
@@ -409,24 +414,28 @@
 msgid "contact"
 msgstr ""
 
-#: src/main/extractor.c:206
+#: src/main/extractor.c:111
+msgid "binary thumbnail data"
+msgstr ""
+
+#: src/main/extractor.c:207
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr ""
 
-#: src/main/extractor.c:392
+#: src/main/extractor.c:393
 #, 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:421
+#: src/main/extractor.c:422
 #, c-format
 msgid "Loading '%s' plugin failed: %s\n"
 msgstr ""
 
-#: src/main/extractor.c:526
+#: src/main/extractor.c:527
 #, c-format
 msgid "Unloading plugin '%s' failed!\n"
 msgstr ""

Modified: Extractor/src/include/extractor.h
===================================================================
--- Extractor/src/include/extractor.h   2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/src/include/extractor.h   2005-02-24 06:59:42 UTC (rev 291)
@@ -29,7 +29,7 @@
  * 0.2.6-1 => 0x00020601
  * 4.5.2-0 => 0x04050200
  */
-#define EXTRACTOR_VERSION 0x00040100
+#define EXTRACTOR_VERSION 0x00040200
 
 #include <stdio.h>
 
@@ -120,6 +120,7 @@
   EXTRACTOR_LYRICS = 67,
   EXTRACTOR_MEDIA_TYPE = 68,
   EXTRACTOR_CONTACT = 69,
+  EXTRACTOR_THUMBNAIL_DATA = 70,
 } EXTRACTOR_KeywordType;
 
 /**

Modified: Extractor/src/main/extract.c
===================================================================
--- Extractor/src/main/extract.c        2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/src/main/extract.c        2005-02-24 06:59:42 UTC (rev 291)
@@ -23,10 +23,10 @@
 #include "getopt.h"
 
 #include <locale.h>
-#include <iconv.h>
+#include <iconv.h>
 #ifndef MINGW
 #include <langinfo.h>
-#endif
+#endif
 
 #define YES 1
 #define NO 0
@@ -179,10 +179,10 @@
  * @param print array indicating which types to print
  */
 static void
-printSelectedKeywords (FILE * handle,
-                      EXTRACTOR_KeywordList * keywords,
-                      const int * print, 
-                      const int verbose)
+printSelectedKeywords(FILE * handle,
+                     EXTRACTOR_KeywordList * keywords,
+                     const int * print, 
+                     const int verbose)
 {
   char * keyword;
   iconv_t cd;
@@ -202,18 +202,24 @@
                            keywords->keyword);
     else
       keyword = strdup(keywords->keyword);
-    
-    if (NULL == EXTRACTOR_getKeywordTypeAsString (keywords->keywordType)) {
-      if (verbose == YES) {
-       fprintf(handle, 
-               _("INVALID TYPE - %s\n"),
-               keyword);
-      }
-    } else if (print[keywords->keywordType] == YES)
+
+    if (keywords->keywordType == EXTRACTOR_THUMBNAIL_DATA) {
       fprintf (handle,
-              "%s - %s\n",
-              EXTRACTOR_getKeywordTypeAsString(keywords->keywordType),
-              keyword);
+              _("%s - (binary)\n"),
+              EXTRACTOR_getKeywordTypeAsString(keywords->keywordType));
+    } else {
+      if (NULL == EXTRACTOR_getKeywordTypeAsString(keywords->keywordType)) {
+       if (verbose == YES) {
+         fprintf(handle, 
+                 _("INVALID TYPE - %s\n"),
+                 keyword);
+       }
+      } else if (print[keywords->keywordType] == YES)
+       fprintf (handle,
+                "%s - %s\n",
+                EXTRACTOR_getKeywordTypeAsString(keywords->keywordType),
+                keyword);
+    }
     free(keyword);
     keywords = keywords->next;
   }

Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c      2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/src/main/extractor.c      2005-02-24 06:59:42 UTC (rev 291)
@@ -108,11 +108,12 @@
   gettext_noop("lyrics"),
   gettext_noop("media type"),
   gettext_noop("contact"),
+  gettext_noop("binary thumbnail data"),
   NULL,
 };
 
 /* the number of keyword types (for bounds-checking) */
-#define HIGHEST_TYPE_NUMBER 70
+#define HIGHEST_TYPE_NUMBER 71
 
 #ifdef HAVE_LIBOGG
 #if HAVE_VORBIS
@@ -729,8 +730,8 @@
  * @param keywords the list of keywords to print, may be NULL
  */
 void
-EXTRACTOR_printKeywords (FILE * handle, 
-                        EXTRACTOR_KeywordList * keywords)
+EXTRACTOR_printKeywords(FILE * handle, 
+                       EXTRACTOR_KeywordList * keywords)
 {
   iconv_t cd;
   char * buf;
@@ -749,15 +750,21 @@
       else
        buf = iconvHelper(cd,
                          keywords->keyword);
-      if (keywords->keywordType >= HIGHEST_TYPE_NUMBER)
-       fprintf(handle, 
-               _("INVALID TYPE - %s\n"),
-               buf);
-      else
+      if (keywords->keywordType == EXTRACTOR_THUMBNAIL_DATA) {
        fprintf(handle,
-               "%s - %s\n",
-               gettext(keywordTypes[keywords->keywordType]),
-               buf);
+               _("%s - (binary)\n"),
+               gettext(keywordTypes[keywords->keywordType]));
+      } else {   
+       if (keywords->keywordType >= HIGHEST_TYPE_NUMBER)
+         fprintf(handle, 
+                 _("INVALID TYPE - %s\n"),
+                 buf);
+       else
+         fprintf(handle,
+                 "%s - %s\n",
+                 gettext(keywordTypes[keywords->keywordType]),
+                 buf);
+      }
       free(buf);
       keywords = keywords->next;
     }

Modified: Extractor/src/plugins/Makefile.am
===================================================================
--- Extractor/src/plugins/Makefile.am   2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor/src/plugins/Makefile.am   2005-02-24 06:59:42 UTC (rev 291)
@@ -10,10 +10,15 @@
  oledir=ole2
 endif
 
-SUBDIRS = . oo printable hash $(oledir) rpm pdf
+if HAVE_WAND
+ thumbdir=thumbnail
+endif
 
+SUBDIRS = . oo printable hash $(oledir) rpm pdf $(thumbdir)
+
 PLUGINFLAGS = -export-dynamic -avoid-version -module
 
+
 if HAVE_VORBISFILE
  extraogg = libextractor_ogg.la
 endif

Modified: Extractor/src/plugins/mp3extractor.c
===================================================================
--- Extractor/src/plugins/mp3extractor.c        2005-02-20 21:56:21 UTC (rev 
290)
+++ Extractor/src/plugins/mp3extractor.c        2005-02-24 06:59:42 UTC (rev 
291)
@@ -467,6 +467,8 @@
     klist = addkword(klist, info.year, EXTRACTOR_DATE);
   if (strlen(info.genre) > 0) 
     klist = addkword(klist, info.genre, EXTRACTOR_GENRE);
+  if (strlen(info.genre) > 0) 
+    klist = addkword(klist, info.comment, EXTRACTOR_COMMENT);
 
 
   /* A keyword that has all of the information together) */

Added: Extractor/src/plugins/thumbnail/Makefile.am
===================================================================
--- Extractor/src/plugins/thumbnail/Makefile.am 2005-02-20 21:56:21 UTC (rev 
290)
+++ Extractor/src/plugins/thumbnail/Makefile.am 2005-02-24 06:59:42 UTC (rev 
291)
@@ -0,0 +1,24 @@
+INCLUDES = -I$(top_srcdir)/src/include
+
+LIBS = \
+ @LTLIBINTL@ @LIBS@
+
+# install plugins under:
+plugindir = $(libdir)/libextractor
+
+SUBDIRS = .
+
+plugin_LTLIBRARIES = \
+ libextractor_thumbnail.la
+
+libextractor_thumbnail_la_SOURCES = \
+  thumbnailextractor.c
+
+libextractor_thumbnail_la_LDFLAGS = \
+ -export-dynamic -avoid-version -module @WAND_LDFLAGS@
+
+libextractor_thumbnail_la_CFLAGS = \
+ @WAND_CFLAGS@ @CFLAGS@
+
+libextractor_thumbnail_la_LIBADD = \
+ @WAND_LIBS@

Added: Extractor/src/plugins/thumbnail/thumbnailextractor.c
===================================================================
--- Extractor/src/plugins/thumbnail/thumbnailextractor.c        2005-02-20 
21:56:21 UTC (rev 290)
+++ Extractor/src/plugins/thumbnail/thumbnailextractor.c        2005-02-24 
06:59:42 UTC (rev 291)
@@ -0,0 +1,253 @@
+/*
+     This file is part of libextractor.
+     (C) 2005 Vidyut Samanta and Christian Grothoff
+
+     libextractor is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     libextractor is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with libextractor; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * @file thumbnailextractor.c
+ * @author Christian Grothoff
+ * @brief this extractor produces a binary (!) encoded
+ * thumbnail of images (using imagemagick).  The bottom
+ * of the file includes a decoder method that can be used
+ * to reproduce the 128x128 PNG thumbnails.
+ */
+
+#include "platform.h"
+#include "extractor.h"
+#include <wand/magick_wand.h>
+
+#define THUMBSIZE 128
+
+static EXTRACTOR_KeywordList * addKeyword(EXTRACTOR_KeywordType type,
+                                         char * keyword,
+                                         EXTRACTOR_KeywordList * next) {
+  EXTRACTOR_KeywordList * result;
+
+  if (keyword == NULL)
+    return next;
+  result = malloc(sizeof(EXTRACTOR_KeywordList));
+  result->next = next;    
+  result->keyword = keyword;
+  result->keywordType = type;
+  return result;
+}
+
+
+/* which mime-types maybe subjected to
+   the thumbnail extractor (ImageMagick 
+   crashes and/or prints errors for bad
+   formats, so we need to be rather 
+   conservative here) */
+static char * whitelist[] = {
+  "image/jpeg",
+  "image/gif",
+  "image/miff",
+  "image/mng",
+  "image/png",
+  "image/tiff",
+  "image/x-bmp",
+  "image/x-mng",
+  "image/x-png",
+  "image/x-xpm",
+  "image/xcf",
+  NULL,
+};
+
+struct EXTRACTOR_Keywords * libextractor_thumbnail_extract(const char * 
filename,
+                                                          const char * data,
+                                                          size_t size,
+                                                          struct 
EXTRACTOR_Keywords * prev) {
+  MagickBooleanType status;
+  MagickWand * magick_wand;
+  size_t length;
+  char * thumb;
+  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;
+  
+  /* if the mime-type of the file is not whitelisted
+     do not run the thumbnail extactor! */
+  mime = EXTRACTOR_extractLast(EXTRACTOR_MIMETYPE,
+                              prev);
+  if (mime == NULL) 
+    return prev;
+  j = 0;
+  while (whitelist[j] != NULL) {
+    if (0 == strcmp(whitelist[j], mime))
+      break;
+    j++;
+  }
+  if (whitelist[j] == NULL)
+    return prev;
+
+  magick_wand = NewMagickWand();  
+  status = MagickReadImageBlob(magick_wand, data, size);
+  if (status == MagickFalse) {
+    DestroyMagickWand(magick_wand);
+    return prev;
+  }
+  MagickResetIterator(magick_wand);
+  if (MagickNextImage(magick_wand) == MagickFalse)
+    return prev;
+
+  height = MagickGetImageHeight(magick_wand);
+  width = MagickGetImageWidth(magick_wand);
+  if (height == 0)
+    height = 1;
+  if (width == 0)
+    width = 1;
+  if ( (height <= THUMBSIZE) &&
+       (width <= THUMBSIZE) ) {
+    DestroyMagickWand(magick_wand);
+    return prev;
+  }
+    
+
+  if (height > THUMBSIZE) {
+    width = width * THUMBSIZE / height;
+    height = THUMBSIZE;
+  }
+  if (width > THUMBSIZE) {
+    height = height * THUMBSIZE / width;
+    width = THUMBSIZE;
+  }
+  MagickResizeImage(magick_wand, height, width, LanczosFilter, 1.0);
+  MagickSetImageDepth(magick_wand,
+                     8);
+  MagickSetImageChannelDepth(magick_wand,
+                            RedChannel,
+                            2);
+  MagickCommentImage(magick_wand, ""); 
+  MagickSetImageChannelDepth(magick_wand,
+                            GreenChannel,
+                            2);
+  MagickSetImageChannelDepth(magick_wand,
+                            BlueChannel,
+                            2);
+  MagickSetImageChannelDepth(magick_wand,
+                            OpacityChannel,
+                            2);
+  MagickSetImageInterlaceScheme(magick_wand,
+                               NoInterlace);
+
+  if (MagickFalse == MagickSetImageFormat(magick_wand, "png")) {
+    DestroyMagickWand(magick_wand);
+    return prev;
+  }
+  thumb = MagickGetImageBlob(magick_wand, &length);
+  DestroyMagickWand(magick_wand);
+  if (thumb == NULL) 
+    return prev;
+  
+  
+  /* encode! */
+  binary = malloc(2 + length + (length+256) / 254);
+  if (binary == NULL)
+    return prev;
+
+  pos = 0;
+  wpos = 0;
+  while (pos < length) {
+    /* find unused value between 1 and 255 in
+       the next 254 bytes */
+    end = pos + 254;
+    if (end < pos)
+      break; /* integer overflow! */
+    if (end > length)
+      end = length;
+    memset(markers, 0, sizeof(markers));
+    for (i=pos;i<end;i++) 
+      markers[thumb[i]&7] |= 1 << (thumb[i] >> 3);    
+    marker = 1;
+    while (markers[marker&7] & (1 << (marker >> 3))) {
+      marker++;
+      if (marker == 0) {
+       /* assertion failed... */
+       free(binary);
+       free(thumb);
+       return prev;
+      }
+    }
+    /* recode */
+    binary[wpos++] = marker;
+    for (i=pos;i<end;i++)
+      binary[wpos++] = thumb[i] == 0 ? marker : thumb[i];
+    pos = end;
+  }
+  binary[wpos++] = 0; /* 0-termination! */
+  free(thumb);
+  return addKeyword(EXTRACTOR_THUMBNAIL_DATA,
+                   binary,
+                   prev);
+}
+
+#if 0
+
+/**
+ * This function can be used to decode the binary data
+ * stream produced by the thumbnailextractor. 
+ *
+ * @param in 0-terminated string from the meta-data
+ * @return 1 on error, 0 on success
+ */
+int decodeThumbnail(const unsigned char * in,
+                   unsigned char ** out,
+                   size_t * outSize) {
+  unsigned char * buf;
+  size_t pos;
+  size_t wpos;
+  unsigned char marker;
+  size_t i;
+  size_t end;
+  size_t inSize;
+  
+  inSize = strlen(in);
+  if (inSize == 0) {
+    *out = NULL;
+    *outSize = 0;
+    return 1;
+  }
+
+  buf = malloc(inSize); /* slightly more than needed ;-) */
+  *out = buf;
+  
+  pos = 0;
+  wpos = 0;
+  while (pos < inSize) {
+    end = pos + 255; /* 255 here: count the marker! */
+    if (end > inSize)
+      end = inSize;
+    marker = in[pos++];
+    for (i=pos;i<end;i++) 
+      buf[wpos++] = (in[i] == marker) ? 0 : in[i];
+    pos = end;
+  }
+  *outSize = wpos;
+  return 0;
+}
+
+
+#endif

Added: Extractor-docs/WWW/download/libextractor-0.4.2.tar.bz2
===================================================================
(Binary files differ)


Property changes on: Extractor-docs/WWW/download/libextractor-0.4.2.tar.bz2
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Extractor-docs/WWW/download/libextractor-0.4.2.tar.gz
===================================================================
(Binary files differ)


Property changes on: Extractor-docs/WWW/download/libextractor-0.4.2.tar.gz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: Extractor-docs/WWW/index.php
===================================================================
--- Extractor-docs/WWW/index.php        2005-02-20 21:56:21 UTC (rev 290)
+++ Extractor-docs/WWW/index.php        2005-02-24 06:59:42 UTC (rev 291)
@@ -1,16 +1,16 @@
 <?php
-$title="libExtractor - a simple library for keyword extraction";
+$title="libextractor - a simple library for keyword extraction";
 $description="a simple library for keyword extraction";
 $email="address@hidden";       
-$keywords="keyword, extraction, mp3, html, pdf, images, jpeg, gif, ps, mime, 
real, qt, asf, mpeg, avi, riff, tiff, summary, summaries, kbps, format, 
mime-type, zip, elf, doc, ppt, xls, sha-1, md5, open office, sxw, dvi, id3, 
id3v2, id3v2.3, id3v2.4";
+$keywords="keyword, extraction, mp3, html, pdf, images, jpeg, gif, ps, mime, 
real, qt, asf, mpeg, avi, riff, tiff, summary, summaries, kbps, format, 
mime-type, zip, elf, doc, ppt, xls, sha-1, md5, open office, sxw, dvi, id3, 
id3v2, id3v2.3, id3v2.4, thumbnails";
 $author="Vids Samanta and Christian Grothoff"; 
 $page="home";  
 include("html_header.php3");
 
 ANCHOR("about");
-H2("About libExtractor");
+H2("About libextractor");
 
-IMG("extractor_logo.png", "libExtractor", "right", "136", "94", "0");
+IMG("extractor_logo.png", "libextractor", "right", "136", "94", "0");
 P();
 W("libextractor is a library used to extract meta-data from files of arbitrary 
type.");
 W("It is designed to use helper-libraries to perform the actual extraction, 
and to be trivially extendable by linking against external extractors for 
additional file types.");
@@ -19,17 +19,19 @@
 W("libextractor contains a shell-command &quot;extract&quot; that, similar to 
the well-known &quot;file&quot; command, can extract meta-data from a file an 
print the results to stdout.");
 P();
 
-W("Currently, libExtractor supports the following formats:");
+W("Currently, libextractor supports the following formats:");
 include("plugins_list");
 BR();
 W("Also, various additional MIME types are detected.");
 P();
 
-W("libExtractor is free software; you can redistribute it and/or modify it 
under the terms of the GNU General Public License as published by the Free 
Software Foundation; either version 2 of the License, or (at your option) any 
later version.");
+W("libextractor is free software; you can redistribute it and/or modify it 
under the terms of the GNU General Public License as published by the Free 
Software Foundation; either version 2 of the License, or (at your option) any 
later version.");
 ANCHOR("news");
 H2("Recent News");
 P();
 echo "<dl>";
+DTDD("Thu Feb 24 01:23:31 EST 2005 | libextractor v0.4.2 released.",
+     "This release fixes some bugs in the ID3, PDF, PNG and REAL extractors.  
The REAL extractor now also handles the new Helix formats.  libextractor can 
now also be used to extract thumbnails from images (using ImageMagick).");
 DTDD("Wed Jan 26 19:51:44 EST 2005 | libextractor v0.4.1 released.",
      "This release fixes a security issue (inherited from xpdf).  It also 
extracts more meta-data from files of TAR or QuickTime format.");
 DTDD("Sat Dec 25 21:42:26 CET 2004 | libextractor v0.4.0 released.",
@@ -85,12 +87,12 @@
 ANCHOR("contact");
 H2("Contact");
 P();
-W("libExtractor is developed by %s and %s.",
+W("libextractor is developed by %s and %s.",
   ARRAY(extlink_("http://grothoff.org/christian/";,
                 "Christian Grothoff"),
-       extlink_("http://www-s3.cs.purdue.edu/~samanta/";,
+       extlink_("http://compilers.cs.purdue.edu/~vids/";,
                 "Vids Samanta")));
-W("For questions about libExtractor send email to %s.",
+W("For questions about libextractor send email to %s.",
   extlink_("mailto:address@hidden";,
           "address@hidden"));
 

Modified: GNUnet/contrib/gnunet.user
===================================================================
--- GNUnet/contrib/gnunet.user  2005-02-20 21:56:21 UTC (rev 290)
+++ GNUnet/contrib/gnunet.user  2005-02-24 06:59:42 UTC (rev 291)
@@ -84,8 +84,8 @@
 # should be just fine for most people. The - before a library name
 # indicates that this should be executed last and makes only sense for
 # the split-library.
-# Default is libextractor_filename:-libextractor_split:-libextractor_lower
-EXTRACTORS = libextractor_filename:-libextractor_split:-libextractor_lower
+# Default is 
libextractor_filename:-libextractor_split:-libextractor_lower:-libextractor_thumbnail
+EXTRACTORS = 
libextractor_filename:-libextractor_split:-libextractor_lower:-libextractor_thumbnail
 
 # Where to download files to (by default)?
 # Default is /tmp/gnunet-downloads/

Added: GNUnet-docs/WWW/news_20050224.inc
===================================================================
--- GNUnet-docs/WWW/news_20050224.inc   2005-02-20 21:56:21 UTC (rev 290)
+++ GNUnet-docs/WWW/news_20050224.inc   2005-02-24 06:59:42 UTC (rev 291)
@@ -0,0 +1,10 @@
+<?php
+W("Version %s of %s has been released.",
+  
ARRAY(extlink_("http://gnunet.org/libextractor/download/libextractor-0.4.2.tar.gz";,
+                "0.4.2"),
+       extlink_("http://gnunet.org/libextractor/","libextractor";)));
+
+W("This release fixes some bugs in the ID3, PDF, PNG and REAL extractors.");
+W("The REAL extractor now also handles the new Helix formats.");
+W("libextractor can now also be used to extract thumbnails from images (using 
ImageMagick).");
+?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]