From d627c510da699417e27a201167aa174d0ee7310a Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Wed, 11 Mar 2020 14:10:57 +0900 Subject: Changed default thumbnail format to png Change to save thumbnails as png, regardless of the format of the original image. Change-Id: I005efca82b9a1c06b255708864000afecc91e40e Signed-off-by: Minje Ahn --- src/media-thumb-internal.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c index f92093f..ddba747 100755 --- a/src/media-thumb-internal.c +++ b/src/media-thumb-internal.c @@ -113,23 +113,11 @@ int _media_thumb_image(const char *origin_path, char *thumb_path, unsigned int t __media_thumb_get_proper_thumb_size(origin_w, origin_h, &thumb_width, &thumb_height); - if (image_type == IMG_CODEC_PNG) { - if (thumb_path != NULL) { - char file_ext[10]; - err = _media_thumb_get_file_ext(origin_path, file_ext, sizeof(file_ext)); - if (strncasecmp(file_ext, "png", 3) == 0) { - int len = strlen(thumb_path); - thumb_path[len - 3] = 'p'; - thumb_path[len - 2] = 'n'; - thumb_path[len - 1] = 'g'; - } - } - err = _media_thumb_general(origin_path, thumb_path, thumb_width, thumb_height, thumb_info); - } else if (image_type == IMG_CODEC_JPEG || image_type == IMG_CODEC_GIF || image_type == IMG_CODEC_BMP || image_type == IMG_CODEC_WBMP) { + if (image_type != IMG_CODEC_UNKNOWN_TYPE) { err = _media_thumb_general(origin_path, thumb_path, thumb_width, thumb_height, thumb_info); } else { thumb_warn("Unsupported image type"); - return MS_MEDIA_ERR_THUMB_UNSUPPORTED; + err = MS_MEDIA_ERR_THUMB_UNSUPPORTED; } return err; @@ -399,7 +387,7 @@ 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.jpg", get_path, file_ext, hash_name); + ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.png", get_path, file_ext, hash_name); SAFE_FREE(get_path); -- cgit v1.2.3