Ethumb Fine Tune Setup
Ethumb

How to fine tune thumbnail generation, setting size, aspect, frames, quality and so on. More...

## Typedefs

typedef enum _Ethumb_Thumb_FDO_Size | Ethumb_Thumb_FDO_Size
typedef enum _Ethumb_Thumb_Format | Ethumb_Thumb_Format
typedef enum _Ethumb_Thumb_Aspect | Ethumb_Thumb_Aspect
typedef enum _Ethumb_Thumb_Orientation | Ethumb_Thumb_Orientation

## Enumerations

enum | _Ethumb_Thumb_FDO_Size { ETHUMB_THUMB_NORMAL , ETHUMB_THUMB_LARGE }
enum | _Ethumb_Thumb_Format { ETHUMB_THUMB_FDO , ETHUMB_THUMB_JPEG , ETHUMB_THUMB_EET }
enum | _Ethumb_Thumb_Aspect { ETHUMB_THUMB_KEEP_ASPECT , ETHUMB_THUMB_IGNORE_ASPECT , ETHUMB_THUMB_CROP }
enum | _Ethumb_Thumb_Orientation { ETHUMB_THUMB_ORIENT_NONE , ETHUMB_THUMB_ROTATE_90_CW , ETHUMB_THUMB_ROTATE_180 , ETHUMB_THUMB_ROTATE_90_CCW , ETHUMB_THUMB_FLIP_HORIZONTAL , ETHUMB_THUMB_FLIP_VERTICAL , ETHUMB_THUMB_FLIP_TRANSPOSE , ETHUMB_THUMB_FLIP_TRANSVERSE , ETHUMB_THUMB_ORIENT_ORIGINAL }

## Functions

EAPI Eina_Bool | ethumb_frame_set (Ethumb *e, const char *theme_file, const char *group, const char *swallow)
| Set the Ethumb Frame.
EAPI void | ethumb_frame_get (const Ethumb *e, const char **theme_file, const char **group, const char **swallow)
| Retreives the current ethumb frame of and Ethumb instance.
EAPI void | ethumb_thumb_dir_path_set (Ethumb *e, const char *path)
| Set the ethumb thumbnails path.
EAPI const char * | ethumb_thumb_dir_path_get (const Ethumb *e)
| Get the ethumb thumbnails path.
EAPI void | ethumb_thumb_category_set (Ethumb *e, const char *category)
| Set the thumbnails category.
EAPI const char * | ethumb_thumb_category_get (const Ethumb *e)
| Get the thumbnails category.
EAPI void | ethumb_thumb_path_set (Ethumb *e, const char *path, const char *key)
EAPI void | ethumb_thumb_path_get (Ethumb *e, const char **path, const char **key)
EAPI void | ethumb_thumb_hash (Ethumb *e)
EAPI void | ethumb_thumb_hash_copy (Ethumb *dst, const Ethumb *src)
EAPI void | ethumb_thumb_fdo_set (Ethumb *e, Ethumb_Thumb_FDO_Size s)
EAPI void | ethumb_thumb_size_set (Ethumb *e, int tw, int th)
| Set the size of thumbnails.
EAPI void | ethumb_thumb_size_get (const Ethumb *e, int *tw, int *th)
| Get the size of thumbnails.
EAPI void | ethumb_thumb_format_set (Ethumb *e, Ethumb_Thumb_Format f)
| Set the fileformat of the thumbnails.
EAPI Ethumb_Thumb_Format | ethumb_thumb_format_get (const Ethumb *e)
| Get the fileformat of the thumbnails.
EAPI void | ethumb_thumb_aspect_set (Ethumb *e, Ethumb_Thumb_Aspect aspect)
| Set the aspect ratio policy.
EAPI Ethumb_Thumb_Aspect | ethumb_thumb_aspect_get (const Ethumb *e)
| Get the aspect ratio policy.
EAPI void | ethumb_thumb_orientation_set (Ethumb *e, Ethumb_Thumb_Orientation orientation)
| Set the thumbnail rotation or flip.
EAPI Ethumb_Thumb_Orientation | ethumb_thumb_orientation_get (const Ethumb *e)
| Get the thumbnail rotation.
EAPI void | ethumb_thumb_crop_align_set (Ethumb *e, float x, float y)
EAPI void | ethumb_thumb_crop_align_get (const Ethumb *e, float *x, float *y)
EAPI void | ethumb_thumb_quality_set (Ethumb *e, int quality)
| Set the thumbnail compression quality.
EAPI int | ethumb_thumb_quality_get (const Ethumb *e)
| Get the thumbnail compression quality.
EAPI void | ethumb_thumb_compress_set (Ethumb *e, int compress)
| Set the compression rate.
EAPI int | ethumb_thumb_compress_get (const Ethumb *e)
| Get the compression rate.
EAPI void | ethumb_video_start_set (Ethumb *e, float start)
| set the video play start point
EAPI float | ethumb_video_start_get (const Ethumb *e)
| get the video play start point
EAPI void | ethumb_video_time_set (Ethumb *e, float time)
| Set the video time (duration) in seconds.
EAPI float | ethumb_video_time_get (const Ethumb *e)
| Get the video time (duration) in seconds.
EAPI void | ethumb_video_interval_set (Ethumb *e, float interval)
| Set the video frame interval, in seconds.
EAPI float | ethumb_video_interval_get (const Ethumb *e)
| Get the video frame interval, in seconds.
EAPI void | ethumb_video_ntimes_set (Ethumb *e, unsigned int ntimes)
| Set the number of times the video loops (if applicable).
EAPI unsigned int | ethumb_video_ntimes_get (const Ethumb *e)
| Get the number of times the video loops (if applicable).
EAPI void | ethumb_video_fps_set (Ethumb *e, unsigned int fps)
| Set the thumbnail framerate.
EAPI unsigned int | ethumb_video_fps_get (const Ethumb *e)
| Get the thumbnail framerate.
EAPI void | ethumb_document_page_set (Ethumb *e, unsigned int page)
| Set the page number to thumbnail in paged documents.
EAPI unsigned int | ethumb_document_page_get (const Ethumb *e)
| Get the page number thumbnailed in paged documents.

