summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/media-thumb-internal.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index bed7cd6..1854cd1 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -391,9 +391,12 @@ int _media_thumb_get_hash_name(const char *file_full_path, char *thumb_hash_path
ret = ms_user_get_root_thumb_store_path(uid, &get_path);
SAFE_FREE(storage_id);
- if (get_path != NULL)
- ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.png", get_path, file_ext, hash_name);
-
+ if (get_path != NULL) {
+ if (strcasecmp(file_ext, "PNG") == 0)
+ ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.png", get_path, file_ext, hash_name);
+ else
+ ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name);
+ }
SAFE_FREE(get_path);
if ((ret_len < 0) || (ret_len > (int)max_thumb_path)) {