forked from enlightenment/efl
Added ETHUMB_THUMB_EET as a format flag.
SVN revision: 41289
This commit is contained in:
parent
6a060751f8
commit
8106bf6d44
|
@ -329,7 +329,8 @@ ethumb_thumb_format_set(Ethumb *e, Ethumb_Thumb_Format f)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(e);
|
EINA_SAFETY_ON_NULL_RETURN(e);
|
||||||
EINA_SAFETY_ON_FALSE_RETURN(f == ETHUMB_THUMB_FDO ||
|
EINA_SAFETY_ON_FALSE_RETURN(f == ETHUMB_THUMB_FDO ||
|
||||||
f == ETHUMB_THUMB_JPEG);
|
f == ETHUMB_THUMB_JPEG ||
|
||||||
|
f == ETHUMB_THUMB_EET);
|
||||||
|
|
||||||
e->format = f;
|
e->format = f;
|
||||||
}
|
}
|
||||||
|
@ -686,8 +687,10 @@ _ethumb_file_generate_custom_category(Ethumb *e)
|
||||||
|
|
||||||
if (e->format == ETHUMB_THUMB_FDO)
|
if (e->format == ETHUMB_THUMB_FDO)
|
||||||
format = "png";
|
format = "png";
|
||||||
else
|
else if (e->format == ETHUMB_THUMB_JPEG)
|
||||||
format = "jpg";
|
format = "jpg";
|
||||||
|
else
|
||||||
|
format = "eet";
|
||||||
|
|
||||||
if (e->frame)
|
if (e->frame)
|
||||||
frame = "-framed";
|
frame = "-framed";
|
||||||
|
@ -732,16 +735,24 @@ _ethumb_file_generate_path(Ethumb *e)
|
||||||
|
|
||||||
if (e->format == ETHUMB_THUMB_FDO)
|
if (e->format == ETHUMB_THUMB_FDO)
|
||||||
ext = "png";
|
ext = "png";
|
||||||
else
|
else if (e->format == ETHUMB_THUMB_JPEG)
|
||||||
ext = "jpg";
|
ext = "jpg";
|
||||||
|
else
|
||||||
|
ext = "eet";
|
||||||
|
|
||||||
|
|
||||||
fullname = ecore_file_realpath(e->src_path);
|
fullname = ecore_file_realpath(e->src_path);
|
||||||
hash = _ethumb_generate_hash(fullname);
|
hash = _ethumb_generate_hash(fullname);
|
||||||
snprintf(buf, sizeof(buf), "%s/%s/%s.%s", thumb_dir, category, hash, ext);
|
snprintf(buf, sizeof(buf), "%s/%s/%s.%s", thumb_dir, category, hash, ext);
|
||||||
free(fullname);
|
free(fullname);
|
||||||
eina_stringshare_replace(&e->thumb_path, buf);
|
eina_stringshare_replace(&e->thumb_path, buf);
|
||||||
eina_stringshare_del(e->thumb_key);
|
if (e->format == ETHUMB_THUMB_EET)
|
||||||
e->thumb_key = NULL;
|
eina_stringshare_replace(&e->thumb_key, "thumbnail");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eina_stringshare_del(e->thumb_key);
|
||||||
|
e->thumb_key = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
eina_stringshare_del(thumb_dir);
|
eina_stringshare_del(thumb_dir);
|
||||||
eina_stringshare_del(category);
|
eina_stringshare_del(category);
|
||||||
|
|
|
@ -51,7 +51,8 @@ typedef enum _Ethumb_Thumb_FDO_Size Ethumb_Thumb_FDO_Size;
|
||||||
enum _Ethumb_Thumb_Format
|
enum _Ethumb_Thumb_Format
|
||||||
{
|
{
|
||||||
ETHUMB_THUMB_FDO,
|
ETHUMB_THUMB_FDO,
|
||||||
ETHUMB_THUMB_JPEG
|
ETHUMB_THUMB_JPEG,
|
||||||
|
ETHUMB_THUMB_EET
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum _Ethumb_Thumb_Format Ethumb_Thumb_Format;
|
typedef enum _Ethumb_Thumb_Format Ethumb_Thumb_Format;
|
||||||
|
|
Loading…
Reference in New Issue