Changed default thumbnail format to png 75/227275/3
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 11 Mar 2020 05:08:00 +0000 (14:08 +0900)
committerhj kim <backto.kim@samsung.com>
Wed, 11 Mar 2020 07:01:29 +0000 (07:01 +0000)
Change to save thumbnails as png, regardless of the format of the original image.

Change-Id: I828a21f72b8c4a836c3f55c23b3966cfbc20819b
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-svc-util.c
src/include/common/media-svc-env.h

index 02dbfef..eafa52e 100644 (file)
@@ -706,10 +706,7 @@ int _media_svc_get_thumbnail_path(media_svc_media_type_e media_type, char *thumb
 
                snprintf(thumb_path, MEDIA_SVC_PATHNAME_SIZE, "%s/.%s-%s.%s", thumb_dir, file_ext, hash, thumbfile_ext);
        } else {
-               if (strcasecmp(file_ext, "PNG") == 0)
-                       snprintf(thumb_path, MEDIA_SVC_PATHNAME_SIZE, "%s/.%s-%s.png", thumb_dir, file_ext, hash);
-               else
-                       snprintf(thumb_path, MEDIA_SVC_PATHNAME_SIZE, "%s/.%s-%s.jpg", thumb_dir, file_ext, hash);
+               snprintf(thumb_path, MEDIA_SVC_PATHNAME_SIZE, "%s/.%s-%s.png", thumb_dir, file_ext, hash);
        }
 
        SAFE_FREE(thumb_dir);
@@ -1645,7 +1642,7 @@ int _media_svc_create_thumbnail(const char *path, char *thumb_path, media_svc_me
        media_svc_sec_debug("Path[%s] Type[%d]", path, media_type);
 
        //1. make hash path
-       ret = _media_svc_get_thumbnail_path(media_type, thumb_path, path, THUMB_EXT, uid);
+       ret = _media_svc_get_thumbnail_path(media_type, thumb_path, path, NULL, uid);
        if (ret != MS_MEDIA_ERR_NONE) {
                media_svc_error("_media_svc_get_thumbnail_path failed - %d", ret);
                SAFE_STRLCPY(thumb_path, "", MAX_FILEPATH_LEN);
index e7987f3..bdd0104 100755 (executable)
@@ -131,7 +131,6 @@ extern "C" {
 
 #define MEDIA_SVC_TAG_UNKNOWN                          ""
 
-#define THUMB_EXT              "jpg"
 #define THUMB_MAX_ALLOWED_MEM 9000000
 #define THUMB_WIDTH 320
 #define THUMB_HEIGHT 240