Index: configure.ac
===================================================================
--- configure.ac	(revision 11)
+++ configure.ac	(working copy)
@@ -48,6 +48,15 @@
 AC_FUNC_STRFTIME
 AC_CHECK_FUNCS([memset sqrt strcasecmp strerror strncasecmp strstr fdatasync ftruncate getcwd gettimeofday localtime_r memmove strerror])
 
+# Checks for required libraries
+AC_CHECK_HEADERS(geotiff/geotiff.h)
+AC_CHECK_HEADERS(libgeotiff/geotiff.h)
+AC_CHECK_HEADERS(geotiff.h)
+if test x"$ac_cv_header_geotiff_geotiff_h" != x"yes" && test x"$ac_cv_header_libgeotiff_geotiff_h" != x"yes" && test x"$ac_cv_header_geotiff_h" != x"yes"; then
+    AC_MSG_ERROR(['libgeotiff' is required but the header (geotiff.h) doesn't seem to be installed on this system])
+fi
+AC_CHECK_LIB(geotiff,GTIFWriteKeys,,AC_MSG_ERROR(['libgeotiff' is required but it doesn't seems to be installed on this system.]),)
+
 AC_CONFIG_FILES([Makefile \
 		headers/Makefile \
 		epsilon/Makefile \
Index: headers/rasterlite_tiff_hdrs.h
===================================================================
--- headers/rasterlite_tiff_hdrs.h	(revision 0)
+++ headers/rasterlite_tiff_hdrs.h	(revision 0)
@@ -0,0 +1,27 @@
+#ifndef _RASTERLITE_TIFF_HDRS_H
+#define _RASTERLITE_TIFF_HDRS_H
+
+#ifdef HAVE_GEOTIFF_GEOTIFF_H
+#include <geotiff/geotiff.h>
+#include <geotiff/xtiffio.h>
+#include <geotiff/geo_tiffp.h>
+#include <geotiff/geo_keyp.h>
+#include <geotiff/geovalues.h>
+#include <geotiff/geo_normalize.h>
+#elif HAVE_LIBGEOTIFF_GEOTIFF_H
+#include <libgeotiff/geotiff.h>
+#include <libgeotiff/xtiffio.h>
+#include <libgeotiff/geo_tiffp.h>
+#include <libgeotiff/geo_keyp.h>
+#include <libgeotiff/geovalues.h>
+#include <libgeotiff/geo_normalize.h>
+#else
+#include <geotiff.h>
+#include <xtiffio.h>
+#include <geo_tiffp.h>
+#include <geo_keyp.h>
+#include <geovalues.h>
+#include <geo_normalize.h>
+#endif
+
+#endif
Index: src/rasterlite_grid.c
===================================================================
--- src/rasterlite_grid.c	(revision 11)
+++ src/rasterlite_grid.c	(working copy)
@@ -31,12 +31,7 @@
 #include <errno.h>
 #include <sys/types.h>
 
-#include <geotiff.h>
-#include <xtiffio.h>
-#include <geo_tiffp.h>
-#include <geo_keyp.h>
-#include <geovalues.h>
-#include <geo_normalize.h>
+#include "rasterlite_tiff_hdrs.h"
 
 #if defined(_WIN32) && !defined(__MINGW32__)
 #include <io.h>
Index: src/rasterlite_load.c
===================================================================
--- src/rasterlite_load.c	(revision 11)
+++ src/rasterlite_load.c	(working copy)
@@ -30,10 +30,7 @@
 #include <errno.h>
 #include <sys/types.h>
 
-#include <geotiff.h>
-#include <xtiffio.h>
-#include <geo_normalize.h>
-#include <geovalues.h>
+#include "rasterlite_tiff_hdrs.h"
 #include <tiffio.h>
 
 #if defined(_WIN32) && !defined(__MINGW32__)
@@ -886,12 +883,6 @@
 		sprintf (dummy, "PNG [RGB]");
 		infos.image_type = IMAGE_PNG_RGB;
 	    }
-	  else if (image_type == GAIA_WAVELET_BLOB)
-	    {
-		sprintf (dummy, "WAVELET [RGB] compression ratio 1:%d",
-			 quality_factor);
-		infos.image_type = IMAGE_WAVELET_RGB;
-	    }
 	  else
 	    {
 		sprintf (dummy, "JPEG [RGB] quality=%d", quality_factor);
@@ -1502,8 +1493,6 @@
 			  image_type = GAIA_GIF_BLOB;
 		      if (strcasecmp (argv[i], "TIFF") == 0)
 			  image_type = GAIA_TIFF_BLOB;
-		      if (strcasecmp (argv[i], "WAVELET") == 0)
-			  image_type = GAIA_WAVELET_BLOB;
 		      break;
 		  case ARG_QUALITY_FACTOR:
 		      quality_factor = atoi (argv[i]);
@@ -1671,16 +1660,6 @@
 	  if (quality_factor > 90)
 	      quality_factor = 90;
       }
-    if (image_type == GAIA_WAVELET_BLOB)
-      {
-	  /* normalizing the commpression factor */
-	  if (quality_factor == -999999)
-	      quality_factor = 25;
-	  if (quality_factor < 10)
-	      quality_factor = 10;
-	  if (quality_factor > 200)
-	      quality_factor = 200;
-      }
     printf ("=====================================================\n");
     printf ("             Arguments Summary\n");
     printf ("=====================================================\n");
@@ -1717,10 +1696,6 @@
       case GAIA_TIFF_BLOB:
 	  printf ("Tile image type: TIFF\n");
 	  break;
-      case GAIA_WAVELET_BLOB:
-	  printf ("Tile image type: WAVELET compression ratio 1:%d\n",
-		  quality_factor);
-	  break;
       default:
 	  printf ("Tile image type: UNKNOWN\n");
 	  break;
Index: src/rasterlite_pyramid.c
===================================================================
--- src/rasterlite_pyramid.c	(revision 11)
+++ src/rasterlite_pyramid.c	(working copy)
@@ -31,10 +31,7 @@
 #include <sys/types.h>
 #include <float.h>
 
-#include <geotiff.h>
-#include <xtiffio.h>
-#include <geo_normalize.h>
-#include <geovalues.h>
+#include "rasterlite_tiff_hdrs.h"
 #include <tiffio.h>
 
 #include <spatialite/sqlite3.h>
@@ -276,8 +273,6 @@
 	img = image_from_gif (blob_size, (void *) blob);
     else if (type == GAIA_TIFF_BLOB)
 	img = image_from_tiff (blob_size, (void *) blob);
-    else if (type == GAIA_WAVELET_BLOB)
-	img = image_from_wavelet (blob_size, (void *) blob);
     return img;
 }
 
@@ -453,15 +448,6 @@
 		goto end;
 	    }
       }
-    else if (image_type == GAIA_WAVELET_BLOB)
-      {
-	  blob = image_to_wavelet (thumbnail, &blob_size, quality_factor);
-	  if (!blob)
-	    {
-		printf ("WAVELET compression error\n");
-		goto end;
-	    }
-      }
     else
       {
 	  blob = image_to_jpeg (thumbnail, &blob_size, quality_factor);
@@ -1625,9 +1611,9 @@
     fprintf (stderr,
 	     "-d or --db-path     pathname      the SpatiaLite db path\n");
     fprintf (stderr, "-T or --table-name  name          DB table name\n");
-    fprintf (stderr, "-i or --image-type  type          [JPEG|WAVELET|TIFF]\n");
+    fprintf (stderr, "-i or --image-type  type          [JPEG|PNG|TIFF]\n");
     fprintf (stderr,
-	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
+	     "-q or --quality     num           [default = 75(JPEG)]\n");
 }
 
 int
@@ -1661,8 +1647,6 @@
 		  case ARG_IMAGE_TYPE:
 		      if (strcasecmp (argv[i], "JPEG") == 0)
 			  image_type = GAIA_JPEG_BLOB;
-		      if (strcasecmp (argv[i], "WAVELET") == 0)
-			  image_type = GAIA_WAVELET_BLOB;
 		      if (strcasecmp (argv[i], "PNG") == 0)
 			  image_type = GAIA_PNG_BLOB;
 		      if (strcasecmp (argv[i], "TIFF") == 0)
@@ -1775,16 +1759,6 @@
 	  if (quality_factor > 90)
 	      quality_factor = 90;
       }
-    if (image_type == GAIA_WAVELET_BLOB)
-      {
-	  /* normalizing the commpression factor */
-	  if (quality_factor == -999999)
-	      quality_factor = 25;
-	  if (quality_factor < 10)
-	      quality_factor = 10;
-	  if (quality_factor > 200)
-	      quality_factor = 200;
-      }
     printf ("=====================================================\n");
     printf ("             Arguments Summary\n");
     printf ("=====================================================\n");
@@ -1799,10 +1773,6 @@
       case GAIA_JPEG_BLOB:
 	  printf ("Pyramid Tile image type: JPEG quality=%d\n", quality_factor);
 	  break;
-      case GAIA_WAVELET_BLOB:
-	  printf ("Pyramid Tile image type: WAVELET compression ratio 1:%d\n",
-		  quality_factor);
-	  break;
       case GAIA_PNG_BLOB:
 	  printf ("Pyramid Tile image type: PNG [RGB]\n");
 	  break;
Index: src/rasterlite_topmost.c
===================================================================
--- src/rasterlite_topmost.c	(revision 11)
+++ src/rasterlite_topmost.c	(working copy)
@@ -461,15 +461,6 @@
 		return 0;
 	    }
       }
