[gthumb: 1/57] started webalbum extension



commit f61c2ffd78b15e0d554cfb08e7f2e1bf8bd6388b
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun May 23 10:54:39 2010 +0200

    started webalbum extension

 configure.ac                                       |   25 +
 extensions/Makefile.am                             |    1 +
 extensions/webalbums/Makefile.am                   |   50 +
 extensions/webalbums/Makefile.in                   |  874 ++++++
 extensions/webalbums/albumtheme-private.c          |  684 +++++
 extensions/webalbums/albumtheme-private.h          |  247 ++
 extensions/webalbums/albumtheme.l                  |  234 ++
 extensions/webalbums/albumtheme.y                  |  459 +++
 extensions/webalbums/catalog-web-exporter.c        | 3209 ++++++++++++++++++++
 extensions/webalbums/catalog-web-exporter.h        |  188 ++
 extensions/webalbums/data/Makefile.am              |    3 +
 extensions/webalbums/data/ui/Makefile.am           |    5 +
 extensions/webalbums/data/ui/web-album-exporter.ui | 2323 ++++++++++++++
 extensions/webalbums/dlg-web-exporter.c            | 1247 ++++++++
 extensions/webalbums/dlg-web-exporter.h            |   30 +
 extensions/webalbums/webalbums.extension.in.in     |   11 +
 16 files changed, 9590 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8e81b35..cfdc7a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -395,6 +395,27 @@ AM_CONDITIONAL(ENABLE_BRASERO_TOOLS, test "x$enable_libbrasero" = xyes)
 
 dnl ===========================================================================
 
