hey
here is some fixes for epsilon
does it lok good ?
also, should we abort the configuration if no epeg nor libpng exists ?
Vincent
--- Makefile.am.~1.7.~ 2005-09-02 22:13:21.000000000 +0200
+++ Makefile.am 2006-01-17 09:04:55.816860431 +0100
@@ -6,7 +6,7 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = exiftags
-INCLUDES = @IMLIB2_CFLAGS@ @EPEG_CFLAGS@ @ECORE_CFLAGS@
@EVAS_CFLAGS@ @EDJE_CFLAGS@
+INCLUDES = @IMLIB2_CFLAGS@ @EPEG_CFLAGS@ @PNG_CFLAGS@
@ECORE_CFLAGS@ @EVAS_CFLAGS@ @EDJE_CFLAGS@
lib_LTLIBRARIES = libepsilon.la
include_HEADERS = Epsilon.h
@@ -15,6 +15,6 @@
Epsilon_Exif.c \
md5.c md5.h
-libepsilon_la_LIBADD = exiftags/libepsilon_exiftags.la @IMLIB2_LIBS@
@EPEG_LIBS@ @ECORE_LIBS@ @EVAS_LIBS@ @EDJE_LIBS@
+libepsilon_la_LIBADD = exiftags/libepsilon_exiftags.la @IMLIB2_LIBS@
@EPEG_LIBS@ @PNG_LIBS@ @ECORE_LIBS@ @EVAS_LIBS@ @EDJE_LIBS@
libepsilon_la_DEPENDENCIES = ../config.h
libepsilon_la_LDFLAGS = $(LDFLAGS) -version-info 0:1:0
--- Epsilon.c.~1.24.~ 2005-12-22 10:34:15.000000000 +0100
+++ Epsilon.c 2006-01-17 09:16:52.165383643 +0100
@@ -1,7 +1,9 @@
#include "Epsilon.h"
#define X_DISPLAY_MISSING 1
#include <Imlib2.h>
+#ifdef HAVE_PNG_H
#include <png.h>
+#endif
#include <limits.h>
#include <string.h>
#include <sys/types.h>
@@ -40,10 +42,12 @@
#ifdef HAVE_EPEG_H
static int _epsilon_jpg_mtime_get (const char *file);
#endif
+#ifdef HAVE_PNG_H
static FILE *_epsilon_open_png_file_reading (const char *filename);
static int _epsilon_png_write (const char *file, DATA32 * ptr,
int tw, int th, int sw, int sh, char *imformat,
int mtime, char *uri);
+#endif
Epsilon *
epsilon_new (const char *file)
@@ -159,6 +163,7 @@
break;
}
#endif
+#ifdef HAVE_PNG_H
snprintf (buf, sizeof(buf), "%s/%s/%s.png", getenv ("HOME"), dirs[i],
e->hash);
if (stat (buf, &status) == 0)
@@ -168,6 +173,7 @@
e->thumb = strdup (buf);
break;
}
+#endif
}
return (e->thumb);
}
@@ -256,8 +262,11 @@
}
else
#endif
+#ifdef HAVE_PNG_H
if ((fp = _epsilon_open_png_file_reading (e->thumb)))
+#endif
{
+#ifdef HAVE_PNG_H
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
png_textp text_ptr;
@@ -301,6 +310,7 @@
/* png_read_end(png_ptr,info_ptr); */
png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp) NULL);
fclose (fp);
+#endif
}
if ((p->eei = epsilon_exif_info_get (e)))
{
@@ -389,6 +399,7 @@
break;
}
#endif
+#ifdef HAVE_PNG_H
snprintf (buf, sizeof(buf), "%s/.thumbnails/%s/%s.png", home,
dirs[i], e->hash);
if (!stat (buf, &filestatus) &&
@@ -399,6 +410,7 @@
ok = 2;
break;
}
+#endif
}
if (!ok)
return (EPSILON_FAIL);
@@ -410,7 +422,11 @@
epsilonmtime = _epsilon_jpg_mtime_get (buf);
else
#endif
+ {
+#ifdef HAVE_PNG_H
epsilonmtime = _epsilon_png_mtime_get (buf);
+#endif
+ }
if (filemtime == epsilonmtime)
return (EPSILON_OK);
}
@@ -552,6 +568,7 @@
snprintf (format, sizeof(format), "image/%s", imlib_image_format ());
}
+#ifdef HAVE_PNG_H
if (tmp)
{
iw = imlib_image_get_width ();
@@ -592,6 +609,7 @@
}
}
+#endif
if (ee) ecore_evas_free(ee);
}
return (EPSILON_FAIL);
@@ -635,6 +653,7 @@
}
#endif
+#ifdef HAVE_PNG_H
static FILE *
_epsilon_open_png_file_reading (const char *filename)
{
@@ -865,3 +884,4 @@
return (ret);
}
+#endif
--- configure.in.~1.15.~ 2006-01-12 06:43:07.000000000 +0100
+++ configure.in 2006-01-17 09:06:29.305288794 +0100
@@ -38,15 +38,21 @@
have_epeg="yes"
],
[
- have_epeg="yes"
+ have_epeg="no"
AC_MSG_WARN(Cannot find Epeg on your system: jpeg thumbnail suckage!)
]
)
dnl Make sure the png header/lib is available
PKG_CHECK_MODULES(PNG, libpng12 >= 1.2.0,
- [ have_png="yes" ],
- [ have_png="no" ]
+ [
+ have_png="yes"
+ AC_DEFINE(HAVE_PNG_H, 1, [png.h is available])
+ ],
+ [
+ have_png="no"
+ AC_MSG_WARN(Cannot find libpng on your system: png thumbnail suckage!)
+ ]
)
AC_PATH_PROG(PERL, perl, 0)