-    else if (info->image_type == GAIA_WAVELET_BLOB)
-      {
-	  blob = image_to_wavelet (thumbnail, &blob_size, info->quality_factor);
-	  if (!blob)
-	    {
-		printf ("WAVELET compression error\n");
-		return 0;
-	    }
-      }
     else
       {
 	  blob = image_to_jpeg (thumbnail, &blob_size, info->quality_factor);
@@ -1377,9 +1368,9 @@
     fprintf (stderr,
 	     "-d or --db-path     pathname      the SpatiaLite db path\n");
     fprintf (stderr, "-T or --table-name  name          DB table name\n");
-    fprintf (stderr, "-i or --image-type  type          [JPEG|WAVELET|TIFF]\n");
+    fprintf (stderr, "-i or --image-type  type          [JPEG|PNG|TIFF]\n");
     fprintf (stderr,
-	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
+	     "-q or --quality     num           [default = 75(JPEG)]\n");
     fprintf (stderr, "-c or --transparent-color 0xRRGGBB [default = NONE]\n");
     fprintf (stderr,
 	     "-b or --background-color  0xRRGGBB [default = 0x000000]\n");
@@ -1421,8 +1412,6 @@
 		  case ARG_IMAGE_TYPE:
 		      if (strcasecmp (argv[i], "JPEG") == 0)
 			  image_type = GAIA_JPEG_BLOB;
-		      if (strcasecmp (argv[i], "WAVELET") == 0)
-			  image_type = GAIA_WAVELET_BLOB;
 		      if (strcasecmp (argv[i], "PNG") == 0)
 			  image_type = GAIA_PNG_BLOB;
 		      if (strcasecmp (argv[i], "TIFF") == 0)
@@ -1592,16 +1581,6 @@
 	  if (quality_factor > 90)
 	      quality_factor = 90;
       }