## Detailed Description

How to fine tune thumbnail generation, setting size, aspect, frames, quality and so on.

## Enumeration Type Documentation

## _Ethumb_Thumb_FDO_Size

enum _Ethumb_Thumb_FDO_Size

Enumerator
ETHUMB_THUMB_NORMAL | 128x128 as defined by FreeDesktop.Org standard
ETHUMB_THUMB_LARGE | 256x256 as defined by FreeDesktop.Org standard

## _Ethumb_Thumb_Format

enum _Ethumb_Thumb_Format

Enumerator
ETHUMB_THUMB_FDO | PNG as defined by FreeDesktop.Org standard.
ETHUMB_THUMB_JPEG | JPEGs are often smaller and faster to read/write.
ETHUMB_THUMB_EET | EFL's own storage system, supports key parameter.

## _Ethumb_Thumb_Aspect

enum _Ethumb_Thumb_Aspect

Enumerator
ETHUMB_THUMB_KEEP_ASPECT | keep original proportion between width and height
ETHUMB_THUMB_IGNORE_ASPECT | ignore aspect and foce it to match thumbnail's width and height
ETHUMB_THUMB_CROP | keep aspect but crop (cut) the largest dimension

## _Ethumb_Thumb_Orientation

enum _Ethumb_Thumb_Orientation

Enumerator
ETHUMB_THUMB_ORIENT_NONE | keep orientation as pixel data is
ETHUMB_THUMB_ROTATE_90_CW | rotate 90° clockwise
ETHUMB_THUMB_ROTATE_180 | rotate 180°
ETHUMB_THUMB_ROTATE_90_CCW | rotate 90° counter-clockwise
ETHUMB_THUMB_FLIP_HORIZONTAL | flip horizontally
ETHUMB_THUMB_FLIP_VERTICAL | flip vertically
ETHUMB_THUMB_FLIP_TRANSPOSE | transpose
ETHUMB_THUMB_FLIP_TRANSVERSE | transverse
ETHUMB_THUMB_ORIENT_ORIGINAL | use orientation from metadata (EXIF-only currently)

