diff -r f6cec49c42ff ChangeLog
--- a/ChangeLog	Wed Sep 27 05:35:31 2006 +0000
+++ b/ChangeLog	Mon Nov 06 08:57:36 2006 +0000
@@ -1,3 +1,16 @@ Mon Jun 13 20:22:58 2005  John Ellis  <j
+Tue Sep 26 18:15:00 2006  Uwe Ohse <uwe@ohse.de>
+
+	* image-overlay.c, image-overlay.h, layout_image.c: implement 
+	  histogramm in overlay.
+	
+	* Makefile.in, aclocal.m4, configure, doc/Makefile.in, 
+	  src/Makefile.in, src/icons/Makefile.in: aclocal, autoreconf, 
+	  automake.
+
+	* src/Makefile.am, src/Makefile.in, src/exif.c, src/filelist.c, 
+	  src/format_raw.c, src/format_pentax.c, src/format_pentax.h:
+	  add support for pentax .pef raw files.
+
 Mon Jun 13 20:22:58 2005  John Ellis  <johne@verizon.net>
 
 	* image.c (image_zoom_cb): If needed, update window title when
diff -r f6cec49c42ff Makefile.in
--- a/Makefile.in	Wed Sep 27 05:35:31 2006 +0000
+++ b/Makefile.in	Mon Nov 06 08:57:36 2006 +0000
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  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.
@@ -355,7 +355,13 @@ uninstall-readmeDATA:
 #     (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):
-	@set fnord $$MAKEFLAGS; amf=$$2; \
+	@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 \
@@ -367,7 +373,7 @@ uninstall-readmeDATA:
 	    local_target="$$target"; \
 	  fi; \
 	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -375,7 +381,13 @@ uninstall-readmeDATA:
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-	@set fnord $$MAKEFLAGS; amf=$$2; \
+	@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)' ;; \
@@ -396,7 +408,7 @@ maintainer-clean-recursive:
 	    local_target="$$target"; \
 	  fi; \
 	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	  || eval $$failcom; \
 	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
diff -r f6cec49c42ff aclocal.m4
--- a/aclocal.m4	Wed Sep 27 05:35:31 2006 +0000
+++ b/aclocal.m4	Mon Nov 06 08:57:36 2006 +0000
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.2 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
 # This file 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.
@@ -12,7 +12,7 @@
 # PARTICULAR PURPOSE.
 
 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
-# Copyright (C) 2001-2003 Red Hat, Inc.
+# Copyright (C) 2001-2003,2004 Red Hat, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -35,7 +35,9 @@
 #
 # Added better handling of ALL_LINGUAS from GNU gettext version 
 # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
-
+#
+# Modified to require ngettext
+# Matthias Clasen <mclasen@redhat.com> 08/06/2004
 #
 # We need this here as well, since someone might use autoconf-2.5x
 # to configure GLib then an older version to configure a package
@@ -128,16 +130,27 @@ glib_DEFUN([GLIB_WITH_NLS],
       #
       # First check in libc
       #
-      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
+      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
         [AC_TRY_LINK([
 #include <libintl.h>
 ],
-          [return (int) dgettext ("","")],
-	  gt_cv_func_dgettext_libc=yes,
-          gt_cv_func_dgettext_libc=no)
+         [return !ngettext ("","", 1)],
+	  gt_cv_func_ngettext_libc=yes,
+          gt_cv_func_ngettext_libc=no)
         ])
   
-      if test "$gt_cv_func_dgettext_libc" = "yes" ; then
+      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
+	      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
+        	[AC_TRY_LINK([
+#include <libintl.h>
+],
+	          [return !dgettext ("","")],
+		  gt_cv_func_dgettext_libc=yes,
+	          gt_cv_func_dgettext_libc=no)
+        	])
+      fi
+  
+      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
         AC_CHECK_FUNCS(bind_textdomain_codeset)
       fi
 
@@ -145,25 +158,29 @@ glib_DEFUN([GLIB_WITH_NLS],
       # If we don't have everything we want, check in libintl
       #
       if test "$gt_cv_func_dgettext_libc" != "yes" \
+	 || test "$gt_cv_func_ngettext_libc" != "yes" \
          || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
         
         AC_CHECK_LIB(intl, bindtextdomain,
-	    [AC_CHECK_LIB(intl, dgettext,
-		          gt_cv_func_dgettext_libintl=yes)])
+	    [AC_CHECK_LIB(intl, ngettext,
+		    [AC_CHECK_LIB(intl, dgettext,
+			          gt_cv_func_dgettext_libintl=yes)])])
 
 	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 	  AC_MSG_CHECKING([if -liconv is needed to use gettext])
 	  AC_MSG_RESULT([])
-          AC_CHECK_LIB(intl, dcgettext,
+  	  AC_CHECK_LIB(intl, ngettext,
+          	[AC_CHECK_LIB(intl, dcgettext,
 		       [gt_cv_func_dgettext_libintl=yes
 			libintl_extra_libs=-liconv],
-			:,-liconv)
+			:,-liconv)],
+		:,-liconv)
         fi
 
         #
         # If we found libintl, then check in it for bind_textdomain_codeset();
         # we'll prefer libc if neither have bind_textdomain_codeset(),
-        # and both have dgettext
+        # and both have dgettext and ngettext
         #
         if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
           glib_save_LIBS="$LIBS"
@@ -175,7 +192,8 @@ glib_DEFUN([GLIB_WITH_NLS],
           if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
             gt_cv_func_dgettext_libc=no
           else
-            if test "$gt_cv_func_dgettext_libc" = "yes"; then
+            if test "$gt_cv_func_dgettext_libc" = "yes" \
+		&& test "$gt_cv_func_ngettext_libc" = "yes"; then
               gt_cv_func_dgettext_libintl=no
             fi
           fi
@@ -589,23 +607,11 @@ main ()
   rm -f conf.gtktest
 ])
 
-#                                                        -*- Autoconf -*-
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
-# Generated from amversion.in; do not edit by hand.
-
-# 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, 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 Place - Suite 330, Boston, MA
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
@@ -618,26 +624,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api
 # Call AM_AUTOMAKE_VERSION so it can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-	 [AM_AUTOMAKE_VERSION([1.9.2])])
-
-# AM_AUX_DIR_EXPAND
-
-# Copyright (C) 2001, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+	 [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
@@ -684,26 +679,16 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
 
-# AM_CONDITIONAL                                              -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 6
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 7
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -727,33 +712,21 @@ Usually this means the macro was only in
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# serial 7						-*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
 # 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+#
+# This file 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.
+
+# serial 8
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
 
 
 # _AM_DEPENDENCIES(NAME)
@@ -895,27 +868,16 @@ AC_SUBST([AMDEPBACKSLASH])
 AC_SUBST([AMDEPBACKSLASH])
 ])
 
-# Generate code to set up dependency tracking.   -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
-#   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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-#serial 2
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
+
+#serial 3
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
@@ -974,30 +936,19 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS]
      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-# Do all the work for Automake.                            -*- Autoconf -*-
-
-# This macro actually does too much some checks are only needed if
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 11
 
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
@@ -1099,51 +1050,27 @@ done
 done
 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
-
-# Copyright (C) 2001, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 install_sh=${install_sh-"$am_aux_dir/install-sh"}
 AC_SUBST(install_sh)])
 
-#                                                          -*- Autoconf -*-
-# 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 1
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 2
 
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
@@ -1158,28 +1085,17 @@ rmdir .tst 2>/dev/null
 rmdir .tst 2>/dev/null
 AC_SUBST([am__leading_dot])])
 
-# Add --enable-maintainer-mode option to configure.
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
 # 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
+#
+# This file 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.
+
+# serial 4
 
 AC_DEFUN([AM_MAINTAINER_MODE],
 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
@@ -1198,26 +1114,15 @@ AC_DEFUN([AM_MAINTAINER_MODE],
 
 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
 
-# Check to see how 'make' treats includes.	-*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 3
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -1261,27 +1166,16 @@ rm -f confinc confmf
 rm -f confinc confmf
 ])
 
