summaryrefslogtreecommitdiff
path: root/legacy/ethumb
diff options
context:
space:
mode:
authorChidambar Zinnoury <illogict@online.fr>2010-09-19 17:07:35 +0000
committerChidambar Zinnoury <illogict@online.fr>2010-09-19 17:07:35 +0000
commit0f4ce94ecf875c69ea09393352a17dc8fa0d1bec (patch)
treef4bf0ebdd1dda1bdb9e1e56582376e5983548627 /legacy/ethumb
parentf1f122bd72031f6d8c582013b395e0ec4c87537f (diff)
ethumb: automagically orient thumbnails based on:
- metadata contained in files (EXIF only currently) - default active; - orientation given by the caller against pixel data orientation. Code is based on els_icon. Next is to add that through dbus. Open question: if orientation is specified, do we need to save the thumbnail in a different folder? SVN revision: 52465
Diffstat (limited to 'legacy/ethumb')
-rw-r--r--legacy/ethumb/configure.ac23
-rw-r--r--legacy/ethumb/src/lib/Ethumb.c202
-rw-r--r--legacy/ethumb/src/lib/Ethumb.h24
-rw-r--r--legacy/ethumb/src/lib/Makefile.am7
-rw-r--r--legacy/ethumb/src/lib/client/Ethumb_Client.c49
-rw-r--r--legacy/ethumb/src/lib/client/Ethumb_Client.h4
-rw-r--r--legacy/ethumb/src/lib/ethumb_private.h1
7 files changed, 304 insertions, 6 deletions
diff --git a/legacy/ethumb/configure.ac b/legacy/ethumb/configure.ac
index ddb64f6e22..62b8a11a92 100644
--- a/legacy/ethumb/configure.ac
+++ b/legacy/ethumb/configure.ac
@@ -121,6 +121,29 @@ if $USE_MODULE_ETHUMBD ; then
121 ] 121 ]
122 ) 122 )
123fi 123fi
124AC_ARG_ENABLE([libexif],
125 [AC_HELP_STRING([--disable-libexif], [disable libexif support. Default is enabled.])],
126 [
127 if test "x${enableval}" = "xyes" ; then
128 _iv_enable_libexif="yes"
129 else
130 _iv_enable_libexif="no"
131 fi
132 ],
133 [_iv_enable_libexif="yes"]
134)
135
136AC_MSG_CHECKING([whether libexif is built])
137AC_MSG_RESULT([${_iv_enable_libexif}])
138
139HAVE_LIBEXIF="no"
140
141if test "x${_iv_enable_libexif}" = "xyes" ; then
142 AC_ETH_CHECK_PKG(LIBEXIF, libexif)
143fi
144
145AM_CONDITIONAL(HAVE_LIBEXIF, test $HAVE_LIBEXIF = yes)
146AC_SUBST(HAVE_LIBEXIF)
124 147
125AC_SUBST(requirement_ethumb) 148AC_SUBST(requirement_ethumb)
126AC_SUBST(requirement_ethumb_client) 149AC_SUBST(requirement_ethumb_client)
diff --git a/legacy/ethumb/src/lib/Ethumb.c b/legacy/ethumb/src/lib/Ethumb.c
index 5bee1dd363..b592639507 100644
--- a/legacy/ethumb/src/lib/Ethumb.c
+++ b/legacy/ethumb/src/lib/Ethumb.c
@@ -69,6 +69,10 @@ void *alloca (size_t);
69#include "Ethumb_Plugin.h" 69#include "Ethumb_Plugin.h"
70#include "md5.h" 70#include "md5.h"
71 71
72#ifdef HAVE_LIBEXIF
73 #include <libexif/exif-data.h>
74#endif
75
72static int _log_dom = -1; 76static int _log_dom = -1;
73#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__) 77#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
74#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__) 78#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
@@ -224,6 +228,7 @@ ethumb_new(void)
224 /* IF CHANGED, UPDATE DOCS in (Ethumb.c, Ethumb_Client.c, python...)!!! */ 228 /* IF CHANGED, UPDATE DOCS in (Ethumb.c, Ethumb_Client.c, python...)!!! */
225 ethumb->tw = THUMB_SIZE_NORMAL; 229 ethumb->tw = THUMB_SIZE_NORMAL;
226 ethumb->th = THUMB_SIZE_NORMAL; 230 ethumb->th = THUMB_SIZE_NORMAL;
231 ethumb->orientation = ETHUMB_THUMB_ORIENT_ORIGINAL;
227 ethumb->crop_x = 0.5; 232 ethumb->crop_x = 0.5;
228 ethumb->crop_y = 0.5; 233 ethumb->crop_y = 0.5;
229 ethumb->quality = 80; 234 ethumb->quality = 80;
@@ -345,6 +350,7 @@ ethumb_thumb_fdo_set(Ethumb *e, Ethumb_Thumb_FDO_Size s)
345 350
346 e->format = ETHUMB_THUMB_FDO; 351 e->format = ETHUMB_THUMB_FDO;
347 e->aspect = ETHUMB_THUMB_KEEP_ASPECT; 352 e->aspect = ETHUMB_THUMB_KEEP_ASPECT;
353 e->orientation = ETHUMB_THUMB_ORIENT_ORIGINAL;
348 _ethumb_frame_free(e->frame); 354 _ethumb_frame_free(e->frame);
349 e->frame = NULL; 355 e->frame = NULL;
350 eina_stringshare_del(e->thumb_dir); 356 eina_stringshare_del(e->thumb_dir);
@@ -413,6 +419,31 @@ ethumb_thumb_aspect_get(const Ethumb *e)
413} 419}
414 420
415EAPI void 421EAPI void
422ethumb_thumb_orientation_set(Ethumb *e, Ethumb_Thumb_Orientation o)
423{
424 EINA_SAFETY_ON_NULL_RETURN(e);
425 EINA_SAFETY_ON_FALSE_RETURN(o == ETHUMB_THUMB_ORIENT_NONE ||
426 o == ETHUMB_THUMB_ROTATE_90_CW ||
427 o == ETHUMB_THUMB_ROTATE_180 ||
428 o == ETHUMB_THUMB_ROTATE_90_CCW ||
429 o == ETHUMB_THUMB_FLIP_HORIZONTAL ||
430 o == ETHUMB_THUMB_FLIP_VERTICAL ||
431 o == ETHUMB_THUMB_FLIP_TRANSPOSE ||
432 o == ETHUMB_THUMB_FLIP_TRANSVERSE ||
433 o == ETHUMB_THUMB_ORIENT_ORIGINAL);
434
435 DBG("ethumb=%p, orientation=%d", e, o);
436 e->orientation = o;
437}
438
439EAPI Ethumb_Thumb_Orientation
440ethumb_thumb_orientation_get(const Ethumb *e)
441{
442 EINA_SAFETY_ON_NULL_RETURN_VAL(e, 0);
443 return e->orientation;
444}
445
446EAPI void
416ethumb_thumb_crop_align_set(Ethumb *e, float x, float y) 447ethumb_thumb_crop_align_set(Ethumb *e, float x, float y)
417{ 448{
418 EINA_SAFETY_ON_NULL_RETURN(e); 449 EINA_SAFETY_ON_NULL_RETURN(e);
@@ -1171,12 +1202,135 @@ ethumb_image_save(Ethumb *e)
1171 return EINA_TRUE; 1202 return EINA_TRUE;
1172} 1203}
1173 1204
1205static void
1206_ethumb_image_orient(Ethumb *e, int orientation)
1207{
1208 Evas_Object *img = e->img, *tmp;
1209 unsigned int *data, *data2, *to, *from, *p1, *p2, pt;
1210 int x, y, w, hw, iw, ih, tw, th;
1211 const char *file, *key;
1212
1213 evas_object_image_size_get(img, &iw, &ih);
1214 data = evas_object_image_data_get(img, 1);
1215
1216 switch (orientation)
1217 {
1218 case ETHUMB_THUMB_FLIP_HORIZONTAL:
1219 for (y = 0; y < ih; y++)
1220 {
1221 p1 = data + (y * iw);
1222 p2 = data + ((y + 1) * iw) - 1;
1223 for (x = 0; x < (iw >> 1); x++)
1224 {
1225 pt = *p1;
1226 *p1 = *p2;
1227 *p2 = pt;
1228 p1++;
1229 p2--;
1230 }
1231 }
1232 evas_object_image_data_set(img, data);
1233 evas_object_image_data_update_add(img, 0, 0, iw, ih);
1234 return;
1235 case ETHUMB_THUMB_FLIP_VERTICAL:
1236 for (y = 0; y < (ih >> 1); y++)
1237 {
1238 p1 = data + (y * iw);
1239 p2 = data + ((ih - 1 - y) * iw);
1240 for (x = 0; x < iw; x++)
1241 {
1242 pt = *p1;
1243 *p1 = *p2;
1244 *p2 = pt;
1245 p1++;
1246 p2++;
1247 }
1248 }
1249 evas_object_image_data_set(img, data);
1250 evas_object_image_data_update_add(img, 0, 0, iw, ih);
1251 return;
1252 case ETHUMB_THUMB_ROTATE_180:
1253 hw = iw * ih;
1254 x = (hw / 2);
1255 p1 = data;
1256 p2 = data + hw - 1;
1257 for (; --x > 0;)
1258 {
1259 pt = *p1;
1260 *p1 = *p2;
1261 *p2 = pt;
1262 p1++;
1263 p2--;
1264 }
1265 evas_object_image_data_set(img, data);
1266 evas_object_image_data_update_add(img, 0, 0, iw, ih);
1267 return;
1268 }
1269
1270 evas_object_image_load_size_get(img, &tw, &th);
1271 evas_object_image_file_get(img, &file, &key);
1272 tmp = evas_object_image_add(evas_object_evas_get(img));
1273 evas_object_image_load_size_set(tmp, tw, th);
1274 evas_object_image_file_set(tmp, file, key);
1275 data2 = evas_object_image_data_get(tmp, 0);
1276
1277 w = ih;
1278 ih = iw;
1279 iw = w;
1280 hw = w * ih;
1281
1282 evas_object_image_size_set(img, iw, ih);
1283 data = evas_object_image_data_get(img, 1);
1284
1285 switch (orientation)
1286 {
1287 case ETHUMB_THUMB_FLIP_TRANSPOSE:
1288 to = data;
1289 hw = -hw + 1;
1290 break;
1291 case ETHUMB_THUMB_FLIP_TRANSVERSE:
1292 to = data + hw - 1;
1293 w = -w;
1294 hw = hw - 1;
1295 break;
1296 case ETHUMB_THUMB_ROTATE_90_CW:
1297 to = data + w - 1;
1298 hw = -hw - 1;
1299 break;
1300 case ETHUMB_THUMB_ROTATE_90_CCW:
1301 to = data + hw - w;
1302 w = -w;
1303 hw = hw + 1;
1304 break;
1305 default:
1306 ERR("unknown orient %d", orientation);
1307 evas_object_del(tmp);
1308 evas_object_image_data_set(img, data); // give it back
1309 return;
1310 }
1311 from = data2;
1312 for (x = iw; --x >= 0;)
1313 {
1314 for (y = ih; --y >= 0;)
1315 {
1316 *to = *from;
1317 from++;
1318 to += w;
1319 }
1320 to += hw;
1321 }
1322 evas_object_del(tmp);
1323 evas_object_image_data_set(img, data);
1324 evas_object_image_data_update_add(img, 0, 0, iw, ih);
1325}
1326
1174static int 1327static int
1175_ethumb_image_load(Ethumb *e) 1328_ethumb_image_load(Ethumb *e)
1176{ 1329{
1177 int error; 1330 int error;
1178 Evas_Coord w, h, ww, hh, fx, fy, fw, fh; 1331 Evas_Coord w, h, ww, hh, fx, fy, fw, fh;
1179 Evas_Object *img; 1332 Evas_Object *img;
1333 int orientation = ETHUMB_THUMB_ORIENT_NONE;
1180 1334
1181 img = e->img; 1335 img = e->img;
1182 1336
@@ -1200,6 +1354,54 @@ _ethumb_image_load(Ethumb *e)
1200 return 0; 1354 return 0;
1201 } 1355 }
1202 1356
1357 if (e->orientation == ETHUMB_THUMB_ORIENT_ORIGINAL)
1358 {
1359#ifdef HAVE_LIBEXIF
1360 ExifData *exif = exif_data_new_from_file(e->src_path);
1361 ExifEntry *entry = NULL;
1362 ExifByteOrder bo;
1363 int o;
1364
1365 if (exif)
1366 {
1367 entry = exif_data_get_entry(exif, EXIF_TAG_ORIENTATION);
1368 if (entry)
1369 {
1370 bo = exif_data_get_byte_order(exif);
1371 o = exif_get_short(entry->data, bo);
1372 }
1373 exif_data_free(exif);
1374 switch (o)
1375 {
1376 case 2:
1377 orientation = ETHUMB_THUMB_FLIP_HORIZONTAL;
1378 break;
1379 case 3:
1380 orientation = ETHUMB_THUMB_ROTATE_180;
1381 break;
1382 case 4:
1383 orientation = ETHUMB_THUMB_FLIP_VERTICAL;
1384 break;
1385 case 5:
1386 orientation = ETHUMB_THUMB_FLIP_TRANSPOSE;
1387 break;
1388 case 6:
1389 orientation = ETHUMB_THUMB_ROTATE_90_CW;
1390 break;
1391 case 7:
1392 orientation = ETHUMB_THUMB_FLIP_TRANSVERSE;
1393 break;
1394 case 8:
1395 orientation = ETHUMB_THUMB_ROTATE_90_CCW;
1396 break;
1397 }
1398 }
1399#endif
1400 }
1401
1402 if (orientation != ETHUMB_THUMB_ORIENT_NONE)
1403 _ethumb_image_orient(e, orientation);
1404
1203 evas_object_image_size_get(img, &w, &h); 1405 evas_object_image_size_get(img, &w, &h);
1204 if ((w <= 0) || (h <= 0)) 1406 if ((w <= 0) || (h <= 0))
1205 return 0; 1407 return 0;
diff --git a/legacy/ethumb/src/lib/Ethumb.h b/legacy/ethumb/src/lib/Ethumb.h
index 37e5ba3194..b9c0c86413 100644
--- a/legacy/ethumb/src/lib/Ethumb.h
+++ b/legacy/ethumb/src/lib/Ethumb.h
@@ -119,16 +119,32 @@ typedef enum _Ethumb_Thumb_Aspect
119 ETHUMB_THUMB_CROP /**< keep aspect but crop (cut) the largest dimension */ 119 ETHUMB_THUMB_CROP /**< keep aspect but crop (cut) the largest dimension */
120} Ethumb_Thumb_Aspect; 120} Ethumb_Thumb_Aspect;
121 121
122typedef enum _Ethumb_Thumb_Orientation
123{
124 ETHUMB_THUMB_ORIENT_NONE, /**< keep orientation as pixel data is */
125 ETHUMB_THUMB_ROTATE_90_CW, /**< rotate 90° clockwise */
126 ETHUMB_THUMB_ROTATE_180, /**< rotate 180° */
127 ETHUMB_THUMB_ROTATE_90_CCW, /**< rotate 90° counter-clockwise */
128 ETHUMB_THUMB_FLIP_HORIZONTAL, /**< flip horizontally */
129 ETHUMB_THUMB_FLIP_VERTICAL, /**< flip vertically */
130 ETHUMB_THUMB_FLIP_TRANSPOSE, /**< transpose */
131 ETHUMB_THUMB_FLIP_TRANSVERSE, /**< transverse */
132 ETHUMB_THUMB_ORIENT_ORIGINAL /**< use orientation from metadata (EXIF-only currently) */
133} Ethumb_Thumb_Orientation;
134
122EAPI void ethumb_thumb_fdo_set(Ethumb *e, Ethumb_Thumb_FDO_Size s) EINA_ARG_NONNULL(1); 135EAPI void ethumb_thumb_fdo_set(Ethumb *e, Ethumb_Thumb_FDO_Size s) EINA_ARG_NONNULL(1);
123 136
124EAPI void ethumb_thumb_size_set(Ethumb *e, int tw, int th) EINA_ARG_NONNULL(1); 137EAPI void ethumb_thumb_size_set(Ethumb *e, int tw, int th) EINA_ARG_NONNULL(1);
125EAPI void ethumb_thumb_size_get(const Ethumb *e, int *tw, int *th) EINA_ARG_NONNULL(1); 138EAPI void ethumb_thumb_size_get(const Ethumb *e, int *tw, int *th) EINA_ARG_NONNULL(1);
126 139
127EAPI void ethumb_thumb_format_set(Ethumb *e, Ethumb_Thumb_Format f) EINA_ARG_NONNULL(1); 140EAPI void ethumb_thumb_format_set(Ethumb *e, Ethumb_Thumb_Format f) EINA_ARG_NONNULL(1);
128EAPI Ethumb_Thumb_Format ethumb_thumb_format_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; 141EAPI Ethumb_Thumb_Format ethumb_thumb_format_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
142
143EAPI void ethumb_thumb_aspect_set(Ethumb *e, Ethumb_Thumb_Aspect a) EINA_ARG_NONNULL(1);
144EAPI Ethumb_Thumb_Aspect ethumb_thumb_aspect_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
129 145
130EAPI void ethumb_thumb_aspect_set(Ethumb *e, Ethumb_Thumb_Aspect a) EINA_ARG_NONNULL(1); 146EAPI void ethumb_thumb_orientation_set(Ethumb *e, Ethumb_Thumb_Orientation o) EINA_ARG_NONNULL(1);
131EAPI Ethumb_Thumb_Aspect ethumb_thumb_aspect_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; 147EAPI Ethumb_Thumb_Orientation ethumb_thumb_orientation_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
132 148
133EAPI void ethumb_thumb_crop_align_set(Ethumb *e, float x, float y) EINA_ARG_NONNULL(1); 149EAPI void ethumb_thumb_crop_align_set(Ethumb *e, float x, float y) EINA_ARG_NONNULL(1);
134EAPI void ethumb_thumb_crop_align_get(const Ethumb *e, float *x, float *y) EINA_ARG_NONNULL(1); 150EAPI void ethumb_thumb_crop_align_get(const Ethumb *e, float *x, float *y) EINA_ARG_NONNULL(1);
diff --git a/legacy/ethumb/src/lib/Makefile.am b/legacy/ethumb/src/lib/Makefile.am
index c521a0bfe6..66796a43fa 100644
--- a/legacy/ethumb/src/lib/Makefile.am
+++ b/legacy/ethumb/src/lib/Makefile.am
@@ -9,6 +9,10 @@ AM_CPPFLAGS = \
9 @EINA_CFLAGS@ @EVAS_CFLAGS@ @ECORE_EVAS_CFLAGS@ @ECORE_FILE_CFLAGS@ @EDJE_CFLAGS@ \ 9 @EINA_CFLAGS@ @EVAS_CFLAGS@ @ECORE_EVAS_CFLAGS@ @ECORE_FILE_CFLAGS@ @EDJE_CFLAGS@ \
10 @EFL_ETHUMB_BUILD@ 10 @EFL_ETHUMB_BUILD@
11 11
12if HAVE_LIBEXIF
13AM_CPPFLAGS += @LIBEXIF_CFLAGS@
14endif
15
12includes_HEADERS = Ethumb.h Ethumb_Plugin.h 16includes_HEADERS = Ethumb.h Ethumb_Plugin.h
13includesdir = $(includedir)/ethumb-@VMAJ@ 17includesdir = $(includedir)/ethumb-@VMAJ@
14 18
@@ -24,6 +28,9 @@ libethumb_la_LIBADD = \
24 @EDJE_LIBS@ @ECORE_FILE_LIBS@ @ECORE_EVAS_LIBS@ @EVAS_LIBS@ 28 @EDJE_LIBS@ @ECORE_FILE_LIBS@ @ECORE_EVAS_LIBS@ @EVAS_LIBS@
25libethumb_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ 29libethumb_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@
26 30
31if HAVE_LIBEXIF
32libethumb_la_LIBADD += @LIBEXIF_LIBS@
33endif
27 34
28if USE_MODULE_ETHUMBD 35if USE_MODULE_ETHUMBD
29SUBDIRS += client 36SUBDIRS += client
diff --git a/legacy/ethumb/src/lib/client/Ethumb_Client.c b/legacy/ethumb/src/lib/client/Ethumb_Client.c
index 2985e2f121..e67fbf250d 100644
--- a/legacy/ethumb/src/lib/client/Ethumb_Client.c
+++ b/legacy/ethumb/src/lib/client/Ethumb_Client.c
@@ -844,7 +844,7 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
844 DBusMessageIter iter, aiter, diter, viter, vaiter; 844 DBusMessageIter iter, aiter, diter, viter, vaiter;
845 Ethumb *e = client->ethumb; 845 Ethumb *e = client->ethumb;
846 const char *entry; 846 const char *entry;
847 dbus_int32_t tw, th, format, aspect, quality, compress; 847 dbus_int32_t tw, th, format, aspect, orientation, quality, compress;
848 float cx, cy; 848 float cx, cy;
849 double t; 849 double t;
850 const char *theme_file, *group, *swallow; 850 const char *theme_file, *group, *swallow;
@@ -900,6 +900,11 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
900 dbus_message_iter_append_basic(&viter, DBUS_TYPE_INT32, &aspect); 900 dbus_message_iter_append_basic(&viter, DBUS_TYPE_INT32, &aspect);
901 _close_variant_iter(viter); 901 _close_variant_iter(viter);
902 902
903 _open_variant_iter("orientation", "i", viter);
904 orientation = ethumb_thumb_orientation_get(e);
905 dbus_message_iter_append_basic(&viter, DBUS_TYPE_INT32, &orientation);
906 _close_variant_iter(viter);
907
903 _open_variant_iter("crop", "(dd)", viter); 908 _open_variant_iter("crop", "(dd)", viter);
904 dbus_message_iter_open_container(&viter, DBUS_TYPE_STRUCT, NULL, &vaiter); 909 dbus_message_iter_open_container(&viter, DBUS_TYPE_STRUCT, NULL, &vaiter);
905 ethumb_thumb_crop_align_get(e, &cx, &cy); 910 ethumb_thumb_crop_align_get(e, &cx, &cy);
@@ -1488,6 +1493,48 @@ ethumb_client_aspect_get(const Ethumb_Client *client)
1488} 1493}
1489 1494
1490/** 1495/**
1496 * Configure orientation to use for future requests.
1497 *
1498 * Default value is #ETHUMB_THUMB_ORIENT_ORIGINAL: metadata from the file
1499 * will be used to orient pixel data.
1500 *
1501 * @param client the client instance to use. Must @b not be @c
1502 * NULL. May be pending connected (can be called before @c
1503 * connected_cb)
1504 * @param f format identifier to use, either #ETHUMB_THUMB_ORIENT_NONE (0),
1505 * #ETHUMB_THUMB_ROTATE_90_CW (1), #ETHUMB_THUMB_ROTATE_180 (2),
1506 * #ETHUMB_THUMB_ROTATE_90_CCW (3), #ETHUMB_THUMB_FLIP_HORIZONTAL (4),
1507 * #ETHUMB_THUMB_FLIP_VERTICAL (5), #ETHUMB_THUMB_FLIP_TRANSPOSE (6),
1508 * #ETHUMB_THUMB_FLIP_TRANSVERSE (7) or #ETHUMB_THUMB_ORIENT_ORIGINAL
1509 * (8). Default is ORIGINAL.
1510 */
1511EAPI void
1512ethumb_client_orientation_set(Ethumb_Client *client, Ethumb_Thumb_Orientation o)
1513{
1514 EINA_SAFETY_ON_NULL_RETURN(client);
1515
1516 client->ethumb_dirty = 1;
1517 ethumb_thumb_orientation_set(client->ethumb, o);
1518}
1519
1520/**
1521 * Get current orientation in use for requests.
1522 *
1523 * @param client the client instance to use. Must @b not be @c
1524 * NULL. May be pending connected (can be called before @c
1525 * connected_cb)
1526 *
1527 * @return orientation in use for future requests.
1528 */
1529EAPI Ethumb_Thumb_Orientation
1530ethumb_client_orientation_get(const Ethumb_Client *client)
1531{
1532 EINA_SAFETY_ON_NULL_RETURN_VAL(client, 0);
1533
1534 return ethumb_thumb_orientation_get(client->ethumb);
1535}
1536
1537/**
1491 * Configure crop alignment in use for future requests. 1538 * Configure crop alignment in use for future requests.
1492 * 1539 *
1493 * @param client the client instance to use. Must @b not be @c 1540 * @param client the client instance to use. Must @b not be @c
diff --git a/legacy/ethumb/src/lib/client/Ethumb_Client.h b/legacy/ethumb/src/lib/client/Ethumb_Client.h
index 7762480d1e..355ecadc1f 100644
--- a/legacy/ethumb/src/lib/client/Ethumb_Client.h
+++ b/legacy/ethumb/src/lib/client/Ethumb_Client.h
@@ -122,7 +122,7 @@ EAPI void ethumb_client_on_server_die_callback_set(Ethumb_Client *client, Ethumb
122/** 122/**
123 * @defgroup Ethumb_Client_Setup Ethumb Client Fine Tune Setup 123 * @defgroup Ethumb_Client_Setup Ethumb Client Fine Tune Setup
124 * 124 *
125 * How to fine tune thumbnail generation, setting size, aspect, 125 * How to fine tune thumbnail generation, setting size, aspect, orientation,
126 * frames, quality and so on. 126 * frames, quality and so on.
127 * 127 *
128 * @{ 128 * @{
@@ -135,6 +135,8 @@ EAPI void ethumb_client_format_set(Ethumb_Client *client, Ethumb_Thumb_Format f)
135EAPI Ethumb_Thumb_Format ethumb_client_format_get(const Ethumb_Client *client); 135EAPI Ethumb_Thumb_Format ethumb_client_format_get(const Ethumb_Client *client);
136EAPI void ethumb_client_aspect_set(Ethumb_Client *client, Ethumb_Thumb_Aspect a); 136EAPI void ethumb_client_aspect_set(Ethumb_Client *client, Ethumb_Thumb_Aspect a);
137EAPI Ethumb_Thumb_Aspect ethumb_client_aspect_get(const Ethumb_Client *client); 137EAPI Ethumb_Thumb_Aspect ethumb_client_aspect_get(const Ethumb_Client *client);
138EAPI void ethumb_client_orientation_set(Ethumb_Client *client, Ethumb_Thumb_Orientation o);
139EAPI Ethumb_Thumb_Orientation ethumb_client_orientation_get(const Ethumb_Client *client);
138EAPI void ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y); 140EAPI void ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y);
139EAPI void ethumb_client_crop_align_get(const Ethumb_Client *client, float *x, float *y); 141EAPI void ethumb_client_crop_align_get(const Ethumb_Client *client, float *x, float *y);
140EAPI void ethumb_client_quality_set(Ethumb_Client *client, int quality); 142EAPI void ethumb_client_quality_set(Ethumb_Client *client, int quality);
diff --git a/legacy/ethumb/src/lib/ethumb_private.h b/legacy/ethumb/src/lib/ethumb_private.h
index a647c5b27a..873b97991d 100644
--- a/legacy/ethumb/src/lib/ethumb_private.h
+++ b/legacy/ethumb/src/lib/ethumb_private.h
@@ -20,6 +20,7 @@ struct _Ethumb
20 int tw, th; 20 int tw, th;
21 int format; 21 int format;
22 int aspect; 22 int aspect;
23 int orientation;
23 float crop_x, crop_y; 24 float crop_x, crop_y;
24 int quality; 25 int quality;
25 int compress; 26 int compress;