summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2020-03-11 14:10:57 +0900
committerMinje Ahn <minje.ahn@samsung.com>2020-03-11 14:10:57 +0900
commit07702e87ee405bff94c3d66aa84f6424f5865dc4 (patch)
treea0b59b015583ab3b80c9f123ae3dbbcccaa034ba
parente421966a110df21102f028d10161f5b9c95be83b (diff)
downloadlibmedia-thumbnail-07702e87ee405bff94c3d66aa84f6424f5865dc4.tar.gz
libmedia-thumbnail-07702e87ee405bff94c3d66aa84f6424f5865dc4.tar.bz2
libmedia-thumbnail-07702e87ee405bff94c3d66aa84f6424f5865dc4.zip
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 9422c10..aa7e6aa 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;
@@ -392,7 +380,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);
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);