-#  -*- Autoconf -*-
-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 4
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -1307,27 +1201,16 @@ fi
 fi
 ])
 
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
 # AM_PROG_MKDIR_P
 # ---------------
 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-
-# Copyright (C) 2003, 2004 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+#
 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
 # created by `make install' are always world readable, even if the
 # installer happens to have an overly restrictive umask (e.g. 077).
@@ -1381,26 +1264,15 @@ fi
 fi
 AC_SUBST([mkdir_p])])
 
-# Helper functions for option handling.                    -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 2
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 3
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -1425,28 +1297,16 @@ AC_DEFUN([_AM_IF_OPTION],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-#
-# Check to make sure that the build environment is sane.
-#
-
-# Copyright (C) 1996, 1997, 2000, 2001, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 4
 
 # AM_SANITY_CHECK
 # ---------------
@@ -1489,25 +1349,14 @@ fi
 fi
 AC_MSG_RESULT(yes)])
 
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
 # AM_PROG_INSTALL_STRIP
-
-# Copyright (C) 2001, 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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+# ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
@@ -1530,25 +1379,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004  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, 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 Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 1
-
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
+# serial 2
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
diff -r f6cec49c42ff configure
--- a/configure	Wed Sep 27 05:35:31 2006 +0000
+++ b/configure	Mon Nov 06 08:57:36 2006 +0000
@@ -719,13 +719,13 @@ echo X"$0" |
   	  /^X\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
+if test ! -r "$srcdir/$ac_unique_file"; then
   if test "$ac_srcdir_defaulted" = yes; then
     { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
    { (exit 1); exit 1; }; }
@@ -734,7 +734,7 @@ if test ! -r $srcdir/$ac_unique_file; th
    { (exit 1); exit 1; }; }
   fi
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null ||
   { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
    { (exit 1); exit 1; }; }
 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
@@ -5119,9 +5119,9 @@ if test $ac_cv_header_libintl_h = yes; t
       #
       # First check in libc
       #
-      echo "$as_me:$LINENO: checking for dgettext in libc" >&5
-echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6
-if test "${gt_cv_func_dgettext_libc+set}" = set; then
+      echo "$as_me:$LINENO: checking for ngettext in libc" >&5
+echo $ECHO_N "checking for ngettext in libc... $ECHO_C" >&6
+if test "${gt_cv_func_ngettext_libc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -5136,7 +5136,7 @@ int
 int
 main ()
 {
-return (int) dgettext ("","")
+return !ngettext ("","", 1)
   ;
   return 0;
 }
