Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
tracker-extract: add faster PNG extractor
Browse files Browse the repository at this point in the history
This extractor reads metadata properties from the tEXt and iTXt sections of PNG
files, and skips IDAT sections (this is where the increased speed comes from)
  • Loading branch information
jonte committed Jun 27, 2013
1 parent d8d287a commit a3fee45
Show file tree
Hide file tree
Showing 4 changed files with 880 additions and 0 deletions.
20 changes: 20 additions & 0 deletions configure.ac
Expand Up @@ -2186,6 +2186,25 @@ if test "x$enable_guarantee_metadata" != "xno"; then
AC_DEFINE(GUARANTEE_METADATA, 1, [Guarantee existence of certain metadata])
fi

#####################################################################
# Check for tracker-extract: Faster PNG extractor
#####################################################################

# Extracts metadata from tEXt and iTXt chunks found before and after IDAT
# chunks Faster than tracker-extract-png since IDAT chunks are skipped.

AC_ARG_ENABLE(png-faster,
AS_HELP_STRING([--enable-png-faster],
[enable a faster PNG extractor [[default=no]]]),
[enable_png_faster=yes],
[enable_png_faster=no])

if test "x$enable_png_faster" != "xno"; then
AC_DEFINE(HAVE_PNG_FASTER, 1, [Faster PNG extractor])
fi

AM_CONDITIONAL(HAVE_PNG_FASTER, test "x$enable_png_faster" = "xyes")

####################################################################
# Check if we should use initctl or sysvinit
####################################################################
Expand Down Expand Up @@ -2391,6 +2410,7 @@ Metadata Extractors:

Support libstreamanalyzer: $have_libstreamanalyzer
Support PNG: yes
Support faster PNG extraction: $enable_png_faster
Support PDF: $have_poppler
Support XPS: $have_libgxps
Support GIF: $have_libgif (xmp: $have_exempi)
Expand Down
4 changes: 4 additions & 0 deletions src/tracker-extract/09-png-faster.rule.in
@@ -0,0 +1,4 @@
[ExtractorRule]
ModulePath=@modulesdir@/libextract-png-faster.so
MimeTypes=image/png

17 changes: 17 additions & 0 deletions src/tracker-extract/Makefile.am
Expand Up @@ -17,6 +17,7 @@ AM_CPPFLAGS = \
# duplicates work and requires more maintenance to keep modules up to
# date.
rules_in_files = \
09-png-faster.rule.in \
10-abw.rule.in \
10-dvi.rule.in \
10-epub.rule.in \
Expand Down Expand Up @@ -156,6 +157,11 @@ modules_LTLIBRARIES += libextract-iso.la
rules_DATA += 11-iso.rule
endif

if HAVE_PNG_FASTER
modules_LTLIBRARIES += libextract-png-faster.la
rules_DATA += 09-png-faster.rule
endif

# ABW
libextract_abw_la_SOURCES = tracker-extract-abw.c
libextract_abw_la_CFLAGS = $(TRACKER_EXTRACT_MODULES_CFLAGS)
Expand Down Expand Up @@ -247,6 +253,17 @@ libextract_png_la_LIBADD = \
$(TRACKER_EXTRACT_MODULES_LIBS) \
$(LIBPNG_LIBS)

# PNG
libextract_png_faster_la_SOURCES = tracker-extract-png-faster.c
libextract_png_faster_la_CFLAGS = \
$(TRACKER_EXTRACT_MODULES_CFLAGS) \
$(LIBPNG_CFLAGS)
libextract_png_faster_la_LDFLAGS = $(module_flags)
libextract_png_faster_la_LIBADD = \
$(top_builddir)/src/libtracker-extract/libtracker-extract-@TRACKER_API_VERSION@.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
$(BUILD_LIBS) \
$(TRACKER_EXTRACT_MODULES_LIBS)

# PS
libextract_ps_la_SOURCES = tracker-extract-ps.c
Expand Down

0 comments on commit a3fee45

Please sign in to comment.