[ACR-1378] Add condition to face related function
[platform/core/api/media-content.git] / src / media_info.c
index a911855..894f077 100755 (executable)
@@ -2050,6 +2050,11 @@ int media_info_start_face_detection(media_info_h media, media_face_detection_com
        }
 
        if (_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path)) {
+               if (g_strcmp0(_media->mime_type, "image/jpeg") != 0 && g_strcmp0(_media->mime_type, "image/png") != 0 && g_strcmp0(_media->mime_type, "image/bmp") != 0) {
+                       media_content_error("Unsupported mime type");
+                       return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+               }
+
                memset(repl_path, 0, sizeof(repl_path));
                ret = _media_content_replace_path(_media->file_path, repl_path);
                media_content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");