@@ -5163,21 +5163,81 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  gt_cv_func_dgettext_libc=yes
+  gt_cv_func_ngettext_libc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gt_cv_func_dgettext_libc=no
+gt_cv_func_ngettext_libc=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
+echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5
+echo "${ECHO_T}$gt_cv_func_ngettext_libc" >&6
+
+      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
+	      echo "$as_me:$LINENO: checking for dgettext in libc" >&5
+echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6
+if test "${gt_cv_func_dgettext_libc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <libintl.h>
+
+int
+main ()
+{
+return !dgettext ("","")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gt_cv_func_dgettext_libc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_dgettext_libc=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
 echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5
 echo "${ECHO_T}$gt_cv_func_dgettext_libc" >&6
-
-      if test "$gt_cv_func_dgettext_libc" = "yes" ; then
+      fi
+
+      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
 for ac_func in bind_textdomain_codeset
 do
@@ -5286,6 +5346,7 @@ done
       # If we don't have everything we want, check in libintl
       #
       if test "$gt_cv_func_dgettext_libc" != "yes" \
+	 || test "$gt_cv_func_ngettext_libc" != "yes" \
          || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
         echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
@@ -5353,6 +5414,71 @@ echo "$as_me:$LINENO: result: $ac_cv_lib
 echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
 echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6
 if test $ac_cv_lib_intl_bindtextdomain = yes; then
+  echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
+echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_ngettext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ngettext ();
+int
+main ()
+{
+ngettext ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_intl_ngettext=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_ngettext=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6
+if test $ac_cv_lib_intl_ngettext = yes; then
   echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
 echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6
 if test "${ac_cv_lib_intl_dgettext+set}" = set; then
@@ -5423,13 +5549,80 @@ fi
 
 fi
 
+fi
+
 
 	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 	  echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5
 echo $ECHO_N "checking if -liconv is needed to use gettext... $ECHO_C" >&6
 	  echo "$as_me:$LINENO: result: " >&5
 echo "${ECHO_T}" >&6
-          echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5
+  	  echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
+echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_ngettext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl -liconv $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ngettext ();
+int
+main ()
+{
+ngettext ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_intl_ngettext=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_ngettext=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6
+if test $ac_cv_lib_intl_ngettext = yes; then
+  echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5
 echo $ECHO_N "checking for dcgettext in -lintl... $ECHO_C" >&6
 if test "${ac_cv_lib_intl_dcgettext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5500,12 +5693,16 @@ else
   :
 fi
 
+else
+  :
+fi
+
         fi
 
         #
         # If we found libintl, then check in it for bind_textdomain_codeset();
         # we'll prefer libc if neither have bind_textdomain_codeset(),
-        # and both have dgettext
+        # and both have dgettext and ngettext
         #
         if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
           glib_save_LIBS="$LIBS"
@@ -5618,7 +5815,8 @@ done
           if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
             gt_cv_func_dgettext_libc=no
           else
-            if test "$gt_cv_func_dgettext_libc" = "yes"; then
+            if test "$gt_cv_func_dgettext_libc" = "yes" \
+		&& test "$gt_cv_func_ngettext_libc" = "yes"; then
               gt_cv_func_dgettext_libintl=no
             fi
           fi
diff -r f6cec49c42ff doc/8_2_fullscreen.html
--- a/doc/8_2_fullscreen.html	Wed Sep 27 05:35:31 2006 +0000
+++ b/doc/8_2_fullscreen.html	Mon Nov 06 08:57:36 2006 +0000
@@ -80,9 +80,11 @@ are available when in full screen, these
 are available when in full screen, these are the commands available:</P>
 <CENTER>
 	<TABLE WIDTH=80% BORDER=1 BORDERCOLOR="#cccccc" CELLPADDING=4 CELLSPACING=0 RULES=ROWS>
-		<COL WIDTH=85*>
-		<COL WIDTH=85*>
-		<COL WIDTH=85*>
+	        <COLGROUP>
+		<COL WIDTH=85*>
+		<COL WIDTH=85*>
+		<COL WIDTH=85*>
+	        </COLGROUP>
 		<TR VALIGN=TOP>
 			<TD WIDTH=33%>
 				<P ALIGN=CENTER><B>Keyboard</B></P>
@@ -319,7 +321,23 @@ also available through the keyboard and 
 				<P>I</P>
 			</TD>
 			<TD WIDTH=50%>
-				<P>Toggle information overlay for full screen.</P>
+				<P>Toggle information overlay for full screen: on with histogramm, on without histogramm, off.</P>
+			</TD>
+		</TR>
+		<TR VALIGN=TOP>
+			<TD WIDTH=50%>
+				<P>K</P>
+			</TD>
+			<TD WIDTH=50%>
+				<P>Switch between the different histogramm modes: RGB, value, maximum value, red channel, green channel, blue channel.</P>
+			</TD>
+		</TR>
+		<TR VALIGN=TOP>
+			<TD WIDTH=50%>
+				<P>L</P>
+			</TD>
+			<TD WIDTH=50%>
+				<P>Toogle between linear and logarithmical histogramm.</P>
 			</TD>
 		</TR>
 		<TR VALIGN=TOP>
diff -r f6cec49c42ff doc/Makefile.in
--- a/doc/Makefile.in	Wed Sep 27 05:35:31 2006 +0000
+++ b/doc/Makefile.in	Mon Nov 06 08:57:36 2006 +0000
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  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.
diff -r f6cec49c42ff src/Makefile.am
--- a/src/Makefile.am	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/Makefile.am	Mon Nov 06 08:57:36 2006 +0000
@@ -92,6 +92,8 @@ gqview_SOURCES = \
 	format_nikon.h	\
 	format_olympus.c	\
 	format_olympus.h	\
+	format_pentax.c	\
+	format_pentax.h	\
 	format_raw.c	\
 	format_raw.h	\
 	fullscreen.c	\
diff -r f6cec49c42ff src/Makefile.in
--- a/src/Makefile.in	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/Makefile.in	Mon Nov 06 08:57:36 2006 +0000
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  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.
@@ -14,8 +14,6 @@
 
 @SET_MAKE@
 
-
-SOURCES = $(gqview_SOURCES)
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -63,8 +61,9 @@ am_gqview_OBJECTS = $(am__objects_1) bar
 	editors.$(OBJEXT) exif.$(OBJEXT) filelist.$(OBJEXT) \
 	format_canon.$(OBJEXT) format_fuji.$(OBJEXT) \
 	format_nikon.$(OBJEXT) format_olympus.$(OBJEXT) \
-	format_raw.$(OBJEXT) fullscreen.$(OBJEXT) globals.$(OBJEXT) \
-	image.$(OBJEXT) image-load.$(OBJEXT) image-overlay.$(OBJEXT) \
+	format_pentax.$(OBJEXT) format_raw.$(OBJEXT) \
+	fullscreen.$(OBJEXT) globals.$(OBJEXT) image.$(OBJEXT) \
+	image-load.$(OBJEXT) image-overlay.$(OBJEXT) \
 	img-view.$(OBJEXT) info.$(OBJEXT) layout.$(OBJEXT) \
 	layout_config.$(OBJEXT) layout_image.$(OBJEXT) \
 	layout_util.$(OBJEXT) main.$(OBJEXT) md5-util.$(OBJEXT) \
@@ -274,6 +273,8 @@ gqview_SOURCES = \
 	format_nikon.h	\
 	format_olympus.c	\
 	format_olympus.h	\
+	format_pentax.c	\
+	format_pentax.h	\
 	format_raw.c	\
 	format_raw.h	\
 	fullscreen.c	\
@@ -429,6 +430,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format_fuji.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format_nikon.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format_olympus.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format_pentax.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format_raw.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fullscreen.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Po@am__quote@
@@ -494,7 +496,13 @@ uninstall-info-am:
 #     (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):
-	@set fnord $$MAKEFLAGS; amf=$$2; \
+	@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 \
@@ -506,7 +514,7 @@ uninstall-info-am:
 	    local_target="$$target"; \
 	  fi; \
 	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -514,7 +522,13 @@ uninstall-info-am:
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-	@set fnord $$MAKEFLAGS; amf=$$2; \
+	@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)' ;; \
@@ -535,7 +549,7 @@ maintainer-clean-recursive:
 	    local_target="$$target"; \
 	  fi; \
 	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	  || eval $$failcom; \
 	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
diff -r f6cec49c42ff src/bar_info.c
--- a/src/bar_info.c	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/bar_info.c	Mon Nov 06 08:57:36 2006 +0000
@@ -21,6 +21,7 @@
 #include "ui_fileops.h"
 #include "ui_misc.h"
 #include "ui_utildlg.h"
+#include <ctype.h>
 
 
 #define BAR_KEYWORD_AUTOSAVE_TIME 10000
@@ -258,6 +259,53 @@ GList *keyword_list_pull(GtkWidget *text
 	g_free(text);
 
 	return list;
+}
+
+gint keyword_list_get_stars(const gchar *path)
+{
+	GList *x;
+	GList *y;
+	gint val=0;
+	if (!comment_cache_read(path, &x, NULL)) return 0;
+	if (!x) return 0;
+	for (y=x;y;y=y->next) {
+		const gchar *word = y->data;
+		if (word && isdigit(word[0]) && word[1]=='*')
+			val=strtol(word,NULL,10);
+	}
+	path_list_free(x);
+	return val;
+}
+
+gint keyword_list_set_stars(const gchar *path, gint stars)
+{
+	GList *x=NULL;
+	GList *y;
+	gchar *comments=0;
+	if (comment_cache_read(path, &x, &comments)) {
+	  while (1) {
+	    int dobreak=1;
+	    for (y=x;y;y=y->next) {
+		    gchar *word = y->data;
+		    if (word && isdigit(word[0]) && word[1]=='*') {
+			    x=g_list_remove_link(x,y);
+		            g_free(word);
+			    g_list_free(y);
+			    dobreak=0;
+		    }
+	    }
+	    if (dobreak) break;
+	  }
+	}
+	if (stars >0 && stars <=5) {
+	  char buf[3];
+	  sprintf(buf,"%u*",stars);
+	  x=g_list_append(x,g_strdup(buf));
+	}
+	comment_cache_write(path, x, comments);
+	path_list_free(x);
+	if (comments) g_free(comments);
+	return stars;
 }
 
 void keyword_list_push(GtkWidget *textview, GList *list)
diff -r f6cec49c42ff src/bar_info.h
--- a/src/bar_info.h	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/bar_info.h	Mon Nov 06 08:57:36 2006 +0000
@@ -36,5 +36,7 @@ GList *keyword_list_pull(GtkWidget *text
 GList *keyword_list_pull(GtkWidget *text_widget);
 void keyword_list_push(GtkWidget *textview, GList *list);
 
+gint keyword_list_get_stars(const gchar *path);
+gint keyword_list_set_stars(const gchar *path, gint stars);
 
 #endif
diff -r f6cec49c42ff src/exif.c
--- a/src/exif.c	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/exif.c	Mon Nov 06 08:57:36 2006 +0000
@@ -106,6 +106,36 @@ ExifFormatAttrib ExifFormatList[] = {
  * Data
  *-----------------------------------------------------------------------------
  */
+static ExifTextList ExifCompressionList[] = {
+	{ 1, "Uncompressed" },
+	{ 2, "CCITT 1D" },
+	{ 3, "T4/Group 3 Fax" },
+	{ 4, "T6/Group 4 Fax" },
+	{ 5, "LZW" },
+	{ 6, "JPEG (old style)" },
+	{ 7, "JPEG" },
+	{ 8, "Adobe Deflate" },
+	{ 9, "JBIG B&W" },
+	{ 10, "JBIG Color" },
+	{ 32766, "Next" },
+	{ 32771, "CCIRLEW" },
+	{ 32773, "PackBits" },
+	{ 32809, "ThunderScan" },
+	{ 32895, "IT8CTPAD" },
+	{ 32896, "IT8LW" },
+	{ 32897, "IT8MP" },
+	{ 32898, "IT8BL" },
+	{ 32908, "PixasFilm" },
+	{ 32909, "PixasLog" },
+	{ 32946, "Deflate" },
+	{ 32947, "DCS" },
+	{ 34661, "JBIG" },
+	{ 34676, "SGILog" },
+	{ 34677, "SGILog24" },
+	{ 34712, "JPEF 2000" },
+	{ 34713, "Nikon NEF Compressed" },
+	EXIF_TEXT_LIST_END
+};
 
 static ExifTextList ExifOrientationList[] = {
 	{ EXIF_ORIENTATION_UNKNOWN,	N_("unknown") },
@@ -284,7 +314,13 @@ static ExifTextList ExifSubjectRangeList
 	EXIF_TEXT_LIST_END
 };
 
+
+
 ExifMarker ExifKnownMarkersList[] = {
+{ 0x0100, EXIF_FORMAT_LONG_UNSIGNED, 1,		"ImageWidth",	N_("Image Width"), NULL },
+{ 0x0101, EXIF_FORMAT_LONG_UNSIGNED, 1,		"ImageHeight",	N_("Image Height"), NULL },
+{ 0x0102, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"BitsPerSample",	N_("Bits per Sample/Pixel"), NULL },
+{ 0x0103, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Compression",	N_("Compression"), ExifCompressionList },
 { 0x010e, EXIF_FORMAT_STRING, -1,		"ImageDescription",	N_("Image description"), NULL },
 { 0x010f, EXIF_FORMAT_STRING, -1,		"Make",			"Camera make", NULL },
 { 0x0110, EXIF_FORMAT_STRING, -1,		"Model",		"Camera model", NULL },
@@ -755,7 +791,6 @@ static gint exif_parse_IFD_entry(ExifDat
 	guint data_length;
 	const ExifMarker *marker;
 	ExifItem *item;
-
 	tag = exif_byte_get_int16(tiff + offset + EXIF_TIFD_OFFSET_TAG, bo);
 	format = exif_byte_get_int16(tiff + offset + EXIF_TIFD_OFFSET_FORMAT, bo);
 	count = exif_byte_get_int32(tiff + offset + EXIF_TIFD_OFFSET_COUNT, bo);
diff -r f6cec49c42ff src/filelist.c
--- a/src/filelist.c	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/filelist.c	Mon Nov 06 08:57:36 2006 +0000
@@ -214,6 +214,7 @@ void filter_add_defaults(void)
 	filter_add_if_missing("crw", "Canon raw format", ".crw;.cr2", TRUE);
 	filter_add_if_missing("raf", "Fujifilm raw format", ".raf", TRUE);
 	filter_add_if_missing("nef", "Nikon raw format", ".nef", TRUE);
+	filter_add_if_missing("pef", "Pentax raw format", ".pef", TRUE);
 }
 
 static GList *filter_to_list(const gchar *extensions)
diff -r f6cec49c42ff src/format_raw.c
--- a/src/format_raw.c	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/format_raw.c	Mon Nov 06 08:57:36 2006 +0000
@@ -32,6 +32,7 @@
 #include "format_fuji.h"
 #include "format_nikon.h"
 #include "format_olympus.h"
+#include "format_pentax.h"
 
 
 /* so that debugging is honored */
@@ -53,6 +54,7 @@ static FormatRawEntry format_raw_list[] 
 	FORMAT_RAW_CANON,
 	FORMAT_RAW_FUJI,
 	FORMAT_RAW_NIKON,
+	FORMAT_RAW_PENTAX,
 	{ NULL, 0, 0, NULL, 0, NULL, NULL }
 };
 
@@ -71,6 +73,7 @@ static FormatExifEntry format_exif_list[
 	FORMAT_EXIF_FUJI,
 	FORMAT_EXIF_NIKON,
 	FORMAT_EXIF_OLYMPUS,
+	FORMAT_EXIF_PENTAX,
 	{ 0, NULL, 0, NULL }
 };
 
@@ -187,7 +190,6 @@ static FormatRawEntry *format_raw_find(u
 	while (format_raw_list[n].magic_pattern)
 		{
 		FormatRawEntry *entry = &format_raw_list[n];
-
 		switch (entry->magic_type)
 			{
 			case FORMAT_RAW_MATCH_MAGIC:
@@ -389,7 +391,6 @@ gint format_exif_makernote_parse(ExifDat
 				 guint size, ExifByteOrder bo)
 {
 	FormatExifEntry *entry;
-
 	entry = format_exif_makernote_find(exif, tiff, offset, size);
 
 	if (!entry || !entry->func_parse) return FALSE;
diff -r f6cec49c42ff src/icons/Makefile.in
--- a/src/icons/Makefile.in	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/icons/Makefile.in	Mon Nov 06 08:57:36 2006 +0000
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  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.
diff -r f6cec49c42ff src/image-overlay.c
--- a/src/image-overlay.c	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/image-overlay.c	Mon Nov 06 09:55:47 2006 +0000
@@ -19,6 +19,76 @@
 #include "layout.h"
 #include "pixbuf-renderer.h"
 #include "pixbuf_util.h"
+#include "bar_info.h"
+#include <math.h>
+
+/*
+ *----------------------------------------------------------------------------
+ * image histogramm
+ *----------------------------------------------------------------------------
+ */
+
+/* cheap and dirty static variables, don't want to modify ImageWindow etc */
+static gint histogramm_on;
+
+#define HCHAN_R 0
+#define HCHAN_G 1
+#define HCHAN_B 2
+#define HCHAN_RGB 3
+#define HCHAN_VAL 4
+#define HCHAN_MAX 5
+#define HCHAN_COUNT (HCHAN_MAX+1)
+static gint histogramm_chan=HCHAN_RGB;
+
+/* 0: linear
+   1: log.
+ */
+static gint histogramm_logmode;
+
+void image_overlay_histogramm_onoff_toggle(gint x)
+{
+  histogramm_on=!!(x);
+}
+gint image_overlay_histogramm_onoff_status(void) { return histogramm_on;}
+
+void image_overlay_histogramm_chan_toggle(void)
+{ histogramm_chan=(histogramm_chan+1)%HCHAN_COUNT;}
+void image_overlay_histogramm_log_toggle(void)
+{ histogramm_logmode=!histogramm_logmode; }
+
+static gulong count_for_histmap(GdkPixbuf *imgpixbuf, gint chan, gulong *cnt)
+{
+	gint w, h, i, j, srs, has_alpha;
+	guchar * s_pix;
+
+	w = gdk_pixbuf_get_width(imgpixbuf);
+	h = gdk_pixbuf_get_height(imgpixbuf);
+	srs = gdk_pixbuf_get_rowstride(imgpixbuf);
+	s_pix = gdk_pixbuf_get_pixels(imgpixbuf);
+	has_alpha = gdk_pixbuf_get_has_alpha(imgpixbuf);
+
+	for (i = 0; i < 256*4; i++) cnt[i]=0;
+
+	for (i = 0; i < h; i++) {
+		guchar *sp = s_pix + (i * srs); /* 8bit */
+		for (j = 0; j < w; j++) {
+			cnt[sp[0]+0]++;
+			cnt[sp[1]+256]++;
+			cnt[sp[2]+512]++;
+			if (chan==HCHAN_MAX) {
+				guchar t=sp[0];
+				if (sp[1]>t) t=sp[1];
+				if (sp[2]>t) t=sp[2];
+  				cnt[t+768]++;
+			}
+			else
+  				cnt[768+(sp[0]+sp[1]+sp[2])/3]++;
+			sp+=3;
+			if (has_alpha) sp++;
+		}
+	}
+	return w*h;
+}
 
 
 /*
@@ -54,6 +124,9 @@ static GdkPixbuf *image_overlay_info_ren
 	CollectionData *cd;
 	CollectInfo *info;
 	gchar *ct;
+	GdkPixbuf *imgpixbuf=NULL;
+	gulong histmap[256*4];
+	gulong total=0;
 
 	name = image_get_name(imd);
 	if (name)
@@ -124,6 +197,10 @@ static GdkPixbuf *image_overlay_info_ren
 	else
 		{
 		gint w, h;
+		const char *t1="";
+		gint stars;
+		const char *t2="";
+		char starbuf[4];
 
 		if (imd->delay_flip &&
 		    imd->il && imd->il->pixbuf &&
@@ -131,16 +208,36 @@ static GdkPixbuf *image_overlay_info_ren
 			{
 			w = gdk_pixbuf_get_width(imd->il->pixbuf);
 			h = gdk_pixbuf_get_height(imd->il->pixbuf);
+			imgpixbuf = imd->il->pixbuf;
 			}
 		else
 			{
 			pixbuf_renderer_get_image_size(PIXBUF_RENDERER(imd->pr), &w, &h);
-			}
-
-		text = g_strdup_printf("%s(%d/%d) <b>%s</b>\n%d x %d - %s - %s", ct,
+			imgpixbuf = (PIXBUF_RENDERER(imd->pr))->pixbuf;
+			}
+		if (histogramm_on) {
+			switch (histogramm_chan) {
+			case HCHAN_R: t1="histogramm on red"; break;
+			case HCHAN_G: t1="histogramm on green"; break;
+			case HCHAN_B: t1="histogramm on blue"; break;
+			case HCHAN_VAL: t1="histogramm on value"; break;
+			case HCHAN_RGB: t1="histogramm on RGB"; break;
+			case HCHAN_MAX: t1="histogramm on max value"; break;
+			}
+			t2=histogramm_logmode ? "\nlogarithmical " : "\nlinear ";
+		}
+		stars = keyword_list_get_stars(imd->image_path);
+		if (stars) 
+		  sprintf(starbuf,"\n%u*",stars); /* no overflow */
+		else
+		  starbuf[0]=0;
+
+		text = g_strdup_printf("%s(%d/%d) <b>%s</b>\n%d x %d - %s - %s%s%s%s", ct,
 				       n, t, name_escaped,
 				       w, h,
-				       text_from_time(imd->mtime), size);
+				       text_from_time(imd->mtime), size,
+				       t2,t1,
+				       starbuf);
 		}
 	g_free(size);
 	g_free(ct);
@@ -154,6 +251,11 @@ static GdkPixbuf *image_overlay_info_ren
 
 	width += 10;
 	height += 10;
+	if (imgpixbuf && histogramm_on) {
+		total=count_for_histmap(imgpixbuf, histogramm_chan,histmap);
+		if (width<266) width=266;
+		height+=256;
+	}
 
 	pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
 	pixbuf_set_rect_fill(pixbuf, 3, 3, width-6, height-6, 240, 240, 240, 210);
@@ -165,6 +267,78 @@ static GdkPixbuf *image_overlay_info_ren
 	pixbuf_pixel_set(pixbuf, 0, height - 1, 0, 0, 0, 0);
 	pixbuf_pixel_set(pixbuf, width - 1, height - 1, 0, 0, 0, 0);
 
+	if (imgpixbuf && histogramm_on) {
+		gint i;
+		gulong max=0;
+		double logmax;
+		for (i=0;i<1024;i++) {
+			int flag=0;
+			switch (histogramm_chan) {
+			case HCHAN_RGB: if ((i%4)!=3) flag=1; break;
+			case HCHAN_R: if ((i%4)==0) flag=1; break;
+			case HCHAN_G: if ((i%4)==1) flag=1; break;
+			case HCHAN_B: if ((i%4)==2) flag=1; break;
+			case HCHAN_VAL: if ((i%4)==3) flag=1; break;
+			case HCHAN_MAX: if ((i%4)==3) flag=1; break;
+			}
+			if (flag)
+				if (histmap[i]>max) max=histmap[i];
+		}
+		logmax=log(max);
+		for (i=0;i<256;i++) {
+			gint j;
+			glong v[4];
+			v[0]=histmap[i+0*256]; // r
+			v[1]=histmap[i+1*256]; // g
+			v[2]=histmap[i+2*256]; // b
+			v[3]=histmap[i+3*256]; // value, max
+			gint rplus=0;
+			gint gplus=0;
+			gint bplus=0;
+			for (j=0;j<4;j++) {
+				gint r=rplus,g=gplus,b=bplus;
+				gint max2=0;
+				gint k;
+				gulong pt;
+				for (k=1;k<4;k++)
+					if (v[k]>v[max2]) max2=k;
+				switch (max2) {
+				case HCHAN_R: rplus=r=255; break;
+				case HCHAN_G: gplus=g=255; break;
+				case HCHAN_B: bplus=b=255; break;
+				}
+
+				switch(histogramm_chan) {
+				case HCHAN_MAX: r=0;b=0;g=0; break;
+				case HCHAN_VAL: r=0;b=0;g=0; break;
+				case HCHAN_R: g=0; b=0; break;
+				case HCHAN_G: r=0; b=0; break;
+				case HCHAN_B: r=0; g=0; break;
+				case HCHAN_RGB: 
+				  if (r==255 && g==255 && b==255) {
+				    r=0; 
+				    g=0; 
+				    b=0; 
+				  }
+				  break;
+				}
+
+				if (v[max2]==0)
+					pt=0;
+				else if (histogramm_logmode)
+					pt=((float)log(v[max2]))/logmax*255;
+				else
+					pt=((float)v[max2])/max*255;
+				if (histogramm_chan>=HCHAN_RGB || max2==histogramm_chan)
+					pixbuf_draw_line(pixbuf, 
+						0+5,height-255,256,256,
+						i+5,height,i+5,height-pt, 
+						r,g,b,255);
+				v[max2]=-1;
+			}
+		}
+	}
+
 	pixbuf_draw_layout(pixbuf, layout, imd->pr, 5, 5, 0, 0, 0, 255);
 
 	g_object_unref(G_OBJECT(layout));
diff -r f6cec49c42ff src/image-overlay.h
--- a/src/image-overlay.h	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/image-overlay.h	Mon Nov 06 08:57:36 2006 +0000
@@ -17,8 +17,9 @@ void image_overlay_info_disable(ImageWin
 void image_overlay_info_disable(ImageWindow *imd, gint id);
 
 void image_overlay_update(ImageWindow *imd, gint id);
-
+void image_overlay_histogramm_onoff_toggle(gint);
+gint image_overlay_histogramm_onoff_status(void);
+void image_overlay_histogramm_chan_toggle(void);
+void image_overlay_histogramm_log_toggle(void);
 
 #endif
-
-
diff -r f6cec49c42ff src/layout_image.c
--- a/src/layout_image.c	Wed Sep 27 05:35:31 2006 +0000
+++ b/src/layout_image.c	Mon Nov 06 08:57:36 2006 +0000
@@ -30,6 +30,7 @@
 #include "ui_bookmark.h"
 #include "ui_fileops.h"
 #include "ui_menu.h"
+#include "bar_info.h"
 
 #include <gdk/gdkkeysyms.h> /* for keyboard values */
 
@@ -102,7 +103,7 @@ static gint layout_image_full_screen_key
 	gint stop_signal = FALSE;
 	gint x = 0;
 	gint y = 0;
-
+	gint stars=-1;
 	switch (event->keyval)
 		{
 		case GDK_Left: case GDK_KP_Left:
@@ -120,6 +121,23 @@ static gint layout_image_full_screen_key
 		case GDK_Down: case GDK_KP_Down:
 			y += 1;
 			stop_signal = TRUE;
+			break;
+		/* FALLTHROUGH series */
+		case GDK_KP_0: stars=0;
+		case GDK_KP_1: if (-1==stars) stars=1;
+		case GDK_KP_2: if (-1==stars) stars=2;
+		case GDK_KP_3: if (-1==stars) stars=3;
+		case GDK_KP_4: if (-1==stars) stars=4;
+		case GDK_KP_5: if (-1==stars) stars=5;
+		case GDK_F6: if (-1==stars) stars=0;
+		case GDK_F1: if (-1==stars) stars=1;
+		case GDK_F2: if (-1==stars) stars=2;
+		case GDK_F3: if (-1==stars) stars=3;
+		case GDK_F4: if (-1==stars) stars=4;
+		case GDK_F5: if (-1==stars) stars=5;
+			keyword_list_set_stars(layout_image_get_path(lw),stars);
+			if (lw->full_screen_overlay_on)
+			  layout_image_overlay_update(lw);
 			break;
 		}
 
@@ -221,7 +239,25 @@ static gint layout_image_full_screen_key
 			stop_signal = TRUE;
 			break;
 		case 'I': case 'i':
-			layout_image_overlay_set(lw, !(lw->full_screen_overlay_on));
+			if (lw->full_screen_overlay_on) {
+			  if (image_overlay_histogramm_onoff_status()) {
+			    image_overlay_histogramm_onoff_toggle(0);
+			    layout_image_overlay_update(lw);
+			  } else
+			    layout_image_overlay_set(lw, 0);
+			} else {
+			  layout_image_overlay_set(lw, 1);
+			  image_overlay_histogramm_onoff_toggle(1);
+			  layout_image_overlay_update(lw);
+			}
+			break;
+		case 'K': case 'k':
+			image_overlay_histogramm_chan_toggle();
+			layout_image_overlay_update(lw);
+			break;
+		case 'L': case 'l':
+			image_overlay_histogramm_log_toggle();
+			layout_image_overlay_update(lw);
 			break;
 		}
 
diff -r f6cec49c42ff .hgignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Nov 06 08:57:36 2006 +0000
@@ -0,0 +1,18 @@
+\.bak$
+\.o$
+\.a$
+\.stamp$
+^deps/
+^check.out$
+\.swp$
+src/.deps/
+^config.h$
+^config.log$
+^config.status$
+Makefile$
+^po/Makefile.in$
+^src/gqview$
+^src/icons/icons_inline.h$
+^src/ui_icons.h$
+^stamp-h1$
+^po/POTFILES$
diff -r f6cec49c42ff src/format_pentax.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/format_pentax.c	Mon Nov 06 08:57:36 2006 +0000
@@ -0,0 +1,532 @@
+/*
+ *  GQView
+ *  (C) 2005 John Ellis
+ *
+ *  Authors:
+ *    Raw NEF jpeg extraction based on nefextract.c by Joseph Heled,
+ *        in addition nefextract.c is based on dcraw by Dave Coffin.
+ *
+ * This software is released under the GNU General Public License (GNU GPL).
+ * Please read the included file COPYING for more information.
+ * This software comes with no warranty of any kind, use at your own risk!
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include "intl.h"
+
+#include "format_pentax.h"
+
+#include "exif.h"
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Raw NEF embedded jpeg extraction for Nikon
+ *-----------------------------------------------------------------------------
+ */
+
+static guint pentax_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+			      gint level,
+			      guint *image_offset, guint *jpeg_len);
+
+
+static void pentax_tiff_entry(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+			     gint level,
+			     guint *image_offset, guint *image_length, guint *jpeg_start, guint *jpeg_len)
+{
+	guint tag;
+	guint type;
+	guint count;
+	guint segment;
+	guint seg_len;
+
+	tag = exif_byte_get_int16(data + offset + EXIF_TIFD_OFFSET_TAG, bo);
+	type = exif_byte_get_int16(data + offset + EXIF_TIFD_OFFSET_FORMAT, bo);
+	count = exif_byte_get_int32(data + offset + EXIF_TIFD_OFFSET_COUNT, bo);
+
+	/* so far, we only care about tags with type long */
+	if (type != EXIF_FORMAT_LONG_UNSIGNED && type != EXIF_FORMAT_LONG) return;
+
+	seg_len = ExifFormatList[type].size * count;
+	if (seg_len > 4)
+		{
+		segment = exif_byte_get_int32(data + offset + EXIF_TIFD_OFFSET_DATA, bo);
+		if (segment + seg_len > len) return;
+		}
+	else
+		{
+		segment = offset + EXIF_TIFD_OFFSET_DATA;
+		}
+
+	if (tag == 0x14a)
+		{
+		/* sub IFD table */
+		gint i;
+
+		for (i = 0; i < count; i++)
+			{
+			guint subset;
+
+			subset = exif_byte_get_int32(data + segment + i * 4, bo);
+			pentax_tiff_table(data, len, subset, bo, level + 1, image_offset, image_length);
+			}
+
+		}
+	else if (tag == 0x201)
+		{
+		/* jpeg data start offset */
+		*jpeg_start = exif_byte_get_int32(data + segment, bo);
+		}
+	else if (tag == 0x202)
+		{
+		/* jpeg data length */
+		*jpeg_len = exif_byte_get_int32(data + segment, bo);
+		}
+}
+
+static guint pentax_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo,
+			      gint level,
+			      guint *image_offset, guint *image_length)
+{
+	guint count;
+	guint i;
+	guint jpeg_start = 0;
+	guint jpeg_len = 0;
+
+	/* limit damage from infinite loops */
+	if (level > EXIF_TIFF_MAX_LEVELS) return 0;
+
+	if (len < offset + 2) return FALSE;
+
+	count = exif_byte_get_int16(data + offset, bo);
+	offset += 2;
+	if (len < offset + count * EXIF_TIFD_SIZE + 4) return 0;
+
+	for (i = 0; i < count; i++)
+		{
+		pentax_tiff_entry(data, len, offset + i * EXIF_TIFD_SIZE, bo, level,
+				 image_offset, image_length, &jpeg_start, &jpeg_len);
+		}
+
+	if (jpeg_start > 0 &&
+	    jpeg_len > *image_length)
+		{
+		*image_offset = jpeg_start;
+		*image_length = jpeg_len;
+		}
+
+	return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
+}
+
+gint format_pentax_raw(unsigned char *data, const guint len,
+		      guint *image_offset, guint *exif_offset)
+{
+	guint i_off = 0;
+	guint i_len = 0;
+	ExifByteOrder bo;
+	guint offset;
+	gint level;
+	if (!exif_tiff_directory_offset(data, len, &offset, &bo)) return FALSE;
+
+	level = 0;
+	while (offset && level < EXIF_TIFF_MAX_LEVELS)
+		{
+		offset = pentax_tiff_table(data, len, offset, bo, 0, &i_off, &i_len);
+		level++;
+		}
+
+	if (i_off != 0)
+		{
+		if (image_offset) *image_offset = i_off;
+		return TRUE;
+		}
+
+	return FALSE;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * EXIF Makernote for Pentax
+ *-----------------------------------------------------------------------------
+ */
+
+
+
+static ExifTextList NikonTagQuality[]= {
+	{ 1,	"VGA basic" },
+	{ 2,	"VGA normal" },
+	{ 3,	"VGA fine" },
+	{ 4,	"SXGA basic" },
+	{ 5,	"SXGA normal" },
+	{ 6,	"SXGA fine" },
+	{ 7,	"XGA basic (?)" },
+	{ 8,	"XGA normal (?)" },
+	{ 9,	"XGA fine (?)" },
+	{ 10,	"UXGA basic" },
+	{ 11,	"UXGA normal" },
+	{ 12,	"UXGA fine" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTagColorMode[]= {
+	{ 1,	"color" },
+	{ 2,	"monochrome" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTagImgAdjust[]= {
+	{ 0,	"normal" },
+	{ 1,	"bright+" },
+	{ 2,	"bright-" },
+	{ 3,	"contrast+" },
+	{ 4,	"contrast-" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTagISOSensitivity[]= {
+	{ 0,	"80" },
+	{ 2,	"160" },
+	{ 4,	"320" },
+	{ 5,	"100" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTagWhiteBalance[]= {
+	{ 0,	"auto" },
+	{ 1,	"preset" },
+	{ 2,	"daylight" },
+	{ 3,	"incandescent" },
+	{ 4,	"fluorescence" },
+	{ 5,	"cloudy" },
+	{ 6,	"speedlight" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTagConverter[]= {
+	{ 0,	"none" },
+	{ 1,	"Fisheye" },
+	EXIF_TEXT_LIST_END
+};
+static ExifTextList PentaxTagCaptureMode[]= {
+	{ 0,	"Auto" },
+	{ 1,	"Night Scene" },
+	{ 2,	"Manual" },
+	{ 2,	"Multiple" },
+	EXIF_TEXT_LIST_END
+};
+static ExifTextList PentaxTagISOSpeed[]= {
+	{ 3,	"50" },
+	{ 4,	"64" },
+	{ 5,	"80" },
+	{ 6,	"100" },
+	{ 7,	"125" },
+	{ 8,	"160" },
+	{ 9,	"200" },
+	{10,	"250" },
+	{11,	"320" },
+	{12,	"400" },
+	{13,	"500" },
+	{14,	"640" },
+	{15,	"800" },
+	{16,	"1000" },
+	{17,	"1250" },
+	{18,	"1600" },
+	{21,	"3200" },
+	EXIF_TEXT_LIST_END
+};
+static ExifTextList PentaxTagPictureMode[]= {
+	{ 0,	"Programm" },
+	{ 5,	"Portrait" },
+	{ 6,	"Landscape" },
+	{ 8,	"Sport" },
+	{ 9,	"Night Scene" },
+	{11,	"Soft" },
+	{12,	"Surf & Snow" },
+	{13,	"Sunset" },
+	{14,	"Autumn" },
+	{15,	"Flower" },
+	{17,	"Fireworks" },
+	{18,	"Text" },
+	{19,	"Panorama" },
+	{30,	"Self Portrait" },
+	{37,	"Museum" },
+	{38,	"Food" },
+	{40,	"Green Mode" },
+	{49,	"Light Pet" },
+	{50,	"Dark Pet" },
+	{51,	"Medium Pet" },
+	{53,	"Underwater" },
+	{54,	"Candlelight" },
+	{55,	"Natural Skin Tone" },
+	{56,	"Synchro Sound Record" },
+	EXIF_TEXT_LIST_END
+};
+static ExifTextList PentaxTagWhiteBalance[]= {
+	{ 0,	"Auto" },
+	{ 1,	"Daylight" },
+	{ 2,	"Shade" },
+	{ 3,	"Fluorescent" },
+	{ 4,	"Tungsten" },
+	{ 5,	"Manual" },
+	EXIF_TEXT_LIST_END
+};
+static ExifTextList PentaxTagWhiteBalanceMode[]= {
+	{ 1,	"Auto (Daylight?)" },
+	{ 2,	"Auto (Shade?)" },
+	{ 3,	"Auto (Flash?)" },
+	{ 4,	"Auto (Tungsten?)" },
+	{ 65534,"Preset (Fireworks?)" },
+	{ 65535,"User-Selected" },
+	EXIF_TEXT_LIST_END
+};
+static ExifTextList PentaxTagMeteringMode[]= {
+	{ 0,	"MultiSegment" },
+	{ 1,	"CenterWeighted" },
+	{ 2,	"Spot" },
+	EXIF_TEXT_LIST_END
+};
+
+#if 0
+static ExifTextList NikonTag[]= {
+	{ ,	"" },
+	{ ,	"" },
+	EXIF_TEXT_LIST_END
+};
+#endif
+
+static ExifMarker PentaxExifMarkersList1[] = {
+{ 0x0001, EXIF_FORMAT_SHORT_UNSIGNED, 1,
+		"Pentax.CaptureMode",	"Capture mode",	 PentaxTagCaptureMode},
+{ 0x0006, EXIF_FORMAT_UNDEFINED, 4,	"Pentax.Date",	"Date",	 NULL },
+{ 0x0007, EXIF_FORMAT_UNDEFINED, 3,	"Pentax.Time",	"Time",	 NULL },
+
+{ 0x000b, EXIF_FORMAT_SHORT_UNSIGNED, 1,	
+		"Pentax. PictureMode",	"Picture mode",	 PentaxTagPictureMode},
+{ 0x0012, EXIF_FORMAT_LONG_UNSIGNED, 1,	"Pentax.ExposureTime",       "ExposureTime",	NULL },
+{ 0x0013, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Pentax.FNumber",       "FNumber",	NULL },
+{ 0x0014, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Pentax.ISOSpeed",
+								"ISO Speed",	PentaxTagISOSpeed },
+{ 0x0016, EXIF_FORMAT_SHORT_UNSIGNED, 1,
+	"Pentax.ExposureCompensation", "Exposure Compensation",	NULL },
+{ 0x0017, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Pentax.MeteringMode",
+								"Metering Mode",PentaxTagMeteringMode },
+{ 0x0019, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Pentax.WhileBalance",
+								"White Balance",PentaxTagWhiteBalance },
+{ 0x001a, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Pentax.WhileBalanceMode",
+						"White Balance Mode",PentaxTagWhiteBalanceMode },
+EXIF_MARKER_LIST_END
+};
+
+static ExifTextList NikonTag2FlashComp[]= {
+	{ 0x06,	"+1.0 EV" },
+	{ 0x04,	"+0.7 EV" },
+	{ 0x03,	"+0.5 EV" },
+	{ 0x02,	"+0.3 EV" },
+	{ 0x00,	"0.0 EV" },
+	{ 0xfe,	"-0.3 EV" },
+	{ 0xfd,	"-0.5 EV" },
+	{ 0xfc,	"-0.7 EV" },
+	{ 0xfa,	"-1.0 EV" },
+	{ 0xf8,	"-1.3 EV" },
+	{ 0xf7,	"-1.5 EV" },
+	{ 0xf6,	"-1.7 EV" },
+	{ 0xf4,	"-2.0 EV" },
+	{ 0xf2,	"-2.3 EV" },
+	{ 0xf1,	"-2.5 EV" },
+	{ 0xf0,	"-2.7 EV" },
+	{ 0xee,	"-3.0 EV" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTag2LensType[]= {
+	{ 0,	"AF non D" },
+	{ 1,	"manual" },
+	{ 2,	"AF-D or AF-s" },
+	{ 6,	"AF-D G" },
+	{ 10,	"AF-D VR" },
+	EXIF_TEXT_LIST_END
+};
+
+static ExifTextList NikonTag2FlashUsed[]= {
+	{ 0,	"no" },
+	{ 4,	"unit unknown" },
+	{ 7,	"external" },
+	{ 9,	"yes" },
+	EXIF_TEXT_LIST_END
+};
+
+#if 0
+static ExifTextList NikonTagi2Saturation[]= {
+	{ -3,	"black and white" },
+	{ -2,	"-2" },
+	{ -1,	"-1" },
+	{ 0,	"normal" },
+	{ 1,	"+1" },
+	{ 2,	"+2" },
+	EXIF_TEXT_LIST_END
+};
+#endif
+
+static ExifMarker NikonExifMarkersList2[] = {
+{ 0x0002, EXIF_FORMAT_SHORT_UNSIGNED, 2,	"Nikon.ISOSpeed",	"ISO speed",	NULL },
+{ 0x0003, EXIF_FORMAT_STRING, -1,		"Nikon.ColorMode",	"Color mode",	NULL },
+{ 0x0004, EXIF_FORMAT_STRING, -1,		"Nikon.Quality",	"Quality",	NULL },
+{ 0x0005, EXIF_FORMAT_STRING, -1,		"Nikon.WhiteBalance",	"White balance",NULL },
+{ 0x0006, EXIF_FORMAT_STRING, -1,		"Nikon.Sharpening",	"Sharpening",	NULL },
+{ 0x0007, EXIF_FORMAT_STRING, -1,		"Nikon.FocusMode",	"Focus mode",	NULL },
+{ 0x0008, EXIF_FORMAT_STRING, -1,		"Nikon.FlashSetting",	"Flash setting",NULL },
+{ 0x0009, EXIF_FORMAT_STRING, -1,		"Nikon.AutoFlashMode","Auto flash mode",NULL },
+{ 0x000b, EXIF_FORMAT_SHORT, 1,			"Nikon.WhiteBalanceBias",
+							"White balance bias value",	NULL },
+/* { 0x000c, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Nikon.WhiteBalanceRB",
+						"White balance red/blue coefficients",	NULL }, */
+/* { 0x000f, EXIF_FORMAT_STRING, -1,		"Nikon.ISOSelect",	"ISO selection",NULL }, */
+{ 0x0012, EXIF_FORMAT_UNDEFINED, 4,		"Nikon.FlashCompensation",
+								"Flash compensation",	NikonTag2FlashComp },
+{ 0x0013, EXIF_FORMAT_SHORT_UNSIGNED, 2,	"Nikon.ISOSpeedRequest",
+								"ISO speed requested",	NULL },
+{ 0x0016, EXIF_FORMAT_SHORT_UNSIGNED, 4,	"Nikon.CornerCoord",
+								"Corner coordinates",	NULL },
+{ 0x0018, EXIF_FORMAT_UNDEFINED, 4,		"Nikon.FlashBracketCompensation",
+							"Flash bracket compensation",	NikonTag2FlashComp },
+{ 0x0019, EXIF_FORMAT_RATIONAL, 1,		"Nikon.AEBracketCompensation",
+							"AE bracket compensation",	NULL },
+{ 0x0080, EXIF_FORMAT_STRING, -1,		"Nikon.ImageAdjustment",
+								"Image adjustment",	NULL },
+{ 0x0081, EXIF_FORMAT_STRING, -1,		"Nikon.Contrast",	"Contrast",	NULL },
+{ 0x0082, EXIF_FORMAT_STRING, -1,		"Nikon.AuxLens", "Aux lens adapter",	NULL },
+{ 0x0083, EXIF_FORMAT_BYTE_UNSIGNED, -1,	"Nikon.LensType",	"Lens type",	NikonTag2LensType },
+{ 0x0084, EXIF_FORMAT_RATIONAL_UNSIGNED, -1,	"Nikon.LensFocalLength",
+							"Lens min/max focal length and aperture", NULL },
+{ 0x0085, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Nikon.ManualFocusDistance",
+							"Manual focus distance", 	NULL },
+{ 0x0086, EXIF_FORMAT_RATIONAL, 1,		"Nikon.DigitalZoomFactor",
+							"Digital zoom factor",		NULL },
+{ 0x0087, EXIF_FORMAT_BYTE_UNSIGNED, 1,		"Nikon.FlashUsed",	"Flash used",	NikonTag2FlashUsed },
+{ 0x0088, EXIF_FORMAT_UNDEFINED, 4,		"Nikon.AutoFocusArea","Auto focus area",NULL },
+/* { 0x0089, EXIF_FORMAT_SHORT_UNSIGNED, -1,	"Nikon.Bracket/ShootingMode", NULL,	NULL }, */
+{ 0x008d, EXIF_FORMAT_STRING, -1,		"Nikon.ColorMode",	"Color mode",	NULL },
+{ 0x008f, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Nikon.SceneMode",	"Scene mode",	NULL },
+{ 0x0090, EXIF_FORMAT_STRING, -1,		"Nikon.LightingType",	"Lighting type",NULL },
+{ 0x0092, EXIF_FORMAT_SHORT, 1,			"Nikon.HueAdjust",	"Hue adjustment",NULL },
+/* { 0x0094, EXIF_FORMAT_SHORT_UNSIGNED, 1,	"Nikon.Saturation",	"Saturation",	NikonTag2Saturation }, */
+{ 0x0095, EXIF_FORMAT_STRING, -1,		"Nikon.NoiseReduction", "Noise reduction", NULL },
+{ 0x00a7, EXIF_FORMAT_LONG_UNSIGNED, 1,		"Nikon.ShutterCount", "Shutter release count", NULL },
+{ 0x00a9, EXIF_FORMAT_STRING, -1,		"Nikon.ImageOptimization", "Image optimization", NULL },
+{ 0x00aa, EXIF_FORMAT_STRING, -1,		"Nikon.Saturation", "Saturation",	NULL },
+{ 0x00ab, EXIF_FORMAT_STRING, -1,		"Nikon.DigitalVariProg", "Digital Vari-program", NULL },
+EXIF_MARKER_LIST_END
+};
+
+static ExifTextList NikonAFPoint[]= {
+	{ 0,	"center" },
+	{ 1,	"top" },
+	{ 2,	"bottom" },
+	{ 3,	"left" },
+	{ 4,	"right" },
+	EXIF_TEXT_LIST_END
+};
+
+
+gint format_pentax_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+			    guint size, ExifByteOrder bo)
+{
+	unsigned char *data;
+	ExifItem *item;
+	if (offset + 8 + 4 >= size) return FALSE;
+
+	data = tiff + offset;
+
+	/* Pentax tag format 2 */
+	if (memcmp(data, "AOC\0", 4) == 0)
+		{
+		if (exif_parse_IFD_table(exif, tiff, offset + 6, size,
+					 bo, 0, PentaxExifMarkersList1) != 0)
+			{
+			return FALSE;
+			}
+		return TRUE;
+		}
+	else
+		return FALSE;
+#if 0
+	/* Nikon tag format 2 uses Embedded tiff header */
+	if (memcmp(data, "Nikon\x00\x02\x00\x00\x00", 10) == 0 ||
+	    memcmp(data, "Nikon\x00\x02\x10\x00\x00", 10) == 0)
+		{
+		guint tiff_header;
+
+		tiff_header = offset + 10;
+		if (exif_tiff_parse(exif, tiff + tiff_header, size - tiff_header,
+		    NikonExifMarkersList2) != 0)
+			{
+			return FALSE;
+			}
+		}
+	/* Nikon tag format 3 uses format 2 tags without "Nikon" and tiff header */
+	else if (exif_parse_IFD_table(exif, tiff, offset, size,
+				      bo, 0, NikonExifMarkersList2) != 0)
+		{
+		return FALSE;
+		}
+#endif
+	item = exif_get_item(exif, "Nikon.AutoFocusArea");
+	if (item && item->data_len == 4 * sizeof(guchar))
+		{
+		static ExifMarker marker = { 0x0088, EXIF_FORMAT_STRING, -1,
+					     "Nikon.AutoFocusPoint", "Auto focus point", NULL };
+		guchar *array = item->data;
+		gchar *text;
+		gint l;
+
+		text = exif_text_list_find_value(NikonAFPoint, (gint)array[1]);
+		l = strlen(text) + 1;
+
+		item = exif_item_new(marker.format, marker.tag, l, &marker);
+		memcpy(item->data, text, l);
+
+		g_free(text);
+
+		exif->items = g_list_prepend(exif->items, item);
+		}
+
+	item = exif_get_item(exif, "Nikon.ISOSpeed");
+	if (item && item->data_len == 2 * 2)
+		{
+		static ExifMarker marker = { 0x0002, EXIF_FORMAT_SHORT_UNSIGNED, 1,
+					     "ISOSpeedRatings", "ISO speed", NULL };
+		ExifItem *shadow;
+
+		shadow = exif_item_new(marker.format, marker.tag, 1, &marker);
+		memcpy(shadow->data, item->data + 2, 2);
+
+		exif->items = g_list_prepend(exif->items, shadow);
+		}
+
+	item = exif_get_item(exif, "Nikon.WhiteBalance");
+	if (item && item->format == EXIF_FORMAT_STRING)
+		{
+		static ExifMarker marker = { 0x0005, EXIF_FORMAT_STRING, -1,
+					     "LightSource", "Light source", NULL };
+		ExifItem *shadow;
+
+		shadow = exif_item_new(marker.format, marker.tag, item->data_len, &marker);
+		memcpy(shadow->data, item->data, item->data_len);
+
+		exif->items = g_list_prepend(exif->items, shadow);
+		}
+
+	return TRUE;
+}
+
diff -r f6cec49c42ff src/format_pentax.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/format_pentax.h	Mon Nov 06 08:57:36 2006 +0000
@@ -0,0 +1,32 @@
+/*
+ *  GQView
+ *  (C) 2005 John Ellis
+ *
+ * This software is released under the GNU General Public License (GNU GPL).
+ * Please read the included file COPYING for more information.
+ * This software comes with no warranty of any kind, use at your own risk!
+ */
+
+#ifndef __FORMAT_PENTAX_H
+#define __FORMAT_PENTAX_H
+
+
+#include "exif.h"
+
+gint format_pentax_raw(unsigned char *data, const guint len,
+		      guint *image_offset, guint *exif_offset);
+
+#define FORMAT_RAW_PENTAX { "pef", \
+			   FORMAT_RAW_MATCH_TIFF_MAKE, 0, "PENTAX Corporation", 18, \
+			   "Pentax raw", format_pentax_raw }
+
+
+gint format_pentax_makernote(ExifData *exif, unsigned char *tiff, guint offset,
+			    guint size, ExifByteOrder bo);
+
+#define FORMAT_EXIF_PENTAX { FORMAT_EXIF_MATCH_MAKERNOTE, "PENTAX\x00", 7, "Pentax", format_pentax_makernote }, \
+			  { FORMAT_EXIF_MATCH_MAKE,      "PENTAX",     6, "Pentax", format_pentax_makernote }
+
+
+#endif
+
