Add get_image_info() 66/306366/2
authorminje.ahn <minje.ahn@samsung.com>
Tue, 20 Feb 2024 23:05:24 +0000 (08:05 +0900)
committerminje.ahn <minje.ahn@samsung.com>
Tue, 20 Feb 2024 23:21:00 +0000 (08:21 +0900)
Added new API for getting width and height from images.

Change-Id: Ib7b7f102daa27943dd8bd072a5b98660b6dba2b2
Signed-off-by: minje.ahn <minje.ahn@samsung.com>
CMakeLists.txt
include/media-thumbnail.h
packaging/libmedia-thumbnail.spec
src/media-thumbnail.c

index 3daef0c..eeff3fb 100644 (file)
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6...2.8.12)
 PROJECT(media-thumbnail C)
 SET(VERSION_MAJOR 1)
 SET(VERSION "${VERSION_MAJOR}.0.0")
index af87ff7..99a1df8 100755 (executable)
@@ -42,6 +42,7 @@ int create_image_thumbnail_to_buffer(const char *path, unsigned int width, unsig
 int create_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height);
 int create_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path);
 
+int get_image_info(const char *path, unsigned int *width, unsigned int *height);
 
 #ifdef __cplusplus
 }
index 90da5db..997a92c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmedia-thumbnail
 Summary:    Media thumbnail service library for multimedia applications
-Version:    0.4.8
+Version:    0.4.9
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 93d2c81..a2f5210 100755 (executable)
@@ -695,3 +695,13 @@ int create_thumbnail_to_file(const char *path, unsigned int width, unsigned int
        regfree(&regex);
        return create_video_thumbnail_to_file(path, width, height, thumb_path, false);
 }
+
+int get_image_info(const char *path, unsigned int *width, unsigned int *height)
+{
+       int ret = MM_UTIL_ERROR_NONE;
+
+       ret = mm_util_extract_image_info(path, NULL, width, height);
+       thumb_retvm_if(ret != MM_UTIL_ERROR_NONE, THUMB_FAIL, "mm_util_extract_image_info failed");
+
+       return THUMB_OK;
+}