AM_CONDITIONAL(HAVE_LIBEXIF, test $HAVE_LIBEXIF = yes)
AC_SUBST(HAVE_LIBEXIF)
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/xattr.h>
+ ]],
+ [[
+size_t tmp = listxattr("/", NULL, 0);
+tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
+setxattr("/", "user.ethumb.md5", NULL, 0, 0);
+ ]])],
+ [
+ AC_DEFINE(HAVE_XATTR, 1, [Define to 1 if you have 'listxattr', 'setxattr' and 'getxattr'])
+ have_xattr="yes"
+ ],
+ [have_xattr="no"])
+
+AC_MSG_CHECKING([for Xattr])
+AC_MSG_RESULT([${have_xattr}])
+
AC_SUBST(requirement_ethumb)
AC_SUBST(requirement_ethumb_client)
AC_SUBST(dbusservicedir)
Configuration Options Summary:
+ * use xattr........: ${have_xattr}
* maximum log level: ${with_max_log_level}
* documentation....: ${build_doc}
#include <dlfcn.h>
#include <ctype.h>
+#ifdef HAVE_XATTR
+# include <sys/xattr.h>
+#endif
+
#ifndef PATH_MAX
# define PATH_MAX 4096
#endif
char *t;
const unsigned char *c;
+#ifdef HAVE_XATTR
+ ssize_t length;
+
+ length = getxattr(file, "user.e.md5", NULL, 0);
+
+ if (length > 0)
+ {
+ char *tmp;
+
+ tmp = alloca(length);
+ length = getxattr(file, "user.e.md5", tmp, length);
+
+ /* check if we have at least something that look like a md5 hash */
+ if (length > 0 && (length == MD5_HASHBYTES * 2 + 1))
+ {
+ tmp[length] = '\0';
+ return eina_stringshare_add(tmp);
+ }
+ }
+#endif
+
#define _check_uri_char(c) \
((c) >= 32 && (c) < 128 && (ACCEPTABLE_URI_CHARS[(c) - 32] & 0x08))
}
md5out[2 * n] = '\0';
+#ifdef HAVE_XATTR
+ setxattr(file, "user.e.md5", md5out, 2 * n + 1, 0);
+#endif
+
DBG("md5=%s, file=%s", md5out, file);
return eina_stringshare_add(md5out);
}
const char *ext;
int fdo_format;
-
fdo_format = _ethumb_file_check_fdo(e);
if (e->thumb_dir)
else
ext = "eet";
-
fullname = ecore_file_realpath(e->src_path);
hash = _ethumb_generate_hash(fullname);
snprintf(buf, sizeof(buf), "%s/%s/%s.%s", thumb_dir, category, hash, ext);