+enable_web_albums=yes
+if test x$enable_web_albums = xyes; then
+	AC_CHECK_PROGS(BISON, bison, no)
+	if test "$BISON" = "no"; then
+		enable_web_albums=no
+	fi
+fi
+if test x$enable_web_albums = xyes; then
+	AC_CHECK_PROGS(FLEX, flex lex, no)
+	if test "$FLEX" = "no"; then
+		enable_web_albums=no
+	else
+		AC_PROG_LEX
+	fi
+fi
+AC_SUBST(BISON)
+AC_SUBST(FLEX)
+AM_CONDITIONAL(ENABLE_WEB_ALBUMS, test "x$enable_web_albums" = xyes)
+
+dnl ===========================================================================
+
 AC_CONFIG_FILES([
 Makefile
 copy-n-paste/Makefile
@@ -506,6 +527,9 @@ extensions/search/data/ui/Makefile
 extensions/slideshow/Makefile
 extensions/slideshow/data/Makefile
 extensions/slideshow/data/ui/Makefile
+extensions/webalbums/Makefile
+extensions/webalbums/data/Makefile
+extensions/webalbums/data/ui/Makefile
 gthumb/Makefile
 gthumb/cursors/Makefile
 gthumb/icons/Makefile
@@ -534,4 +558,5 @@ Configuration:
 	Web services support : ${enable_libsoup}
 	Use GNOME Keyring    : ${enable_gnome_keyring}
 	Burn disc support    : ${enable_libbrasero}
+	Web albums           : ${enable_web_albums}
 "
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 7d88fb6..132c8cb 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -31,6 +31,7 @@ SUBDIRS = 			\
 	resize_images		\
 	search			\
 	slideshow		\
+	webalbums		\
 	flicker
 
 EXTRA_DIST = example
diff --git a/extensions/webalbums/Makefile.am b/extensions/webalbums/Makefile.am
new file mode 100644
index 0000000..efb3684
--- /dev/null
+++ b/extensions/webalbums/Makefile.am
@@ -0,0 +1,50 @@
+if ENABLE_WEB_ALBUMS
+
+SUBDIRS = data
+
+extensiondir = $(pkglibdir)/extensions
+extension_LTLIBRARIES = libwebalbums.la
+
+libwebalbums_la_SOURCES = 			\
+	albumtheme.c				\
+	albumtheme-private.c			\
+	albumtheme-private.h			\
+	catalog-web-exporter.c			\
+	catalog-web-exporter.h			\
+	dlg-web-exporter.c			\
+	dlg-web-exporter.h
+
+albumtheme-lex.c: albumtheme.l 
+	$(AM_V_GEN)( $(FLEX) $< && mv $(LEX_OUTPUT_ROOT).c albumtheme-lex.c ) 
+	
+albumtheme.c: albumtheme.y albumtheme-lex.c
+	$(AM_V_GEN)( $(BISON) $< -o albumtheme.c ) 
+	
+libwebalbums_la_CFLAGS = $(GTHUMB_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb 
+libwebalbums_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
+libwebalbums_la_LIBADD = $(GTHUMB_LIBS)
+libwebalbums_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
+
+extensioninidir = $(extensiondir)
+extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
+DISTCLEANFILES = $(extensionini_DATA)
+
+endif
+
+extensionini_in_files = webalbums.extension.in.in
+
+%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
+	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
+	$< > $@ )
+
+%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+
+EXTRA_DIST = $(extensionini_in_files)	\
+	albumtheme.c			\
+	albumtheme.y			\
+	albumtheme.l			\
+	lex.albumtheme.c
+
+CLEANFILES = $(BUILT_SOURCES) 
+
+-include $(top_srcdir)/git.mk
diff --git a/extensions/webalbums/Makefile.in b/extensions/webalbums/Makefile.in
new file mode 100644
index 0000000..c1581c3
--- /dev/null
+++ b/extensions/webalbums/Makefile.in
@@ -0,0 +1,874 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = extensions/webalbums
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \
+	$(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(extensiondir)" \
+	"$(DESTDIR)$(extensioninidir)"
+LTLIBRARIES = $(extension_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+am__libwebalbums_la_SOURCES_DIST = albumtheme.c albumtheme-private.c \
+	albumtheme-private.h catalog-web-exporter.c \
+	catalog-web-exporter.h dlg-web-exporter.c dlg-web-exporter.h
+ ENABLE_WEB_ALBUMS_TRUE@am_libwebalbums_la_OBJECTS =  \
+ ENABLE_WEB_ALBUMS_TRUE@	libwebalbums_la-albumtheme.lo \
+ ENABLE_WEB_ALBUMS_TRUE@	libwebalbums_la-albumtheme-private.lo \
+ ENABLE_WEB_ALBUMS_TRUE@	libwebalbums_la-catalog-web-exporter.lo \
+ ENABLE_WEB_ALBUMS_TRUE@	libwebalbums_la-dlg-web-exporter.lo
+libwebalbums_la_OBJECTS = $(am_libwebalbums_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libwebalbums_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(libwebalbums_la_CFLAGS) $(CFLAGS) $(libwebalbums_la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+ ENABLE_WEB_ALBUMS_TRUE@am_libwebalbums_la_rpath = -rpath \
+ ENABLE_WEB_ALBUMS_TRUE@	$(extensiondir)
+DEFAULT_INCLUDES = -I  am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(libwebalbums_la_SOURCES)
+DIST_SOURCES = $(am__libwebalbums_la_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+DATA = $(extensionini_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = data
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BISON = @BISON@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLUTTER_CFLAGS = @CLUTTER_CFLAGS@
+CLUTTER_LIBS = @CLUTTER_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
+DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
+DOC_USER_FORMATS = @DOC_USER_FORMATS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXIV2_CFLAGS = @EXIV2_CFLAGS@
+EXIV2_LIBS = @EXIV2_LIBS@
+EXTENSION_LIBTOOL_FLAGS = @EXTENSION_LIBTOOL_FLAGS@
+FGREP = @FGREP@
+FLEX = @FLEX@
+GCONFTOOL = @GCONFTOOL@
+GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
+GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@
+GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@
+GREP = @GREP@
+GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@
+GSTREAMER_LIBS = @GSTREAMER_LIBS@
+GTHUMB_API_VERSION = @GTHUMB_API_VERSION@
+GTHUMB_CFLAGS = @GTHUMB_CFLAGS@
+GTHUMB_LIBS = @GTHUMB_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HELP_DIR = @HELP_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+JPEG_LIBS = @JPEG_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBBRASERO_CFLAGS = @LIBBRASERO_CFLAGS@
+LIBBRASERO_LIBS = @LIBBRASERO_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBOPENRAW_CFLAGS = @LIBOPENRAW_CFLAGS@
+LIBOPENRAW_LIBS = @LIBOPENRAW_LIBS@
+LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_GNOME_CFLAGS = @LIBSOUP_GNOME_CFLAGS@
+LIBSOUP_GNOME_LIBS = @LIBSOUP_GNOME_LIBS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGFMT_OPTS = @MSGFMT_OPTS@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OMF_DIR = @OMF_DIR@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TIFF_LIBS = @TIFF_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WARN_CXXFLAGS = @WARN_CXXFLAGS@
+XGETTEXT = @XGETTEXT@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ ENABLE_WEB_ALBUMS_TRUE@SUBDIRS = data
+ ENABLE_WEB_ALBUMS_TRUE@extensiondir = $(pkglibdir)/extensions
+ ENABLE_WEB_ALBUMS_TRUE@extension_LTLIBRARIES = libwebalbums.la
+ ENABLE_WEB_ALBUMS_TRUE@libwebalbums_la_SOURCES = \
+ ENABLE_WEB_ALBUMS_TRUE@	albumtheme.c				\
+ ENABLE_WEB_ALBUMS_TRUE@	albumtheme-private.c			\
+ ENABLE_WEB_ALBUMS_TRUE@	albumtheme-private.h			\
+ ENABLE_WEB_ALBUMS_TRUE@	catalog-web-exporter.c			\
+ ENABLE_WEB_ALBUMS_TRUE@	catalog-web-exporter.h			\
+ ENABLE_WEB_ALBUMS_TRUE@	dlg-web-exporter.c			\
+ ENABLE_WEB_ALBUMS_TRUE@	dlg-web-exporter.h
+
+ ENABLE_WEB_ALBUMS_TRUE@libwebalbums_la_CFLAGS = $(GTHUMB_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb 
+ ENABLE_WEB_ALBUMS_TRUE@libwebalbums_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
+ ENABLE_WEB_ALBUMS_TRUE@libwebalbums_la_LIBADD = $(GTHUMB_LIBS)
+ ENABLE_WEB_ALBUMS_TRUE@libwebalbums_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
+ ENABLE_WEB_ALBUMS_TRUE@extensioninidir = $(extensiondir)
+ ENABLE_WEB_ALBUMS_TRUE@extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
+ ENABLE_WEB_ALBUMS_TRUE@DISTCLEANFILES = $(extensionini_DATA)
+extensionini_in_files = webalbums.extension.in.in
+EXTRA_DIST = $(extensionini_in_files)	\
+	albumtheme.c			\
+	albumtheme.y			\
+	albumtheme.l			\
+	lex.albumtheme.c
+
+CLEANFILES = $(BUILT_SOURCES) 
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extensions/webalbums/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign extensions/webalbums/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-extensionLTLIBRARIES: $(extension_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(extensiondir)" || $(MKDIR_P) "$(DESTDIR)$(extensiondir)"
+	@list='$(extension_LTLIBRARIES)'; test -n "$(extensiondir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(extensiondir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(extensiondir)"; \
+	}
+
+uninstall-extensionLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(extension_LTLIBRARIES)'; test -n "$(extensiondir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(extensiondir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(extensiondir)/$$f"; \
+	done
+
+clean-extensionLTLIBRARIES:
+	-test -z "$(extension_LTLIBRARIES)" || rm -f $(extension_LTLIBRARIES)
+	@list='$(extension_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libwebalbums.la: $(libwebalbums_la_OBJECTS) $(libwebalbums_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libwebalbums_la_LINK) $(am_libwebalbums_la_rpath) $(libwebalbums_la_OBJECTS) $(libwebalbums_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ AMDEP_TRUE@@am__include@ @am__quote  /$(DEPDIR)/libwebalbums_la-albumtheme-private Plo am__quote@
+ AMDEP_TRUE@@am__include@ @am__quote  /$(DEPDIR)/libwebalbums_la-albumtheme Plo am__quote@
+ AMDEP_TRUE@@am__include@ @am__quote  /$(DEPDIR)/libwebalbums_la-catalog-web-exporter Plo am__quote@
+ AMDEP_TRUE@@am__include@ @am__quote  /$(DEPDIR)/libwebalbums_la-dlg-web-exporter Plo am__quote@
+
+.c.o:
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+libwebalbums_la-albumtheme.lo: albumtheme.c
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -MT libwebalbums_la-albumtheme.lo -MD -MP -MF $(DEPDIR)/libwebalbums_la-albumtheme.Tpo -c -o libwebalbums_la-albumtheme.lo `test -f 'albumtheme.c' || echo '$(srcdir)/'`albumtheme.c
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libwebalbums_la-albumtheme.Tpo $(DEPDIR)/libwebalbums_la-albumtheme.Plo
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='albumtheme.c' object='libwebalbums_la-albumtheme.lo' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -c -o libwebalbums_la-albumtheme.lo `test -f 'albumtheme.c' || echo '$(srcdir)/'`albumtheme.c
+
+libwebalbums_la-albumtheme-private.lo: albumtheme-private.c
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -MT libwebalbums_la-albumtheme-private.lo -MD -MP -MF $(DEPDIR)/libwebalbums_la-albumtheme-private.Tpo -c -o libwebalbums_la-albumtheme-private.lo `test -f 'albumtheme-private.c' || echo '$(srcdir)/'`albumtheme-private.c
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libwebalbums_la-albumtheme-private.Tpo $(DEPDIR)/libwebalbums_la-albumtheme-private.Plo
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='albumtheme-private.c' object='libwebalbums_la-albumtheme-private.lo' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -c -o libwebalbums_la-albumtheme-private.lo `test -f 'albumtheme-private.c' || echo '$(srcdir)/'`albumtheme-private.c
+
+libwebalbums_la-catalog-web-exporter.lo: catalog-web-exporter.c
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -MT libwebalbums_la-catalog-web-exporter.lo -MD -MP -MF $(DEPDIR)/libwebalbums_la-catalog-web-exporter.Tpo -c -o libwebalbums_la-catalog-web-exporter.lo `test -f 'catalog-web-exporter.c' || echo '$(srcdir)/'`catalog-web-exporter.c
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libwebalbums_la-catalog-web-exporter.Tpo $(DEPDIR)/libwebalbums_la-catalog-web-exporter.Plo
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='catalog-web-exporter.c' object='libwebalbums_la-catalog-web-exporter.lo' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -c -o libwebalbums_la-catalog-web-exporter.lo `test -f 'catalog-web-exporter.c' || echo '$(srcdir)/'`catalog-web-exporter.c
+
+libwebalbums_la-dlg-web-exporter.lo: dlg-web-exporter.c
+ am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -MT libwebalbums_la-dlg-web-exporter.lo -MD -MP -MF $(DEPDIR)/libwebalbums_la-dlg-web-exporter.Tpo -c -o libwebalbums_la-dlg-web-exporter.lo `test -f 'dlg-web-exporter.c' || echo '$(srcdir)/'`dlg-web-exporter.c
+ am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libwebalbums_la-dlg-web-exporter.Tpo $(DEPDIR)/libwebalbums_la-dlg-web-exporter.Plo
+ am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dlg-web-exporter.c' object='libwebalbums_la-dlg-web-exporter.lo' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwebalbums_la_CFLAGS) $(CFLAGS) -c -o libwebalbums_la-dlg-web-exporter.lo `test -f 'dlg-web-exporter.c' || echo '$(srcdir)/'`dlg-web-exporter.c
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-extensioniniDATA: $(extensionini_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(extensioninidir)" || $(MKDIR_P) "$(DESTDIR)$(extensioninidir)"
+	@list='$(extensionini_DATA)'; test -n "$(extensioninidir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(extensioninidir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(extensioninidir)" || exit $$?; \
+	done
+
+uninstall-extensioniniDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(extensionini_DATA)'; test -n "$(extensioninidir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(extensioninidir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(extensioninidir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(extensiondir)" "$(DESTDIR)$(extensioninidir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-extensionLTLIBRARIES clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-extensionLTLIBRARIES install-extensioniniDATA
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-extensionLTLIBRARIES \
+	uninstall-extensioniniDATA
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+	install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-extensionLTLIBRARIES \
+	clean-generic clean-libtool ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am \
+	install-extensionLTLIBRARIES install-extensioniniDATA \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-extensionLTLIBRARIES uninstall-extensioniniDATA
+
+
+ ENABLE_WEB_ALBUMS_TRUE@albumtheme-lex.c: albumtheme.l 
+ ENABLE_WEB_ALBUMS_TRUE@	$(AM_V_GEN)( $(FLEX) $< && mv $(LEX_OUTPUT_ROOT).c albumtheme-lex.c ) 
+
+ ENABLE_WEB_ALBUMS_TRUE@albumtheme.c: albumtheme.y albumtheme-lex.c
+ ENABLE_WEB_ALBUMS_TRUE@	$(AM_V_GEN)( $(BISON) $< -o albumtheme.c ) 
+
+%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
+	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
+	$< > $@ )
+
+%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+
+-include $(top_srcdir)/git.mk
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/extensions/webalbums/albumtheme-private.c b/extensions/webalbums/albumtheme-private.c
new file mode 100644
index 0000000..66a7f2f
--- /dev/null
+++ b/extensions/webalbums/albumtheme-private.c
@@ -0,0 +1,684 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include "albumtheme-private.h"
+
+#define MAX_EXPR_SIZE 100
+#define MEM_SIZE 1000
+
+
+GList *yy_parsed_doc = NULL;
+
+
+GthMem *
+gth_mem_new (int size)
+{
+	GthMem *mem;
+
+	mem = g_new0 (GthMem, 1);
+
+	mem->data = g_new (int, size);
+	gth_mem_set_empty (mem);
+
+	return mem;
+}
+
+
+void
+gth_mem_free (GthMem *mem)
+{
+	g_free (mem->data);
+	g_free (mem);
+}
+
+
+void
+gth_mem_set_empty (GthMem *mem)
+{
+	mem->top = 0;
+}
+
+
+gboolean
+gth_mem_is_empty (GthMem *mem)
+{
+	return (mem->top == 0);
+}
+
+
+void
+gth_mem_push (GthMem *mem, 
+	      int     val)
+{
+	mem->data[mem->top++] = val;
+}
+
+
+int
+gth_mem_pop (GthMem *mem)
+{
+	if (! gth_mem_is_empty (mem)) {
+		mem->top--;
+		return mem->data[mem->top];
+	}
+
+	return 0;
+}
+
+
+int
+gth_mem_get_pos (GthMem *mem, 
+		 int     pos)
+{
+	if ((pos <= 0) || (pos > mem->top))
+		return 0;
+	return mem->data[pos - 1];
+}
+
+
+int
+gth_mem_get (GthMem *mem)
+{
+	return gth_mem_get_pos (mem, mem->top);
+}
+
+
+int
+gth_mem_get_top (GthMem *mem)
+{
+	return mem->top;
+}
+
+
+/* GthCell */
+
+
+GthCell *
+gth_cell_new (void)
+{
+	GthCell *cell;
+
+	cell = g_new0 (GthCell, 1);
+	cell->ref = 1;
+
+	return cell;
+}
+
+
+GthCell *
+gth_cell_ref (GthCell *cell)
+{
+	cell->ref++;
+	return cell;
+}
+
+
+void
+gth_cell_unref (GthCell *cell)
+{
+	if (cell == NULL)
+		return;
+
+	cell->ref--;
+	if (cell->ref == 0) {
+		if (cell->type == GTH_CELL_TYPE_VAR)
+			g_free (cell->value.var);
+		g_free (cell);
+	}
+}
+
+
+/* GthExpr */
+
+
+static int
+default_get_var_value_func (const char *var_name,
+			    gpointer    data)
+{
+	return 0;
+}
+
+
+GthExpr *
+gth_expr_new (void)
+{
+	GthExpr *e;
+
+	e = g_new0 (GthExpr, 1);
+	e->ref = 1;
+	e->data = g_new0 (GthCell*, MAX_EXPR_SIZE);
+	gth_expr_set_get_var_value_func (e, default_get_var_value_func, NULL);
+
+	return e;
+}
+
+
+GthExpr *
+gth_expr_ref (GthExpr *e)
+{
+	e->ref++;
+	return e;
+}
+
+
+void
+gth_expr_unref (GthExpr *e)
+{
+	if (e == NULL)
+		return;
+
+	e->ref--;
+
+	if (e->ref == 0) {
+		int i;
+
+		for (i = 0; i < MAX_EXPR_SIZE; i++) 
+			gth_cell_unref (e->data[i]);
+		g_free (e->data);
+		g_free (e);
+	}
+}
+
+
+void      
+gth_expr_set_empty (GthExpr *e)
+{
+	e->top = 0;
+}
+
+
+gboolean
+gth_expr_is_empty (GthExpr *e)
+{
+	return (e->top == 0);
+}
+
+
+void
+gth_expr_push_expr (GthExpr *e, GthExpr *e2)
+{
+	int i;
+
+	for (i = 0; i < e2->top; i++) {
+		gth_cell_unref (e->data[e->top]);
+		e->data[e->top] = gth_cell_ref (e2->data[i]);
+		e->top++;
+	}
+}
+
+
+void
+gth_expr_push_op (GthExpr *e, GthOp op)
+{
+	GthCell *cell;
+
+	gth_cell_unref (e->data[e->top]);
+
+	cell = gth_cell_new ();
+	cell->type = GTH_CELL_TYPE_OP;
+	cell->value.op = op;
+	e->data[e->top] = cell;
+
+	e->top++;
+}
+
+
+void
+gth_expr_push_var (GthExpr *e, const char *name)
+{
+	GthCell *cell;
+
+	gth_cell_unref (e->data[e->top]);
+
+	cell = gth_cell_new ();
+	cell->type = GTH_CELL_TYPE_VAR;
+	cell->value.var = g_strdup (name);
+	e->data[e->top] = cell;
+
+	e->top++;
+}
+
+
+void
+gth_expr_push_constant (GthExpr *e, int value)
+{
+	GthCell *cell;
+
+	gth_cell_unref (e->data[e->top]);
+
+	cell = gth_cell_new ();
+	cell->type = GTH_CELL_TYPE_CONSTANT;
+	cell->value.constant = value;
+	e->data[e->top] = cell;
+
+	e->top++;
+}
+
+
+void
+gth_expr_pop (GthExpr *e)
+{
+	if (! gth_expr_is_empty (e))
+		e->top--;
+}
+
+
+GthCell*
+gth_expr_get_pos (GthExpr *e, int pos)
+{
+	if ((pos <= 0) || (pos > e->top))
+		return NULL;
+	return e->data[pos - 1];
+}
+
+
+GthCell*
+gth_expr_get (GthExpr *e)
+{
+	return gth_expr_get_pos (e, e->top);
+}
+
+
+int
+gth_expr_get_top (GthExpr *e)
+{
+	return e->top;
+}
+
+
+void
+gth_expr_set_get_var_value_func (GthExpr            *e,
+				 GthGetVarValueFunc  f,
+				 gpointer            data)
+{
+	e->get_var_value_func = f;
+	e->get_var_value_data = data;
+}
+
+
+static char *op_name[] = {
+	"ADD",
+	"SUB",
+	"MUL",
+	"DIV",
+	"NEG",
+	"NOT",
+	"AND",
+	"OR",
+	"CMP_EQ",
+	"CMP_NE",
+	"CMP_LT",
+	"CMP_GT",
+	"CMP_LE",
+	"CMP_GE"
+};
+
+
+void
+gth_expr_print (GthExpr *e)
+{
+	int i;
+	
+	for (i = 0; i < gth_expr_get_top (e); i++) {
+		GthCell *cell = gth_expr_get_pos (e, i + 1);
+
+		switch (cell->type) {
+		case GTH_CELL_TYPE_VAR:
+			printf ("VAR: %s (%d)\n", 
+				cell->value.var,
+				e->get_var_value_func (cell->value.var,
+						       e->get_var_value_data));
+			break;
+
+		case GTH_CELL_TYPE_CONSTANT:
+			printf ("NUM: %d\n", cell->value.constant);
+			break;
+
+		case GTH_CELL_TYPE_OP:
+			printf ("OP: %s\n", op_name[cell->value.op]);
+			break;
+		}
+	}
+}
+
+
+int
+gth_expr_eval (GthExpr *e)
+{
+	GthMem *mem;
+	int     retval = 0;
+	int     i;
+
+	mem = gth_mem_new (MEM_SIZE);
+
+	for (i = 0; i < gth_expr_get_top (e); i++) {
+		GthCell *cell = gth_expr_get_pos (e, i + 1);
+		int      a, b, c;
+
+		switch (cell->type) {
+		case GTH_CELL_TYPE_VAR:
+			gth_mem_push (mem, 
+				      e->get_var_value_func (cell->value.var,
+							     e->get_var_value_data));
+			break;
+
+		case GTH_CELL_TYPE_CONSTANT:
+			gth_mem_push (mem, cell->value.constant);
+			break;
+
+		case GTH_CELL_TYPE_OP:
+			switch (cell->value.op) {
+			case GTH_OP_NEG:
+				a = gth_mem_pop (mem);
+				gth_mem_push (mem, -a);
+				break;
+
+			case GTH_OP_NOT:
+				a = gth_mem_pop (mem);
+				gth_mem_push (mem, (a == 0) ? 1 : 0);
+				break;
+
+			case GTH_OP_ADD:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = a + b;
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_SUB:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = a - b;
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_MUL:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = a * b;
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_DIV:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = a / b;
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_AND:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a != 0) && (b != 0);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_OR:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a != 0) || (b != 0);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_CMP_EQ:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a == b);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_CMP_NE:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a != b);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_CMP_LT:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a < b);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_CMP_GT:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a > b);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_CMP_LE:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a <= b);
+				gth_mem_push (mem, c);
+				break;
+
+			case GTH_OP_CMP_GE:
+				b = gth_mem_pop (mem);
+				a = gth_mem_pop (mem);
+				c = (a >= b);
+				gth_mem_push (mem, c);
+				break;
+			}
+			break;
+		}
+	}
+
+	retval = gth_mem_get (mem);
+
+	gth_mem_free (mem);
+
+	return retval;
+}
+
+
+/* GthVar */
+
+
+GthVar *
+gth_var_new_constant (int value)
+{
+	GthVar *var;
+
+	var = g_new0 (GthVar, 1);
+	var->name = NULL;
+	var->type = GTH_VAR_EXPR;
+	var->value.expr = gth_expr_new ();
+	gth_expr_push_constant (var->value.expr, value);
+
+	return var;
+}
+
+
+GthVar *
+gth_var_new_expression (const char *name, 
+			GthExpr    *e)
+{
+	GthVar *var;
+
+	g_return_val_if_fail (name != NULL, NULL);
+
+	var = g_new0 (GthVar, 1);
+	var->type = GTH_VAR_EXPR;
+	var->name = g_strdup (name);
+	var->value.expr = gth_expr_ref (e);
+
+	return var;
+}
+
+
+GthVar*
+gth_var_new_string (const char *name,
+		    const char *string)
+{
+	GthVar *var;
+
+	g_return_val_if_fail (name != NULL, NULL);
+
+	var = g_new0 (GthVar, 1);
+	var->type = GTH_VAR_STRING;
+	var->name = g_strdup (name);
+	if (string != NULL)
+		var->value.string = g_strdup (string);
+
+	return var;
+}
+
+
+void
+gth_var_free (GthVar *var)
+{
+	g_free (var->name);
+	if (var->type == GTH_VAR_EXPR)
+		gth_expr_unref (var->value.expr);
+	if (var->type == GTH_VAR_STRING)
+		g_free (var->value.string);
+	g_free (var);
+}
+
+
+/* GthCondition */
+
+
+GthCondition *
+gth_condition_new (GthExpr *expr)
+{
+	GthCondition *cond;
+
+	cond = g_new0 (GthCondition, 1);
+	cond->expr = gth_expr_ref (expr);
+
+	return cond;
+}
+
+
+void
+gth_condition_free (GthCondition *cond)
+{
+	if (cond == NULL)
+		return;
+	gth_expr_unref (cond->expr);
+	gth_parsed_doc_free (cond->document);
+	g_free (cond);
+}
+
+
+void
+gth_condition_add_document  (GthCondition *cond,
+			     GList        *document)
+{
+	if (cond->document != NULL)
+		gth_parsed_doc_free (cond->document);
+	cond->document = document;
+}
+
+
+/* GthTag */
+
+
+GthTag *
+gth_tag_new (GthTagType  type, 
+	     GList      *arg_list)
+{
+	GthTag *tag;
+
+	tag = g_new0 (GthTag, 1);
+	tag->type = type;
+	tag->value.arg_list = arg_list;
+
+	return tag;
+}
+
+
+GthTag *
+gth_tag_new_html (const char *html)
+{
+	GthTag *tag;
+
+	tag = g_new0 (GthTag, 1);
+	tag->type = GTH_TAG_HTML;
+	tag->value.html = g_strdup (html);
+
+	return tag;	
+}
+
+
+GthTag *
+gth_tag_new_condition (GList *cond_list) 
+{
+	GthTag *tag;
+
+	tag = g_new0 (GthTag, 1);
+	tag->type = GTH_TAG_IF;
+	tag->value.cond_list = cond_list;
+
+	return tag;	
+}
+
+
+void
+gth_tag_add_document (GthTag *tag,
+		      GList  *document)
+{
+	if (tag->document != NULL)
+		gth_parsed_doc_free (tag->document);
+	tag->document = document;
+}
+
+
+void
+gth_tag_free (GthTag *tag)
+{
+	if (tag->type == GTH_TAG_HTML) 
+		g_free (tag->value.html);
+
+	else if (tag->type == GTH_TAG_IF) {
+		g_list_foreach (tag->value.cond_list, 
+				(GFunc) gth_condition_free,
+				NULL);
+		g_list_free (tag->value.cond_list);
+
+	} else {
+		g_list_foreach (tag->value.arg_list, 
+				(GFunc) gth_var_free, 
+				NULL);
+		g_list_free (tag->value.arg_list);
+	}
+
+	if (tag->document != NULL)
+		gth_parsed_doc_free (tag->document);
+
+	g_free (tag);
+}
+
+
+void
+gth_parsed_doc_free (GList *parsed_doc)
+{
+	if (parsed_doc != NULL) {
+		g_list_foreach (parsed_doc, (GFunc) gth_tag_free, NULL);
+		g_list_free (parsed_doc);
+	}
+}
diff --git a/extensions/webalbums/albumtheme-private.h b/extensions/webalbums/albumtheme-private.h
new file mode 100644
index 0000000..8dad66b
--- /dev/null
+++ b/extensions/webalbums/albumtheme-private.h
@@ -0,0 +1,247 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef ALBUMTHEME_PRIVATE_H
+#define ALBUMTHEME_PRIVATE_H
+
+#include <glib.h>
+
+extern GList *yy_parsed_doc;
+
+/* GthMem */
+
+typedef struct {
+	int *data;
+	int  top;
+} GthMem;
+
+GthMem*   gth_mem_new        (int     size);
+
+void      gth_mem_free       (GthMem *mem);
+
+void      gth_mem_set_empty  (GthMem *mem);
+
+gboolean  gth_mem_is_empty   (GthMem *mem);
+
+void      gth_mem_push       (GthMem *mem, 
+			      int     val);
+
+int       gth_mem_pop        (GthMem *mem);
+
+int       gth_mem_get_pos    (GthMem *mem, 
+			      int     pos);
+
+int       gth_mem_get        (GthMem *mem);
+
+int       gth_mem_get_top    (GthMem *mem);
+
+/* GthCell */
+
+typedef enum {
+	GTH_OP_ADD,
+	GTH_OP_SUB,
+	GTH_OP_MUL,
+	GTH_OP_DIV,
+	GTH_OP_NEG,
+	GTH_OP_NOT,
+	GTH_OP_AND,
+	GTH_OP_OR,
+	GTH_OP_CMP_EQ,
+	GTH_OP_CMP_NE,
+	GTH_OP_CMP_LT,
+	GTH_OP_CMP_GT,
+	GTH_OP_CMP_LE,
+	GTH_OP_CMP_GE,
+} GthOp;
+
+typedef enum {
+	GTH_CELL_TYPE_OP,
+	GTH_CELL_TYPE_VAR,
+	GTH_CELL_TYPE_CONSTANT
+} GthCellType;
+
+typedef struct {
+	int         ref;
+	GthCellType type;
+	union {
+		GthOp  op;
+		char  *var;
+		int    constant;
+	} value;
+} GthCell;
+
+GthCell*   gth_cell_new   (void);
+
+GthCell*   gth_cell_ref   (GthCell *cell);
+
+void       gth_cell_unref (GthCell *cell);
+
+/* GthExpr */
+
+typedef int (*GthGetVarValueFunc) (const char *var_name, gpointer data);
+
+typedef struct {
+	int                  ref;
+	GthCell            **data;
+	int                  top;
+	GthGetVarValueFunc   get_var_value_func;
+	gpointer             get_var_value_data;
+} GthExpr;
+
+GthExpr*  gth_expr_new               (void);
+
+GthExpr*  gth_expr_ref               (GthExpr *e);
+
+void      gth_expr_unref             (GthExpr *e);
+
+void      gth_expr_set_empty         (GthExpr *e);
+
+gboolean  gth_expr_is_empty          (GthExpr *e);
+
+void      gth_expr_push_expr         (GthExpr *e, GthExpr *e2);
+
+void      gth_expr_push_op           (GthExpr *e, GthOp op);
+
+void      gth_expr_push_var          (GthExpr *e, const char *name);
+
+void      gth_expr_push_constant     (GthExpr *e, int value);
+
+void      gth_expr_pop               (GthExpr *e);
+
+GthCell*  gth_expr_get_pos           (GthExpr *e, int pos);
+
+GthCell*  gth_expr_get               (GthExpr *e);
+
+int       gth_expr_get_top           (GthExpr *e);
+
+void      gth_expr_set_get_var_value_func (GthExpr *e,
+					   GthGetVarValueFunc f,
+					   gpointer data);
+
+int       gth_expr_eval              (GthExpr *e);
+
+/* GthVar */
+
+typedef enum {
+	GTH_VAR_EXPR,
+	GTH_VAR_STRING
+} GthVarType;
+
+typedef struct {
+	char       *name;
+	GthVarType  type;
+	union {
+		GthExpr *expr;
+		char    *string;
+	} value;
+} GthVar;
+
+GthVar*  gth_var_new_constant   (int value);
+
+GthVar*  gth_var_new_expression (const char *name, GthExpr *e);
+
+GthVar*  gth_var_new_string     (const char *name, const char *string);
+
+void     gth_var_free           (GthVar *var);
+
+/* GthCondition */
+
+typedef struct {
+	GthExpr *expr;
+	GList   *document; /* GthTag list */
+} GthCondition;
+
+GthCondition * gth_condition_new           (GthExpr      *expr);
+
+void           gth_condition_free          (GthCondition *cond);
+
+void           gth_condition_add_document  (GthCondition *cond,
+					    GList        *document);
+
+/* GthTag */
+
+typedef enum {
+	GTH_TAG_HEADER,
+	GTH_TAG_FOOTER,
+	GTH_TAG_LANGUAGE,
+	GTH_TAG_THEME_LINK,
+	GTH_TAG_IMAGE,
+	GTH_TAG_IMAGE_LINK,
+	GTH_TAG_IMAGE_IDX,
+	GTH_TAG_IMAGE_DIM,
+	GTH_TAG_IMAGES,
+	GTH_TAG_FILENAME,
+	GTH_TAG_FILEPATH,
+	GTH_TAG_FILESIZE,
+	GTH_TAG_COMMENT,
+	GTH_TAG_PLACE,
+	GTH_TAG_DATE_TIME,
+	GTH_TAG_PAGE_LINK,
+	GTH_TAG_PAGE_IDX,
+	GTH_TAG_PAGE_ROWS,
+	GTH_TAG_PAGE_COLS,
+	GTH_TAG_PAGES,
+	GTH_TAG_TABLE,
+	GTH_TAG_THUMBS,
+	GTH_TAG_DATE,
+	GTH_TAG_TEXT,
+	GTH_TAG_HTML,
+	GTH_TAG_SET_VAR,
+	GTH_TAG_EVAL,
+	GTH_TAG_IF,
+	GTH_TAG_EXIF_EXPOSURE_TIME,
+	GTH_TAG_EXIF_EXPOSURE_MODE,
+	GTH_TAG_EXIF_FLASH,
+	GTH_TAG_EXIF_SHUTTER_SPEED,
+	GTH_TAG_EXIF_APERTURE_VALUE,
+	GTH_TAG_EXIF_FOCAL_LENGTH,
+	GTH_TAG_EXIF_DATE_TIME,
+	GTH_TAG_EXIF_CAMERA_MODEL
+} GthTagType;
+
+typedef struct {
+	GthTagType type;
+	union {
+		GList *arg_list;    /* GthVar list */ 
+		char  *html;        /* html */
+		GList *cond_list;   /* GthCondition list */
+	} value;
+	GList *document; /* GthTag list */
+} GthTag;
+
+GthTag * gth_tag_new                 (GthTagType    type, 
+				      GList        *arg_list);
+
+GthTag * gth_tag_new_html            (const char   *html);
+
+GthTag * gth_tag_new_condition       (GList        *cond_list);
+
+void     gth_tag_add_document        (GthTag       *tag,
+				      GList        *document);
+
+void     gth_tag_free                (GthTag       *tag);
+
+/**/
+
+void     gth_parsed_doc_free         (GList *parsed_doc);
+
+#endif /* ALBUMTHEME_PRIVATE_H */
diff --git a/extensions/webalbums/albumtheme.l b/extensions/webalbums/albumtheme.l
new file mode 100644
index 0000000..4e15fe0
--- /dev/null
+++ b/extensions/webalbums/albumtheme.l
@@ -0,0 +1,234 @@
+%{
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <gio/gio.h>
+
+GFileInputStream *yy_istream;
+
+#undef YY_INPUT
+#define YY_INPUT(buf,result,max_size)									\
+{													\
+	gssize n = g_input_stream_read (G_INPUT_STREAM (yy_istream), buf, max_size, NULL, NULL);	\
+	result = (n <= 0 ? YY_NULL : n);								\
+}
+
+%}
+
+%option noinput nounput
+
+number           [0-9]+
+name             [a-zA-Z_][0-9a-zA-Z_:@]*
+string           ([^'\n]|\\')*
+
+%x TAG STR
+
+%%
+
+"<gthumb:theme-link"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_THEME_LINK;
+					return THEME_LINK;
+				}
+"<gthumb:image"			{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_IMAGE;
+					return IMAGE;
+				}
+"<gthumb:image-link"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_IMAGE_LINK;
+					return IMAGE_LINK;
+				}
+"<gthumb:image-index"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_IMAGE_IDX;
+					return IMAGE_IDX;
+				}
+"<gthumb:images"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_IMAGES;
+					return IMAGES;
+				}
+"<gthumb:page-link"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_PAGE_LINK;
+					return PAGE_LINK;
+				}
+"<gthumb:page-index"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_PAGE_IDX;
+					return PAGE_IDX;
+				}
+"<gthumb:table"			{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_TABLE;
+					return TABLE;
+				}
+"<gthumb:thumbs"		{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_THUMBS;
+					return THUMBS;
+				}
+"<gthumb:text"			{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_TEXT;
+					return TEXT;
+				}
+"</gthumb:text>"		{
+					BEGIN (INITIAL);
+					return TEXT_END;
+				}
+"<gthumb:set"			{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_SET;
+					return SET;
+				}
+"<gthumb:get"    	        {
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_GET;
+					return GET;
+				}
+"<gthumb:eval"			{
+					BEGIN (TAG);
+					yylval.ivalue = GTH_TAG_EVAL;
+					return EVAL;
+				}
+"<gthumb:if"			{
+					BEGIN (TAG);
+					return IF;
+				}
+"<gthumb:else"			{
+					BEGIN (TAG);
+					return ELSE;
+				}
+"<gthumb:else_if"		{
+					BEGIN (TAG);
+					return ELSE_IF;
+				}
+"<gthumb:end"			{
+					BEGIN (TAG);
+					return END;
+				}
+<TAG>"'"			{
+					BEGIN (STR);
+					return '\'';
+				}
+<STR>{string}			{
+					yylval.text = g_strdup (yytext);
+					return STRING;
+				}
+<STR>"'"			{
+					BEGIN (TAG);
+					return '\'';
+				}
+<TAG>{number}			{
+					yylval.ivalue = atoi (yytext);
+					return NUMBER;
+				}
+<TAG>{name}			{
+					yylval.text = g_strdup (yytext);
+					return NAME;
+				}
+<TAG>"="			{
+					return '=';
+				}
+<TAG,STAG>"<"			{
+					yylval.ivalue = GTH_OP_CMP_LT;
+					return COMPARE;
+				}
+<TAG>">"			{
+					yylval.ivalue = GTH_OP_CMP_GT;
+					return COMPARE;
+				}
+<STAG>">"		        {
+					BEGIN (INITIAL);
+					return END_TAG;
+				}
+<TAG,STAG>"+"			{
+					return '+';
+				}
+<TAG,STAG>"-"			{
+					return '-';
+				}
+<TAG,STAG>"*"			{
+					return '*';
+				}
+<TAG,STAG>"/"			{
+					return '/';
+				}
+<TAG,STAG>"!"			{
+					return '!';
+				}
+<TAG,STAG>"("			{
+					return '(';
+				}
+<TAG,STAG>")"			{
+					return ')';
+				}
+<TAG,STAG>\"			{
+					return '"';
+				}
+<TAG,STAG>"&&"			{
+					yylval.ivalue = GTH_OP_AND;
+					return BOOL_OP;
+				}
+<TAG,STAG>"||"			{
+					yylval.ivalue = GTH_OP_OR;
+					return BOOL_OP;
+				}
+<TAG,STAG>"=="			{
+					yylval.ivalue = GTH_OP_CMP_EQ;
+					return COMPARE;
+				}
+<TAG,STAG>"!="			{
+					yylval.ivalue = GTH_OP_CMP_NE;
+					return COMPARE;
+				}
+<TAG,STAG>"<="			{
+					yylval.ivalue = GTH_OP_CMP_LE;
+					return COMPARE;
+				}
+<TAG,STAG>">="			{
+					yylval.ivalue = GTH_OP_CMP_GE;
+					return COMPARE;
+				}
+<TAG,STAG>[ \t\n]		{
+					/* Eat spaces inside tag. */
+				}
+<TAG>"/>"		        {
+					BEGIN (INITIAL);
+					return END_TAG;
+				}
+"<"				{
+					yylval.text = g_strdup (yytext);
+					return HTML;
+				}
+[^<]{1,100}			{
+					yylval.text = g_strdup (yytext);
+					return HTML;
+				}
+<<EOF>>				{
+					return 0;
+				}
+
+%%
+
diff --git a/extensions/webalbums/albumtheme.y b/extensions/webalbums/albumtheme.y
new file mode 100644
index 0000000..9fd9996
--- /dev/null
+++ b/extensions/webalbums/albumtheme.y
@@ -0,0 +1,459 @@
+%{
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <gio/gio.h>
+#include "albumtheme-private.h"
+
+void  yyerror (char *fmt, ...);
+int   yywrap  (void);
+int   yylex   (void);
+
+#define YY_NO_UNPUT
+
+%}
+
+%union {
+	char         *text;
+	int           ivalue;
+        GString      *string;
+	GthVar       *var;
+	GthTag       *tag;
+	GthExpr      *expr;
+	GList        *list;
+	GthCondition *cond;
+}
+
+%nonassoc       IF ELSE ELSE_IF END
+%token          END_TAG
+%token <text>   NAME STRING
+%token <ivalue> NUMBER
+%token <ivalue> HEADER FOOTER
+%token <ivalue> LANGUAGE
+%token <ivalue> THEME_LINK
+%token <ivalue> IMAGE
+%token <ivalue> IMAGE_LINK
+%token <ivalue> IMAGE_IDX
+%token <ivalue> IMAGE_DIM
+%token <ivalue> IMAGES
+%token <ivalue> FILENAME
+%token <ivalue> FILEPATH
+%token <ivalue> FILESIZE
+%token <ivalue> COMMENT
+%token <ivalue> PLACE
+%token <ivalue> DATE_TIME
+%token <ivalue> PAGE_LINK
+%token <ivalue> PAGE_IDX
+%token <ivalue> PAGE_ROWS
+%token <ivalue> PAGE_COLS
+%token <ivalue> PAGES
+%token <ivalue> TABLE
+%token <ivalue> THUMBS
+%token <ivalue> DATE
+%token <ivalue> TEXT TEXT_END
+%token <ivalue> EXIF_EXPOSURE_TIME
+%token <ivalue> EXIF_EXPOSURE_MODE
+%token <ivalue> EXIF_FLASH
+%token <ivalue> EXIF_SHUTTER_SPEED
+%token <ivalue> EXIF_APERTURE_VALUE
+%token <ivalue> EXIF_FOCAL_LENGTH
+%token <ivalue> EXIF_DATE_TIME
+%token <ivalue> EXIF_CAMERA_MODEL
+
+%token <ivalue> SET_VAR
+%token <ivalue> EVAL
+
+%token <text> HTML
+
+%type <list>   document
+%type <tag>    gthumb_tag
+%type <tag>    gthumb_text_tag
+%type <cond>   gthumb_if
+%type <cond>   gthumb_else_if
+%type <cond>   opt_else
+%type <list>   opt_if_list
+%type <ivalue> tag_name
+%type <list>   arg_list
+%type <var>    arg
+%type <expr>   expr
+%type <expr>   quoted_expr
+%type <string> constant_list
+%type <string> constant
+%type <string> constant1
+
+%left  <ivalue> BOOL_OP
+%left  <ivalue> COMPARE
+%left  '+' '-' '*' '/' '!'
+%right UNARY_OP
+
+%%
+
+all		: document {
+			yy_parsed_doc = $1;
+
+			if (yy_parsed_doc == NULL)
+				YYABORT;
+			else
+				YYACCEPT;
+		}
+		;
+
+document	: HTML document {
+			$$ = g_list_prepend ($2, gth_tag_new_html ($1));
+			g_free ($1);
+		}
+
+		| gthumb_tag document {
+			$$ = g_list_prepend ($2, $1);
+		}
+
+		| gthumb_if document opt_if_list opt_else gthumb_end document {
+			GList  *cond_list;
+			GthTag *tag;
+
+			gth_condition_add_document ($1, $2);
+			cond_list = g_list_prepend ($3, $1);
+			if ($4 != NULL)
+				cond_list = g_list_append (cond_list, $4);
+
+			tag = gth_tag_new_condition (cond_list);
+			$$ = g_list_prepend ($6, tag);
+		}
+
+		| gthumb_text_tag HTML TEXT_END document {
+			GthTag *tag = gth_tag_new_html ($2);
+			GList *child_doc = g_list_append (NULL, tag);
+			gth_tag_add_document ($1, child_doc);
+			$$ = g_list_prepend ($4, $1);
+			g_free ($2);
+		}
+
+		| /* empty */ {
+			$$ = NULL;
+		}
+
+		| error document {
+			if ($2 != NULL)
+				gth_parsed_doc_free ($2);
+			$$ = NULL;
+		}
+		;
+
+gthumb_if	: IF expr END_TAG {
+			$$ = gth_condition_new ($2);
+		}
+		| IF '"' quoted_expr '"' END_TAG {
+			$$ = gth_condition_new ($3);
+		}
+		;
+
+opt_if_list     : gthumb_else_if document opt_if_list {
+			gth_condition_add_document ($1, $2);
+			$$ = g_list_prepend ($3, $1);
+		}
+
+		| /* empty */ {
+			$$ = NULL;
+		}
+		;
+
+gthumb_else_if  : ELSE_IF expr END_TAG {
+			$$ = gth_condition_new ($2);
+		}
+		| ELSE_IF '"' quoted_expr '"' END_TAG {
+			$$ = gth_condition_new ($3);
+		}
+		;
+
+opt_else        : gthumb_else document {
+			GthExpr      *else_expr;
+			GthCondition *cond;
+
+			else_expr = gth_expr_new ();
+			gth_expr_push_constant (else_expr, 1);
+			cond = gth_condition_new (else_expr);
+			gth_condition_add_document (cond, $2);
+
+			$$ = cond;
+		}
+
+		| /* empty */ {
+			$$ = NULL;
+		}
+		;
+
+gthumb_else	: ELSE END_TAG
+		;
+
+gthumb_end	: END END_TAG
+		;
+
+expr		: '(' expr ')' {
+			$$ = $2;
+		}
+		| expr COMPARE expr {
+			GthExpr *e = gth_expr_new ();
+
+			gth_expr_push_expr (e, $1);
+			gth_expr_push_expr (e, $3);
+			gth_expr_push_op (e, $2);
+
+			gth_expr_unref ($1);
+			gth_expr_unref ($3);
+
+			$$ = e;
+		}
+		| expr '+' expr {
+			GthExpr *e = gth_expr_new ();
+
+			gth_expr_push_expr (e, $1);
+			gth_expr_push_expr (e, $3);
+			gth_expr_push_op (e, GTH_OP_ADD);
+
+			gth_expr_unref ($1);
+			gth_expr_unref ($3);
+
+			$$ = e;
+		}
+		| expr '-' expr {
+			GthExpr *e = gth_expr_new ();
+
+			gth_expr_push_expr (e, $1);
+			gth_expr_push_expr (e, $3);
+			gth_expr_push_op (e, GTH_OP_SUB);
+
+			gth_expr_unref ($1);
+			gth_expr_unref ($3);
+
+			$$ = e;
+		}
+
+		| expr '*' expr {
+			GthExpr *e = gth_expr_new ();
+
+			gth_expr_push_expr (e, $1);
+			gth_expr_push_expr (e, $3);
+			gth_expr_push_op (e, GTH_OP_MUL);
+
+			gth_expr_unref ($1);
+			gth_expr_unref ($3);
+
+			$$ = e;
+		}
+		| expr '/' expr {
+			GthExpr *e = gth_expr_new ();
+
+			gth_expr_push_expr (e, $1);
+			gth_expr_push_expr (e, $3);
+			gth_expr_push_op (e, GTH_OP_DIV);
+
+			gth_expr_unref ($1);
+			gth_expr_unref ($3);
+
+			$$ = e;
+		}
+		| expr BOOL_OP expr {
+			GthExpr *e = gth_expr_new ();
+
+			gth_expr_push_expr (e, $1);
+			gth_expr_push_expr (e, $3);
+			gth_expr_push_op (e, $2);
+
+			gth_expr_unref ($1);
+			gth_expr_unref ($3);
+
+			$$ = e;
+		}
+		| '+' expr %prec UNARY_OP {
+			$$ = $2;
+		}
+		| '-' expr %prec UNARY_OP {
+			gth_expr_push_op ($2, GTH_OP_NEG);
+			$$ = $2;
+		}
+		| '!' expr %prec UNARY_OP {
+			gth_expr_push_op ($2, GTH_OP_NOT);
+			$$ = $2;
+		}
+		| NAME {
+			GthExpr *e = gth_expr_new ();
+			gth_expr_push_var (e, $1);
+			g_free ($1);
+			$$ = e;
+		}
+		| NUMBER {
+			GthExpr *e = gth_expr_new ();
+			gth_expr_push_constant (e, $1);
+			$$ = e;
+		}
+		;
+quoted_expr     : expr {
+			$$ = $1;
+		}
+		| STRING {
+			GthExpr *e = gth_expr_new ();
+			gth_expr_push_var (e, $1);
+			g_free ($1);
+			$$ = e;
+		}
+		| constant1 constant constant_list {
+			GthExpr *e = gth_expr_new ();
+			g_string_append ($1, $2->str);
+			g_string_free ($2, TRUE);
+			if ($3 != NULL) {
+				g_string_append ($1, $3->str);
+				g_string_free ($3, TRUE);
+			}
+			gth_expr_push_var (e, $1->str);
+			g_string_free ($1, TRUE);
+			$$ = e;
+		}
+		;
+constant1       : NAME {
+			GString *s = g_string_new ($1);
+			g_free ($1);
+			$$ = s;
+		}
+		;
+constant        : NAME {
+			GString *s = g_string_new ($1);
+			g_string_prepend_c (s, ' ');
+			g_free ($1);
+			$$ = s;
+		}
+		| NUMBER {
+			GString *s = g_string_new ("");
+			g_string_sprintf (s, " %i", $1);
+			$$ = s;
+		}
+		;
+constant_list   : constant constant_list {
+			if ($2 != NULL)	{
+				g_string_append ($1, $2->str);
+				g_string_free ($2, TRUE);
+			}
+			$$ = $1;
+		}
+		| /* empty */ {
+			$$ = NULL;
+		}
+		;
+gthumb_text_tag	: TEXT arg_list END_TAG {
+			$$ = gth_tag_new ($1, $2);
+		}
+		;
+
+gthumb_tag 	: tag_name arg_list END_TAG {
+			$$ = gth_tag_new ($1, $2);
+		}
+		;
+
+tag_name	: HEADER              { $$ = $1; }
+		| FOOTER              { $$ = $1; }
+		| LANGUAGE            { $$ = $1; }
+		| THEME_LINK          { $$ = $1; }
+		| IMAGE               { $$ = $1; }
+		| IMAGE_LINK          { $$ = $1; }
+		| IMAGE_IDX           { $$ = $1; }
+		| IMAGE_DIM           { $$ = $1; }
+		| IMAGES              { $$ = $1; }
+		| FILENAME            { $$ = $1; }
+		| FILEPATH            { $$ = $1; }
+		| FILESIZE            { $$ = $1; }
+		| COMMENT             { $$ = $1; }
+		| PLACE               { $$ = $1; }
+		| DATE_TIME           { $$ = $1; }
+		| PAGE_LINK           { $$ = $1; }
+		| PAGE_IDX            { $$ = $1; }
+		| PAGE_ROWS           { $$ = $1; }
+		| PAGE_COLS           { $$ = $1; }
+		| PAGES               { $$ = $1; }
+		| TABLE               { $$ = $1; }
+		| THUMBS              { $$ = $1; }
+		| DATE                { $$ = $1; }
+		| EXIF_EXPOSURE_TIME  { $$ = $1; }
+		| EXIF_EXPOSURE_MODE  { $$ = $1; }
+		| EXIF_FLASH          { $$ = $1; }
+		| EXIF_SHUTTER_SPEED  { $$ = $1; }
+		| EXIF_APERTURE_VALUE { $$ = $1; }
+		| EXIF_FOCAL_LENGTH   { $$ = $1; }
+		| EXIF_DATE_TIME      { $$ = $1; }
+		| EXIF_CAMERA_MODEL   { $$ = $1; }
+		| SET_VAR             { $$ = $1; }
+		| EVAL                { $$ = $1; }
+		;
+
+arg_list	: arg arg_list {
+			$$ = g_list_prepend ($2, $1);
+		}
+
+		| /* empty */ {
+			$$ = NULL;
+		}
+		;
+
+arg		: NAME '=' expr {
+			$$ = gth_var_new_expression ($1, $3);
+			g_free ($1);
+		}
+
+		| NAME '=' '\'' quoted_expr '\'' {
+			$$ = gth_var_new_expression ($1, $4);
+			g_free($1);
+		}
+
+		| NAME '=' '"' quoted_expr '"' {
+			$$ = gth_var_new_expression ($1, $4);
+			g_free($1);
+		}
+
+		| NAME {
+		  	GthExpr *e = gth_expr_new ();
+			gth_expr_push_constant (e, 1);
+			$$ = gth_var_new_expression ($1, e);
+			g_free ($1);
+		}
+		;
+
+%%
+
+int
+yywrap (void)
+{
+	return 1;
+}
+
+
+void
+yyerror (char *fmt, ...)
+{
+	va_list ap;
+
+	va_start (ap, fmt);
+	vfprintf (stderr, fmt, ap);
+	fprintf (stderr, "\n");
+	va_end (ap);
+}
+
+
+#include "albumtheme-lex.c"
diff --git a/extensions/webalbums/catalog-web-exporter.c b/extensions/webalbums/catalog-web-exporter.c
new file mode 100644
index 0000000..1d92e1b
--- /dev/null
+++ b/extensions/webalbums/catalog-web-exporter.c
@@ -0,0 +1,3209 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+#include <locale.h>
+#include <ctype.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+#include <libgnomevfs/gnome-vfs-directory.h>
+
+#include "catalog-web-exporter.h"
+#include "comments.h"
+#include "gfile-utils.h"
+#include "file-utils.h"
+#include "gconf-utils.h"
+#include "jpegutils/jpeg-data.h"
+#include "gth-exif-utils.h"
+#include "dlg-file-utils.h"
+#include "gthumb-init.h"
+#include "gthumb-marshal.h"
+#include "gtk-utils.h"
+#include "pixbuf-utils.h"
+#include "thumb-loader.h"
+#include "image-loader.h"
+#include "glib-utils.h"
+#include "albumtheme-private.h"
+#include "rotation-utils.h"
+#include "typedefs.h"
+#include "gth-sort-utils.h"
+#include "jpegutils/jpegtran.h"
+
+#define DATE_FORMAT _("%d %B %Y, %H:%M")
+
+
+typedef enum {
+	GTH_VISIBILITY_ALWAYS = 0,
+	GTH_VISIBILITY_INDEX,
+	GTH_VISIBILITY_IMAGE
+} GthTagVisibility;
+
+typedef enum {
+	GTH_IMAGE_TYPE_IMAGE = 0,
+	GTH_IMAGE_TYPE_THUMBNAIL,
+	GTH_IMAGE_TYPE_PREVIEW
+} GthAttrImageType;
+
+enum {
+	WEB_EXPORTER_DONE,
+	WEB_EXPORTER_PROGRESS,
+	WEB_EXPORTER_INFO,
+	WEB_EXPORTER_START_COPYING,
+	LAST_SIGNAL
+};
+
+extern int yyparse (void);
+extern GFileInputStream *yy_istream;
+
+static GObjectClass *parent_class = NULL;
+static guint         catalog_web_exporter_signals[LAST_SIGNAL] = { 0 };
+
+#define DEFAULT_THUMB_SIZE 100
+#define DEFAULT_INDEX_FILE "index.html"
+#define SAVING_TIMEOUT 5
+
+
+/* Default subdirectories.
+ * - Used as fallback when gconf values are empty or not accessible
+ * - Please keep in sync with values in gthumb.schemas.in 
+ */
+
+#define DEFAULT_WEB_DIR_PREVIEWS     "previews"
+#define DEFAULT_WEB_DIR_THUMBNAILS   "thumbnails"
+#define DEFAULT_WEB_DIR_IMAGES       "images"
+#define DEFAULT_WEB_DIR_HTML_IMAGES  "html"
+#define DEFAULT_WEB_DIR_HTML_INDEXES "html"
+#define DEFAULT_WEB_DIR_THEME_FILES  "theme"
+
+
+struct _ImageData {
+	FileData         *src_file;
+	char             *comment;
+	char             *place;
+	char             *date_time;
+	char             *dest_filename;
+	GdkPixbuf        *image;
+	int               image_width, image_height;
+	GdkPixbuf        *thumb;
+	int               thumb_width, thumb_height;
+	GdkPixbuf        *preview;
+	int               preview_width, preview_height;
+	gboolean          caption_set;
+	gboolean          no_preview;
+};
+
+#define IMAGE_DATA(x) ((ImageData*)(x))
+
+
+static char *
+zero_padded (int n)
+{
+	static char  s[1024];
+	char        *t;
+
+	sprintf (s, "%3d", n);
+	for (t = s; (t != NULL) && (*t != 0); t++)
+		if (*t == ' ')
+			*t = '0';
+
+	return s;
+}
+
+
+static int img_counter = 0;
+
+
+static ImageData *
+image_data_new (FileData *file)
+{
+	ImageData   *idata;
+	CommentData *cdata;
+
+	idata = g_new0 (ImageData, 1);
+
+	cdata = comments_load_comment (file->path, TRUE);
+	if (cdata != NULL) {
+		idata->comment = g_strdup (cdata->comment);
+		idata->place = g_strdup (cdata->place);
+		if (cdata->time != 0) {
+			struct tm *tm;
+			char   time_txt[50];
+			tm = localtime (&(cdata->time));
+			if (tm->tm_hour + tm->tm_min + tm->tm_sec == 0)
+				strftime (time_txt, 50, _("%d %B %Y"), tm);
+			else
+				strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);
+			idata->date_time = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
+		}
+		else
+			idata->date_time = NULL;
+		comment_data_free (cdata);
+	} 
+	else {
+		idata->comment = NULL;
+		idata->place = NULL;
+		idata->date_time = NULL;
+	}
+
+	idata->src_file = file_data_ref (file);
+	idata->dest_filename = g_strconcat (zero_padded (img_counter++),
+					    "-",
+					    file_name_from_path (file->path),
+					    NULL);
+
+	idata->image = NULL;
+	idata->image_width = 0;
+	idata->image_height = 0;
+
+	idata->thumb = NULL;
+	idata->thumb_width = 0;
+	idata->thumb_height = 0;
+
+	idata->preview = NULL;
+	idata->preview_width = 0;
+	idata->preview_height = 0;
+
+	idata->caption_set = FALSE;
+	idata->no_preview = FALSE;
+
+	return idata;
+}
+
+
+static void
+image_data_free (ImageData *idata)
+{
+	g_free (idata->comment);
+	g_free (idata->place);
+	g_free (idata->date_time);
+	file_data_unref (idata->src_file);
+	g_free (idata->dest_filename);
+
+	if (idata->image != NULL)
+		g_object_unref (idata->image);
+	if (idata->thumb != NULL)
+		g_object_unref (idata->thumb);
+	if (idata->preview != NULL)
+		g_object_unref (idata->preview);
+
+	g_free (idata);
+}
+
+
+static void
+free_parsed_docs (CatalogWebExporter *ce)
+{
+	if (ce->index_parsed != NULL) {
+		gth_parsed_doc_free (ce->index_parsed);
+		ce->index_parsed = NULL;
+	}
+
+	if (ce->thumbnail_parsed != NULL) {
+		gth_parsed_doc_free (ce->thumbnail_parsed);
+		ce->thumbnail_parsed = NULL;
+	}
+
+	if (ce->image_parsed != NULL) {
+		gth_parsed_doc_free (ce->image_parsed);
+		ce->image_parsed = NULL;
+	}
+}
+
+
+static void
+album_dirs_init (AlbumDirs *ad)
+{
+	ad->previews = NULL;
+	ad->thumbnails = NULL;
+	ad->images = NULL;
+	ad->html_images = NULL;
+	ad->html_indexes = NULL;
+	ad->theme_files = NULL;
+}
+
+
+static void
+album_dirs_free_dirs (AlbumDirs *ad)
+{
+	g_free (ad->previews);
+	g_free (ad->thumbnails);
+	g_free (ad->images);
+	g_free (ad->html_images);
+	g_free (ad->html_indexes);
+	g_free (ad->theme_files);
+}
+
+
+static void
+album_dirs_free (AlbumDirs *ad)
+{
+	album_dirs_free_dirs (ad);
+	g_free (ad);
+}
+
+static AlbumDirs *
+album_dirs_new ()
+{
+	AlbumDirs *ad;
+
+	ad = g_new (AlbumDirs, 1);
+	album_dirs_init (ad);
+	
+	return ad;
+}
+
+
+// TODO: locale?
+
+static void
+album_dirs_set (AlbumDirs *ad)
+{
+	album_dirs_free_dirs (ad);
+	
+	ad->previews =     eel_gconf_get_string (PREF_EXP_WEB_DIR_PREVIEWS, 
+						 DEFAULT_WEB_DIR_PREVIEWS);
+	ad->thumbnails =   eel_gconf_get_string (PREF_EXP_WEB_DIR_THUMBNAILS, 
+						 DEFAULT_WEB_DIR_THUMBNAILS);
+	ad->images =       eel_gconf_get_string (PREF_EXP_WEB_DIR_IMAGES, 
+						 DEFAULT_WEB_DIR_IMAGES);
+	ad->html_images =  eel_gconf_get_string (PREF_EXP_WEB_DIR_HTML_IMAGES, 
+						 DEFAULT_WEB_DIR_HTML_IMAGES);
+	ad->html_indexes = eel_gconf_get_string (PREF_EXP_WEB_DIR_HTML_INDEXES, 
+						 DEFAULT_WEB_DIR_HTML_INDEXES);
+	ad->theme_files =  eel_gconf_get_string (PREF_EXP_WEB_DIR_THEME_FILES, 
+						 DEFAULT_WEB_DIR_THEME_FILES);
+}
+
+
+static GFile *
+gfile_get_style_dir (CatalogWebExporter *ce,
+		     const char         *style)
+{
+	GFile *dir;
+	GFile *style_dir;
+
+	if (style == NULL)
+		return NULL;
+	
+	dir = gfile_get_home_dir ();
+	style_dir = gfile_append_path (dir,
+			               ".gnome2",
+			               "gthumb",
+			               "albumthemes",
+			               style,
+			               NULL);
+ 	g_object_unref (dir);
+ 	
+	if (! gfile_path_is_dir (style_dir)) {
+		g_object_unref (style_dir);
+
+		style_dir = gfile_new_va (GTHUMB_DATADIR,
+				          "gthumb",
+				          "albumthemes",
+				          style,
+				          NULL);
+		if (! gfile_path_is_dir (style_dir)) {
+			g_object_unref (style_dir);
+			style_dir = NULL;
+		}
+	}
+
+	return style_dir;
+}
+
+
+static void
+catalog_web_exporter_finalize (GObject *object)
+{
+	CatalogWebExporter *ce;
+
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (object));
+
+	ce = CATALOG_WEB_EXPORTER (object);
+
+	g_free (ce->header);
+	ce->header = NULL;
+
+	g_free (ce->footer);
+	ce->footer = NULL;
+
+	UNREF (ce->style_dir)
+
+	g_free (ce->base_dir);     /* NOTE: gio port: get rid of these two */
+	g_free (ce->base_tmp_dir);
+	
+	UNREF (ce->target_dir)
+	UNREF (ce->target_tmp_dir)
+	album_dirs_free (ce->ad);
+
+	g_free (ce->index_file);
+	ce->index_file = NULL;
+
+	g_free (ce->info);
+	ce->info = NULL;
+
+	if (ce->file_list != NULL) {
+		g_list_foreach (ce->file_list, (GFunc) image_data_free, NULL);
+		g_list_free (ce->file_list);
+		ce->file_list = NULL;
+	}
+
+	if (ce->iloader != NULL) {
+		g_object_unref (ce->iloader);
+		ce->iloader = NULL;
+	}
+
+	free_parsed_docs (ce);
+
+	/* Chain up */
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
+static void
+catalog_web_exporter_class_init (CatalogWebExporterClass *class)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+	parent_class = g_type_class_peek_parent (class);
+
+	catalog_web_exporter_signals[WEB_EXPORTER_DONE] =
+		g_signal_new ("web_exporter_done",
+			      G_TYPE_FROM_CLASS (class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (CatalogWebExporterClass, web_exporter_done),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE,
+			      0);
+
+	catalog_web_exporter_signals[WEB_EXPORTER_PROGRESS] =
+		g_signal_new ("web_exporter_progress",
+			      G_TYPE_FROM_CLASS (class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (CatalogWebExporterClass, web_exporter_progress),
+			      NULL, NULL,
+			      gthumb_marshal_VOID__FLOAT,
+			      G_TYPE_NONE,
+			      1, G_TYPE_FLOAT);
+
+	catalog_web_exporter_signals[WEB_EXPORTER_INFO] =
+		g_signal_new ("web_exporter_info",
+			      G_TYPE_FROM_CLASS (class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (CatalogWebExporterClass, web_exporter_info),
+			      NULL, NULL,
+			      gthumb_marshal_VOID__STRING,
+			      G_TYPE_NONE,
+			      1, G_TYPE_STRING);
+
+	catalog_web_exporter_signals[WEB_EXPORTER_START_COPYING] =
+		g_signal_new ("web_exporter_start_copying",
+			      G_TYPE_FROM_CLASS (class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (CatalogWebExporterClass, web_exporter_start_copying),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE,
+			      0);
+
+	object_class->finalize = catalog_web_exporter_finalize;
+}
+
+
+static void
+catalog_web_exporter_init (CatalogWebExporter *ce)
+{
+	ce->header = NULL;
+	ce->footer = NULL;
+	ce->style_dir = NULL;
+
+	ce->base_dir = NULL;     /* NOTE: gio port: get rid of these two */
+	ce->base_tmp_dir = NULL;
+	
+	ce->target_dir = NULL;
+	ce->target_tmp_dir = NULL;
+
+	ce->use_subfolders = TRUE;
+	ce->ad = album_dirs_new ();
+
+	ce->index_file = g_strdup (DEFAULT_INDEX_FILE);
+	ce->file_list = NULL;
+	ce->iloader = NULL;
+
+	ce->thumb_width = DEFAULT_THUMB_SIZE;
+	ce->thumb_height = DEFAULT_THUMB_SIZE;
+
+	ce->copy_images = FALSE;
+	ce->resize_images = FALSE;
+	ce->resize_max_width = 0;
+	ce->resize_max_height = 0;
+
+	ce->single_index = FALSE;
+
+	ce->preview_min_width = 0;
+	ce->preview_min_height = 0;
+	ce->preview_max_width = 0;
+	ce->preview_max_height = 0;
+
+	ce->index_caption_mask = GTH_CAPTION_IMAGE_DIM | GTH_CAPTION_FILE_SIZE;
+	ce->image_caption_mask = GTH_CAPTION_COMMENT | GTH_CAPTION_PLACE | GTH_CAPTION_EXIF_DATE_TIME;
+}
+
+
+GType
+catalog_web_exporter_get_type ()
+{
+	static GType type = 0;
+
+	if (! type) {
+		GTypeInfo type_info = {
+			sizeof (CatalogWebExporterClass),
+			NULL,
+			NULL,
+			(GClassInitFunc) catalog_web_exporter_class_init,
+			NULL,
+			NULL,
+			sizeof (CatalogWebExporter),
+			0,
+			(GInstanceInitFunc) catalog_web_exporter_init
+                };
+
+                type = g_type_register_static (G_TYPE_OBJECT,
+					       "CatalogWebExporter",
+					       &type_info,
+					       0);
+        }
+
+	return type;
+}
+
+
+CatalogWebExporter *
+catalog_web_exporter_new (GthWindow *window,
+			  GList     *file_list)
+{
+	CatalogWebExporter *ce;
+	GList              *scan;
+
+	g_return_val_if_fail (window != NULL, NULL);
+
+	ce = CATALOG_WEB_EXPORTER (g_object_new (CATALOG_WEB_EXPORTER_TYPE, NULL));
+
+	ce->window = window;
+
+	img_counter = 0;
+	for (scan = file_list; scan; scan = scan->next) {
+		FileData  *file = (FileData *) scan->data;
+		ce->file_list = g_list_prepend (ce->file_list, image_data_new (file));
+	}
+	ce->file_list = g_list_reverse (ce->file_list);
+
+	return ce;
+}
+
+
+void
+catalog_web_exporter_set_header (CatalogWebExporter *ce,
+				 const char         *header)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	g_free (ce->header);
+	ce->header = g_strdup (header);
+}
+
+
+void
+catalog_web_exporter_set_footer (CatalogWebExporter *ce,
+				 const char         *footer)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	g_free (ce->footer);
+	ce->footer = g_strdup (footer);
+}
+
+
+void
+catalog_web_exporter_set_style (CatalogWebExporter *ce,
+				const char         *style)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	UNREF (ce->style_dir)
+	ce->style_dir = gfile_get_style_dir (ce, style);
+}
+
+
+void
+catalog_web_exporter_set_location (CatalogWebExporter *ce,
+				   const char         *location)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	UNREF (ce->target_dir)
+	ce->target_dir = gfile_new (location);
+}
+
+
+void
+catalog_web_exporter_set_use_subfolders (CatalogWebExporter *ce,
+					 gboolean            use_subfolders)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->use_subfolders = use_subfolders;
+}
+
+
+void
+catalog_web_exporter_set_copy_images (CatalogWebExporter *ce,
+				      gboolean            copy)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->copy_images = copy;
+}
+
+
+void
+catalog_web_exporter_set_resize_images (CatalogWebExporter *ce,
+					gboolean            resize,
+					int                 max_width,
+					int                 max_height)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->resize_images = resize;
+	if (resize) {
+		ce->resize_max_width = max_width;
+		ce->resize_max_height = max_height;
+	} else {
+		ce->resize_max_width = 0;
+		ce->resize_max_height = 0;
+	}
+}
+
+
+void
+catalog_web_exporter_set_sorted (CatalogWebExporter *ce,
+				 GthSortMethod       method,
+				 GtkSortType         sort_type)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->sort_method = method;
+	ce->sort_type = sort_type;
+}
+
+
+void
+catalog_web_exporter_set_row_col (CatalogWebExporter *ce,
+				  int                 rows,
+				  int                 cols)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->page_rows = rows;
+	ce->page_cols = cols;
+}
+
+
+void
+catalog_web_exporter_set_single_index (CatalogWebExporter *ce,
+				       gboolean            single)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->single_index = single;
+}
+
+
+void
+catalog_web_exporter_set_thumb_size (CatalogWebExporter *ce,
+				     int                 width,
+				     int                 height)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->thumb_width = width;
+	ce->thumb_height = height;
+}
+
+
+void
+catalog_web_exporter_set_preview_size (CatalogWebExporter *ce,
+				       int                 width,
+				       int                 height)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+
+	if (ce->copy_images
+	    && ce->resize_images
+	    && (ce->resize_max_width > 0)
+	    && (ce->resize_max_height > 0)) {
+		if (width > ce->resize_max_width)
+			width = ce->resize_max_width;
+		if (height > ce->resize_max_height)
+			height = ce->resize_max_height;
+	}
+
+	ce->preview_max_width = width;
+	ce->preview_max_height = height;
+}
+
+
+void
+catalog_web_exporter_set_preview_min_size (CatalogWebExporter *ce,
+					   int                 width,
+					   int                 height)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+
+	ce->preview_min_width = width;
+	ce->preview_min_height = height;
+}
+
+
+void
+catalog_web_exporter_set_image_caption (CatalogWebExporter *ce,
+					GthCaptionFields    caption)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->image_caption_mask = caption;
+}
+
+
+guint16
+catalog_web_exporter_get_image_caption (CatalogWebExporter *ce)
+{
+	return ce->image_caption_mask;
+}
+
+
+void
+catalog_web_exporter_set_index_caption (CatalogWebExporter *ce,
+					GthCaptionFields    caption)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+	ce->index_caption_mask = caption;
+}
+
+
+guint16
+catalog_web_exporter_get_index_caption (CatalogWebExporter *ce)
+{
+	return ce->index_caption_mask;
+}
+
+
+static int
+comp_func_name (gconstpointer a, gconstpointer b)
+{
+	ImageData *data_a, *data_b;
+
+	data_a = IMAGE_DATA (a);
+	data_b = IMAGE_DATA (b);
+
+	return gth_sort_by_filename_but_ignore_path (data_a->src_file->name, data_b->src_file->name);}
+
+
+static int
+comp_func_path (gconstpointer a, 
+		gconstpointer b)
+{
+	ImageData *data_a, *data_b;
+
+	data_a = IMAGE_DATA (a);
+	data_b = IMAGE_DATA (b);
+
+	return gth_sort_by_full_path (data_a->src_file->path, data_b->src_file->path);
+}
+
+
+static int
+comp_func_comment (gconstpointer a, 
+		   gconstpointer b)
+{
+	ImageData *data_a, *data_b;
+
+	data_a = IMAGE_DATA (a);
+	data_b = IMAGE_DATA (b);
+
+	return gth_sort_by_comment_then_name (data_a->comment, data_b->comment,
+					      data_a->src_file->path, data_b->src_file->path);
+}
+
+
+static int
+comp_func_time (gconstpointer a, 
+		gconstpointer b)
+{
+	ImageData *data_a, *data_b;
+
+	data_a = IMAGE_DATA (a);
+	data_b = IMAGE_DATA (b);
+
+	return gth_sort_by_filetime_then_name (data_a->src_file->mtime, data_b->src_file->mtime,
+					       data_a->src_file->path, data_b->src_file->path);
+}
+
+
+static int
+comp_func_exif_date (gconstpointer a, 
+		     gconstpointer b)
+{
+	ImageData *data_a, *data_b;
+
+	data_a = IMAGE_DATA (a);
+	data_b = IMAGE_DATA (b);
+
+	return gth_sort_by_exiftime_then_name (data_a->src_file, data_b->src_file);
+}
+
+
+static int
+comp_func_size (gconstpointer a, 
+		gconstpointer b)
+{
+	ImageData *data_a, *data_b;
+
+	data_a = IMAGE_DATA (a);
+	data_b = IMAGE_DATA (b);
+
+	return gth_sort_by_size_then_name (data_a->src_file->size, data_b->src_file->size,
+				           data_a->src_file->path, data_b->src_file->path);
+}
+
+
+static GCompareFunc
+get_sortfunc (CatalogWebExporter *ce)
+{
+	GCompareFunc func;
+
+	switch (ce->sort_method) {
+	case GTH_SORT_METHOD_BY_NAME:
+		func = comp_func_name;
+		break;
+	case GTH_SORT_METHOD_BY_TIME:
+		func = comp_func_time;
+		break;
+	case GTH_SORT_METHOD_BY_SIZE:
+		func = comp_func_size;
+		break;
+	case GTH_SORT_METHOD_BY_PATH:
+		func = comp_func_path;
+		break;
+	case GTH_SORT_METHOD_BY_COMMENT:
+		func = comp_func_comment;
+		break;
+	case GTH_SORT_METHOD_BY_EXIF_DATE:
+		func = comp_func_exif_date;
+		break;
+	case GTH_SORT_METHOD_NONE:
+		func = gth_sort_none;
+		break;
+	default:
+		func = gth_sort_none;
+		break;
+	}
+
+	return func;
+}
+
+
+#define RETURN_IMAGE_FIELD(image, field) {	\
+	if (image == NULL)			\
+		return 0;			\
+	else					\
+		return image->field;		\
+}
+
+
+static int
+get_var_value (const char *var_name,
+	       gpointer    data)
+{
+	CatalogWebExporter *ce = data;
+
+	if (strcmp (var_name, "image_idx") == 0)
+		return ce->image + 1;
+	else if (strcmp (var_name, "images") == 0)
+		return ce->n_images;
+	else if (strcmp (var_name, "page_idx") == 0)
+		return ce->page + 1;
+	else if (strcmp (var_name, "page_rows") == 0)
+		return ce->page_rows;
+	else if (strcmp (var_name, "page_cols") == 0)
+		return ce->page_cols;
+	else if (strcmp (var_name, "pages") == 0)
+		return ce->n_pages;
+	else if (strcmp (var_name, "preview_min_width") == 0)
+		return ce->preview_min_width;
+	else if (strcmp (var_name, "preview_min_height") == 0)
+		return ce->preview_min_height;
+	else if (strcmp (var_name, "index") == 0)
+		return GTH_VISIBILITY_INDEX;
+	else if (strcmp (var_name, "image") == 0)
+		return GTH_VISIBILITY_IMAGE;
+	else if (strcmp (var_name, "always") == 0)
+		return GTH_VISIBILITY_ALWAYS;
+
+	else if (strcmp (var_name, "image_width") == 0)
+		RETURN_IMAGE_FIELD (ce->eval_image, image_width)
+	else if (strcmp (var_name, "image_height") == 0)
+		RETURN_IMAGE_FIELD (ce->eval_image, image_height)
+	else if (strcmp (var_name, "preview_width") == 0)
+		RETURN_IMAGE_FIELD (ce->eval_image, preview_width)
+	else if (strcmp (var_name, "preview_height") == 0)
+		RETURN_IMAGE_FIELD (ce->eval_image, preview_height)
+	else if (strcmp (var_name, "thumb_width") == 0)
+		RETURN_IMAGE_FIELD (ce->eval_image, thumb_width)
+	else if (strcmp (var_name, "thumb_height") == 0)
+		RETURN_IMAGE_FIELD (ce->eval_image, thumb_height)
+
+	else if (strcmp (var_name, "image_dim_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_IMAGE_DIM;
+	else if (strcmp (var_name, "file_name_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_FILE_NAME;
+ 	else if (strcmp (var_name, "file_path_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_FILE_PATH;
+	else if (strcmp (var_name, "file_size_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_FILE_SIZE;
+	else if (strcmp (var_name, "comment_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_COMMENT;
+	else if (strcmp (var_name, "place_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_PLACE;
+	else if (strcmp (var_name, "date_time_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_DATE_TIME;
+	else if (strcmp (var_name, "exif_date_time_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_DATE_TIME;
+	else if (strcmp (var_name, "exif_exposure_time_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_EXPOSURE_TIME;
+	else if (strcmp (var_name, "exif_exposure_mode_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_EXPOSURE_MODE;
+	else if (strcmp (var_name, "exif_flash_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_FLASH;
+	else if (strcmp (var_name, "exif_shutter_speed_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_SHUTTER_SPEED;
+	else if (strcmp (var_name, "exif_aperture_value_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_APERTURE_VALUE;
+	else if (strcmp (var_name, "exif_focal_length_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_FOCAL_LENGTH;
+	else if (strcmp (var_name, "exif_camera_model_visibility_index") == 0)
+		return ce->index_caption_mask & GTH_CAPTION_EXIF_CAMERA_MODEL;
+
+	else if (strcmp (var_name, "image_dim_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_IMAGE_DIM;
+	else if (strcmp (var_name, "file_name_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_FILE_NAME;
+ 	else if (strcmp (var_name, "file_path_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_FILE_PATH;
+	else if (strcmp (var_name, "file_size_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_FILE_SIZE;
+	else if (strcmp (var_name, "comment_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_COMMENT;
+	else if (strcmp (var_name, "place_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_PLACE;
+	else if (strcmp (var_name, "date_time_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_DATE_TIME;
+	else if (strcmp (var_name, "exif_date_time_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_DATE_TIME;
+	else if (strcmp (var_name, "exif_exposure_time_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_EXPOSURE_TIME;
+	else if (strcmp (var_name, "exif_exposure_mode_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_EXPOSURE_MODE;
+	else if (strcmp (var_name, "exif_flash_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_FLASH;
+	else if (strcmp (var_name, "exif_shutter_speed_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_SHUTTER_SPEED;
+	else if (strcmp (var_name, "exif_aperture_value_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_APERTURE_VALUE;
+	else if (strcmp (var_name, "exif_focal_length_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_FOCAL_LENGTH;
+	else if (strcmp (var_name, "exif_camera_model_visibility_image") == 0)
+		return ce->image_caption_mask & GTH_CAPTION_EXIF_CAMERA_MODEL;
+
+	else if (strcmp (var_name, "copy_originals") == 0)
+		return ce->copy_images;
+
+	g_warning ("[GetVarValue] Unknown variable name: %s", var_name);
+
+	return 0;
+}
+
+
+static int
+expression_value (CatalogWebExporter *ce,
+		  GthExpr            *expr)
+{
+	gth_expr_set_get_var_value_func (expr, get_var_value, ce);
+	return gth_expr_eval (expr);
+}
+
+
+static int
+gth_tag_get_idx (GthTag             *tag,
+		 CatalogWebExporter *ce,
+		 int                 default_value,
+		 int                 max_value)
+{
+	GList *scan;
+	int    retval = default_value;
+
+	for (scan = tag->value.arg_list; scan; scan = scan->next) {
+		GthVar *var = scan->data;
+
+		if (strcmp (var->name, "idx_relative") == 0) {
+			retval = default_value + expression_value (ce, var->value.expr);
+			break;
+
+		} else if (strcmp (var->name, "idx") == 0) {
+			retval = expression_value (ce, var->value.expr) - 1;
+			break;
+		}
+	}
+
+	retval = MIN (retval, max_value);
+	retval = MAX (retval, 0);
+
+	return retval;
+}
+
+
+static int
+get_image_idx (GthTag             *tag,
+	       CatalogWebExporter *ce)
+{
+	return gth_tag_get_idx (tag, ce, ce->image, ce->n_images - 1);
+}
+
+
+static int
+get_page_idx (GthTag             *tag,
+	      CatalogWebExporter *ce)
+{
+	return gth_tag_get_idx (tag, ce, ce->page, ce->n_pages - 1);
+}
+
+
+static int
+gth_tag_get_var (CatalogWebExporter *ce,
+		 GthTag             *tag,
+		 const char         *var_name)
+{
+	GList *scan;
+
+	for (scan = tag->value.arg_list; scan; scan = scan->next) {
+		GthVar *var = scan->data;
+		if (strcmp (var->name, var_name) == 0)
+			return expression_value (ce, var->value.expr);
+	}
+
+	return 0;
+}
+
+
+static const char *
+gth_tag_get_str (CatalogWebExporter *ce,
+		 GthTag             *tag,
+		 const char         *var_name)
+{
+	GList *scan;
+
+	for (scan = tag->value.arg_list; scan; scan = scan->next) {
+		GthVar *var = scan->data;
+		if (strcmp (var->name, var_name) == 0) {
+			GthCell *cell = gth_expr_get(var->value.expr);
+			if (cell->type == GTH_CELL_TYPE_VAR)
+				return cell->value.var;
+		}
+	}
+
+	return NULL;
+}
+
+
+static int
+get_page_idx_from_image_idx (CatalogWebExporter *ce,
+			     int                 image_idx)
+{
+	if (ce->single_index)
+		return 0;
+	else
+		return image_idx / (ce->page_rows * ce->page_cols);
+}
+
+
+static gboolean
+line_is_void (const char *line)
+{
+	const char *scan;
+
+	if (line == NULL)
+		return TRUE;
+
+	for (scan = line; *scan != '\0'; scan++)
+		if ((*scan != ' ')
+		    && (*scan != '\t')
+		    && (*scan != '\n'))
+			return FALSE;
+
+	return TRUE;
+}
+
+
+/* write a line when no error is pending */
+
+static void
+_write_line (GFileOutputStream   *ostream, 
+	     GError             **error,
+	     const char          *line)
+{
+	if (error != NULL && *error != NULL)
+		return;
+	
+	gfile_output_stream_write (ostream, error, line);
+}
+
+
+static void
+_write_locale_line (GFileOutputStream  *ostream, 
+		    GError            **error,
+		    const char         *line)
+{
+	char *utf8_line;
+
+	utf8_line = g_locale_to_utf8 (line, -1, 0, 0, 0);
+	_write_line (ostream, error, utf8_line);
+	g_free (utf8_line);
+}
+
+
+static void
+write_line (GFileOutputStream  *ostream, 
+	    GError            **error,
+	    const char         *line)
+{
+	if (line_is_void (line))
+		return;
+
+	_write_line (ostream, error, line);
+}
+
+
+static void
+write_markup_escape_line (GFileOutputStream  *ostream, 
+                          GError            **error,
+                          const char         *line)
+{
+	char *e_line;
+
+	if (line_is_void (line))
+		return;
+	
+	e_line = _g_escape_text_for_html (line, -1);
+	_write_line (ostream, error, e_line);
+	g_free (e_line);
+}
+
+
+static void
+write_markup_escape_locale_line (GFileOutputStream  *ostream, 
+                                 GError            **error,
+                                 const char         *line)
+{
+	char *e_line;
+
+	if (line == NULL)
+		return;
+	if (*line == 0)
+		return;
+	
+	e_line = _g_escape_text_for_html (line, -1);
+	_write_locale_line (ostream, error, e_line);
+	g_free (e_line);
+}
+
+
+/* GFile to string */
+
+static char *
+gfile_get_relative_uri (GFile *file, 
+		        GFile *relative_to)
+{
+	char  *escaped;
+	char  *relative_uri;
+	char  *result;
+	
+	escaped = gfile_get_uri (file);
+	relative_uri = gfile_get_uri (relative_to);
+	
+	result = get_path_relative_to_uri (escaped, relative_uri);
+	
+	g_free (relative_uri);
+	g_free (escaped);
+	
+	return result;
+}
+
+
+static char *
+gfile_get_relative_path (GFile *file, 
+		         GFile *relative_to)
+{
+	char  *escaped, *unescaped;
+	
+	escaped = gfile_get_relative_uri (file, relative_to);
+	unescaped = g_uri_unescape_string (escaped, NULL);
+
+	g_free (escaped);
+	
+	return unescaped;
+}
+
+
+/* construct a GFile for a CatalogWebExporter */
+
+GFile *
+get_album_file (CatalogWebExporter *ce,
+		GFile              *target_dir,
+		const char         *subdir,
+		const char         *filename)
+{
+
+	GFile *dir, *file;
+
+	dir = gfile_append_path (target_dir, 
+			         (ce->use_subfolders ? subdir : NULL),
+			         NULL);
+	file = gfile_append_path (dir, 
+				  filename,
+				  NULL);
+
+	g_object_unref (dir);
+
+	return file;
+}
+
+
+GFile *
+get_html_index_dir (CatalogWebExporter *ce,
+		    const int           page,
+		    GFile              *target_dir)
+{
+	return (page == 0 ?
+		g_file_dup (target_dir) :
+		get_album_file (ce, target_dir, ce->ad->html_indexes, NULL));
+}
+
+
+GFile *
+get_html_image_dir (CatalogWebExporter *ce,
+		    GFile              *target_dir)
+{
+	return get_album_file (ce, target_dir, ce->ad->html_images, NULL);
+}
+
+
+
+GFile *
+get_theme_file (CatalogWebExporter *ce,
+		GFile              *target_dir,
+		const char         *filename)
+{
+	return get_album_file (ce, target_dir, ce->ad->theme_files, filename);
+}
+
+
+GFile *
+get_html_index_file (CatalogWebExporter *ce,
+		     const int           page,
+		     GFile              *target_dir)
+{
+	GFile *dir, *result;
+	char  *filename;
+
+	if (page == 0)
+		filename = g_strdup (ce->index_file);
+	else
+		filename = g_strconcat ("page",
+					 zero_padded (page + 1),
+					 ".html",
+					 NULL);
+	dir = get_html_index_dir (ce, page, target_dir);
+	result = get_album_file (ce, dir, NULL, filename);
+	
+	g_free (filename);
+	g_object_unref (dir);
+	
+	return result;
+}
+
+
+GFile *
+get_html_image_file (CatalogWebExporter *ce,
+		     ImageData          *idata,
+		     GFile              *target_dir)
+{
+	GFile	    *result;
+	const char  *escaped;
+	char        *unescaped;
+	char        *filename;
+
+	escaped = file_name_from_path (idata->dest_filename);
+	unescaped = g_uri_unescape_string (escaped, NULL);
+	filename = g_strconcat (unescaped, ".html", NULL);
+	g_free (unescaped);
+	
+	result = get_album_file (ce, target_dir, ce->ad->html_images, filename);
+	g_free (filename);
+	
+	return result;
+}
+
+
+GFile *
+get_thumbnail_file (CatalogWebExporter *ce,
+		    ImageData          *idata,
+		    GFile              *target_dir)
+{
+	GFile	    *result;
+	const char  *escaped;
+	char        *unescaped;
+	char        *filename;
+
+	escaped = file_name_from_path (idata->dest_filename);
+	unescaped = g_uri_unescape_string (escaped, NULL);
+	filename = g_strconcat (unescaped, ".small", ".jpeg", NULL);
+	g_free (unescaped);
+
+	result = get_album_file (ce, target_dir, ce->ad->thumbnails, filename);
+	g_free (filename);
+	
+	return result;
+}
+
+
+GFile *
+get_image_file (CatalogWebExporter *ce,
+		ImageData          *idata,
+		GFile              *target_dir)
+{
+	GFile  *result;
+	char   *escaped;
+	char   *filename;
+
+	if (ce->copy_images) {
+		escaped = g_strdup (file_name_from_path (idata->dest_filename));
+		filename = g_uri_unescape_string (escaped, NULL);
+		
+		result = get_album_file (ce, target_dir, ce->ad->images, filename);
+		g_free (filename);
+		g_free (escaped);
+
+	} else {
+		result = gfile_new (idata->src_file->path);
+	}
+	
+	return result;
+}
+
+
+GFile *
+get_preview_file (CatalogWebExporter *ce,
+		  ImageData          *idata,
+		  GFile              *target_dir)
+{
+	GFile	    *result;
+	const char  *escaped;
+	char        *unescaped;
+	char        *filename;
+	
+	if (idata->no_preview)
+		result = get_image_file (ce, idata, target_dir);
+	else {
+		escaped = file_name_from_path (idata->dest_filename);
+		unescaped = g_uri_unescape_string (escaped, NULL);
+		filename = g_strconcat (unescaped, ".medium", ".jpeg", NULL);
+		g_free (unescaped);
+		
+		result = get_album_file (ce, target_dir, ce->ad->previews, filename);
+		g_free (filename);	
+	}
+	
+	return result;		
+}
+
+
+
+static char*
+get_current_date (void)
+{
+	time_t     t;
+	struct tm *tp;
+	char       s[100];
+
+	t = time (NULL);
+	tp = localtime (&t);
+	strftime (s, 99, DATE_FORMAT, tp);
+
+	return g_locale_to_utf8 (s, -1, 0, 0, 0);
+}
+
+
+static int
+is_alpha_string (char   *s,
+		 size_t  maxlen)
+{
+	if (s == NULL)
+		return 0;
+
+	while ((maxlen > 0) && (*s != '\0') && isalpha (*s)) {
+		maxlen--;
+		s++;
+	}
+
+	return ((maxlen == 0) || (*s == '\0'));
+}
+
+
+static char*
+get_current_language (void)
+{
+	char   *language = NULL;
+	char   *tmp_locale;
+	char   *locale;
+	char   *underline;
+	size_t  len;
+
+	tmp_locale = setlocale (LC_ALL, NULL);
+	if (tmp_locale == NULL)
+		return NULL;
+	locale = g_strdup (tmp_locale);
+
+	/* FIXME: complete LC_ALL -> RFC 3066 */
+
+	underline = strchr (locale, '_');
+	if (underline != NULL)
+		*underline = '\0';
+
+	len = strlen (locale);
+	if (((len == 2) || (len == 3)) && is_alpha_string (locale, len))
+		language = g_locale_to_utf8 (locale, -1, 0, 0, 0);
+
+	g_free (locale);
+
+	return language;
+}
+
+
+static char *
+get_hf_text (const char *utf8_text)
+{
+	const char *s;
+	GString    *r;
+	char       *r_str;
+
+	if (utf8_text == NULL)
+		return NULL;
+
+	if (g_utf8_strchr (utf8_text,  -1, '%') == NULL)
+		return g_strdup (utf8_text);
+
+	r = g_string_new (NULL);
+	for (s = utf8_text; *s != 0; s = g_utf8_next_char (s)) {
+		gunichar ch = g_utf8_get_char (s);
+
+		if (ch == '%') {
+			s = g_utf8_next_char (s);
+
+			if (*s == 0) {
+				g_string_append_unichar (r, ch);
+				break;
+			}
+
+			ch = g_utf8_get_char (s);
+			switch (ch) {
+				char *t;
+
+			case '%':
+				g_string_append (r, "%");
+				break;
+
+			case 'd':
+				t = get_current_date ();
+				g_string_append (r, t);
+				g_free (t);
+				break;
+			}
+		} else
+			g_string_append_unichar (r, ch);
+	}
+
+	r_str = r->str;
+	g_string_free (r, FALSE);
+
+	return r_str;
+}
+
+
+
+static GthAttrImageType
+get_attr_image_type_from_tag (CatalogWebExporter *ce,
+			      GthTag             *tag)
+{
+	if (gth_tag_get_var (ce, tag, "thumbnail") != 0)
+		return GTH_IMAGE_TYPE_THUMBNAIL;
+	
+	if (gth_tag_get_var (ce, tag, "preview") != 0)
+		return GTH_IMAGE_TYPE_PREVIEW;
+	
+	return GTH_IMAGE_TYPE_IMAGE;
+}
+
+
+static void
+gth_parsed_doc_print (GList               *document,
+		      GFile		  *relative_to,
+		      CatalogWebExporter  *ce,
+		      GFileOutputStream   *ostream, 
+		      GError             **error,
+		      gboolean             allow_table)
+{
+	GList *scan;
+
+	for (scan = document; scan; scan = scan->next) {
+		GthTag     *tag = scan->data;
+		ImageData  *idata;
+		GFile      *file;
+		GFile      *dir;
+		char       *line = NULL;
+		char       *image_src = NULL;
+		char       *unescaped_path = NULL;
+		int         idx;
+		int         image_width;
+		int         image_height;
+		int         max_size;
+		int         r, c;
+		int         value;
+		const char *src;
+		char       *src_attr;
+		const char *class = NULL;
+		char       *class_attr = NULL;
+		const char *alt = NULL;
+		char       *alt_attr = NULL;
+		const char *id = NULL;
+		char       *id_attr = NULL;
+		gboolean   relative;
+		GList      *scan;
+
+
+		if (error != NULL && *error != NULL)
+			return;
+		
+		switch (tag->type) {
+		case GTH_TAG_HEADER:
+			line = get_hf_text (ce->header);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_FOOTER:
+			line = get_hf_text (ce->footer);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_LANGUAGE:
+			line = get_current_language ();
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_THEME_LINK:
+			src = gth_tag_get_str (ce, tag, "src");
+			if (src == NULL)
+				break;
+			
+			file = get_theme_file (ce, 
+					       ce->target_dir,
+					       src);
+			line = gfile_get_relative_uri (file, relative_to);
+			
+			write_markup_escape_line (ostream, error, line);
+			
+			g_object_unref (file);
+			break;
+		
+		case GTH_TAG_IMAGE:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+
+			switch (get_attr_image_type_from_tag (ce, tag)) {
+			case GTH_IMAGE_TYPE_THUMBNAIL:
+				file = get_thumbnail_file (ce, 
+							   idata, 
+							   ce->target_dir);
+				image_width = idata->thumb_width;
+				image_height = idata->thumb_height;
+				break;
+				
+			case GTH_IMAGE_TYPE_PREVIEW:
+				file = get_preview_file (ce, 
+							 idata, 
+							 ce->target_dir);
+				image_width = idata->preview_width;
+				image_height = idata->preview_height;
+				break;
+			
+			case GTH_IMAGE_TYPE_IMAGE:
+				file = get_image_file (ce, 
+						       idata, 
+						       ce->target_dir);
+				image_width = idata->image_width;
+				image_height = idata->image_height;
+				break;
+			}
+			
+			image_src = gfile_get_relative_uri (file, relative_to);
+			src_attr = _g_escape_text_for_html (image_src, -1);
+
+			class = gth_tag_get_str (ce, tag, "class");
+			if (class)
+				class_attr = g_strdup_printf (" class=\"%s\"", class);
+			else
+				class_attr = g_strdup ("");
+
+			max_size = gth_tag_get_var (ce, tag, "max_size");
+			if (max_size > 0)
+				scale_keeping_ratio (&image_width,
+						     &image_height,
+						     max_size,
+						     max_size,
+						     FALSE);
+
+			alt = gth_tag_get_str (ce, tag, "alt");
+			if (alt != NULL)
+				alt_attr = g_strdup (alt);
+			else {
+				char *unescaped_path;
+				
+				unescaped_path = g_uri_unescape_string (image_src, NULL);
+				alt_attr = _g_escape_text_for_html (unescaped_path, -1);
+				g_free (unescaped_path);
+			}
+
+			id = gth_tag_get_str (ce, tag, "id");
+			if (id != NULL)
+				id_attr = g_strdup_printf (" id=\"%s\"", id);
+			else
+				id_attr = g_strdup ("");
+
+			line = g_strdup_printf ("<img src=\"%s\" alt=\"%s\" width=\"%d\" height=\"%d\"%s%s />",
+						src_attr,
+						alt_attr,
+						image_width,
+						image_height,
+						id_attr,
+						class_attr);
+			write_line (ostream, error, line);
+
+			g_free (src_attr);
+			g_free (id_attr);
+			g_free (alt_attr);
+			g_free (class_attr);
+			g_free (image_src);
+			g_object_unref (file);
+			break;
+
+		case GTH_TAG_IMAGE_LINK:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			file = get_html_image_file (ce, 
+						    idata, 
+						    ce->target_dir);
+			line = gfile_get_relative_uri (file, relative_to);
+			write_markup_escape_line (ostream, error, line);
+
+			g_object_unref (file);
+			break;
+
+		case GTH_TAG_IMAGE_IDX:
+			line = g_strdup_printf ("%d", get_image_idx (tag, ce) + 1);
+			write_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_IMAGE_DIM:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = g_strdup_printf ("%dx%d",
+						idata->image_width,
+						idata->image_height);
+			write_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_IMAGES:
+			line = g_strdup_printf ("%d", ce->n_images);
+			write_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_FILENAME:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+
+			switch (get_attr_image_type_from_tag (ce, tag)) {
+			case GTH_IMAGE_TYPE_THUMBNAIL:
+				file = get_thumbnail_file (ce, 
+							   idata, 
+							   ce->target_dir);
+				break;
+				
+			case GTH_IMAGE_TYPE_PREVIEW:
+				file = get_preview_file (ce, 
+							 idata, 
+							 ce->target_dir);
+				break;
+			
+			case GTH_IMAGE_TYPE_IMAGE:
+				file = get_image_file (ce, 
+						       idata, 
+						       ce->target_dir);
+				break;
+			}
+			
+			relative = (gth_tag_get_var (ce, tag, "with_relative_path") != 0);
+			
+			if (relative)
+				unescaped_path = gfile_get_relative_path (file, 
+									 relative_to);
+			else
+				unescaped_path = gfile_get_path (file);
+				
+			
+			if (relative || (gth_tag_get_var (ce, tag, "with_path") != 0)) {
+				line = unescaped_path;
+			} else {
+				line = g_strdup (file_name_from_path (unescaped_path));
+				g_free (unescaped_path);
+			}
+
+			if  (gth_tag_get_var (ce, tag, "utf8") != 0)
+				write_markup_escape_locale_line (ostream, error, line);
+			else
+				write_markup_escape_line (ostream, error, line);
+
+			g_object_unref (file);
+			break;
+
+		case GTH_TAG_FILEPATH:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+
+			switch (get_attr_image_type_from_tag (ce, tag)) {
+			case GTH_IMAGE_TYPE_THUMBNAIL:
+				file = get_thumbnail_file (ce, 
+							   idata, 
+							   ce->target_dir);
+				break;
+				
+			case GTH_IMAGE_TYPE_PREVIEW:
+				file = get_preview_file (ce, 
+							 idata, 
+							 ce->target_dir);
+				break;
+			
+			case GTH_IMAGE_TYPE_IMAGE:
+				file = get_image_file (ce, 
+						       idata, 
+						       ce->target_dir);
+				break;
+			}
+
+			dir = g_file_get_parent (file);
+			
+			relative = (gth_tag_get_var (ce, tag, "relative_path") != 0);
+
+			if (relative)
+				line = gfile_get_relative_path (dir, 
+							       relative_to);
+			else
+				line = gfile_get_path (dir);
+
+			if  (gth_tag_get_var (ce, tag, "utf8") != 0)
+				write_markup_escape_locale_line (ostream, error, line);
+			else
+				write_markup_escape_line (ostream, error, line);
+
+			g_object_unref (dir);
+			g_object_unref (file);
+			break;
+
+		case GTH_TAG_FILESIZE:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = g_format_size_for_display (idata->src_file->size);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_COMMENT:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+
+			if (idata->comment == NULL)
+				break;
+
+			max_size = gth_tag_get_var (ce, tag, "max_size");
+			if (max_size <= 0)
+				line = g_strdup (idata->comment);
+			else {
+				char *comment;
+				
+				comment = g_strndup (idata->comment, max_size);
+				if (strlen (comment) < strlen (idata->comment))
+					line = g_strconcat (comment, "...", NULL);
+				else
+					line = g_strdup (comment);
+				g_free (comment);
+			}
+
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_PLACE:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+
+			if (idata->place == NULL)
+				break;
+
+			max_size = gth_tag_get_var (ce, tag, "max_size");
+			if (max_size <= 0)
+				line = g_strdup (idata->place);
+			else 
+			{
+				char *place = g_strndup (idata->place, max_size);
+				if (strlen (place) < strlen (idata->place))
+					line = g_strconcat (place, "...", NULL);
+				else
+					line = g_strdup (place);
+				g_free (place);
+			}
+
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_DATE_TIME:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+			
+			if (idata->date_time == NULL)
+				break;
+
+			max_size = gth_tag_get_var (ce, tag, "max_size");
+			if (max_size <= 0)
+				line = g_strdup (idata->date_time);
+			else {
+				char *date_time = g_strndup (idata->date_time, max_size);
+				if (strlen (date_time) < strlen (idata->date_time))
+					line = g_strconcat (date_time, "...", NULL);
+				else
+					line = g_strdup (date_time);
+				g_free (date_time);
+			}
+
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_PAGE_LINK:
+			if (gth_tag_get_var (ce, tag, "image_idx") != 0) {
+				int image_idx;
+				image_idx = get_image_idx (tag, ce);
+				idx = get_page_idx_from_image_idx (ce, image_idx);
+			} 
+			else
+				idx = get_page_idx (tag, ce);
+
+			file = get_html_index_file (ce, 
+						    idx, 
+						    ce->target_dir);
+			line = gfile_get_relative_uri (file, relative_to);
+			write_markup_escape_line (ostream, error, line);
+
+			g_object_unref (file);
+			break;
+
+		case GTH_TAG_PAGE_IDX:
+			line = g_strdup_printf ("%d", get_page_idx (tag, ce) + 1);
+			write_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_PAGE_ROWS:
+			line = g_strdup_printf ("%d", ce->page_rows);
+			write_line (ostream, error, line);
+			break;
+			
+		case GTH_TAG_PAGE_COLS:
+			line = g_strdup_printf ("%d", ce->page_cols);
+			write_line (ostream, error, line);
+			break;
+			
+		case GTH_TAG_PAGES:
+			line = g_strdup_printf ("%d", ce->n_pages);
+			write_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_TABLE:
+			if (! allow_table)
+				break;
+
+			if (ce->single_index)
+				ce->page_rows = (ce->n_images + ce->page_cols - 1) / ce->page_cols;
+
+			/* this may not work correctly if single_index is set */
+			for (r = 0; r < ce->page_rows; r++) {
+				if (ce->image < ce->n_images)
+					write_line (ostream, error, "  <tr class=\"tr_index\">\n");
+				else
+					write_line (ostream, error, "  <tr class=\"tr_empty_index\">\n");
+				for (c = 0; c < ce->page_cols; c++) {
+					if (ce->image < ce->n_images) {
+						write_line (ostream, error, "    <td class=\"td_index\">\n");
+						gth_parsed_doc_print (ce->thumbnail_parsed,
+								      relative_to,
+								      ce,
+								      ostream,
+								      error,
+								      FALSE);
+						write_line (ostream, error, "    </td>\n");
+						ce->image++;
+					} 
+					else {
+						write_line (ostream, error, "    <td class=\"td_empty_index\">\n");
+						write_line (ostream, error, "    &nbsp;\n");
+						write_line (ostream, error, "    </td>\n");
+					}
+				}
+				write_line (ostream, error, "  </tr>\n");
+			}
+			break;
+
+		case GTH_TAG_THUMBS:
+			if (! allow_table)
+				break;
+
+			for (r = 0; r < (ce->single_index ? ce->n_images : ce->page_rows * ce->page_cols); r++)
+			{
+				if (ce->image >= ce->n_images)
+					break;
+				gth_parsed_doc_print (ce->thumbnail_parsed, 
+						      relative_to,
+						      ce,
+						      ostream,
+						      error,
+						      FALSE);
+				ce->image++;
+			}
+			break;
+
+		case GTH_TAG_DATE:
+			line = get_current_date ();
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_HTML:
+			write_line (ostream, error, tag->value.html);
+			break;
+
+		case GTH_TAG_EXIF_EXPOSURE_TIME:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file, 
+							    TAG_NAME_SETS[EXPTIME_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_EXIF_EXPOSURE_MODE:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file,
+							    TAG_NAME_SETS[EXPMODE_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_EXIF_FLASH:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file,
+					     		    TAG_NAME_SETS[FLASH_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_EXIF_SHUTTER_SPEED:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file,
+							    TAG_NAME_SETS[SHUTTERSPEED_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_EXIF_APERTURE_VALUE:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file,
+							    TAG_NAME_SETS[APERTURE_TAG_NAMES]); 
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_EXIF_FOCAL_LENGTH:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file,
+					     		    TAG_NAME_SETS[FOCAL_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_EXIF_DATE_TIME:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			{
+				time_t     t;
+				struct tm *tp;
+				char s[100];
+
+				t = get_exif_time (idata->src_file);
+				if (t != 0) {
+					tp = localtime (&t);
+					strftime (s, 99, DATE_FORMAT, tp);
+					line = g_locale_to_utf8 (s, -1, 0, 0, 0);
+					write_markup_escape_line (ostream, error, line);
+				} 
+				else
+					write_line (ostream, error, "-");
+
+			}
+			break;
+
+		case GTH_TAG_EXIF_CAMERA_MODEL:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			line = get_metadata_tagset_string (idata->src_file,
+							    TAG_NAME_SETS[MAKE_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			g_free (line);
+
+			write_line (ostream, error, " &nbsp; ");
+
+			line = get_metadata_tagset_string (idata->src_file,
+					    		    TAG_NAME_SETS[MODEL_TAG_NAMES]);
+			write_markup_escape_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_SET_VAR:
+			break;
+
+		case GTH_TAG_EVAL:
+			idx = get_image_idx (tag, ce);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+
+			value = gth_tag_get_var (ce, tag, "expr");
+
+			line = g_strdup_printf ("%d", value);
+			write_line (ostream, error, line);
+			break;
+
+		case GTH_TAG_IF:
+			idx = MIN (ce->image, ce->n_images - 1);
+			idata = g_list_nth (ce->file_list, idx)->data;
+			ce->eval_image = idata;
+			
+			for (scan = tag->value.cond_list; scan; scan = scan->next) {
+				GthCondition *cond = scan->data;
+				if (expression_value (ce, cond->expr) != 0) {
+					gth_parsed_doc_print (cond->document,
+							      relative_to,
+							      ce,
+							      ostream,
+							      error,
+							      FALSE);
+					break;
+				}
+			}
+			break;
+
+		case GTH_TAG_TEXT:
+			if ((tag->value.arg_list == NULL) && (tag->document != NULL)) {
+				GthTag *child = tag->document->data;
+
+				if (child->type != GTH_TAG_HTML)
+					break;
+				line = g_strdup (_(child->value.html));
+				write_markup_escape_line (ostream, error, line);
+			}
+			break;
+
+		default:
+			break;
+		}
+
+		g_free (line);
+	}
+}
+
+
+
+static gboolean
+gfile_parsed_doc_print (CatalogWebExporter *ce,
+                        GList              *document,
+                        GFile              *file,
+			GFile              *relative_to)
+{
+        GFileOutputStream  *ostream;
+        GError             *error = NULL;
+        gboolean            result;
+
+	gfile_debug (DEBUG_INFO, "save html file", file);
+
+        ostream = g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &error);
+        
+        if (error) {
+                gfile_warning ("Cannot open html file for writing",
+                               file,
+                               error);
+        }
+        else {
+		gth_parsed_doc_print (document,
+				      relative_to,
+				      ce, 
+				      ostream,
+				      &error,
+				      TRUE);
+	} 
+
+	g_output_stream_close (G_OUTPUT_STREAM(ostream), NULL, &error);
+	g_object_unref (ostream);
+	
+	result = (error == NULL);
+	g_clear_error (&error);
+
+	return result;
+}
+
+
+static void
+exporter_set_info (CatalogWebExporter *ce,
+		   const char         *info)
+{
+	g_free (ce->info);
+	ce->info = g_strdup (info);
+	g_signal_emit (G_OBJECT (ce), catalog_web_exporter_signals[WEB_EXPORTER_INFO],
+		       0,
+		       ce->info);
+}
+
+
+static void
+export__final_step (GError 	   *error,
+		    gpointer        data)
+{
+	CatalogWebExporter *ce = data;
+
+	free_parsed_docs (ce);
+	g_signal_emit (G_OBJECT (ce), catalog_web_exporter_signals[WEB_EXPORTER_DONE], 0);
+}
+
+
+static void
+export__copy_to_destination__step2 (GError 	   *error,
+				    gpointer        data)
+{
+	CatalogWebExporter *ce = data;
+
+	debug (DEBUG_INFO, "result: %s", error->message);
+
+	if (error != NULL)
+		_gtk_error_dialog_run (GTK_WINDOW (ce->window),
+				       "%s",
+				       error->message);
+
+	dlg_folder_delete (ce->window,
+			   ce->base_tmp_dir,
+			   export__final_step,
+			   ce);
+}
+
+
+static gboolean
+export__copy_to_destination (gpointer data)
+{
+	CatalogWebExporter *ce = data;
+
+	g_signal_emit (G_OBJECT (ce), catalog_web_exporter_signals[WEB_EXPORTER_START_COPYING], 0);
+
+	dlg_folder_copy (ce->window,
+			 ce->base_tmp_dir,
+			 ce->base_dir,
+			 FALSE,
+			 FALSE,
+			 TRUE,
+			 export__copy_to_destination__step2,
+			 ce);
+	return FALSE;
+}
+
+
+static int
+export__save_other_files__progress_update_cb (GnomeVFSXferProgressInfo *info,
+					      gpointer                  data)
+{
+	CatalogWebExporter *ce = data;
+
+	if (info->status != GNOME_VFS_XFER_PROGRESS_STATUS_OK) {
+		ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+						    export__copy_to_destination,
+						    ce);
+		return FALSE;
+
+	} else if (info->phase == GNOME_VFS_XFER_PHASE_COMPLETED) {
+		ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+						    export__copy_to_destination,
+						    ce);
+	}
+
+	return TRUE;
+}
+
+
+static void
+export__save_other_files (CatalogWebExporter *ce)
+{
+	GFileEnumerator  *file_enum;
+	GError           *error = NULL;
+		
+	file_enum = g_file_enumerate_children (ce->style_dir,
+					       G_FILE_ATTRIBUTE_STANDARD_NAME ","
+					       G_FILE_ATTRIBUTE_STANDARD_TYPE,
+					       0, NULL, &error);
+
+	if (error != NULL) {
+		gfile_warning ("Cannot enumerate style directory", 
+			       ce->style_dir, 
+			       error);
+		g_error_free (error);
+	}
+	else {
+		GList *source_uri_list = NULL;
+		GList *target_uri_list = NULL;
+		
+		gboolean enumerate = TRUE;
+		
+		while (enumerate) {
+	
+			GFileInfo        *info;
+	
+			info = g_file_enumerator_next_file (file_enum, NULL, &error);
+			
+			/* error during enumeration */
+			
+			if (error != NULL) {
+				gfile_warning ("Error during enumeration of style directory", 
+					       ce->style_dir, 
+					       error);
+				g_error_free (error);
+				enumerate = FALSE;
+			}
+			
+			/* no more files */
+			
+			else if (info == NULL) {
+				enumerate = FALSE;
+			}
+			
+			/* OK, got a file */
+			
+			else {
+				const char       *name;
+				char		 *target_filename, *source_filename;
+				GFile            *source_file, *target_file;
+				GnomeVFSURI	 *source_uri = NULL, *target_uri = NULL;
+				
+				if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
+					continue;
+		
+				name = g_file_info_get_name (info);
+				
+				if ((strcmp (name, "index.gthtml") == 0)
+				    || (strcmp (name, "thumbnail.gthtml") == 0)
+				    || (strcmp (name, "image.gthtml") == 0))
+					continue;
+		
+				source_file = gfile_append_path (ce->style_dir,
+								 name,
+								 NULL);
+				target_file = get_theme_file (ce, 
+							      ce->target_tmp_dir,
+							      name);
+		
+				source_filename = gfile_get_uri (source_file);
+				source_uri = gnome_vfs_uri_new (source_filename);
+				
+				target_filename = gfile_get_uri (target_file);
+				target_uri = gnome_vfs_uri_new (target_filename);
+				
+				source_uri_list = g_list_prepend (source_uri_list, source_uri);
+				target_uri_list = g_list_prepend (target_uri_list, target_uri);
+		
+				gfile_debug (DEBUG_INFO, "save file", source_file);
+		
+				g_free (source_filename);
+				g_free (target_filename);
+				g_object_unref (source_file);
+				g_object_unref (target_file);
+				
+				g_object_unref (info);
+			}
+		}
+		
+		g_object_unref (file_enum);
+		
+		if (source_uri_list != NULL) {
+			
+			GnomeVFSXferOptions        xfer_options;
+			GnomeVFSXferErrorMode      xfer_error_mode;
+			GnomeVFSXferOverwriteMode  overwrite_mode;
+			GnomeVFSResult             result;
+			
+			xfer_options    = 0;
+			xfer_error_mode = GNOME_VFS_XFER_ERROR_MODE_ABORT;
+			overwrite_mode  = GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE;
+	
+			result = gnome_vfs_xfer_uri_list (source_uri_list,
+							  target_uri_list,
+							  xfer_options,
+							  xfer_error_mode,
+							  overwrite_mode,
+							  export__save_other_files__progress_update_cb,
+							  ce);
+		}
+		
+		if (source_uri_list != NULL)
+			gnome_vfs_uri_list_free (source_uri_list);
+		if (target_uri_list != NULL)
+			gnome_vfs_uri_list_free (target_uri_list);
+	}
+}
+
+
+static gboolean
+save_thumbnail_cb (gpointer data)
+{
+	CatalogWebExporter *ce = data;
+	ImageData          *idata;
+	
+	if (ce->saving_timeout != 0) {
+		g_source_remove (ce->saving_timeout);
+		ce->saving_timeout = 0;
+	}
+
+	if (ce->current_image == NULL) {
+		export__save_other_files (ce);
+		return FALSE;
+	}
+
+	idata = ce->current_image->data;
+		
+	if (idata->thumb != NULL) {
+		GFile *file;
+		GFile *src_local_gfile = g_file_new_for_uri (idata->src_file->path);
+		char  *local_file;
+		char  *src_local_file;
+
+		g_signal_emit (G_OBJECT (ce),
+			       catalog_web_exporter_signals[WEB_EXPORTER_PROGRESS],
+			       0,
+			       (float) ce->image / ce->n_images);
+
+		file = get_thumbnail_file (ce, 
+					   idata, 
+					   ce->target_tmp_dir);
+		local_file = gfile_get_path (file);
+		src_local_file = gfile_get_path (src_local_gfile);
+		
+		debug (DEBUG_INFO, "save thumbnail: %s", local_file);
+
+		_gdk_pixbuf_save (idata->thumb,
+				  local_file,
+				  src_local_file,
+				  "jpeg",
+				  NULL, NULL); 
+
+		g_object_unref (file);
+		g_object_unref (src_local_gfile);
+		g_free (local_file);
+		g_free (src_local_file);
+		
+		g_object_unref (idata->thumb);
+		idata->thumb = NULL;
+	}
+
+	/**/
+
+	ce->current_image = ce->current_image->next;
+	ce->image++;
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_thumbnail_cb,
+					    data);
+
+	return FALSE;
+}
+
+
+static void
+export__save_thumbnails (CatalogWebExporter *ce)
+{
+	exporter_set_info (ce, _("Saving thumbnails"));
+
+	ce->image = 0;
+	ce->current_image = ce->file_list;
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_thumbnail_cb,
+					    ce);
+}
+
+
+
+static gboolean
+save_html_image_cb (gpointer data)
+{
+	CatalogWebExporter *ce = data;
+	ImageData          *idata;
+	GFile              *file;
+	GFile              *relative_to;
+
+	if (ce->saving_timeout != 0) {
+		g_source_remove (ce->saving_timeout);
+		ce->saving_timeout = 0;
+	}
+
+	if (ce->current_image == NULL) {
+		export__save_thumbnails (ce);
+		return FALSE;
+	}
+
+	idata = ce->current_image->data;
+
+	g_signal_emit (G_OBJECT (ce),
+		       catalog_web_exporter_signals[WEB_EXPORTER_PROGRESS],
+		       0,
+		       (float) ce->image / ce->n_images);
+
+	file = get_html_image_file (ce, 
+				    idata, 
+				    ce->target_tmp_dir);
+	
+	
+	relative_to = get_html_image_dir (ce, 
+					  ce->target_dir);
+	
+
+	gfile_parsed_doc_print (ce, ce->image_parsed, file, relative_to);
+
+	g_object_unref (file);
+	g_object_unref (relative_to);
+
+	/**/
+
+	ce->current_image = ce->current_image->next;
+	ce->image++;
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_html_image_cb,
+					    data);
+
+	return FALSE;
+}
+
+
+static void
+export__save_html_files__step2 (CatalogWebExporter *ce)
+{
+	exporter_set_info (ce, _("Saving HTML pages: Images"));
+
+	ce->image = 0;
+	ce->current_image = ce->file_list;
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_html_image_cb,
+					    ce);
+}
+
+
+static gboolean
+save_html_index_cb (gpointer data)
+{
+	CatalogWebExporter *ce = data;
+	GFile              *file;
+	GFile              *relative_to;
+
+	if (ce->saving_timeout != 0) {
+		g_source_remove (ce->saving_timeout);
+		ce->saving_timeout = 0;
+	}
+
+	if (ce->page >= ce->n_pages) {
+		export__save_html_files__step2 (ce);
+		return FALSE;
+	}
+	
+	/* write index.html and pageXXX.html */
+	
+	g_signal_emit (G_OBJECT (ce),
+		       catalog_web_exporter_signals[WEB_EXPORTER_PROGRESS],
+		       0,
+		       (float) ce->page / ce->n_pages);
+
+	relative_to = get_html_index_dir (ce, 
+					  ce->page, 
+					  ce->target_dir);
+	
+	file = get_html_index_file (ce,
+				    ce->page, 
+				    ce->target_tmp_dir);
+
+	gfile_parsed_doc_print (ce, ce->index_parsed, file, relative_to);
+
+	g_object_unref (file);
+	g_object_unref (relative_to);
+
+	/**/
+
+	ce->page++;
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_html_index_cb,
+					    data);
+
+	return FALSE;
+}
+
+
+static void
+export__save_html_files (CatalogWebExporter *ce)
+{
+	exporter_set_info (ce, _("Saving HTML pages: Indexes"));
+
+	ce->image = 0;
+	ce->eval_image = NULL;
+	ce->page = 0;
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_html_index_cb,
+					    ce);
+}
+
+
+static void
+load_next_file (CatalogWebExporter *ce)
+{
+	if (ce->interrupted) {
+		if (ce->file_list != NULL) {
+			g_list_foreach (ce->file_list,
+					(GFunc) image_data_free,
+					NULL);
+			g_list_free (ce->file_list);
+			ce->file_list = NULL;
+		}
+		dlg_folder_delete (ce->window,
+				   ce->base_tmp_dir,
+				   export__final_step,
+				   ce);
+		return;
+	}
+
+	/**/
+
+	if (ce->file_to_load != NULL) {
+		ImageData *idata = ce->file_to_load->data;
+
+		if (idata->preview != NULL) {
+			g_object_unref (idata->preview);
+			idata->preview = NULL;
+		}
+
+		if (idata->image != NULL) {
+			g_object_unref (idata->image);
+			idata->image = NULL;
+		}
+	}
+
+	/**/
+
+	g_signal_emit (G_OBJECT (ce),
+		       catalog_web_exporter_signals[WEB_EXPORTER_PROGRESS],
+		       0,
+		       (float) ++ce->n_images_done / ce->n_images);
+
+	ce->file_to_load = ce->file_to_load->next;
+	
+	if (ce->file_to_load != NULL) {
+		FileData *file;
+		
+		file = IMAGE_DATA (ce->file_to_load->data)->src_file;
+		image_loader_set_file (ce->iloader, file);
+		image_loader_start (ce->iloader);
+		
+		return;
+	}
+
+	/* sort the list */
+
+	if ((ce->sort_method != GTH_SORT_METHOD_NONE)
+	    && (ce->sort_method != GTH_SORT_METHOD_MANUAL))
+		ce->file_list = g_list_sort (ce->file_list, get_sortfunc (ce));
+	if (ce->sort_type == GTK_SORT_DESCENDING)
+		ce->file_list = g_list_reverse (ce->file_list);
+
+	export__save_html_files (ce);
+}
+
+
+static gboolean
+save_image_preview_cb (gpointer data)
+{
+	CatalogWebExporter *ce = data;
+
+	if (ce->saving_timeout != 0) {
+		g_source_remove (ce->saving_timeout);
+		ce->saving_timeout = 0;
+	}
+
+	if (ce->file_to_load != NULL) {
+		ImageData *idata = ce->file_to_load->data;
+
+		if ((! idata->no_preview) && (idata->preview != NULL)) {
+			GFile *file;
+			GFile *src_local_gfile = g_file_new_for_uri (idata->src_file->path);
+			char  *local_file;
+			char  *src_local_file;
+
+			file = get_preview_file (ce, 
+						 idata, 
+						 ce->target_tmp_dir);
+			local_file = gfile_get_path (file);
+			src_local_file = gfile_get_path (src_local_gfile);
+
+			debug (DEBUG_INFO, "saving preview: %s", local_file);
+
+			_gdk_pixbuf_save (idata->preview,
+					  local_file,
+					  src_local_file,
+					  "jpeg",
+					  NULL, NULL);
+			 
+			g_free (local_file);
+			g_free (src_local_file);
+			g_object_unref (file);
+			g_object_unref (src_local_gfile);
+		}
+	}
+
+	load_next_file (ce);
+
+	return FALSE;
+}
+
+
+static gboolean
+save_resized_image_cb (gpointer data)
+{
+	CatalogWebExporter *ce = data;
+
+	if (ce->saving_timeout != 0) {
+		g_source_remove (ce->saving_timeout);
+		ce->saving_timeout = 0;
+	}
+
+	if (ce->file_to_load != NULL) {
+		ImageData *idata = ce->file_to_load->data;
+
+		if (ce->copy_images && (idata->image != NULL)) {
+			GFile *file;
+			GFile *src_local_gfile = g_file_new_for_uri (idata->src_file->path);
+			char  *image_uri;
+			char  *local_file; 
+			char  *src_local_file;
+
+			exporter_set_info (ce, _("Saving images"));
+			
+			file = get_image_file (ce, 
+					       idata, 
+					       ce->target_tmp_dir);
+			image_uri = gfile_get_uri (file);
+			local_file = gfile_get_path (file);
+			src_local_file = gfile_get_path (src_local_gfile);
+
+			debug (DEBUG_INFO, "saving image: %s", local_file);
+
+			if (_gdk_pixbuf_save (idata->image,
+					      local_file,
+					      src_local_file,
+					      "jpeg",
+					      NULL, NULL)) {
+				idata->src_file->size = get_file_size (image_uri);
+			} 
+			
+			g_free (local_file);
+			g_free (src_local_file);
+			g_free (image_uri);
+			g_object_unref (file);
+			g_object_unref (src_local_gfile);
+		}
+	}
+
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_image_preview_cb,
+					    ce);
+
+	return FALSE;
+}
+
+
+static void
+export__copy_image (CatalogWebExporter *ce)
+{
+	ImageData  *idata;
+	GFile      *sfile;
+	GFile      *dfile;
+	gboolean    copy_done;
+
+	/* This function is used when "Copy originals to destination" is
+	   enabled, and resizing is NOT enabled. This allows us to use a
+	   lossless copy (and rotate). When resizing is enabled, a lossy
+	   save has to be used. */
+
+	exporter_set_info (ce, _("Copying original images"));
+
+	idata = ce->file_to_load->data;
+
+	sfile = gfile_new (idata->src_file->path);
+	
+	dfile = get_image_file (ce, 
+			        idata, 
+			        ce->target_tmp_dir);
+		
+	copy_done = gfile_copy (sfile, dfile);
+
+	if (copy_done) {
+		if (gfile_image_is_jpeg (dfile)) {
+			char *uri;
+			uri = gfile_get_uri (dfile);
+		
+			GthTransform  transform;
+		
+			FileData *fd;
+			fd = file_data_new (uri);
+			transform = get_orientation_from_fd (fd);
+			
+			if (transform > 1) {
+				apply_transformation_jpeg (fd,
+							   transform,
+							   JPEG_MCU_ACTION_TRIM,
+							   NULL);
+			}
+
+			file_data_unref (fd);
+			g_free (uri);
+		}
+	}
+	
+	g_object_unref (sfile);
+	g_object_unref (dfile);
+	
+	ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+					    save_image_preview_cb,
+					    ce);	
+}
+
+
+static GdkPixbuf *
+pixbuf_scale (const GdkPixbuf *src,
+	      int              dest_width,
+	      int              dest_height,
+	      GdkInterpType    interp_type)
+{
+	GdkPixbuf *dest;
+
+	if (! gdk_pixbuf_get_has_alpha (src))
+		return gdk_pixbuf_scale_simple (src, dest_width, dest_height, interp_type);
+
+	g_return_val_if_fail (src != NULL, NULL);
+	g_return_val_if_fail (dest_width > 0, NULL);
+	g_return_val_if_fail (dest_height > 0, NULL);
+
+	dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, gdk_pixbuf_get_has_alpha (src), 8, dest_width, dest_height);
+	if (dest == NULL)
+		return NULL;
+
+	gdk_pixbuf_composite_color (src,
+				    dest,
+				    0, 0, dest_width, dest_height, 0, 0,
+				    (double) dest_width / gdk_pixbuf_get_width (src),
+				    (double) dest_height / gdk_pixbuf_get_height (src),
+				    interp_type,
+				    255,
+				    0, 0,
+				    200,
+				    0xFFFFFF,
+				    0xFFFFFF);
+
+	return dest;
+}
+
+
+static void
+image_loader_done (ImageLoader *iloader,
+		   gpointer     data)
+{
+	CatalogWebExporter *ce = data;
+	GdkPixbuf          *pixbuf;
+	ImageData          *idata;
+
+	idata = (ImageData*) ce->file_to_load->data;
+
+	/* image */
+
+	idata->image = pixbuf = image_loader_get_pixbuf (iloader);
+	g_object_ref (idata->image);
+
+	if (ce->copy_images && ce->resize_images) {
+		int w = gdk_pixbuf_get_width (pixbuf);
+		int h = gdk_pixbuf_get_height (pixbuf);
+		if (scale_keeping_ratio (&w, &h, ce->resize_max_width, ce->resize_max_height, FALSE)) {
+			GdkPixbuf *scaled;
+			scaled = pixbuf_scale (pixbuf, w, h, GDK_INTERP_BILINEAR);
+			g_object_unref (idata->image);
+			idata->image = scaled;
+		}
+	}
+
+	idata->image_width = gdk_pixbuf_get_width (idata->image);
+	idata->image_height = gdk_pixbuf_get_height (idata->image);
+
+	/* preview */
+
+	idata->preview = pixbuf = image_loader_get_pixbuf (iloader);
+	g_object_ref (idata->preview);
+
+	if ((ce->preview_max_width > 0) && (ce->preview_max_height > 0)) {
+		int w = gdk_pixbuf_get_width (pixbuf);
+		int h = gdk_pixbuf_get_height (pixbuf);
+
+		if (scale_keeping_ratio_min (&w, &h,
+					     ce->preview_min_width,
+					     ce->preview_min_height,
+					     ce->preview_max_width,
+					     ce->preview_max_height,
+					     FALSE))
+		{
+			GdkPixbuf *scaled;
+			scaled = pixbuf_scale (pixbuf, w, h, GDK_INTERP_BILINEAR);
+			g_object_unref (idata->preview);
+			idata->preview = scaled;
+		}
+	}
+
+	idata->preview_width = gdk_pixbuf_get_width (idata->preview);
+	idata->preview_height = gdk_pixbuf_get_height (idata->preview);
+
+	idata->no_preview = ((idata->preview_width == idata->image_width)
+			     && (idata->preview_height == idata->image_height));
+
+	if (idata->no_preview)
+		if (idata->preview != NULL) {
+			g_object_unref (idata->preview);
+			idata->preview = NULL;
+		}
+
+	/* thumbnail. */
+
+	idata->thumb = pixbuf = image_loader_get_pixbuf (iloader);
+	g_object_ref (idata->thumb);
+
+	if ((ce->thumb_width > 0) && (ce->thumb_height > 0)) {
+		int w = gdk_pixbuf_get_width (pixbuf);
+		int h = gdk_pixbuf_get_height (pixbuf);
+
+		if (scale_keeping_ratio (&w, &h,
+					 ce->thumb_width,
+					 ce->thumb_height,
+					 FALSE)) 
+		{
+			GdkPixbuf *scaled;
+			scaled = pixbuf_scale (pixbuf, w, h, GDK_INTERP_BILINEAR);
+			g_object_unref (idata->thumb);
+			idata->thumb = scaled;
+		}
+	}
+
+	idata->thumb_width = gdk_pixbuf_get_width (idata->thumb);
+	idata->thumb_height = gdk_pixbuf_get_height (idata->thumb);
+
+	/* save the image */
+
+	if (! ce->copy_images)
+		ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+						    save_image_preview_cb,
+						    ce);
+
+	else if (ce->copy_images && ! ce->resize_images)
+		export__copy_image (ce);
+
+	else if (ce->copy_images && ce->resize_images) {
+		exporter_set_info (ce, _("Saving images"));
+		ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
+						    save_resized_image_cb,
+						    ce);
+	}
+}
+
+
+static void
+image_loader_error (ImageLoader *iloader,
+		    gpointer     data)
+{
+	CatalogWebExporter *ce = data;
+	load_next_file (ce);
+}
+
+
+static GList *
+get_parsed_file (GFile *file) 
+{
+	GList            *result = NULL;
+	GError           *error = NULL;
+	
+	yy_parsed_doc = NULL;
+	
+	gfile_debug (DEBUG_INFO, "load template", file);
+	
+	yy_istream = g_file_read (file, NULL, &error);
+	
+	if (error != NULL) {
+		gfile_warning ("Could not open template", file, error);
+		g_object_unref (&error);
+	}
+	else {
+		if (yyparse () == 0)
+			result = yy_parsed_doc;
+		else
+			debug (DEBUG_INFO, "<<syntax error>>");
+		
+		g_input_stream_close (G_INPUT_STREAM(yy_istream), NULL, &error);
+		g_object_unref (yy_istream);
+	}
+	
+	return result;
+}
+
+
+static void
+parse_theme_files (CatalogWebExporter *ce)
+{
+	GFile            *template;
+	GList            *scan;
+
+	free_parsed_docs (ce);
+
+	ce->image = 0;
+
+	/* read and parse index.gthtml */
+
+	template = gfile_append_path (ce->style_dir, 
+				      "index.gthtml",
+				      NULL);
+	
+	ce->index_parsed = get_parsed_file (template);
+
+	g_object_unref (template);
+
+	if (ce->index_parsed == NULL) {
+		GthTag *tag = gth_tag_new (GTH_TAG_TABLE, NULL);
+		ce->index_parsed = g_list_prepend (NULL, tag);
+	}
+
+	/* read and parse thumbnail.gthtml */
+
+	template = gfile_append_path (ce->style_dir, 
+				      "thumbnail.gthtml",
+				      NULL);
+	
+	ce->thumbnail_parsed = get_parsed_file (template);
+
+	g_object_unref (template);
+	
+	if (ce->thumbnail_parsed == NULL) {
+		GthExpr *expr;
+		GthVar  *var;
+		GList   *vars = NULL;
+		GthTag  *tag;
+
+		expr = gth_expr_new ();
+		gth_expr_push_constant (expr, 0);
+		var = gth_var_new_expression ("idx_relative", expr);
+		vars = g_list_prepend (vars, var);
+
+		expr = gth_expr_new ();
+		gth_expr_push_constant (expr, 1);
+		var = gth_var_new_expression ("thumbnail", expr);
+		vars = g_list_prepend (vars, var);
+
+		tag = gth_tag_new (GTH_TAG_IMAGE, vars);
+		ce->thumbnail_parsed = g_list_prepend (NULL, tag);
+	}
+
+	/* Read and parse image.gthtml */
+
+	template = gfile_append_path (ce->style_dir, 
+				      "image.gthtml",
+				      NULL);
+	
+	ce->image_parsed = get_parsed_file (template);
+
+	g_object_unref (template);
+	
+	if (ce->image_parsed == NULL) {
+		GthExpr *expr;
+		GthVar  *var;
+		GList   *vars = NULL;
+		GthTag  *tag;
+
+		expr = gth_expr_new ();
+		gth_expr_push_constant (expr, 0);
+		var = gth_var_new_expression ("idx_relative", expr);
+		vars = g_list_prepend (vars, var);
+
+		expr = gth_expr_new ();
+		gth_expr_push_constant (expr, 0);
+		var = gth_var_new_expression ("thumbnail", expr);
+		vars = g_list_prepend (vars, var);
+
+		tag = gth_tag_new (GTH_TAG_IMAGE, vars);
+		ce->image_parsed = g_list_prepend (NULL, tag);
+	}
+
+	/* read index.html and set variables. */
+
+	for (scan = ce->index_parsed; scan; scan = scan->next) {
+		GthTag *tag = scan->data;
+		int     width, height;
+
+		switch (tag->type) {
+		case GTH_TAG_SET_VAR:
+			
+			width = gth_tag_get_var (ce, tag, "thumbnail_width");
+			height = gth_tag_get_var (ce, tag, "thumbnail_height");
+
+			if ((width != 0) && (height != 0)) {
+				debug (DEBUG_INFO, "thumbnail --> %dx%d", width, height);
+				catalog_web_exporter_set_thumb_size (ce, width, height);
+				break;
+			}
+
+			/**/
+
+			width = gth_tag_get_var (ce, tag, "preview_width");
+			height = gth_tag_get_var (ce, tag, "preview_height");
+
+			if ((width != 0) && (height != 0)) {
+				debug (DEBUG_INFO, "preview --> %dx%d", width, height);
+				catalog_web_exporter_set_preview_size (ce, width, height);
+				break;
+			}
+
+			width = gth_tag_get_var (ce, tag, "preview_min_width");
+			height = gth_tag_get_var (ce, tag, "preview_min_height");
+
+			if ((width != 0) && (height != 0)) {
+				debug (DEBUG_INFO, "preview min --> %dx%d", width, height);
+				catalog_web_exporter_set_preview_min_size (ce, width, height);
+				break;
+			}
+
+			break;
+
+		default:
+			break;
+		}
+	}
+}
+
+
+static gboolean
+ensure_album_dir_exists (GFile *target_dir, 
+		         const char *subdir)
+{
+	gboolean  ok;
+	GFile    *dir;
+	
+	dir = gfile_append_path (target_dir, subdir, NULL);
+	
+	ok = gfile_ensure_dir_exists (dir, 0700, NULL);
+	
+	g_object_unref (dir);
+
+	return ok;
+}
+
+
+static void
+ensure_dir_structure (CatalogWebExporter *ce,
+		      GFile              *target_dir)
+{
+	gfile_ensure_dir_exists (target_dir, 0700, NULL);
+	
+	if (ce->use_subfolders) {
+		ensure_album_dir_exists (target_dir, ce->ad->previews);
+		ensure_album_dir_exists (target_dir, ce->ad->thumbnails);
+		if (ce->copy_images)
+			ensure_album_dir_exists (target_dir, ce->ad->images);
+		ensure_album_dir_exists (target_dir, ce->ad->html_images);
+		if (ce->n_pages > 1)
+			ensure_album_dir_exists (target_dir, ce->ad->html_indexes);
+		ensure_album_dir_exists (target_dir, ce->ad->theme_files);
+	}
+}
+
+
+void
+catalog_web_exporter_export (CatalogWebExporter *ce)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+
+	if ((ce->exporting) || (ce->file_list == NULL))
+		return;
+	ce->exporting = TRUE;
+
+	/* 
+	 * check that the style directory is not NULL. A NULL indicates that
+	 * the folder of the selected style has been deleted or renamed 
+	 * before the user started the export. It is unlikely.
+	 */
+	
+	if (ce->style_dir == NULL) {
+		_gtk_error_dialog_run (GTK_WINDOW (ce->window), _("Could not find the style folder"));
+		g_signal_emit (G_OBJECT (ce), catalog_web_exporter_signals[WEB_EXPORTER_DONE], 0);
+		return;
+	}
+	
+	gfile_debug (DEBUG_INFO, "style dir", ce->style_dir);
+	
+	/* get index file name and subdirs from gconf (hidden prefs) */
+
+	g_free (ce->index_file);
+	ce->index_file =  eel_gconf_get_string (PREF_EXP_WEB_INDEX_FILE, 
+						DEFAULT_INDEX_FILE);
+	
+	debug (DEBUG_INFO, "index file: %s", ce->index_file);
+	
+	album_dirs_set (ce->ad);
+
+	/* get tmp dir */
+
+	UNREF (ce->target_tmp_dir)
+	ce->target_tmp_dir = gfile_get_temp_dir_name ();
+	
+	if (ce->target_tmp_dir == NULL) {
+		_gtk_error_dialog_run (GTK_WINDOW (ce->window), _("Could not create a temporary folder"));
+		g_signal_emit (G_OBJECT (ce), catalog_web_exporter_signals[WEB_EXPORTER_DONE], 0);
+		return;
+	}
+	
+	gfile_debug (DEBUG_INFO, "temp dir", ce->target_tmp_dir);
+	
+	/* compute n_images, n_pages */
+	
+	ce->n_images = g_list_length (ce->file_list);
+
+	if (ce->single_index)
+		ce->n_pages = 1;
+	else {
+		ce->n_pages = ce->n_images / (ce->page_rows * ce->page_cols);
+		if (ce->n_images % (ce->page_rows * ce->page_cols) > 0)
+			ce->n_pages++;
+	}
+
+	/* parse .gthtml files */
+
+	parse_theme_files (ce);
+
+	debug (DEBUG_INFO, "thumb size: %dx%d", ce->thumb_width, ce->thumb_height);
+	
+	/* create tmp dir structure */
+	
+	ensure_dir_structure (ce, ce->target_tmp_dir);
+
+	
+	/**/
+	
+	/* 
+	 * NOTE: we cannot get rid of these two members 
+	 * since xfer functions have not yet been ported to gio
+	 */
+	g_free (ce->base_tmp_dir);
+	ce->base_tmp_dir = g_file_get_uri (ce->target_tmp_dir);
+	
+	g_free (ce->base_dir);
+	ce->base_dir = g_file_get_uri (ce->target_dir);
+
+	
+	if (ce->iloader != NULL)
+		g_object_unref (ce->iloader);
+
+	ce->iloader = IMAGE_LOADER (image_loader_new (FALSE));
+	g_signal_connect (G_OBJECT (ce->iloader),
+			  "image_done",
+			  G_CALLBACK (image_loader_done),
+			  ce);
+	g_signal_connect (G_OBJECT (ce->iloader),
+			  "image_error",
+			  G_CALLBACK (image_loader_error),
+			  ce);
+
+	/* Load thumbnails. */
+
+	exporter_set_info (ce, _("Loading images"));
+
+	ce->n_images_done = 0;
+
+	ce->file_to_load = ce->file_list;
+	image_loader_set_file (ce->iloader,
+			       IMAGE_DATA (ce->file_to_load->data)->src_file);
+	image_loader_start (ce->iloader);
+}
+
+
+void
+catalog_web_exporter_interrupt (CatalogWebExporter *ce)
+{
+	g_return_if_fail (IS_CATALOG_WEB_EXPORTER (ce));
+
+	if (! ce->exporting)
+		return;
+	ce->interrupted = TRUE;
+}
diff --git a/extensions/webalbums/catalog-web-exporter.h b/extensions/webalbums/catalog-web-exporter.h
new file mode 100644
index 0000000..c0d303a
--- /dev/null
+++ b/extensions/webalbums/catalog-web-exporter.h
@@ -0,0 +1,188 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef CATALOG_WEB_EXPORTER_H
+#define CATALOG_WEB_EXPORTER_H
+
+#include <glib.h>
+#include <gio/gio.h>
+#include <gtk/gtk.h>
+#include "gth-window.h"
+#include "image-loader.h"
+#include "typedefs.h"
+
+#define CATALOG_WEB_EXPORTER_TYPE            (catalog_web_exporter_get_type ())
+#define CATALOG_WEB_EXPORTER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CATALOG_WEB_EXPORTER_TYPE, CatalogWebExporter))
+#define CATALOG_WEB_EXPORTER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CATALOG_WEB_EXPORTER_TYPE, CatalogWebExporterClass))
+#define IS_CATALOG_WEB_EXPORTER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CATALOG_WEB_EXPORTER_TYPE))
+#define IS_CATALOG_WEB_EXPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CATALOG_WEB_EXPORTER_TYPE))
+#define CATALOG_WEB_EXPORTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), CATALOG_WEB_EXPORTER_TYPE, CatalogWebExporterClass))
+
+typedef struct _CatalogWebExporter       CatalogWebExporter;
+typedef struct _CatalogWebExporterClass  CatalogWebExporterClass;
+typedef struct _ImageData                ImageData;
+typedef struct _AlbumDirs		 AlbumDirs;
+
+struct _AlbumDirs {
+	char         *previews;
+	char         *thumbnails;
+	char         *images;
+	char         *html_images;
+	char         *html_indexes;
+	char         *theme_files;
+};
+
+struct _CatalogWebExporter {
+	GObject __parent;
+
+	/*< private >*/
+
+	GthWindow    *window;
+
+	GList        *file_list;              /* char* elements. */
+
+	char         *header;
+	char         *footer;
+	GFile        *style_dir;
+
+	int           page_rows;              /* Number of rows and columns
+	 				       * each page must have. */
+	int           page_cols;
+	gboolean      single_index;
+
+	char         *base_dir;               /* Save files in this location. */
+	char         *base_tmp_dir;
+	
+	GFile        *target_dir;               /* Save files in this location. */
+	GFile        *target_tmp_dir;
+
+	gboolean      use_subfolders;
+	AlbumDirs    *ad;	
+					     					       
+	char         *index_file;
+
+	char         *info;
+
+	int           thumb_width;
+	int           thumb_height;
+
+	gboolean      copy_images;
+	GthSortMethod sort_method;
+	GtkSortType   sort_type;
+
+	gboolean      resize_images;
+	int           resize_max_width;
+	int           resize_max_height;
+
+	int           preview_min_width;
+	int           preview_min_height;
+
+	int           preview_max_width;
+	int           preview_max_height;
+
+	guint16       index_caption_mask;
+	guint16       image_caption_mask;
+
+	/**/
+
+	ImageLoader  *iloader;
+	GList        *file_to_load;          /* Next file to be loaded. */
+
+	int           n_images;              /* Used for the progress signal.*/
+	int           n_images_done;
+	int           n_pages;
+	int           page;
+	int           image;
+	GList        *index_parsed;
+	GList        *thumbnail_parsed;
+	GList        *image_parsed;
+
+	GList        *current_image;
+	guint         saving_timeout;
+	ImageData    *eval_image;
+
+	gboolean      exporting;
+	gboolean      interrupted;
+};
+
+
+struct _CatalogWebExporterClass {
+	GObjectClass __parent;
+
+	/* -- signals -- */
+	
+	void (*web_exporter_done)             (CatalogWebExporter *ce);
+	void (*web_exporter_progress)         (CatalogWebExporter *ce,
+					       float               percent);
+	void (*web_exporter_info)             (CatalogWebExporter *ce,
+					       const char         *info);
+	void (*web_exporter_start_copying)    (CatalogWebExporter *ce);
+};
+
+
+GType      catalog_web_exporter_get_type              (void);
+CatalogWebExporter *  catalog_web_exporter_new        (GthWindow          *window,
+						       GList              *file_list);
+void       catalog_web_exporter_set_header            (CatalogWebExporter *ce,
+						       const char         *header);
+void       catalog_web_exporter_set_footer            (CatalogWebExporter *ce,
+						       const char         *footer);
+void       catalog_web_exporter_set_style             (CatalogWebExporter *ce,
+						       const char         *style);
+void       catalog_web_exporter_set_location          (CatalogWebExporter *ce,
+						       const char         *location);
+void       catalog_web_exporter_set_use_subfolders    (CatalogWebExporter *ce,
+						       gboolean            use_subfolders);
+void       catalog_web_exporter_set_row_col           (CatalogWebExporter *ce,
+						       int                 rows,
+						       int                 cols);
+void       catalog_web_exporter_set_thumb_size        (CatalogWebExporter *ce,
+						       int                 width,
+						       int                 height);
+void       catalog_web_exporter_set_preview_size      (CatalogWebExporter *ce,
+						       int                 width,
+						       int                 height);
+void       catalog_web_exporter_set_copy_images       (CatalogWebExporter *ce,
+						       gboolean            copy);
+void       catalog_web_exporter_set_resize_images     (CatalogWebExporter *ce,
+						       gboolean            resize,
+						       int                 max_width,
+						       int                 max_height);
+void       catalog_web_exporter_set_sorted            (CatalogWebExporter *ce,
+						       GthSortMethod       method,
+						       GtkSortType         sort_type);
+void       catalog_web_exporter_set_row_col           (CatalogWebExporter *ce,
+						       int                 rows,
+						       int                 cols);
+void       catalog_web_exporter_set_single_index      (CatalogWebExporter *ce,
+						       gboolean            copy);
+void       catalog_web_exporter_set_image_caption     (CatalogWebExporter *ce,
+						       GthCaptionFields    caption);
+guint16    catalog_web_exporter_get_image_caption     (CatalogWebExporter *ce);
+void       catalog_web_exporter_set_index_caption     (CatalogWebExporter *ce,
+						       GthCaptionFields    caption);
+guint16    catalog_web_exporter_get_index_caption     (CatalogWebExporter *ce);
+void       catalog_web_exporter_export                (CatalogWebExporter *ce);
+void       catalog_web_exporter_interrupt             (CatalogWebExporter *ce);
+
+
+#endif /* CATALOG_WEB_EXPORTER_H */
diff --git a/extensions/webalbums/data/Makefile.am b/extensions/webalbums/data/Makefile.am
new file mode 100644
index 0000000..c1713cf
--- /dev/null
+++ b/extensions/webalbums/data/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = ui
+
+-include $(top_srcdir)/git.mk
diff --git a/extensions/webalbums/data/ui/Makefile.am b/extensions/webalbums/data/ui/Makefile.am
new file mode 100644
index 0000000..fb48642
--- /dev/null
+++ b/extensions/webalbums/data/ui/Makefile.am
@@ -0,0 +1,5 @@
+uidir = $(pkgdatadir)/ui
+ui_DATA = web-album-exporter.ui
+EXTRA_DIST = $(ui_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/extensions/webalbums/data/ui/web-album-exporter.ui b/extensions/webalbums/data/ui/web-album-exporter.ui
new file mode 100644
index 0000000..d5090a3
--- /dev/null
+++ b/extensions/webalbums/data/ui/web-album-exporter.ui
@@ -0,0 +1,2323 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
+
+<glade-interface>
+<requires lib="gnome"/>
+
+<widget class="GtkDialog" id="web_album_dialog">
+  <property name="border_width">6</property>
+  <property name="title" translatable="yes">Web Album</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox6">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">12</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area6">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="wa_help_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-help</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-11</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="wa_cancel_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="wa_ok_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="has_focus">True</property>
+	      <property name="label">gtk-save</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkTable" id="table8">
+	  <property name="border_width">6</property>
+	  <property name="visible">True</property>
+	  <property name="n_rows">16</property>
+	  <property name="n_columns">3</property>
+	  <property name="homogeneous">False</property>
+	  <property name="row_spacing">6</property>
+	  <property name="column_spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label112">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">S_ort:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">10</property>
+	      <property name="bottom_attach">11</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label113">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Index Page Layout&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">5</property>
+	      <property name="bottom_attach">6</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label88">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">    </property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label84">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Destination:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label87">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Saving&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label94">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Album Style&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">11</property>
+	      <property name="bottom_attach">12</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label86">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Header:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">12</property>
+	      <property name="bottom_attach">13</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox62">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">12</property>
+
+	      <child>
+		<widget class="GtkComboBox" id="wa_sort_images_combobox">
+		  <property name="visible">True</property>
+		  <property name="items" translatable="yes">by name</property>
+		  <property name="add_tearoffs">False</property>
+		  <property name="focus_on_click">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkCheckButton" id="wa_reverse_order_checkbutton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Re_verse order</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">10</property>
+	      <property name="bottom_attach">11</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label122">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Footer:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">13</property>
+	      <property name="bottom_attach">14</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox70">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkEntry" id="wa_header_entry">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">True</property>
+		  <property name="visibility">True</property>
+		  <property name="max_length">0</property>
+		  <property name="text" translatable="yes"></property>
+		  <property name="has_frame">True</property>
+		  <property name="invisible_char">*</property>
+		  <property name="activates_default">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">12</property>
+	      <property name="bottom_attach">13</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox71">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkEntry" id="wa_footer_entry">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">True</property>
+		  <property name="visibility">True</property>
+		  <property name="max_length">0</property>
+		  <property name="text" translatable="yes"></property>
+		  <property name="has_frame">True</property>
+		  <property name="invisible_char">*</property>
+		  <property name="activates_default">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">13</property>
+	      <property name="bottom_attach">14</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label99">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Size :</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="mnemonic_widget">wa_rows_spinbutton</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">6</property>
+	      <property name="bottom_attach">7</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label123">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;&lt;b&gt;Note:&lt;/b&gt; %d (current date).&lt;/i&gt;&lt;/small&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">True</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">14</property>
+	      <property name="bottom_attach">15</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label85">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Theme:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">15</property>
+	      <property name="bottom_attach">16</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox54">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">5</property>
+
+	      <child>
+		<widget class="GtkButton" id="wa_select_theme_button">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">...</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label124">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;&lt;b&gt;Note:&lt;/b&gt; click to customize.&lt;/i&gt;&lt;/small&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">True</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+	    </packing>
+	  </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">15</property>
+	      <property name="bottom_attach">16</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+	  
+	  <child>
+	    <widget class="GtkCheckButton" id="wa_copy_images_checkbutton">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label" translatable="yes">_Copy originals to destination</property>
+	      <property name="use_underline">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="active">False</property>
+	      <property name="inconsistent">False</property>
+	      <property name="draw_indicator">True</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">3</property>
+	      <property name="bottom_attach">4</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="wa_resize_images_hbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkCheckButton" id="wa_resize_images_checkbutton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">_Resize if larger than:</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="wa_resize_images_options_hbox">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkOptionMenu" id="wa_resize_images_optionmenu">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="history">0</property>
+
+		      <child>
+			<widget class="GtkMenu" id="menu2">
+
+			  <child>
+			    <widget class="GtkMenuItem" id="320x1">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">320 x 200</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_320x1_activate" last_modification_time="Thu, 15 May 2003 18:27:44 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="320x2">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">320 x 320</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_320x2_activate" last_modification_time="Thu, 15 May 2003 18:27:44 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="640x1">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">640 x 480</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_640x1_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="640x2">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">640 x 640</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_640x2_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="800x6">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">800 x 600</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_800x1_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="800x7">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">800 x 800</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_800x2_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="1024x1">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">1024 x 768</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_1024x1_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="1024x2">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">1024 x 1024</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_1024x2_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="1280x1">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">1280 x 960</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_1280x1_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="1280x2">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">1280 x 1280</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_1280x2_activate" last_modification_time="Thu, 15 May 2003 18:26:48 GMT"/>
+			    </widget>
+			  </child>
+			</widget>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">5</property>
+	      <property name="x_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkFileChooserButton" id="wa_destination_filechooserbutton">
+	      <property name="visible">True</property>
+	      <property name="title" translatable="yes">Choose destination folder</property>
+	      <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+	      <property name="local_only">False</property>
+	      <property name="show_hidden">False</property>
+	      <property name="do_overwrite_confirmation">False</property>
+	      <property name="width_chars">-1</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox91">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkCheckButton" id="wa_single_index_checkbutton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">or _use a single index page</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">8</property>
+	      <property name="bottom_attach">9</property>
+	      <property name="x_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="wa_rows_hbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox60">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">12</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox69">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkSpinButton" id="wa_rows_spinbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="climb_rate">1</property>
+			  <property name="digits">0</property>
+			  <property name="numeric">False</property>
+			  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+			  <property name="snap_to_ticks">False</property>
+			  <property name="wrap">False</property>
+			  <property name="adjustment">1 1 100 1 10 0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label132">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">rows per page,</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">7</property>
+	      <property name="bottom_attach">8</property>
+	      <property name="x_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="wa_cols_hbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkSpinButton" id="wa_cols_spinbutton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="climb_rate">1</property>
+		  <property name="digits">0</property>
+		  <property name="numeric">False</property>
+		  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+		  <property name="snap_to_ticks">False</property>
+		  <property name="wrap">False</property>
+		  <property name="adjustment">1 1 100 1 10 0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label133">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">columns, by</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">6</property>
+	      <property name="bottom_attach">7</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label143">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;&lt;b&gt;Note:&lt;/b&gt; Some themes may auto-adjust the
+number of rows and columns, but keep the total 
+number of images per page constant.&lt;/i&gt;&lt;/small&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">9</property>
+	      <property name="bottom_attach">10</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkCheckButton" id="wa_use_subfolders_checkbutton">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label" translatable="yes">Use subfolders to organize files</property>
+	      <property name="use_underline">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="active">False</property>
+	      <property name="inconsistent">False</property>
+	      <property name="draw_indicator">True</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">2</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="web_album_theme_dialog">
+  <property name="border_width">6</property>
+  <property name="title" translatable="yes">Web Album Theme</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">True</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox7">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">12</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area7">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="wat_cancel_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="wat_ok_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="has_focus">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment3">
+		  <property name="visible">True</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">0</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox85">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">2</property>
+
+		      <child>
+			<widget class="GtkImage" id="image4">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-apply</property>
+			  <property name="icon_size">4</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label135">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">_Select</property>
+			  <property name="use_underline">True</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox32">
+	  <property name="border_width">6</property>
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">12</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox24">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">5</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label102">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Theme&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox57">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label101">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">     </property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox37">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox58">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">10</property>
+
+			  <child>
+			    <widget class="GtkScrolledWindow" id="scrolledwindow4">
+			      <property name="width_request">200</property>
+			      <property name="height_request">250</property>
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			      <property name="shadow_type">GTK_SHADOW_IN</property>
+			      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			      <child>
+				<widget class="GtkTreeView" id="wat_theme_treeview">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="headers_visible">False</property>
+				  <property name="rules_hint">False</property>
+				  <property name="reorderable">False</property>
+				  <property name="enable_search">True</property>
+				  <property name="fixed_height_mode">False</property>
+				  <property name="hover_selection">False</property>
+				  <property name="hover_expand">False</property>
+				</widget>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkVBox" id="vbox27">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">6</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label137">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Style Preview</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkFrame" id="frame1">
+				  <property name="visible">True</property>
+				  <property name="label_xalign">0</property>
+				  <property name="label_yalign">0.5</property>
+				  <property name="shadow_type">GTK_SHADOW_IN</property>
+
+				  <child>
+				    <widget class="GtkHBox" id="hbox87">
+				      <property name="border_width">3</property>
+				      <property name="visible">True</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">0</property>
+
+				      <child>
+					<widget class="GtkImage" id="wat_preview_image">
+					  <property name="width_request">220</property>
+					  <property name="height_request">220</property>
+					  <property name="visible">True</property>
+					  <property name="stock">gtk-missing-image</property>
+					  <property name="icon_size">4</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkButton" id="wat_go_to_folder_button">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+
+				  <child>
+				    <widget class="GtkAlignment" id="alignment4">
+				      <property name="visible">True</property>
+				      <property name="xalign">0.5</property>
+				      <property name="yalign">0.5</property>
+				      <property name="xscale">0</property>
+				      <property name="yscale">0</property>
+				      <property name="top_padding">0</property>
+				      <property name="bottom_padding">0</property>
+				      <property name="left_padding">0</property>
+				      <property name="right_padding">0</property>
+
+				      <child>
+					<widget class="GtkHBox" id="hbox90">
+					  <property name="visible">True</property>
+					  <property name="homogeneous">False</property>
+					  <property name="spacing">2</property>
+
+					  <child>
+					    <widget class="GtkImage" id="image5">
+					      <property name="visible">True</property>
+					      <property name="stock">gtk-jump-to</property>
+					      <property name="icon_size">4</property>
+					      <property name="xalign">0.5</property>
+					      <property name="yalign">0.5</property>
+					      <property name="xpad">0</property>
+					      <property name="ypad">0</property>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">False</property>
+					    </packing>
+					  </child>
+
+					  <child>
+					    <widget class="GtkLabel" id="label136">
+					      <property name="visible">True</property>
+					      <property name="label" translatable="yes">_Go to Theme Folder</property>
+					      <property name="use_underline">True</property>
+					      <property name="use_markup">False</property>
+					      <property name="justify">GTK_JUSTIFY_LEFT</property>
+					      <property name="wrap">False</property>
+					      <property name="selectable">False</property>
+					      <property name="xalign">0.5</property>
+					      <property name="yalign">0.5</property>
+					      <property name="xpad">0</property>
+					      <property name="ypad">0</property>
+					      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+					      <property name="width_chars">-1</property>
+					      <property name="single_line_mode">False</property>
+					      <property name="angle">0</property>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">False</property>
+					    </packing>
+					  </child>
+					</widget>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				  <property name="pack_type">GTK_PACK_END</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkButton" id="wat_install_button">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">_Install Theme...</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				  <property name="pack_type">GTK_PACK_END</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox33">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label117">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Personalize theme&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox65">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label116">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">     </property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox34">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox89">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">True</property>
+			  <property name="spacing">6</property>
+
+			  <child>
+			    <widget class="GtkButton" id="wat_thumbnail_caption_button">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">_Thumbnail Caption...</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkButton" id="wat_image_caption_button">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">I_mage Caption...</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="progress_dialog">
+  <property name="border_width">6</property>
+  <property name="width_request">300</property>
+  <property name="title" translatable="yes"></property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox8">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">8</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area8">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="progress_cancel">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox26">
+	  <property name="border_width">6</property>
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkProgressBar" id="progress_progressbar">
+	      <property name="visible">True</property>
+	      <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
+	      <property name="fraction">0</property>
+	      <property name="pulse_step">0.10000000149</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">12</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="progress_info">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes"></property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="caption_dialog">
+  <property name="border_width">6</property>
+  <property name="title" translatable="yes">Caption</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox9">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">3</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area9">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="c_cancelbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="c_okbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox31">
+	  <property name="border_width">6</property>
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">12</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox36">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label140">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Basic Information&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox93">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label141">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes"></property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">6</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox38">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_filename_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">File _name</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_filesize_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">File si_ze</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_imagedim_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Image dim_ensions</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="c_caption_data_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label138">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Comments&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox92">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label139">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes"></property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">6</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="caption_vbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_comment_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Co_mment</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_place_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">_Place</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_date_time_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">_Date and Time</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="c_exif_data_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label119">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Camera Data&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox67">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label120">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes"></property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">6</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="exif_vbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">6</property>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_date_time_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Da_te and Time</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_exposure_time_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Exposure _time</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_exposure_mode_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">E_xposure mode</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_flash_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">_Flash</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_shutter_speed_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">_Shutter speed</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_aperture_value_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">_Aperture value</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_focal_length_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Focal _length</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="c_exif_camera_model_checkbutton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Came_ra Model</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>
diff --git a/extensions/webalbums/dlg-web-exporter.c b/extensions/webalbums/dlg-web-exporter.c
new file mode 100644
index 0000000..e1c5842
--- /dev/null
+++ b/extensions/webalbums/dlg-web-exporter.c
@@ -0,0 +1,1247 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <libgnome/gnome-url.h>
+#include <libgnome/gnome-help.h>
+#include <libgnomevfs/gnome-vfs-directory.h>
+#include <libgnomevfs/gnome-vfs-ops.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+#include <glade/glade.h>
+
+#include "catalog-web-exporter.h"
+#include "dlg-file-utils.h"
+#include "file-utils.h"
+#include "gfile-utils.h"
+#include "gtk-utils.h"
+#include "gth-file-view.h"
+#include "main.h"
+#include "pixbuf-utils.h"
+#include "gconf-utils.h"
+#include "gth-browser.h"
+#include "gth-utils.h"
+#include "glib-utils.h"
+
+static int           sort_method_to_idx[] = { -1, 0, 1, 2, 3, 4, 5, 6 };
+static GthSortMethod idx_to_sort_method[] = { GTH_SORT_METHOD_BY_NAME,
+					      GTH_SORT_METHOD_BY_PATH,
+					      GTH_SORT_METHOD_BY_SIZE,
+					      GTH_SORT_METHOD_BY_TIME,
+					      GTH_SORT_METHOD_BY_EXIF_DATE,
+					      GTH_SORT_METHOD_BY_COMMENT,
+					      GTH_SORT_METHOD_MANUAL};
+static int           idx_to_resize_width[] = { 320, 320, 640, 640, 800, 800, 1024, 1024, 1280, 1280 };
+static int           idx_to_resize_height[] = { 200, 320, 480, 640, 600, 800, 768, 1024, 960, 1280 };
+
+
+#define str_void(x) (((x) == NULL) || (*(x) == 0))
+#define GLADE_EXPORTER_FILE "gthumb_web_exporter.glade"
+#define MAX_PREVIEW_SIZE 220
+#define DEFAULT_ALBUM_THEME "Wiki"
+
+typedef struct {
+	GthBrowser         *browser;
+
+	GladeXML           *gui;
+	GtkWidget          *dialog;
+
+	GtkWidget          *progress_dialog;
+	GtkWidget          *progress_progressbar;
+	GtkWidget          *progress_info;
+	GtkWidget          *progress_cancel;
+
+	GtkWidget          *btn_ok;
+
+	GtkWidget          *wa_destination_filechooserbutton;
+	GtkWidget          *wa_use_subfolders_checkbutton;
+	GtkWidget          *wa_copy_images_checkbutton;
+	GtkWidget          *wa_resize_images_checkbutton;
+	GtkWidget          *wa_resize_images_optionmenu;
+	GtkWidget          *wa_resize_images_hbox;
+	GtkWidget          *wa_resize_images_options_hbox;
+
+	GtkWidget          *wa_rows_spinbutton;
+	GtkWidget          *wa_cols_spinbutton;
+	GtkWidget          *wa_single_index_checkbutton;
+	GtkWidget          *wa_rows_hbox;
+	GtkWidget          *wa_cols_hbox;
+	GtkWidget          *wa_sort_images_combobox;
+	GtkWidget          *wa_reverse_order_checkbutton;
+
+	GtkWidget          *wa_header_entry;
+	GtkWidget          *wa_footer_entry;
+	GtkWidget          *wa_theme_combo;
+	GtkWidget          *wa_select_theme_button;
+
+	/**/
+
+	CatalogWebExporter *exporter;
+} DialogData;
+
+
+/* called when the main dialog is closed. */
+static void
+destroy_cb (GtkWidget  *widget,
+	    DialogData *data)
+{
+	g_object_unref (data->gui);
+	if (data->exporter != NULL)
+		g_object_unref (data->exporter);
+	g_free (data);
+}
+
+
+/* called when the "help" button is clicked. */
+static void
+help_cb (GtkWidget  *widget,
+         DialogData *data)
+{
+	gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-web-album");
+}
+
+
+static void
+export (GtkWidget  *widget,
+	DialogData *data)
+{
+	CatalogWebExporter *exporter = data->exporter;
+	char               *location;
+	char               *path;
+	char               *theme;
+	const char         *header;
+	const char         *footer;
+
+	/* Save options. */
+
+	path = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (data->wa_destination_filechooserbutton));
+	location = remove_ending_separator (path);
+	g_free (path);
+
+	eel_gconf_set_path (PREF_WEB_ALBUM_DESTINATION, location);
+
+	eel_gconf_set_boolean (PREF_WEB_ALBUM_USE_SUBFOLDERS, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->wa_use_subfolders_checkbutton)));
+	
+	eel_gconf_set_boolean (PREF_WEB_ALBUM_COPY_IMAGES, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->wa_copy_images_checkbutton)));
+
+	eel_gconf_set_boolean (PREF_WEB_ALBUM_RESIZE_IMAGES, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->wa_resize_images_checkbutton)));
+
+	eel_gconf_set_integer (PREF_WEB_ALBUM_RESIZE_WIDTH, idx_to_resize_width[gtk_option_menu_get_history (GTK_OPTION_MENU (data->wa_resize_images_optionmenu))]);
+
+	eel_gconf_set_integer (PREF_WEB_ALBUM_RESIZE_HEIGHT, idx_to_resize_height[gtk_option_menu_get_history (GTK_OPTION_MENU (data->wa_resize_images_optionmenu))]);
+
+	eel_gconf_set_integer (PREF_WEB_ALBUM_ROWS, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->wa_rows_spinbutton)));
+
+	eel_gconf_set_integer (PREF_WEB_ALBUM_COLUMNS, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->wa_cols_spinbutton)));
+
+	eel_gconf_set_boolean (PREF_WEB_ALBUM_SINGLE_INDEX, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->wa_single_index_checkbutton)));
+
+	pref_set_web_album_sort_order (idx_to_sort_method [gtk_combo_box_get_active (GTK_COMBO_BOX (data->wa_sort_images_combobox))]);
+
+	eel_gconf_set_boolean (PREF_WEB_ALBUM_REVERSE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->wa_reverse_order_checkbutton)));
+
+	header = gtk_entry_get_text (GTK_ENTRY (data->wa_header_entry));
+	eel_gconf_set_string (PREF_WEB_ALBUM_HEADER, header);
+
+	footer = gtk_entry_get_text (GTK_ENTRY (data->wa_footer_entry));
+	eel_gconf_set_string (PREF_WEB_ALBUM_FOOTER, footer);
+
+	theme = _gtk_button_get_filename_label (GTK_BUTTON (data->wa_select_theme_button));
+	eel_gconf_set_string (PREF_WEB_ALBUM_THEME, theme);
+
+	if (strcmp (theme, "") == 0) {
+		g_free (location);
+		return;
+	}
+
+	/**/
+
+	if (! dlg_check_folder (GTH_WINDOW (data->browser), location)) {
+		g_free (location);
+		return;
+	}
+
+	gtk_widget_hide (data->dialog);
+
+	/* Set options. */
+
+	catalog_web_exporter_set_location (exporter, location);
+
+	catalog_web_exporter_set_use_subfolders (exporter, eel_gconf_get_boolean (PREF_WEB_ALBUM_USE_SUBFOLDERS, TRUE));
+	
+	catalog_web_exporter_set_copy_images (exporter, eel_gconf_get_boolean (PREF_WEB_ALBUM_COPY_IMAGES, FALSE));
+
+	catalog_web_exporter_set_resize_images (exporter,
+						eel_gconf_get_boolean (PREF_WEB_ALBUM_RESIZE_IMAGES, FALSE),
+						idx_to_resize_width[gtk_option_menu_get_history (GTK_OPTION_MENU (data->wa_resize_images_optionmenu))],
+						idx_to_resize_height[gtk_option_menu_get_history (GTK_OPTION_MENU (data->wa_resize_images_optionmenu))]);
+
+	catalog_web_exporter_set_row_col (exporter, eel_gconf_get_integer (PREF_WEB_ALBUM_ROWS, 4), eel_gconf_get_integer (PREF_WEB_ALBUM_COLUMNS, 4));
+	catalog_web_exporter_set_single_index (exporter, eel_gconf_get_boolean (PREF_WEB_ALBUM_SINGLE_INDEX, FALSE));
+
+	catalog_web_exporter_set_sorted (exporter, pref_get_web_album_sort_order (), eel_gconf_get_boolean (PREF_WEB_ALBUM_REVERSE, FALSE));
+	catalog_web_exporter_set_header (exporter, header);
+	catalog_web_exporter_set_footer (exporter, footer);
+	catalog_web_exporter_set_style (exporter, theme);
+
+	g_free (location);
+	g_free (theme);
+
+	/* Export. */
+
+	gtk_window_set_transient_for (GTK_WINDOW (data->progress_dialog),
+				      GTK_WINDOW (data->browser));
+	gtk_window_set_modal (GTK_WINDOW (data->progress_dialog), TRUE);
+	gtk_widget_show_all (data->progress_dialog);
+
+	catalog_web_exporter_export (exporter);
+}
+
+
+static void
+export_done (GtkObject  *object,
+	     DialogData *data)
+{
+	gtk_widget_destroy (data->progress_dialog);
+	gtk_widget_destroy (data->dialog);
+}
+
+
+static void
+export_progress (GtkObject  *object,
+		 float       percent,
+		 DialogData *data)
+{
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (data->progress_progressbar), percent);
+}
+
+
+static void
+export_info (GtkObject  *object,
+	     const char *info,
+	     DialogData *data)
+{
+	gtk_label_set_text (GTK_LABEL (data->progress_info), info);
+}
+
+
+static void
+export_start_copying (GtkObject  *object,
+		      DialogData *data)
+{
+	gtk_widget_hide (data->progress_dialog);
+}
+
+
+static void show_album_theme_cb (GtkWidget *widget, DialogData *data);
+
+
+static int
+get_idx_from_size (int width, int height)
+{
+	int idx;
+	if (width == 320)
+		idx = 0;
+	else if (width == 640)
+		idx = 1;
+	else if (width == 800)
+		idx = 2;
+	else if (width == 1024)
+		idx = 3;
+	else if (width == 1280)
+		idx = 4;
+	else
+		idx = 1;
+	return 2 * idx + (width == height? 1 : 0);
+}
+
+
+static void
+copy_image_toggled_cb (GtkToggleButton *button,
+		       DialogData      *data)
+{
+	gtk_widget_set_sensitive (data->wa_resize_images_hbox, gtk_toggle_button_get_active (button));
+}
+
+
+static void
+resize_image_toggled_cb (GtkToggleButton *button,
+			 DialogData      *data)
+{
+	gtk_widget_set_sensitive (data->wa_resize_images_options_hbox, gtk_toggle_button_get_active (button));
+}
+
+
+static void
+single_index_toggled_cb (GtkToggleButton *button,
+			 DialogData      *data)
+{
+	gtk_widget_set_sensitive (data->wa_rows_hbox, !gtk_toggle_button_get_active (button));
+}
+
+
+
+static gboolean
+theme_present (const char *theme_name,
+	       const char *theme_dir)
+{
+	char *filename;
+
+	if (theme_name == NULL)
+		return FALSE;
+
+	if (theme_dir == NULL)
+		return FALSE;
+
+	filename = g_build_filename (theme_dir, theme_name, NULL);
+
+	return path_is_dir (filename);
+}
+
+
+static char *
+get_default_theme (void)
+{
+	char     *current_theme;
+	char     *local_theme_dir;
+	char     *system_theme_dir;
+	gboolean  found = FALSE;
+
+	current_theme = eel_gconf_get_string (PREF_WEB_ALBUM_THEME, DEFAULT_ALBUM_THEME);
+
+	local_theme_dir = g_build_path (G_DIR_SEPARATOR_S,
+					g_get_home_dir (),
+					".gnome2",
+					"gthumb/albumthemes",
+					NULL);
+	system_theme_dir = g_build_path (G_DIR_SEPARATOR_S,
+					 GTHUMB_DATADIR,
+					 "gthumb/albumthemes",
+					 NULL);
+
+	found = theme_present (current_theme, local_theme_dir);
+
+	if (!found) {
+		found = theme_present (current_theme, system_theme_dir);
+	}
+
+        if (!found) {
+		g_free (current_theme);
+		current_theme = g_strdup (DEFAULT_ALBUM_THEME);
+                found = theme_present (current_theme, local_theme_dir);
+        }
+
+        if (!found) {
+                found = theme_present (current_theme, system_theme_dir);
+        }
+	
+	g_free (local_theme_dir);
+	g_free (system_theme_dir);
+
+	if (! found) {
+		g_free (current_theme);
+		return g_strdup ("");
+	}
+
+	return current_theme;
+}
+
+
+/* create the main dialog. */
+void
+dlg_web_exporter (GthBrowser *browser)
+{
+	DialogData *data;
+	GtkWidget  *btn_cancel;
+	GtkWidget  *btn_help;
+	GList      *list;
+	char       *svalue;
+	gboolean    reorderable;
+	int         idx;
+
+	data = g_new0 (DialogData, 1);
+
+	data->browser = browser;
+
+	list = gth_window_get_file_list_selection_as_fd (GTH_WINDOW (browser));
+	if (list == NULL) {
+		g_warning ("No file selected.");
+		g_free (data);
+		return;
+	}
+
+	reorderable = gth_file_view_get_reorderable (gth_browser_get_file_view (browser));
+
+	data->exporter = catalog_web_exporter_new (GTH_WINDOW (browser), list);
+	file_data_list_free (list);
+
+	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_EXPORTER_FILE, NULL, NULL);
+        if (!data->gui) {
+		g_object_unref (data->exporter);
+		g_free (data);
+                g_warning ("Could not find " GLADE_EXPORTER_FILE "\n");
+                return;
+        }
+
+	/* Get the widgets. */
+
+	data->dialog = glade_xml_get_widget (data->gui, "web_album_dialog");
+	data->wa_destination_filechooserbutton = glade_xml_get_widget (data->gui, "wa_destination_filechooserbutton");
+	data->wa_use_subfolders_checkbutton = glade_xml_get_widget (data->gui, "wa_use_subfolders_checkbutton");
+	data->wa_copy_images_checkbutton = glade_xml_get_widget (data->gui, "wa_copy_images_checkbutton");
+
+	data->wa_resize_images_checkbutton = glade_xml_get_widget (data->gui, "wa_resize_images_checkbutton");
+	data->wa_resize_images_optionmenu = glade_xml_get_widget (data->gui, "wa_resize_images_optionmenu");
+	data->wa_resize_images_hbox = glade_xml_get_widget (data->gui, "wa_resize_images_hbox");
+	data->wa_resize_images_options_hbox = glade_xml_get_widget (data->gui, "wa_resize_images_options_hbox");
+
+	data->wa_rows_spinbutton = glade_xml_get_widget (data->gui, "wa_rows_spinbutton");
+	data->wa_cols_spinbutton = glade_xml_get_widget (data->gui, "wa_cols_spinbutton");
+	data->wa_single_index_checkbutton = glade_xml_get_widget (data->gui, "wa_single_index_checkbutton");
+	data->wa_rows_hbox = glade_xml_get_widget (data->gui, "wa_rows_hbox");
+	data->wa_cols_hbox = glade_xml_get_widget (data->gui, "wa_cols_hbox");
+	data->wa_sort_images_combobox = glade_xml_get_widget (data->gui, "wa_sort_images_combobox");
+	data->wa_reverse_order_checkbutton = glade_xml_get_widget (data->gui, "wa_reverse_order_checkbutton");
+
+	data->wa_header_entry = glade_xml_get_widget (data->gui, "wa_header_entry");
+	data->wa_footer_entry = glade_xml_get_widget (data->gui, "wa_footer_entry");
+	data->wa_select_theme_button = glade_xml_get_widget (data->gui, "wa_select_theme_button");
+
+	/**/
+
+	data->progress_dialog = glade_xml_get_widget (data->gui, "progress_dialog");
+	data->progress_progressbar = glade_xml_get_widget (data->gui, "progress_progressbar");
+	data->progress_info = glade_xml_get_widget (data->gui, "progress_info");
+	data->progress_cancel = glade_xml_get_widget (data->gui, "progress_cancel");
+
+	btn_cancel = glade_xml_get_widget (data->gui, "wa_cancel_button");
+	data->btn_ok = glade_xml_get_widget (data->gui, "wa_ok_button");
+	btn_help = glade_xml_get_widget (data->gui, "wa_help_button");
+
+	/* Set widgets data. */
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->wa_use_subfolders_checkbutton), eel_gconf_get_boolean (PREF_WEB_ALBUM_USE_SUBFOLDERS, TRUE));
+	
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->wa_copy_images_checkbutton), eel_gconf_get_boolean (PREF_WEB_ALBUM_COPY_IMAGES, FALSE));
+
+	gtk_widget_set_sensitive (data->wa_resize_images_hbox, eel_gconf_get_boolean (PREF_WEB_ALBUM_COPY_IMAGES, FALSE));
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->wa_resize_images_checkbutton), eel_gconf_get_boolean (PREF_WEB_ALBUM_RESIZE_IMAGES, FALSE));
+
+	gtk_widget_set_sensitive (data->wa_resize_images_options_hbox, eel_gconf_get_boolean (PREF_WEB_ALBUM_RESIZE_IMAGES, FALSE));
+
+	gtk_option_menu_set_history (GTK_OPTION_MENU (data->wa_resize_images_optionmenu), get_idx_from_size (eel_gconf_get_integer (PREF_WEB_ALBUM_RESIZE_WIDTH, 640), eel_gconf_get_integer (PREF_WEB_ALBUM_RESIZE_HEIGHT, 480)));
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->wa_rows_spinbutton), eel_gconf_get_integer (PREF_WEB_ALBUM_ROWS, 4));
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->wa_cols_spinbutton), eel_gconf_get_integer (PREF_WEB_ALBUM_COLUMNS, 4));
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->wa_single_index_checkbutton), eel_gconf_get_boolean (PREF_WEB_ALBUM_SINGLE_INDEX, FALSE));
+
+	gtk_widget_set_sensitive (data->wa_rows_hbox, !eel_gconf_get_boolean (PREF_WEB_ALBUM_SINGLE_INDEX, FALSE));
+
+	/**/
+
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->wa_sort_images_combobox),
+				   _("by path"));
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->wa_sort_images_combobox),
+				   _("by size"));
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->wa_sort_images_combobox),
+				   _("by file modified time"));
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->wa_sort_images_combobox),
+				   _("by Exif DateTime tag"));
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->wa_sort_images_combobox),
+                                   _("by comment"));
+	if (reorderable)
+		gtk_combo_box_append_text (GTK_COMBO_BOX (data->wa_sort_images_combobox),
+					   _("manual order"));
+
+	idx = sort_method_to_idx [pref_get_web_album_sort_order ()];
+	if (!reorderable && (sort_method_to_idx[GTH_SORT_METHOD_MANUAL] == idx))
+		idx = sort_method_to_idx[GTH_SORT_METHOD_BY_NAME];
+	gtk_combo_box_set_active (GTK_COMBO_BOX (data->wa_sort_images_combobox), idx);
+
+	/**/
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->wa_reverse_order_checkbutton), eel_gconf_get_boolean (PREF_WEB_ALBUM_REVERSE, FALSE));
+
+	svalue = eel_gconf_get_string (PREF_WEB_ALBUM_HEADER, "");
+	gtk_entry_set_text (GTK_ENTRY (data->wa_header_entry), svalue);
+	g_free (svalue);
+
+	svalue = eel_gconf_get_string (PREF_WEB_ALBUM_FOOTER, "");
+	gtk_entry_set_text (GTK_ENTRY (data->wa_footer_entry), svalue);
+	g_free (svalue);
+
+	svalue = get_default_theme();
+	_gtk_button_set_filename_label (GTK_BUTTON (data->wa_select_theme_button), svalue);
+	g_free (svalue);
+
+	catalog_web_exporter_set_index_caption (data->exporter, eel_gconf_get_integer (PREF_WEB_ALBUM_INDEX_CAPTION, 0));
+	catalog_web_exporter_set_image_caption (data->exporter, eel_gconf_get_integer (PREF_WEB_ALBUM_IMAGE_CAPTION, 0));
+
+	/**/
+
+	svalue = eel_gconf_get_path (PREF_WEB_ALBUM_DESTINATION, NULL);
+	if (svalue == NULL)
+		svalue = g_strdup (g_get_home_dir ());
+	gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (data->wa_destination_filechooserbutton), svalue);
+	g_free (svalue);
+
+	/* Signals. */
+
+	g_signal_connect (G_OBJECT (data->dialog),
+			  "destroy",
+			  G_CALLBACK (destroy_cb),
+			  data);
+        g_signal_connect (G_OBJECT (btn_help),
+                          "clicked",
+                          G_CALLBACK (help_cb),
+                          data);
+	g_signal_connect_swapped (G_OBJECT (btn_cancel),
+				  "clicked",
+				  G_CALLBACK (gtk_widget_destroy),
+				  G_OBJECT (data->dialog));
+	g_signal_connect (G_OBJECT (data->btn_ok),
+			  "clicked",
+			  G_CALLBACK (export),
+			  data);
+	g_signal_connect (G_OBJECT (data->wa_select_theme_button),
+			  "clicked",
+			  G_CALLBACK (show_album_theme_cb),
+			  data);
+	g_signal_connect (G_OBJECT (data->wa_copy_images_checkbutton),
+			  "toggled",
+			  G_CALLBACK (copy_image_toggled_cb),
+			  data);
+	g_signal_connect (G_OBJECT (data->wa_resize_images_checkbutton),
+			  "toggled",
+			  G_CALLBACK (resize_image_toggled_cb),
+			  data);
+
+	g_signal_connect (G_OBJECT (data->wa_single_index_checkbutton),
+			  "toggled",
+			  G_CALLBACK (single_index_toggled_cb),
+			  data);
+
+	g_signal_connect (G_OBJECT (data->exporter),
+			  "web_exporter_done",
+			  G_CALLBACK (export_done),
+			  data);
+	g_signal_connect (G_OBJECT (data->exporter),
+			  "web_exporter_progress",
+			  G_CALLBACK (export_progress),
+			  data);
+	g_signal_connect (G_OBJECT (data->exporter),
+			  "web_exporter_info",
+			  G_CALLBACK (export_info),
+			  data);
+	g_signal_connect (G_OBJECT (data->exporter),
+			  "web_exporter_start_copying",
+			  G_CALLBACK (export_start_copying),
+			  data);
+
+	g_signal_connect_swapped (G_OBJECT (data->progress_dialog),
+				  "delete_event",
+				  G_CALLBACK (catalog_web_exporter_interrupt),
+				  data->exporter);
+	g_signal_connect_swapped (G_OBJECT (data->progress_cancel),
+				  "clicked",
+				  G_CALLBACK (catalog_web_exporter_interrupt),
+				  data->exporter);
+
+	/* Run dialog. */
+
+	gtk_window_set_transient_for (GTK_WINDOW (data->dialog), GTK_WINDOW (browser));
+	gtk_window_set_modal (GTK_WINDOW (data->dialog), TRUE);
+	gtk_widget_show_all (data->dialog);
+}
+
+
+
+
+typedef struct {
+	DialogData         *data;
+	GthBrowser         *browser;
+
+	GladeXML           *gui;
+	GtkWidget          *dialog;
+
+	GtkWidget          *wat_dialog;
+	GtkWidget          *wat_theme_treeview;
+	GtkWidget          *wat_ok_button;
+	GtkWidget          *wat_cancel_button;
+	GtkWidget          *wat_install_button;
+	GtkWidget          *wat_go_to_folder_button;
+	GtkWidget          *wat_thumbnail_caption_button;
+	GtkWidget          *wat_image_caption_button;
+	GtkWidget          *wat_preview_image;
+
+	GtkListStore       *list_store;
+} ThemeDialogData;
+
+
+enum {
+	THEME_NAME_COLUMN,
+	NUM_OF_COLUMNS
+};
+
+
+/* called when the main dialog is closed. */
+static void
+theme_dialog_destroy_cb (GtkWidget       *widget,
+			 ThemeDialogData *tdata)
+{
+	g_object_unref (tdata->gui);
+	g_free (tdata);
+}
+
+
+static void
+theme_dialog__ok_clicked (GtkWidget       *widget,
+			  ThemeDialogData *tdata)
+{
+	GtkTreeSelection *selection;
+	gboolean          theme_selected;
+	GtkTreeIter       iter;
+
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tdata->wat_theme_treeview));
+	theme_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
+
+	if (theme_selected) {
+		char *utf8_name;
+
+		gtk_tree_model_get (GTK_TREE_MODEL (tdata->list_store),
+				    &iter,
+				    THEME_NAME_COLUMN, &utf8_name,
+				    -1);
+		gtk_button_set_label (GTK_BUTTON (tdata->data->wa_select_theme_button), utf8_name);
+		g_free (utf8_name);
+	}
+
+	gtk_widget_destroy (tdata->dialog);
+}
+
+
+static void
+add_theme_dir (ThemeDialogData *tdata,
+	       char            *theme_dir)
+{
+	GList          *dir_list = NULL;
+	GList          *scan;
+
+	debug (DEBUG_INFO, "theme dir: %s", theme_dir);
+
+	if (path_is_dir (theme_dir))
+		path_list_new (theme_dir, NULL, &dir_list);
+
+	for (scan = dir_list; scan; scan = scan->next) {
+		GtkTreeIter  iter;
+		char        *dir = scan->data;
+		char        *display_name;
+		GFile       *gfile;
+		
+		gfile = gfile_new (dir);
+		display_name = gfile_get_display_name (gfile);
+
+		gtk_list_store_append (tdata->list_store, &iter);
+		gtk_list_store_set (tdata->list_store, &iter,
+				    THEME_NAME_COLUMN, display_name,
+				    -1);
+		g_object_unref (gfile);
+		g_free (display_name);
+	}
+	path_list_free (dir_list);
+}
+
+
+static void
+load_themes (ThemeDialogData *tdata)
+{
+	char             *theme_dir;
+	const char       *theme_name;
+	GtkTreeModel     *model;
+	GtkTreeSelection *selection;
+	GtkTreeIter       iter;
+
+	theme_dir = g_build_path (G_DIR_SEPARATOR_S,
+				  g_get_home_dir (),
+				  ".gnome2",
+				  "gthumb/albumthemes",
+				  NULL);
+	add_theme_dir (tdata, theme_dir);
+	g_free (theme_dir);
+
+	theme_dir = g_build_path (G_DIR_SEPARATOR_S,
+				  GTHUMB_DATADIR,
+				  "gthumb/albumthemes",
+				  NULL);
+	add_theme_dir (tdata, theme_dir);
+	g_free (theme_dir);
+
+	/* Select the current theme */
+
+	model = GTK_TREE_MODEL (tdata->list_store);
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tdata->wat_theme_treeview));
+	theme_name = gtk_button_get_label (GTK_BUTTON (tdata->data->wa_select_theme_button));
+	if (! gtk_tree_model_get_iter_first (model, &iter))
+		return;
+
+	do {
+		char *utf8_name;
+		gtk_tree_model_get (model, &iter,
+				    THEME_NAME_COLUMN, &utf8_name,
+				    -1);
+		if (strcmp (utf8_name, theme_name) == 0)
+			gtk_tree_selection_select_iter (selection, &iter);
+	} while (gtk_tree_model_iter_next (model, &iter));
+}
+
+
+static void
+theme_dialog__row_activated_cb (GtkTreeView       *tree_view,
+				GtkTreePath       *path,
+				GtkTreeViewColumn *column,
+				ThemeDialogData   *tdata)
+{
+	theme_dialog__ok_clicked (NULL, tdata);
+}
+
+
+static void
+ensure_local_theme_dir_exists (void)
+{
+	char *theme_dir;
+
+	theme_dir = build_uri (get_home_uri (),
+			       ".gnome2",
+			       "gthumb/albumthemes",
+			       NULL);
+
+	dir_make (theme_dir);
+
+	g_free (theme_dir);
+}
+
+
+static void
+install_theme__ok_cb (GtkDialog  *file_sel,
+		      int         button_number,
+		      gpointer    data)
+{
+	ThemeDialogData  *tdata;
+	char             *theme_archive;
+	char             *command_line = NULL;
+	GError           *err = NULL;
+
+	tdata = g_object_get_data (G_OBJECT (file_sel), "theme_dialog_data");
+	theme_archive = g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_sel)));
+
+	gtk_widget_destroy (GTK_WIDGET (file_sel));
+
+	if (theme_archive == NULL)
+		return;
+
+	/**/
+
+	ensure_local_theme_dir_exists ();
+
+	if (file_extension_is (theme_archive, ".tar.gz")
+	    || file_extension_is (theme_archive, ".tgz"))
+		command_line = g_strdup_printf ("tar -C %s%s -zxf %s",
+						g_get_home_dir (),
+						"/.gnome2/gthumb/albumthemes",
+						theme_archive);
+
+	else if (file_extension_is (theme_archive, ".tar.bz2"))
+		command_line = g_strdup_printf ("tar -C %s%s -xf %s --use-compress-program bzip2",
+						g_get_home_dir (),
+						"/.gnome2/gthumb/albumthemes",
+						theme_archive);
+
+	if ((command_line != NULL)
+	    && ! g_spawn_command_line_sync (command_line, NULL, NULL, NULL, &err)
+	    && (err != NULL))
+		_gtk_error_dialog_from_gerror_run (NULL, &err);
+
+	g_free (command_line);
+	g_free (theme_archive);
+
+	/**/
+
+	gtk_list_store_clear (tdata->list_store);
+	load_themes (tdata);
+}
+
+
+static void
+install_theme_response_cb (GtkDialog  *file_sel,
+			   int         button_number,
+			   gpointer    userdata)
+{
+	if (button_number == GTK_RESPONSE_ACCEPT)
+		install_theme__ok_cb (file_sel, button_number, userdata);
+	 else
+		gtk_widget_destroy (GTK_WIDGET (file_sel));
+}
+
+
+static void
+theme_dialog__install_theme_clicked (GtkWidget       *widget,
+				     ThemeDialogData *tdata)
+{
+	GtkWidget *file_sel;
+
+	file_sel = gtk_file_chooser_dialog_new (_("Select Album Theme"),
+						GTK_WINDOW (tdata->dialog),
+						GTK_FILE_CHOOSER_ACTION_OPEN,
+						GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+						GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+						NULL);
+
+	gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), FALSE);
+	gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_sel), g_get_home_dir ());
+	gtk_dialog_set_default_response (GTK_DIALOG (file_sel), GTK_RESPONSE_ACCEPT);
+
+	g_object_set_data (G_OBJECT (file_sel), "theme_dialog_data", tdata);
+
+	g_signal_connect (G_OBJECT (file_sel),
+			  "response",
+			  G_CALLBACK (install_theme_response_cb),
+			  NULL);
+
+	gtk_window_set_modal (GTK_WINDOW (file_sel), TRUE);
+	gtk_widget_show (file_sel);
+}
+
+
+static void
+theme_dialog__go_to_folder_clicked (GtkWidget       *widget,
+				    ThemeDialogData *tdata)
+{
+	char         *path;
+	GError       *err = NULL;
+
+	path = g_strdup_printf ("file://%s/.gnome2/gthumb/albumthemes",
+			       g_get_home_dir ());
+
+	ensure_dir_exists (path, 0775);
+
+	if (! gnome_url_show (path, &err))
+		_gtk_error_dialog_from_gerror_run (GTK_WINDOW (tdata->dialog),
+						   &err);
+        g_free (path);
+}
+
+
+/* called when an item of the catalog list is selected. */
+static void
+theme_dialog__sel_changed_cb (GtkTreeSelection *selection,
+			      gpointer          p)
+{
+	ThemeDialogData  *tdata = p;
+	gboolean          theme_selected;
+	GtkTreeIter       iter;
+	char             *utf8_name;
+	char             *theme, *path;
+
+	theme_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
+
+	if (!theme_selected)
+		return;
+
+	gtk_tree_model_get (GTK_TREE_MODEL (tdata->list_store),
+			    &iter,
+			    THEME_NAME_COLUMN, &utf8_name,
+			    -1);
+
+	theme = gnome_vfs_escape_string (utf8_name);
+	path = g_build_path (G_DIR_SEPARATOR_S,
+			     g_get_home_dir (),
+			     ".gnome2",
+			     "gthumb/albumthemes",
+			     theme,
+			     NULL);
+
+	if (!path_is_dir (path)) {
+		g_free (path);
+		path = g_build_path (G_DIR_SEPARATOR_S,
+				     GTHUMB_DATADIR,
+				     "gthumb/albumthemes",
+				     theme,
+				     NULL);
+	}
+
+	if (path_is_dir (path)) {
+		char      *filename;
+		GdkPixbuf *image = NULL;
+					       
+		filename = build_uri (path, "preview.png", NULL);
+		if (path_is_file (filename)
+		    && ((image = gdk_pixbuf_new_from_file (filename, NULL)) != NULL)) {
+			int        w = gdk_pixbuf_get_width (image);
+			int        h = gdk_pixbuf_get_height (image);
+			if (scale_keeping_ratio (&w, &h, MAX_PREVIEW_SIZE, MAX_PREVIEW_SIZE, FALSE)) {
+				GdkPixbuf *tmp = image;
+				image = gdk_pixbuf_scale_simple (tmp, w, h, GDK_INTERP_BILINEAR);
+				g_object_unref (tmp);
+			}
+			gtk_image_set_from_pixbuf (GTK_IMAGE (tdata->wat_preview_image), image);
+		} 
+		else
+			gtk_image_set_from_stock (GTK_IMAGE (tdata->wat_preview_image), GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_BUTTON);
+
+		g_free (filename);
+		if (image != NULL)
+			g_object_unref (image);
+	}
+
+	g_free (utf8_name);
+	g_free (path);
+	g_free (theme);
+}
+
+
+static void show_thumbnail_caption_dialog_cb (GtkWidget  *widget,  ThemeDialogData *data);
+static void show_image_caption_dialog_cb     (GtkWidget  *widget,  ThemeDialogData *data);
+
+
+static void
+show_album_theme_cb (GtkWidget  *widget,
+		     DialogData *data)
+{
+	ThemeDialogData   *tdata;
+	GtkCellRenderer   *renderer;
+	GtkTreeViewColumn *column;
+	GtkTreeSelection  *selection;
+
+	tdata = g_new (ThemeDialogData, 1);
+
+	tdata->data = data;
+	tdata->browser = data->browser;
+
+	tdata->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_EXPORTER_FILE, NULL, NULL);
+        if (!tdata->gui) {
+		g_free (tdata);
+                g_warning ("Could not find " GLADE_EXPORTER_FILE "\n");
+                return;
+        }
+
+	/* Get the widgets. */
+
+	tdata->dialog = glade_xml_get_widget (tdata->gui, "web_album_theme_dialog");
+	tdata->wat_theme_treeview = glade_xml_get_widget (tdata->gui, "wat_theme_treeview");
+	tdata->wat_ok_button = glade_xml_get_widget (tdata->gui, "wat_ok_button");
+	tdata->wat_cancel_button = glade_xml_get_widget (tdata->gui, "wat_cancel_button");
+	tdata->wat_install_button = glade_xml_get_widget (tdata->gui, "wat_install_button");
+	tdata->wat_go_to_folder_button = glade_xml_get_widget (tdata->gui, "wat_go_to_folder_button");
+	tdata->wat_thumbnail_caption_button = glade_xml_get_widget (tdata->gui, "wat_thumbnail_caption_button");
+	tdata->wat_image_caption_button = glade_xml_get_widget (tdata->gui, "wat_image_caption_button");
+	tdata->wat_preview_image = glade_xml_get_widget (tdata->gui, "wat_preview_image");
+
+	/* Signals. */
+
+	g_signal_connect (G_OBJECT (tdata->dialog),
+			  "destroy",
+			  G_CALLBACK (theme_dialog_destroy_cb),
+			  tdata);
+	g_signal_connect_swapped (G_OBJECT (tdata->wat_cancel_button),
+				  "clicked",
+				  G_CALLBACK (gtk_widget_destroy),
+				  G_OBJECT (tdata->dialog));
+	g_signal_connect (G_OBJECT (tdata->wat_ok_button),
+			  "clicked",
+			  G_CALLBACK (theme_dialog__ok_clicked),
+			  tdata);
+	g_signal_connect (G_OBJECT (tdata->wat_theme_treeview),
+			  "row_activated",
+			  G_CALLBACK (theme_dialog__row_activated_cb),
+			  tdata);
+
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tdata->wat_theme_treeview));
+        g_signal_connect (G_OBJECT (selection),
+			  "changed",
+			  G_CALLBACK (theme_dialog__sel_changed_cb),
+			  tdata);
+
+	g_signal_connect (G_OBJECT (tdata->wat_install_button),
+			  "clicked",
+			  G_CALLBACK (theme_dialog__install_theme_clicked),
+			  tdata);
+	g_signal_connect (G_OBJECT (tdata->wat_go_to_folder_button),
+			  "clicked",
+			  G_CALLBACK (theme_dialog__go_to_folder_clicked),
+			  tdata);
+	g_signal_connect (G_OBJECT (tdata->wat_thumbnail_caption_button),
+			  "clicked",
+			  G_CALLBACK (show_thumbnail_caption_dialog_cb),
+			  tdata);
+	g_signal_connect (G_OBJECT (tdata->wat_image_caption_button),
+			  "clicked",
+			  G_CALLBACK (show_image_caption_dialog_cb),
+			  tdata);
+
+	/* Set widgets data. */
+
+	tdata->list_store = gtk_list_store_new (NUM_OF_COLUMNS, G_TYPE_STRING);
+	gtk_tree_view_set_model (GTK_TREE_VIEW (tdata->wat_theme_treeview), GTK_TREE_MODEL (tdata->list_store));
+	g_object_unref (tdata->list_store);
+
+	gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tdata->wat_theme_treeview), FALSE);
+	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tdata->wat_theme_treeview), FALSE);
+
+	column = gtk_tree_view_column_new ();
+	renderer = gtk_cell_renderer_text_new ();
+        gtk_tree_view_column_pack_start (column, renderer, TRUE);
+        gtk_tree_view_column_set_attributes (column, renderer,
+                                             "text", THEME_NAME_COLUMN,
+                                             NULL);
+
+        gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+	gtk_tree_view_column_set_sort_column_id (column, THEME_NAME_COLUMN);
+        gtk_tree_view_append_column (GTK_TREE_VIEW (tdata->wat_theme_treeview), column);
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (tdata->list_store), THEME_NAME_COLUMN, GTK_SORT_ASCENDING);
+
+	load_themes (tdata);
+
+	/* Run dialog. */
+
+	gtk_widget_grab_focus (tdata->wat_theme_treeview);
+
+	gtk_window_set_transient_for (GTK_WINDOW (tdata->dialog), GTK_WINDOW (data->dialog));
+	gtk_window_set_modal (GTK_WINDOW (tdata->dialog), TRUE);
+	gtk_widget_show_all (tdata->dialog);
+}
+
+
+typedef struct {
+	DialogData         *data;
+	GthBrowser         *browser;
+
+	GladeXML           *gui;
+	GtkWidget          *dialog;
+
+	GtkWidget          *c_comment_checkbutton;
+	GtkWidget          *c_place_checkbutton;
+	GtkWidget          *c_date_time_checkbutton;
+	GtkWidget          *c_imagedim_checkbutton;
+	GtkWidget          *c_filename_checkbutton;
+	GtkWidget          *c_filesize_checkbutton;
+
+	GtkWidget          *c_exif_date_time_checkbutton;
+	GtkWidget          *c_exif_exposure_time_checkbutton;
+	GtkWidget          *c_exif_exposure_mode_checkbutton;
+	GtkWidget          *c_exif_flash_checkbutton;
+	GtkWidget          *c_exif_shutter_speed_checkbutton;
+	GtkWidget          *c_exif_aperture_value_checkbutton;
+	GtkWidget          *c_exif_focal_length_checkbutton;
+	GtkWidget          *c_exif_camera_model_checkbutton;
+
+	gboolean            thumbnail_caption;
+} CaptionDialogData;
+
+
+/* called when the dialog is closed. */
+static void
+caption_dialog_destroy_cb (GtkWidget         *widget,
+			   CaptionDialogData *cdata)
+{
+	g_object_unref (cdata->gui);
+	g_free (cdata);
+}
+
+
+static void
+caption_dialog__ok_clicked (GtkWidget         *widget,
+			    CaptionDialogData *cdata)
+{
+	const char       *gconf_key;
+	GthCaptionFields  caption = 0;
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_comment_checkbutton)))
+		caption |= GTH_CAPTION_COMMENT;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_place_checkbutton)))
+		caption |= GTH_CAPTION_PLACE;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_date_time_checkbutton)))
+		caption |= GTH_CAPTION_DATE_TIME;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_imagedim_checkbutton)))
+		caption |= GTH_CAPTION_IMAGE_DIM;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_filename_checkbutton)))
+		caption |= GTH_CAPTION_FILE_NAME;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_filesize_checkbutton)))
+		caption |= GTH_CAPTION_FILE_SIZE;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_date_time_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_DATE_TIME;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_exposure_time_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_EXPOSURE_TIME;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_exposure_mode_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_EXPOSURE_MODE;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_flash_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_FLASH;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_shutter_speed_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_SHUTTER_SPEED;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_aperture_value_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_APERTURE_VALUE;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_focal_length_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_FOCAL_LENGTH;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cdata->c_exif_camera_model_checkbutton)))
+		caption |= GTH_CAPTION_EXIF_CAMERA_MODEL;
+
+	if (cdata->thumbnail_caption) {
+		catalog_web_exporter_set_index_caption (cdata->data->exporter, caption);
+		gconf_key = PREF_WEB_ALBUM_INDEX_CAPTION;
+	} else {
+		catalog_web_exporter_set_image_caption (cdata->data->exporter, caption);
+		gconf_key = PREF_WEB_ALBUM_IMAGE_CAPTION;
+	}
+
+	eel_gconf_set_integer (gconf_key, caption);
+
+	gtk_widget_destroy (cdata->dialog);
+}
+
+
+static void
+show_caption_dialog_cb (GtkWidget       *widget,
+			ThemeDialogData *tdata,
+			gboolean         thumbnail_caption)
+{
+	CaptionDialogData *cdata;
+	GtkWidget         *ok_button;
+	GtkWidget         *cancel_button;
+	const char        *gconf_key;
+	GthCaptionFields   caption = 0;
+	cdata = g_new (CaptionDialogData, 1);
+
+	cdata->data = tdata->data;
+	cdata->browser = tdata->browser;
+	cdata->thumbnail_caption = thumbnail_caption;
+
+	cdata->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_EXPORTER_FILE, NULL, NULL);
+        if (!cdata->gui) {
+		g_free (cdata);
+                g_warning ("Could not find " GLADE_EXPORTER_FILE "\n");
+                return;
+        }
+
+	/* Get the widgets. */
+
+	cdata->dialog = glade_xml_get_widget (cdata->gui, "caption_dialog");
+	cdata->c_comment_checkbutton = glade_xml_get_widget (cdata->gui, "c_comment_checkbutton");
+	cdata->c_place_checkbutton = glade_xml_get_widget (cdata->gui, "c_place_checkbutton");
+	cdata->c_date_time_checkbutton = glade_xml_get_widget (cdata->gui, "c_date_time_checkbutton");
+	cdata->c_imagedim_checkbutton = glade_xml_get_widget (cdata->gui, "c_imagedim_checkbutton");
+	cdata->c_filename_checkbutton = glade_xml_get_widget (cdata->gui, "c_filename_checkbutton");
+	cdata->c_filesize_checkbutton = glade_xml_get_widget (cdata->gui, "c_filesize_checkbutton");
+	cdata->c_exif_date_time_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_date_time_checkbutton");
+	cdata->c_exif_exposure_time_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_exposure_time_checkbutton");
+	cdata->c_exif_exposure_mode_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_exposure_mode_checkbutton");
+	cdata->c_exif_flash_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_flash_checkbutton");
+	cdata->c_exif_shutter_speed_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_shutter_speed_checkbutton");
+	cdata->c_exif_aperture_value_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_aperture_value_checkbutton");
+	cdata->c_exif_focal_length_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_focal_length_checkbutton");
+	cdata->c_exif_camera_model_checkbutton = glade_xml_get_widget (cdata->gui, "c_exif_camera_model_checkbutton");
+
+	ok_button = glade_xml_get_widget (cdata->gui, "c_okbutton");
+	cancel_button = glade_xml_get_widget (cdata->gui, "c_cancelbutton");
+
+	/* Signals. */
+
+	g_signal_connect (G_OBJECT (cdata->dialog),
+			  "destroy",
+			  G_CALLBACK (caption_dialog_destroy_cb),
+			  cdata);
+	g_signal_connect_swapped (G_OBJECT (cancel_button),
+				  "clicked",
+				  G_CALLBACK (gtk_widget_destroy),
+				  G_OBJECT (cdata->dialog));
+	g_signal_connect (G_OBJECT (ok_button),
+			  "clicked",
+			  G_CALLBACK (caption_dialog__ok_clicked),
+			  cdata);
+
+	/* Set widgets data. */
+
+	if (cdata->thumbnail_caption)
+		gconf_key = PREF_WEB_ALBUM_INDEX_CAPTION;
+	 else
+		gconf_key = PREF_WEB_ALBUM_IMAGE_CAPTION;
+	caption = eel_gconf_get_integer (gconf_key, 0);
+
+	if (caption & GTH_CAPTION_COMMENT)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_comment_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_PLACE)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_place_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_DATE_TIME)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_date_time_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_IMAGE_DIM)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_imagedim_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_FILE_NAME)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_filename_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_FILE_SIZE)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_filesize_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_DATE_TIME)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_date_time_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_EXPOSURE_TIME)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_exposure_time_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_EXPOSURE_MODE)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_exposure_mode_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_FLASH)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_flash_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_SHUTTER_SPEED)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_shutter_speed_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_APERTURE_VALUE)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_aperture_value_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_FOCAL_LENGTH)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_focal_length_checkbutton), TRUE);
+	if (caption & GTH_CAPTION_EXIF_CAMERA_MODEL)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cdata->c_exif_camera_model_checkbutton), TRUE);
+
+
+	/* Run dialog. */
+
+	gtk_window_set_transient_for (GTK_WINDOW (cdata->dialog), GTK_WINDOW (tdata->dialog));
+	gtk_window_set_modal (GTK_WINDOW (cdata->dialog), TRUE);
+	gtk_widget_show (cdata->dialog);
+}
+
+
+static void
+show_thumbnail_caption_dialog_cb (GtkWidget       *widget,
+				  ThemeDialogData *data)
+{
+	show_caption_dialog_cb (widget, data, TRUE);
+}
+
+
+static void
+show_image_caption_dialog_cb (GtkWidget       *widget,
+			      ThemeDialogData *data)
+{
+	show_caption_dialog_cb (widget, data, FALSE);
+}
diff --git a/extensions/webalbums/dlg-web-exporter.h b/extensions/webalbums/dlg-web-exporter.h
new file mode 100644
index 0000000..bc5e950
--- /dev/null
+++ b/extensions/webalbums/dlg-web-exporter.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef DLG_WEB_EXPORTER_H
+#define DLG_WEB_EXPORTER_H
+
+#include "gth-browser.h"
+
+void   dlg_web_exporter    (GthBrowser *browser);
+
+#endif /* DLG_WEB_EXPORTER_H */
diff --git a/extensions/webalbums/webalbums.extension.in.in b/extensions/webalbums/webalbums.extension.in.in
new file mode 100644
index 0000000..f0565a0
--- /dev/null
+++ b/extensions/webalbums/webalbums.extension.in.in
@@ -0,0 +1,11 @@
+[Extension]
+_Name=Web Albums
+_Description=Create static web albums.
+_Authors=gthumb development team
+Copyright=Copyright © 2010 The Free Software Foundation, Inc.
+Version=1.0
+Category=Exporter
+
+[Loader]
+Type=module
+File=%LIBRARY%



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