Add to return error for thumbnail_util_extract in thumbnail_extracted_cb 41/124641/2 submit/tizen/20170418.034351
authorJiyong Min <jiyong.min@samsung.com>
Wed, 12 Apr 2017 04:37:13 +0000 (13:37 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Thu, 13 Apr 2017 04:05:48 +0000 (21:05 -0700)
Change-Id: I2f30a8eb6da1930310043453d747188838245e7a
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
packaging/capi-media-thumbnail-util.spec
src/thumbnail_util.c

index 70aa43d..08aaa5a 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-thumbnail-util
 Summary:    A media thumbnail util library in Tizen Native API
-Version: 0.1.6
+Version: 0.1.7
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 148e55e..cdf3cf3 100755 (executable)
@@ -74,6 +74,10 @@ int __thumbnail_util_error_capi(int content_error)
        else if (content_error == MS_MEDIA_ERR_PERMISSION_DENIED)
                return THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED;
 
+       /* Thumbnail error*/
+       else if ((content_error == MS_MEDIA_ERR_THUMB_TOO_BIG) || (content_error == MS_MEDIA_ERR_THUMB_UNSUPPORTED))
+                       return THUMBNAIL_UTIL_ERROR_UNSUPPORTED_CONTENT;
+
        /*ETC*/
        return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION;
 }
@@ -93,7 +97,7 @@ void __thumbnail_util_extract_completed_cb(int error, int request_id, const char
        if (_thumb_cb != NULL) {
                __thumbnail_util_convert_itoa(request_id, &request_id_str);
                if (_thumb_cb->thumb_extract_cb)
-                       _thumb_cb->thumb_extract_cb(error, request_id_str, thumb_width, thumb_height, thumb_data, thumb_size, _thumb_cb->user_data);
+                       _thumb_cb->thumb_extract_cb(__thumbnail_util_error_capi(error), request_id_str, thumb_width, thumb_height, thumb_data, thumb_size, _thumb_cb->user_data);
 
        }
        SAFE_FREE(_thumb_cb);