// Check media type
ret = aul_get_mime_from_file(path, mimetype, sizeof(mimetype));
- if (ret < 0) {
- thumbnail_util_warn("aul_get_mime_from_file fail.. Now trying to get type by extension");
-
- char ext[255] = { 0 };
- ret = __thumbnail_util_get_file_ext(path, ext, sizeof(ext));
- thumbnail_util_retvm_if(ret != THUMBNAIL_UTIL_ERROR_NONE, ret, "__thumbnail_util_get_file_ext failed");
-
- if (strcasecmp(ext, "JPG") == 0 ||
- strcasecmp(ext, "JPEG") == 0 ||
- strcasecmp(ext, "PNG") == 0 ||
- strcasecmp(ext, "GIF") == 0 ||
- strcasecmp(ext, "AGIF") == 0 ||
- strcasecmp(ext, "XWD") == 0 ||
- strcasecmp(ext, "BMP") == 0 ||
- strcasecmp(ext, "WBMP") == 0) {
- *type = THUMBNAIL_UTIL_IMAGE;
- return THUMBNAIL_UTIL_ERROR_NONE;
- } else if (strcasecmp(ext, "AVI") == 0 ||
- strcasecmp(ext, "MPEG") == 0 ||
- strcasecmp(ext, "MP4") == 0 ||
- strcasecmp(ext, "DCF") == 0 ||
- strcasecmp(ext, "WMV") == 0 ||
- strcasecmp(ext, "3GPP") == 0 ||
- strcasecmp(ext, "3GP") == 0) {
- *type = THUMBNAIL_UTIL_VIDEO;
- return THUMBNAIL_UTIL_ERROR_NONE;
- } else {
- return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;
- }
- }
+ thumbnail_util_retvm_if(ret < 0, THUMBNAIL_UTIL_ERROR_INVALID_OPERATION, "aul_get_mime_from_file failed");
thumbnail_util_debug("mime type : %s", mimetype);
/* categorize from mimetype */
if (strstr(mimetype, "image") != NULL) {
- if (!strcmp(mimetype, unsupported_type)) {
- thumbnail_util_warn("This is unsupport file type");
- return THUMBNAIL_UTIL_ERROR_UNSUPPORTED_CONTENT;
- }
+ thumbnail_util_retvm_if(!strcmp(mimetype, unsupported_type), THUMBNAIL_UTIL_ERROR_UNSUPPORTED_CONTENT, "This is unsupport file type");
*type = THUMBNAIL_UTIL_IMAGE;
return THUMBNAIL_UTIL_ERROR_NONE;
} else if (strstr(mimetype, "video") != NULL) {