return;
}
-int __media_svc_get_proper_thumb_size(unsigned int orig_w, unsigned int orig_h, unsigned int *thumb_w, unsigned int *thumb_h)
+static void __media_svc_get_proper_thumb_size(unsigned int orig_w, unsigned int orig_h, unsigned int *thumb_w, unsigned int *thumb_h)
{
bool portrait = false;
- double ratio;
+ double ratio = 0.0;
+
+ media_svc_retm_if(orig_w <= 0, "Invalid orig_w");
+ media_svc_retm_if(orig_h <= 0, "Invalid orig_h");
+ media_svc_retm_if(!thumb_w, "Invalid thumb_w");
+ media_svc_retm_if(!thumb_h, "Invalid thumb_h");
if (orig_w < orig_h)
portrait = true;
media_svc_debug("proper thumb w: %d h: %d", *thumb_w, *thumb_h);
- return MS_MEDIA_ERR_NONE;
+ return;
}
static void __get_rotation_and_cdis(const char *origin_path, mm_util_magick_rotate_type *rot_type, int *cdis_value)
GPtrArray *path_list = NULL;
int i = 0;
- ms_user_get_internal_root_path(uid, &root_path);
+ ret = ms_user_get_internal_root_path(uid, &root_path);
+ media_svc_retm_if(ret != MS_MEDIA_ERR_NONE, "Fail to get root path");
+
ret = _media_svc_publish_dir_noti(MS_MEDIA_ITEM_UPDATE, root_path, NULL, 0);
if (ret != MS_MEDIA_ERR_NONE)
media_svc_error("Fail to send noti");