-#if 0
-static int __media_svc_resize_artwork(const char *path, const char *img_format)
-{
- int ret = MS_MEDIA_ERR_NONE;
- unsigned int width = 0;
- unsigned int height = 0;
- unsigned int resized_width = 0;
- unsigned int resized_height = 0;
- mm_util_img_codec_type img_type = IMG_CODEC_UNKNOWN_TYPE;
-
- if ((strstr(img_format, "jpeg") != NULL) || (strstr(img_format, "jpg") != NULL) || (strstr(img_format, "JPG") != NULL)) {
- media_svc_debug("type [jpeg]");
-
- mm_util_extract_image_info(path, &img_type, &width, &height);
-
- if (width <= MEDIA_SVC_ARTWORK_SIZE || height <= MEDIA_SVC_ARTWORK_SIZE) {
- media_svc_debug("No need resizing");
- return MS_MEDIA_ERR_NONE;
- }
-
- /* resizing */
- if (width > height) {
- resized_height = MEDIA_SVC_ARTWORK_SIZE;
- resized_width = width * MEDIA_SVC_ARTWORK_SIZE / height;
- } else {
- resized_width = MEDIA_SVC_ARTWORK_SIZE;
- resized_height = height * MEDIA_SVC_ARTWORK_SIZE / width;
- }
-
- ret = mm_util_resize_P_P(path, resized_width, resized_height, path);
-
- } else if ((strstr(img_format, "png") != NULL) || (strstr(img_format, "PNG") != NULL)) {
- media_svc_debug("type [png]");
- } else {
- media_svc_debug("Not proper img format");
- }
-
- return ret;
-}
-#endif
-static int __media_svc_safe_atoi(char *buffer, int *si)
-{
- char *end = NULL;
- errno = 0;
- media_svc_retvm_if(buffer == NULL || si == NULL, MS_MEDIA_ERR_INTERNAL, "invalid parameter");
-
- const long sl = strtol(buffer, &end, 10);
-
- media_svc_retvm_if(end == buffer, MS_MEDIA_ERR_INTERNAL, "not a decimal number");
- media_svc_retvm_if('\0' != *end, MS_MEDIA_ERR_INTERNAL, "extra characters at end of input: %s", end);
- media_svc_retvm_if((LONG_MIN == sl || LONG_MAX == sl) && (ERANGE == errno), MS_MEDIA_ERR_INTERNAL, "out of range of type long");
- media_svc_retvm_if(sl > INT_MAX, MS_MEDIA_ERR_INTERNAL, "greater than INT_MAX");
- media_svc_retvm_if(sl < INT_MIN, MS_MEDIA_ERR_INTERNAL, "less than INT_MIN");
-
- *si = (int)sl;
-
- return MS_MEDIA_ERR_NONE;
-}