summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2020-03-11 05:10:57 (GMT)
committerhj kim <backto.kim@samsung.com>2020-03-11 07:07:21 (GMT)
commitd627c510da699417e27a201167aa174d0ee7310a (patch)
tree225bdb48a2a85b4e87f912c7881149e162f578bb
parent27d1f11ca4a7434b27fafcc72c0d98e76017852d (diff)
downloadlibmedia-thumbnail-d627c510da699417e27a201167aa174d0ee7310a.zip
libmedia-thumbnail-d627c510da699417e27a201167aa174d0ee7310a.tar.gz
libmedia-thumbnail-d627c510da699417e27a201167aa174d0ee7310a.tar.bz2
Changed default thumbnail format to pngtizen_5.5_tvrefs/changes/15/227315/1
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>
-rwxr-xr-xsrc/media-thumb-internal.c18
1 files 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);