## Function Documentation

## ethumb_frame_set()

EAPI Eina_Bool ethumb_frame_set | ( | Ethumb * | e,
|  | const char * | theme_file,
|  | const char * | group,
|  | const char * | swallow )

Set the Ethumb Frame.

This can be used to simulate wood frames in the Thumbnails

Parameters

  e | handle of the current thumbnailer.
  theme_file | the edje theme file
  group | the edje group in theme
  swallow | the edje swallow in theme

Returns
  EINA_TRUE on success and EINA_FALSE on failure

References DBG, edje_object_add(), edje_object_file_set(), edje_object_part_swallow(), edje_object_part_swallow_get(), edje_object_part_unswallow(), EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_replace(), EINA_TRUE, and ERR.

Referenced by ethumb_client_frame_set().

## ethumb_frame_get()

EAPI void ethumb_frame_get | ( | const Ethumb * | e,
|  | const char ** | theme_file,
|  | const char ** | group,
|  | const char ** | swallow )

Retreives the current ethumb frame of and Ethumb instance.

Parameters

  e | handle of the current thumbnailer.
  theme_file | will be setted with the edje theme
  group | will be setted with the edje group
  swallow | will be setted with the edje swallow

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_ethumb_setup().

## ethumb_thumb_dir_path_set()

EAPI void ethumb_thumb_dir_path_set | ( | Ethumb * | e,
|  | const char * | path )

Set the ethumb thumbnails path.

Parameters

  e | handle of the current thumbnailer.
  path | The thumbnails path

References DBG, eina_file_path_sanitize(), EINA_SAFETY_ON_NULL_RETURN, and eina_stringshare_replace().

Referenced by ethumb_client_dir_path_set().

## ethumb_thumb_dir_path_get()

EAPI const char * ethumb_thumb_dir_path_get | ( | const Ethumb * | e | ) |

Get the ethumb thumbnails path.

Parameters

  e | handle of the current thumbnailer.

Returns
  The thumbnails path for the current thumbnailer

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_dir_path_get(), and ethumb_client_ethumb_setup().

## ethumb_thumb_category_set()

EAPI void ethumb_thumb_category_set | ( | Ethumb * | e,
|  | const char * | category )

Set the thumbnails category.

Parameters

  e | handle of the current thumbnailer.
  category | the category to set

References DBG, EINA_SAFETY_ON_NULL_RETURN, and eina_stringshare_replace().

Referenced by ethumb_client_category_set().

## ethumb_thumb_category_get()

EAPI const char * ethumb_thumb_category_get | ( | const Ethumb * | e | ) |

Get the thumbnails category.

Parameters

  e | handle of the current thumbnailer

Returns
  the current thumbnailer thumbnails category

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_category_get(), and ethumb_client_ethumb_setup().

## ethumb_thumb_size_set()

EAPI void ethumb_thumb_size_set | ( | Ethumb * | e,
|  | int | tw,
|  | int | th )

Set the size of thumbnails.

Parameters

  e | A pointer to an Ethumb object.
  tw | Thumbnail width.
  th | Thumbnail height.

References DBG, EINA_SAFETY_ON_FALSE_RETURN, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_size_set().

## ethumb_thumb_size_get()

EAPI void ethumb_thumb_size_get | ( | const Ethumb * | e,
|  | int * | tw,
|  | int * | th )

Get the size of thumbnails.

Parameters

  | e | A pointer to an Ethumb object.
  [out] | tw | Pointer to an int to store the thumbnail width.
  [out] | th | Pointer to an int to store the thumbnail height.

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_ethumb_setup(), and ethumb_client_size_get().

## ethumb_thumb_format_set()

EAPI void ethumb_thumb_format_set | ( | Ethumb * | e,
|  | Ethumb_Thumb_Format | f )

Set the fileformat of the thumbnails.

Thumbnails are sent compressed; possible formats are PNG, JPEG and EET.

Parameters

  e | A pointer to an Ethumb object.

