Changed default thumbnail format to png 14/227314/1 accepted/tizen/5.5/unified/20200311.224718 submit/tizen_5.5/20200311.071614
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 11 Mar 2020 05:10:57 +0000 (14:10 +0900)
committerhj kim <backto.kim@samsung.com>
Wed, 11 Mar 2020 07:07:15 +0000 (07:07 +0000)
Change to save thumbnails as png, regardless of the format of the original image.

Change-Id: I005efca82b9a1c06b255708864000afecc91e40e
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/media-thumb-internal.c

index f92093f..ddba747 100755 (executable)
@@ -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);