-    if (image_type == GAIA_WAVELET_BLOB)
-      {
-	  /* normalizing the commpression factor */
-	  if (quality_factor == -999999)
-	      quality_factor = 25;
-	  if (quality_factor < 10)
-	      quality_factor = 10;
-	  if (quality_factor > 200)
-	      quality_factor = 200;
-      }
     printf ("=====================================================\n");
     printf ("             Arguments Summary\n");
     printf ("=====================================================\n");
@@ -1618,11 +1597,6 @@
 	  printf ("Topmost Pyramid Tile image type: JPEG quality=%d\n",
 		  quality_factor);
 	  break;
-      case GAIA_WAVELET_BLOB:
-	  printf
-	      ("Topmost Pyramid Tile image type: WAVELET compression ratio 1:%d\n",
-	       quality_factor);
-	  break;
       case GAIA_PNG_BLOB:
 	  printf ("Topmost Pyramid Tile image type: PNG [RGB]\n");
 	  break;
Index: lib/rasterlite_aux.c
===================================================================
--- lib/rasterlite_aux.c	(revision 11)
+++ lib/rasterlite_aux.c	(working copy)
@@ -36,10 +36,7 @@
 #include <unistd.h>
 #endif
 
-#include <geotiff.h>
-#include <xtiffio.h>
-#include <geo_normalize.h>
-#include <geovalues.h>
+#include "rasterlite_tiff_hdrs.h"
 #include <tiffio.h>
 
 #include <spatialite/sqlite3.h>
Index: lib/rasterlite.c
===================================================================
--- lib/rasterlite.c	(revision 11)
+++ lib/rasterlite.c	(working copy)
@@ -30,10 +30,7 @@
 #include <float.h>
 #include <math.h>
 
-#include <geotiff.h>
-#include <xtiffio.h>
-#include <geo_normalize.h>
-#include <geovalues.h>
+#include "rasterlite_tiff_hdrs.h"
 #include <tiffio.h>
 
 #include <spatialite/sqlite3.h>
Index: lib/rasterlite_tiff.c
===================================================================
--- lib/rasterlite_tiff.c	(revision 11)
+++ lib/rasterlite_tiff.c	(working copy)
@@ -29,12 +29,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <geotiff.h>
-#include <xtiffio.h>
-#include <geo_tiffp.h>
-#include <geo_keyp.h>
-#include <geovalues.h>
-#include <geo_normalize.h>
+#include "rasterlite_tiff_hdrs.h"
 
 #include <spatialite/sqlite3.h>
 #include <spatialite/gaiageo.h>