References DBG, EINA_SAFETY_ON_FALSE_RETURN, EINA_SAFETY_ON_NULL_RETURN, ETHUMB_THUMB_EET, ETHUMB_THUMB_FDO, and ETHUMB_THUMB_JPEG.

Referenced by ethumb_client_format_set().

## ethumb_thumb_format_get()

EAPI Ethumb_Thumb_Format ethumb_thumb_format_get | ( | const Ethumb * | e | ) |

Get the fileformat of the thumbnails.

Parameters

  e | A pointer to an Ethumb object.

Returns
  The thumbnail fileformat

See also
  ethumb_thumb_format_set

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup(), and ethumb_client_format_get().

## ethumb_thumb_aspect_set()

EAPI void ethumb_thumb_aspect_set | ( | Ethumb * | e,
|  | Ethumb_Thumb_Aspect | aspect )

Set the aspect ratio policy.

When the source and thumbnail aspect ratios don't match, this policy sets how to adapt from the former to the latter: resize keeping source aspect ratio, resize ignoring it or crop.

Parameters

  e | A pointer to an Ethumb object.
  aspect | The new aspect ratio policy.

References DBG, EINA_SAFETY_ON_FALSE_RETURN, EINA_SAFETY_ON_NULL_RETURN, ETHUMB_THUMB_CROP, ETHUMB_THUMB_IGNORE_ASPECT, and ETHUMB_THUMB_KEEP_ASPECT.

Referenced by ethumb_client_aspect_set().

## ethumb_thumb_aspect_get()

EAPI Ethumb_Thumb_Aspect ethumb_thumb_aspect_get | ( | const Ethumb * | e | ) |

Get the aspect ratio policy.

Parameters

  e | A pointer to an Ethumb object.

Returns
  The aspect ratio policy.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_aspect_get(), and ethumb_client_ethumb_setup().

## ethumb_thumb_orientation_set()

EAPI void ethumb_thumb_orientation_set | ( | Ethumb * | e,
|  | Ethumb_Thumb_Orientation | orientation )

Set the thumbnail rotation or flip.

Parameters

  e | A pointer to an Ethumb object.
  orientation | The new orientation.

References DBG, EINA_SAFETY_ON_FALSE_RETURN, EINA_SAFETY_ON_NULL_RETURN, ETHUMB_THUMB_FLIP_HORIZONTAL, ETHUMB_THUMB_FLIP_TRANSPOSE, ETHUMB_THUMB_FLIP_TRANSVERSE, ETHUMB_THUMB_FLIP_VERTICAL, ETHUMB_THUMB_ORIENT_NONE, ETHUMB_THUMB_ORIENT_ORIGINAL, ETHUMB_THUMB_ROTATE_180, ETHUMB_THUMB_ROTATE_90_CCW, and ETHUMB_THUMB_ROTATE_90_CW.

Referenced by ethumb_client_orientation_set().

## ethumb_thumb_orientation_get()

EAPI Ethumb_Thumb_Orientation ethumb_thumb_orientation_get | ( | const Ethumb * | e | ) |

Get the thumbnail rotation.

Parameters

  e | A pointer to an Ethumb object.

Returns
  The current rotation.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup(), and ethumb_client_orientation_get().

## ethumb_thumb_quality_set()

EAPI void ethumb_thumb_quality_set | ( | Ethumb * | e,
|  | int | quality )

Set the thumbnail compression quality.

Parameters

  e | A pointer to an Ethumb object.
  quality | Compression quality (from 0 to 100, 100 being the best; default is 80)

References DBG, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_quality_set().

## ethumb_thumb_quality_get()

EAPI int ethumb_thumb_quality_get | ( | const Ethumb * | e | ) |

Get the thumbnail compression quality.

Parameters

  e | A pointer to an Ethumb object.

Returns
  The current compression quality (from 0 to 100, 100 being the best)

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup(), and ethumb_client_quality_get().

## ethumb_thumb_compress_set()

EAPI void ethumb_thumb_compress_set | ( | Ethumb * | e,
|  | int | compress )

Set the compression rate.

Parameters

  e | handle of the current thumbnailer.
  compress | the compression rate (in percentage)

References DBG, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_compress_set().

