summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-02-01 14:01:03 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-02-01 14:01:03 +0900
commit8a646fbfa5f0e8d2e5c3aca3c14d21bb5df0509c (patch)
treeb310f407e67566ffb123d1d21de171a3ac76cdd4
parentbc7783d7aba7ce52fa555f3715fe255885de2411 (diff)
downloadethumb-tizen_2.3.tar.gz
ethumb-tizen_2.3.tar.bz2
ethumb-tizen_2.3.zip
-rw-r--r--ethumb-tools.manifest9
-rw-r--r--ethumb.manifest2
-rw-r--r--packaging/ethumb.spec57
-rw-r--r--src/bin/ethumbd.c2
-rw-r--r--src/lib/Ethumb.h61
-rw-r--r--src/lib/client/Ethumb_Client.h62
-rw-r--r--src/lib/client/ethumb_client.c4
-rw-r--r--src/lib/ethumb.c4
8 files changed, 124 insertions, 77 deletions
diff --git a/ethumb-tools.manifest b/ethumb-tools.manifest
new file mode 100644
index 0000000..b0e80e1
--- /dev/null
+++ b/ethumb-tools.manifest
@@ -0,0 +1,9 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+ <assign>
+ <filesystem path="/usr/bin/ethumb" exec_label="none" />
+ <filesystem path="/usr/bin/ethumbd_client" exec_label="none" />
+ </assign>
+</manifest>
diff --git a/ethumb.manifest b/ethumb.manifest
index 46bd60c..c2767b1 100644
--- a/ethumb.manifest
+++ b/ethumb.manifest
@@ -3,9 +3,7 @@
<domain name="_"/>
</request>
<assign>
- <filesystem path="/usr/bin/ethumb" exec_label="none" />
<filesystem path="/usr/bin/ethumbd" exec_label="none" />
- <filesystem path="/usr/bin/ethumbd_client" exec_label="none" />
<filesystem path="/usr/libexec/ethumbd_slave" exec_label="none" />
</assign>
</manifest>
diff --git a/packaging/ethumb.spec b/packaging/ethumb.spec
index c700d72..d521408 100644
--- a/packaging/ethumb.spec
+++ b/packaging/ethumb.spec
@@ -1,11 +1,10 @@
-#sbs-git:slp/pkgs/e/ethumb ethumb 1.0.0+svn.68464slp2+build01 eee5311dd71f4fde48a4838412f70490e5d70c0b
-
Name: ethumb
Summary: Thumbnail Generator Library
-Version: 1.6.0+svn.75994slp2+build05
+Version: 1.6.0+svn.75994slp2+build09
Release: 1
Group: System/Libraries
License: LGPLv2.1
+URL: http://www.enlightenment.org/
Source0: %{name}-%{version}.tar.gz
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@ -16,52 +15,80 @@ BuildRequires: edje-devel
BuildRequires: eet-devel
BuildRequires: edje-bin
BuildRequires: edbus-devel
-BuildRequires: libexif-devel
+#BuildRequires: libexif-devel
+
%description
Enlightenment thumbnailing library Thumbnailing library meant to replace epsilon
+
%package devel
Summary: Thumbnail Generator Library (devel)
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+
%description devel
Thumbnailing library meant to replace epsilon (devel)
+
+%package tools
+Summary: Thumbnail Generator Library (tools)
+Group: Development/Tools
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-bin
+Obsoletes: %{name}-bin
+
+
+%description tools
+Thumbnailing library meant to replace epsilon (tools)
+
%prep
%setup -q
+
%build
-export CFLAGS+=" -fPIC"
-export LDFLAGS+=" -Wl,--hash-style=both -Wl,--as-needed"
+export CFLAGS+=" -fvisibility=hidden -fPIC -Wall"
+export LDFLAGS+=" -fvisibility=hidden -Wl,--hash-style=both -Wl,--as-needed"
+
%autogen --disable-static
make %{?jobs:-j%jobs}
+
%install
%make_install
-mkdir -p %{buildroot}/usr/share/license
-cp %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/usr/share/license/%{name}
+mkdir -p %{buildroot}/%{_datadir}/license
+cp %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{_datadir}/license/%{name}
+cp %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{_datadir}/license/%{name}-tools
+
%post -p /sbin/ldconfig
+
%postun -p /sbin/ldconfig
+
%files
%defattr(-,root,root,-)
%{_libdir}/libethumb*.so.*
-/usr/share/dbus-1/services/org.enlightenment.Ethumb.service
-/usr/share/ethumb/data/frames/default.edj
-/usr/bin/ethumb
-/usr/bin/ethumbd
-/usr/bin/ethumbd_client
-/usr/libexec/ethumbd_slave
+%{_datadir}/dbus-1/services/org.enlightenment.Ethumb.service
+%{_datadir}/ethumb/data/frames/default.edj
+%{_bindir}/ethumbd
+%{_libexecdir}/ethumbd_slave
+%{_datadir}/license/%{name}
%manifest %{name}.manifest
-/usr/share/license/%{name}
+
%files devel
%defattr(-,root,root,-)
%{_includedir}/ethumb-1/*.h
%{_libdir}/libethumb*.so
%{_libdir}/pkgconfig/*.pc
+
+
+%files tools
+%{_bindir}/ethumb
+%{_bindir}/ethumbd_client
+%{_datadir}/license/%{name}-tools
+%manifest %{name}-tools.manifest
diff --git a/src/bin/ethumbd.c b/src/bin/ethumbd.c
index d3ca7c3..bd26cbd 100644
--- a/src/bin/ethumbd.c
+++ b/src/bin/ethumbd.c
@@ -773,7 +773,7 @@ _ethumb_table_append(Ethumbd *ed)
q->max_count = new_max;
}
- for (i = 0; i < q->max_count; i++)
+ for (i = 0; i < (q->max_count - 1); i++)
{
if (!q->table[i].used)
break;
diff --git a/src/lib/Ethumb.h b/src/lib/Ethumb.h
index 12984ac..d506be2 100644
--- a/src/lib/Ethumb.h
+++ b/src/lib/Ethumb.h
@@ -47,12 +47,17 @@ extern "C" {
EAPI extern Ethumb_Version *ethumb_version;
/**
- * @defgroup Ethumb Ethumb
+ * @internal
+ * @defgroup Ethumb_Group Ethumb
+ * @ingroup EFL_Group
*
* @{
*/
+
/**
- * @defgroup Ethumb_Basics Ethumb Basics
+ * @internal
+ * @defgroup Ethumb_Basics_Group Ethumb Basics
+ * @ingroup Ethumb_Group
*
* Functions that all users must know of to use Ethumb.
*
@@ -81,12 +86,28 @@ EAPI int ethumb_shutdown(void);
EAPI Ethumb * ethumb_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI void ethumb_free(Ethumb *e);
+EAPI Eina_Bool ethumb_file_set(Ethumb *e, const char *path, const char *key) EINA_ARG_NONNULL(1, 2);
+EAPI void ethumb_file_get(const Ethumb *e, const char **path, const char **key) EINA_ARG_NONNULL(1);
+EAPI void ethumb_file_free(Ethumb *e) EINA_ARG_NONNULL(1);
+
+EAPI Eina_Bool ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Eina_Free_Cb free_data) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool ethumb_exists(Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
+
+EAPI Ethumb *ethumb_dup(const Ethumb *e) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool ethumb_cmp(const Ethumb *e1, const Ethumb *e2) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE;
+EAPI int ethumb_hash(const void *key, int key_length) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
+EAPI int ethumb_key_cmp(const void *key1, int key1_length,
+ const void *key2, int key2_length) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT EINA_PURE;
+EAPI unsigned int ethumb_length(const void *key) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
/**
* @}
*/
/**
- * @defgroup Ethumb_Setup Ethumb Fine Tune Setup
+ * @internal
+ * @defgroup Ethumb_Setup_Group Ethumb Fine Tune Setup
+ * @ingroup Ethumb_Group
*
* How to fine tune thumbnail generation, setting size, aspect,
* frames, quality and so on.
@@ -108,12 +129,18 @@ EAPI void ethumb_thumb_path_get(Ethumb *e, const char **path, const char
EAPI void ethumb_thumb_hash(Ethumb *e) EINA_ARG_NONNULL(1);
EAPI void ethumb_thumb_hash_copy(Ethumb *dst, const Ethumb *src) EINA_ARG_NONNULL(1, 2);
+/**
+ * @brief Enumeration of Ethumb thumb FDO size
+ */
typedef enum _Ethumb_Thumb_FDO_Size
{
ETHUMB_THUMB_NORMAL, /**< 128x128 as defined by FreeDesktop.Org standard */
ETHUMB_THUMB_LARGE /**< 256x256 as defined by FreeDesktop.Org standard */
} Ethumb_Thumb_FDO_Size;
+/**
+ * @brief Enumeration of Ethumb thumb format type
+ */
typedef enum _Ethumb_Thumb_Format
{
ETHUMB_THUMB_FDO, /**< PNG as defined by FreeDesktop.Org standard */
@@ -121,6 +148,9 @@ typedef enum _Ethumb_Thumb_Format
ETHUMB_THUMB_EET /**< EFL's own storage system, supports key parameter */
} Ethumb_Thumb_Format;
+/**
+ * @brief Enumeration of Ethumb thumb aspect type
+ */
typedef enum _Ethumb_Thumb_Aspect
{
ETHUMB_THUMB_KEEP_ASPECT, /**< keep original proportion between width and height */
@@ -128,6 +158,9 @@ typedef enum _Ethumb_Thumb_Aspect
ETHUMB_THUMB_CROP /**< keep aspect but crop (cut) the largest dimension */
} Ethumb_Thumb_Aspect;
+/**
+ * @brief Enumeration of Ethumb orientation type
+ */
typedef enum _Ethumb_Thumb_Orientation
{
ETHUMB_THUMB_ORIENT_NONE, /**< keep orientation as pixel data is */
@@ -183,28 +216,6 @@ EAPI unsigned int ethumb_document_page_get(const Ethumb *e) EINA_WARN_UNUSED_RES
*/
/**
- * @addtogroup Ethumb_Basics Ethumb Basics
- * @{
- */
-EAPI Eina_Bool ethumb_file_set(Ethumb *e, const char *path, const char *key) EINA_ARG_NONNULL(1, 2);
-EAPI void ethumb_file_get(const Ethumb *e, const char **path, const char **key) EINA_ARG_NONNULL(1);
-EAPI void ethumb_file_free(Ethumb *e) EINA_ARG_NONNULL(1);
-
-EAPI Eina_Bool ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Eina_Free_Cb free_data) EINA_ARG_NONNULL(1, 2);
-EAPI Eina_Bool ethumb_exists(Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
-
-EAPI Ethumb *ethumb_dup(const Ethumb *e) EINA_ARG_NONNULL(1);
-EAPI Eina_Bool ethumb_cmp(const Ethumb *e1, const Ethumb *e2) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE;
-EAPI int ethumb_hash(const void *key, int key_length) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
-EAPI int ethumb_key_cmp(const void *key1, int key1_length,
- const void *key2, int key2_length) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT EINA_PURE;
-EAPI unsigned int ethumb_length(const void *key) EINA_PURE EINA_WARN_UNUSED_RESULT;
-
- /**
- * @}
- */
-
-/**
* @}
*/
diff --git a/src/lib/client/Ethumb_Client.h b/src/lib/client/Ethumb_Client.h
index 81105aa..3736797 100644
--- a/src/lib/client/Ethumb_Client.h
+++ b/src/lib/client/Ethumb_Client.h
@@ -34,13 +34,17 @@ extern "C" {
#endif
/**
- * @defgroup Ethumb_Client Ethumb Client
+ * @internal
+ * @defgroup Ethumb_Client_Group Ethumb Client
+ * @ingroup Ethumb_Group
*
* @{
*/
/**
- * @defgroup Ethumb_Client_Basics Ethumb Client Basics
+ * @internal
+ * @defgroup Ethumb_Client_Basics_Group Ethumb Client Basics
+ * @ingroup Ethumb_Client_Group
*
* Functions that all users must know of to use Ethumb_Client.
*
@@ -131,12 +135,35 @@ EAPI Ethumb_Client * ethumb_client_connect(Ethumb_Client_Connect_Cb connect_cb,
EAPI void ethumb_client_disconnect(Ethumb_Client *client);
EAPI void ethumb_client_on_server_die_callback_set(Ethumb_Client *client, Ethumb_Client_Die_Cb server_die_cb, const void *data, Eina_Free_Cb free_data);
+EAPI Eina_Bool ethumb_client_file_set(Ethumb_Client *client, const char *path, const char *key);
+EAPI void ethumb_client_file_get(Ethumb_Client *client, const char **path, const char **key);
+EAPI void ethumb_client_file_free(Ethumb_Client *client);
+
+EAPI Ethumb_Exists *ethumb_client_thumb_exists(Ethumb_Client *client, Ethumb_Client_Thumb_Exists_Cb exists_cb, const void *data);
+EAPI void ethumb_client_thumb_exists_cancel(Ethumb_Exists *exists);
+EAPI Eina_Bool ethumb_client_thumb_exists_check(Ethumb_Exists *exists);
+EAPI int ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, const void *data, Eina_Free_Cb free_data);
+EAPI void ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, const void *data, Eina_Free_Cb free_data);
+EAPI void ethumb_client_generate_cancel_all(Ethumb_Client *client);
+
+typedef void (*Ethumb_Client_Async_Done_Cb)(Ethumb_Client *ethumbd, const char *thumb_path, const char *thumb_key, void *data);
+typedef void (*Ethumb_Client_Async_Error_Cb)(Ethumb_Client *ethumbd, void *data);
+
+typedef struct _Ethumb_Client_Async Ethumb_Client_Async;
+
+EAPI Ethumb_Client_Async *ethumb_client_thumb_async_get(Ethumb_Client *client,
+ Ethumb_Client_Async_Done_Cb done,
+ Ethumb_Client_Async_Error_Cb error,
+ const void *data);
+EAPI void ethumb_client_thumb_async_cancel(Ethumb_Client *client, Ethumb_Client_Async *request);
/**
* @}
*/
/**
- * @defgroup Ethumb_Client_Setup Ethumb Client Fine Tune Setup
+ * @internal
+ * @defgroup Ethumb_Client_Setup_Group Ethumb Client Fine Tune Setup
+ * @ingroup Ethumb_Client_Group
*
* How to fine tune thumbnail generation, setting size, aspect, orientation,
* frames, quality and so on.
@@ -180,35 +207,6 @@ EAPI void ethumb_client_thumb_path_get(Ethumb_Client *client, const char **path,
*/
/**
- * @addtogroup Ethumb_Client_Basics Ethumb Client Basics
- * @{
- */
-EAPI Eina_Bool ethumb_client_file_set(Ethumb_Client *client, const char *path, const char *key);
-EAPI void ethumb_client_file_get(Ethumb_Client *client, const char **path, const char **key);
-EAPI void ethumb_client_file_free(Ethumb_Client *client);
-
-EAPI Ethumb_Exists *ethumb_client_thumb_exists(Ethumb_Client *client, Ethumb_Client_Thumb_Exists_Cb exists_cb, const void *data);
-EAPI void ethumb_client_thumb_exists_cancel(Ethumb_Exists *exists);
-EAPI Eina_Bool ethumb_client_thumb_exists_check(Ethumb_Exists *exists);
-EAPI int ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, const void *data, Eina_Free_Cb free_data);
-EAPI void ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, const void *data, Eina_Free_Cb free_data);
-EAPI void ethumb_client_generate_cancel_all(Ethumb_Client *client);
-
-typedef void (*Ethumb_Client_Async_Done_Cb)(Ethumb_Client *ethumbd, const char *thumb_path, const char *thumb_key, void *data);
-typedef void (*Ethumb_Client_Async_Error_Cb)(Ethumb_Client *ethumbd, void *data);
-
-typedef struct _Ethumb_Client_Async Ethumb_Client_Async;
-
-EAPI Ethumb_Client_Async *ethumb_client_thumb_async_get(Ethumb_Client *client,
- Ethumb_Client_Async_Done_Cb done,
- Ethumb_Client_Async_Error_Cb error,
- const void *data);
-EAPI void ethumb_client_thumb_async_cancel(Ethumb_Client *client, Ethumb_Client_Async *request);
- /**
- * @}
- */
-
-/**
* @}
*/
diff --git a/src/lib/client/ethumb_client.c b/src/lib/client/ethumb_client.c
index ee17507..59ebe43 100644
--- a/src/lib/client/ethumb_client.c
+++ b/src/lib/client/ethumb_client.c
@@ -2420,13 +2420,15 @@ _ethumb_client_thumb_generate_idler(void *data __UNUSED__)
async->error(async->client, (void *)async->data);
async->client->ethumb = tmp;
_ethumb_client_async_free(async);
+ async = NULL;
}
else
{
async->client->ethumb = tmp;
}
- pending = eina_list_append(pending, async);
+ if (async)
+ pending = eina_list_append(pending, async);
if (ecore_time_get() - ecore_loop_time_get() > ecore_animator_frametime_get() * 0.5)
return EINA_TRUE;
diff --git a/src/lib/ethumb.c b/src/lib/ethumb.c
index a783b34..549ca55 100644
--- a/src/lib/ethumb.c
+++ b/src/lib/ethumb.c
@@ -1265,12 +1265,14 @@ ethumb_image_save(Ethumb *e)
dname = ecore_file_dir_get(e->thumb_path);
r = ecore_file_mkpath(dname);
- free(dname);
+
if (!r)
{
ERR("could not create directory '%s'", dname);
+ free(dname);
return EINA_FALSE;
}
+ free(dname);
snprintf(flags, sizeof(flags), "quality=%d compress=%d",
e->quality, e->compress);