## ethumb_thumb_compress_get()

EAPI int ethumb_thumb_compress_get | ( | const Ethumb * | e | ) |

Get the compression rate.

Parameters

  e | handle of the current thumbnailer.

Returns
  the compression rate (in percentage)

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_compress_get(), and ethumb_client_ethumb_setup().

## ethumb_video_start_set()

EAPI void ethumb_video_start_set | ( | Ethumb * | e,
|  | float | start )

set the video play start point

Set the start point of video thumbnail

Parameters

  e | handle of the current thumbnailer.
  start | the start point (float from 0.0 to 1.0)

References DBG, EINA_SAFETY_ON_FALSE_RETURN, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_video_start_set().

## ethumb_video_start_get()

EAPI float ethumb_video_start_get | ( | const Ethumb * | e | ) |

get the video play start point

Get the start point of video thumbnail

Parameters

  e | handle of the current thumbnailer.

Returns
  the start point (float from 0.0 to 1.0)

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup().

## ethumb_video_time_set()

EAPI void ethumb_video_time_set | ( | Ethumb * | e,
|  | float | time )

Set the video time (duration) in seconds.

Parameters

  e | handle of the current thumbnailer.
  time | the video duration in seconds

References DBG, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_video_time_set().

## ethumb_video_time_get()

EAPI float ethumb_video_time_get | ( | const Ethumb * | e | ) |

Get the video time (duration) in seconds.

Parameters

  e | handle of the current thumbnailer.

Returns
  the video duration in seconds

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup().

## ethumb_video_interval_set()

EAPI void ethumb_video_interval_set | ( | Ethumb * | e,
|  | float | interval )

Set the video frame interval, in seconds.

This is useful for animated thumbnail and will define skip time before going to the next frame. Note that video backends might not be able to precisely skip that amount as it will depend on various factors, including video encoding.

Parameters

  e | handle of the current thumbnailer.
  interval | the frame display interval in seconds

References DBG, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_video_interval_set().

## ethumb_video_interval_get()

EAPI float ethumb_video_interval_get | ( | const Ethumb * | e | ) |

Get the video frame interval, in seconds.

Parameters

  e | handle of the current thumbnailer.

Returns
  the frame display interval in seconds

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup().

## ethumb_video_ntimes_set()

EAPI void ethumb_video_ntimes_set | ( | Ethumb * | e,
|  | unsigned int | ntimes )

Set the number of times the video loops (if applicable).

Parameters

  e | A pointer to an Ethumb object.
  ntimes | The number of times the video loops.

References DBG, EINA_SAFETY_ON_FALSE_RETURN, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_video_ntimes_set().

## ethumb_video_ntimes_get()

EAPI unsigned int ethumb_video_ntimes_get | ( | const Ethumb * | e | ) |

Get the number of times the video loops (if applicable).

Parameters

  e | A pointer to an Ethumb object.

Returns
  The number of times the video loops.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup().

## ethumb_video_fps_set()

EAPI void ethumb_video_fps_set | ( | Ethumb * | e,
|  | unsigned int | fps )

Set the thumbnail framerate.

Parameters

  e | A pointer to an Ethumb object.
  fps | New framerate of the thumbnail (default 10).

References DBG, EINA_SAFETY_ON_FALSE_RETURN, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_video_fps_set().

## ethumb_video_fps_get()

EAPI unsigned int ethumb_video_fps_get | ( | const Ethumb * | e | ) |

Get the thumbnail framerate.

Parameters

  e | A pointer to an Ethumb object.

Returns
  Current framerate of the thumbnail.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup().

## ethumb_document_page_set()

EAPI void ethumb_document_page_set | ( | Ethumb * | e,
|  | unsigned int | page )

Set the page number to thumbnail in paged documents.

Parameters

  e | handle of the current thumbnailer.
  page | the page number.

References DBG, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_document_page_set().

## ethumb_document_page_get()

EAPI unsigned int ethumb_document_page_get | ( | const Ethumb * | e | ) |

Get the page number thumbnailed in paged documents.

Parameters

  e | handle of the current thumbnailer.

Returns
  the page number.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_ethumb_setup().