Use new image_util(magicK) APIs instead of Old one 41/168941/5 accepted/tizen/unified/20180206.064132 submit/tizen/20180205.005408
authorhj kim <backto.kim@samsung.com>
Thu, 1 Feb 2018 08:42:50 +0000 (17:42 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 5 Feb 2018 00:04:41 +0000 (09:04 +0900)
Change-Id: Ia554632d366dd26289ee9d543993793c22ee73d7

CMakeLists.txt
include/dcm_svc_internal.h
libdcm-face/dcm-face.c
libdcm-face/dcm-face_mediavision.c
libdcm-face/dcm-face_priv.h
libdcm-face/include/dcm-face.h
libdcm-util/dcm_image_codec.c
libdcm-util/include/dcm_image_codec.h
packaging/dcm-service.spec
src/dcm_svc_internal.c

index 4ed11997bb587e6f577b197bfd437940e89847eb..77210006446011b335cf26e5b7a6d7dcd6c78edc 100755 (executable)
@@ -40,8 +40,8 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libdcm-util/include ${CMAKE_SOURCE_DIR}/libdcm-face/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED glib-2.0 dlog sqlite3 capi-media-image-util capi-media-vision
- libmedia-utils libtzplatform-config)
+pkg_check_modules(pkgs REQUIRED glib-2.0 dlog sqlite3 capi-media-vision
+ libmedia-utils libtzplatform-config mmutil-magick)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 677825dbc6128805c12d447f0b7e0680749ef23b..08b3fe1cbe92892c95daba13a5daa1348d58c58b 100755 (executable)
@@ -32,7 +32,7 @@ typedef struct {
 
 typedef struct {
        unsigned char *pixel;           /* decoding results, must be freed after use */
-       unsigned long long size;
+       size_t size;
        int orientation;                        /* orientation information extracted from exif */
        unsigned int original_width;                    /* original image width */
        unsigned int original_height;           /* original image height */
index 31245ed0893a2029c1e06360cda070f0c6a07a95..92784b739f03e7ffa29dc333e4e8baa4ddaa4e3e 100755 (executable)
@@ -70,7 +70,7 @@ EXPORT_API int dcm_face_destroy(__in dcm_face_h handle)
        return ret;
 }
 
-EXPORT_API int dcm_face_set_image_info(dcm_face_h handle, face_image_colorspace_e colorspace, unsigned char *buffer, unsigned int width, unsigned int height, unsigned long long size)
+EXPORT_API int dcm_face_set_image_info(dcm_face_h handle, face_image_colorspace_e colorspace, unsigned char *buffer, unsigned int width, unsigned int height, size_t size)
 {
        FaceHandleT *_handle = (FaceHandleT *)handle;
        unsigned char *data = NULL;
index a2a90bc37eb219d1ca19ec2b8a2adfc71cd39949..6a35989b28da9c99a7f27845473bef64d0270a9e 100755 (executable)
@@ -205,7 +205,7 @@ int _face_detect_faces(__in dcm_face_h handle, __out face_rect_s *face_rect[], _
 
        __convert_to_mv_colorspace_e(handle->image_info->colorspace, &colorspace);
 
-       dcm_debug("face_detect image: %p, size: %llu, width: %d, height: %d, color: %d", handle->image_info->data, handle->image_info->size, handle->image_info->width, handle->image_info->height, colorspace);
+       dcm_debug("face_detect image: %p, size: %zu, width: %d, height: %d, color: %d", handle->image_info->data, handle->image_info->size, handle->image_info->width, handle->image_info->height, colorspace);
 
        err = mv_source_fill_by_buffer(_fengine->source, handle->image_info->data, (unsigned int)(handle->image_info->size), handle->image_info->width, handle->image_info->height, colorspace);
        if (err != MEDIA_VISION_ERROR_NONE) {
index d3b2a24ed39e217c37e031ab797275bd94d69ebd..887a625184cea14ef237542bcfac50f6724a583b 100755 (executable)
@@ -36,7 +36,7 @@ typedef struct face_image_s {
        unsigned char *data;
        unsigned int width;
        unsigned int height;
-       unsigned long long size;
+       size_t size;
        face_image_colorspace_e colorspace;
        unsigned int magic;
 } FaceImage;
index b411ba546d6962cb174a29f5538bb2bcaab2d31c..1b4d89daf5c798c1e219d10e71d7ecdc4e311856 100755 (executable)
@@ -16,6 +16,7 @@
 #ifndef __TIZEN_DCM_FACE_H__
 #define __TIZEN_DCM_FACE_H__
 
+#include <stdio.h>
 #include <tizen.h>
 #include "dcm-face_type.h"
 
@@ -78,7 +79,7 @@ int dcm_face_get_prefered_colorspace(dcm_face_h handle, face_image_colorspace_e
  * @retval #MS_MEDIA_ERR_OUT_OF_MEMORY Out of memory
  * @see dcm_face_create()
  */
-int dcm_face_set_image_info(dcm_face_h handle, face_image_colorspace_e colorspace, unsigned char *buffer, unsigned int width, unsigned int height, unsigned long long size);
+int dcm_face_set_image_info(dcm_face_h handle, face_image_colorspace_e colorspace, unsigned char *buffer, unsigned int width, unsigned int height, size_t size);
 
 /**
  * @brief Gets the face information of detected faces.
index 2a5176447fbfce475a5b6400c41b0e4ca7203cce..3809c52c4f7adfbd0c88d3621f82358c1a9077be 100755 (executable)
  */
 
 
-#include <image_util.h>
-#include <image_util_internal.h>
 #include <dcm_image_codec_debug.h>
 #include <dcm_image_codec.h>
+#include <mm_util_magick.h>
 
 #define OPT_IMAGE_WIDTH                1280
 #define OPT_IMAGE_HEIGHT       720
@@ -36,7 +35,7 @@ typedef enum {
        ROT_270 = 8
 } dcm_exif_orientation_e;
 
-static void __dcm_get_optimized_wh(unsigned int src_width, unsigned int src_height, unsigned int *calc_width, unsigned int *calc_height)
+static bool __dcm_get_optimized_wh(unsigned int src_width, unsigned int src_height, unsigned int *calc_width, unsigned int *calc_height)
 {
        *calc_width = 0;
        *calc_height = 0;
@@ -45,7 +44,7 @@ static void __dcm_get_optimized_wh(unsigned int src_width, unsigned int src_heig
                dcm_debug("Original image is smaller than target image");
                *calc_width = src_width;
                *calc_height = src_height;
-               return;
+               return FALSE;
        }
 
        if (src_width > src_height) {
@@ -55,263 +54,93 @@ static void __dcm_get_optimized_wh(unsigned int src_width, unsigned int src_heig
                *calc_width = (int)(src_width * (((double) OPT_IMAGE_HEIGHT) / ((double) src_height)));
                *calc_height = OPT_IMAGE_HEIGHT;
        }
-}
-
-static int __dcm_rotate_image(const unsigned char *source, const dcm_image_format_e format, dcm_exif_orientation_e orientation, unsigned char **image_buffer, unsigned long long *size, unsigned int *buff_width, unsigned int *buff_height)
-{
-       int ret = IMAGE_UTIL_ERROR_NONE;
-       image_util_colorspace_e colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888;
-       image_util_rotation_e rotate = IMAGE_UTIL_ROTATION_NONE;
-       unsigned char *rotated_buffer = NULL;
-       unsigned int rotated_buffer_size = 0;
-       int rotated_width = 0, rotated_height = 0;
-
-       DCM_CHECK_VAL(source, MS_MEDIA_ERR_INVALID_PARAMETER);
-
-       if (format == DCM_IMAGE_FORMAT_I420)
-               colorspace = IMAGE_UTIL_COLORSPACE_I420;
-       else if (format == DCM_IMAGE_FORMAT_RGB)
-               colorspace = IMAGE_UTIL_COLORSPACE_RGB888;
-       else if (format == DCM_IMAGE_FORMAT_RGBA)
-               colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888;
-       else
-               return MS_MEDIA_ERR_UNSUPPORTED_CONTENT;
-
-       /* Get rotate angle enum */
-       if (orientation == ROT_180)
-               rotate = IMAGE_UTIL_ROTATION_180;
-       else if (orientation == ROT_90)
-               rotate = IMAGE_UTIL_ROTATION_90;
-       else if (orientation == ROT_270)
-               rotate = IMAGE_UTIL_ROTATION_270;
-       else if (orientation == HFLIP)
-               rotate = IMAGE_UTIL_ROTATION_FLIP_HORZ;
-       else if (orientation == VFLIP)
-               rotate = IMAGE_UTIL_ROTATION_FLIP_VERT;
-       else
-               rotate = IMAGE_UTIL_ROTATION_NONE;
-
-       dcm_debug("orientation: %d, rotate: %d", orientation, rotate);
 
-       if (rotate == IMAGE_UTIL_ROTATION_90 || rotate == IMAGE_UTIL_ROTATION_270) {
-               rotated_width = *buff_height;
-               rotated_height = *buff_width;
-       } else {
-               rotated_width = *buff_width;
-               rotated_height = *buff_height;
-       }
-
-       /* Calculate the rotated buffer size */
-       ret = image_util_calculate_buffer_size(rotated_width, rotated_height, colorspace, &rotated_buffer_size);
-       if (ret != IMAGE_UTIL_ERROR_NONE) {
-               dcm_error("Failed to calculate buffer size! err: %d", ret);
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       /* Allocate rotated buffer */
-       if (rotated_buffer_size <= 0) {
-               dcm_error("Invalid rotated buffer size!");
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       dcm_debug("rotate buffer size: %u", rotated_buffer_size);
-       rotated_buffer = (unsigned char *) g_malloc0(rotated_buffer_size);
-       if (rotated_buffer == NULL) {
-               dcm_error("rotated_buffer is NULL!");
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       *size = rotated_buffer_size;
-
-       /* Rotate input buffer */
-       ret = image_util_rotate(rotated_buffer, &rotated_width, &rotated_height, rotate, source, *buff_width, *buff_height, colorspace);
-
-       if (ret != IMAGE_UTIL_ERROR_NONE || rotated_buffer == NULL) {
-               dcm_error("Failed to rotate image buffer! err: %d", ret);
-               DCM_SAFE_FREE(rotated_buffer);
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       /* Decoded buffer size is set to rotated buffer size to match buffer */
-       dcm_debug("After rotation: [width: %d] [height: %d]", rotated_width, rotated_height);
-       *buff_width = rotated_width;
-       *buff_height = rotated_height;
-
-       /* Allocated data should be freed when scanning is finished for this rotated image */
-       *image_buffer = rotated_buffer;
-       dcm_warn("rotated decode buffer: %p", *image_buffer);
-
-       return MS_MEDIA_ERR_NONE;
+       return TRUE;
 }
 
-static int __dcm_rotate_rgb(unsigned char *source, const unsigned long long *size, int format, unsigned int *ori_width, unsigned int *ori_height)
-{
-       unsigned int dpp = 0; /* data per pixel */
-       unsigned int x = 0, y = 0;
-       unsigned int i = 0;
-       unsigned int width = 0, height = 0;
-       unsigned char *temp_buf = NULL;
-       size_t _size = (size_t)*size;
-
-       if (format == DCM_IMAGE_FORMAT_RGBA) {
-               dpp = 4;
-       } else if (format == DCM_IMAGE_FORMAT_RGB) {
-               dpp = 3;
-       } else {
-               dcm_error("Invalid parameter");
-               return MS_MEDIA_ERR_INVALID_PARAMETER;
-       }
-
-       temp_buf = (unsigned char*)g_malloc0(_size);
-       if (temp_buf == NULL) {
-               dcm_error("Failed to allocate memory");
-               return MS_MEDIA_ERR_OUT_OF_MEMORY;
-       }
-
-       width = *ori_width;
-       height = *ori_height;
-
-       /* rotate image to 90 degree clockwise */
-       for (y = 0; y < height; y++) {
-               for (x = 0; x < width; x++) {
-                       for (i = 0; i < dpp; i++)
-                               temp_buf[(x * height + (height - y - 1)) * dpp + i] = source[(y * width + x) * dpp + i];
-               }
-       }
-
-       /* copy image from temp buffer to original buffer */
-       memcpy(source, temp_buf, _size);
-       DCM_SAFE_FREE(temp_buf);
-
-       /* swap width & height due to rotate 90 degree */
-       *ori_width = height;
-       *ori_height = width;
-
-       return MS_MEDIA_ERR_NONE;
-}
-
-int dcm_decode_image(const char *file_path, const dcm_image_format_e format,
-       const char* mimne_type, const int orientation, const gboolean resize,
-       unsigned char **image_buffer, unsigned long long *size,
+int dcm_decode_image(const char *file_path, const int orientation, const gboolean resize, unsigned char **image_buffer, size_t *size,
        unsigned int *buff_width, unsigned int *buff_height)
 {
-       int ret = IMAGE_UTIL_ERROR_NONE;
-       image_util_colorspace_e colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888;
-       unsigned char *decode_buffer = NULL;
-       unsigned int decode_width = 0, decode_height = 0;
-       unsigned char *resize_buffer = NULL;
-       unsigned int buffer_size = 0;
-       image_util_decode_h handle = NULL;
+       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 type = IMG_CODEC_UNKNOWN_TYPE;
+       mm_util_magick_rotate_type angle = MM_UTIL_ROTATE_NUM;
+       mm_util_image_h resize_dst_handle = NULL;
+       mm_util_image_h dst_handle = NULL;
+       mm_util_magick_format format = MM_UTIL_IMG_FMT_NUM;
 
        dcm_debug_fenter();
 
        DCM_CHECK_VAL(file_path, MS_MEDIA_ERR_INVALID_PARAMETER);
 
-       ret = image_util_decode_create(&handle);
-       if (ret != IMAGE_UTIL_ERROR_NONE) {
-               dcm_error("Error image_util_decode_create ret : %d", ret);
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       ret = image_util_decode_set_input_path(handle, file_path);
-       if (ret != IMAGE_UTIL_ERROR_NONE) {
-               dcm_error("Error image_util_decode_set_input_path ret : %d", ret);
-               image_util_decode_destroy(handle);
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       if (strcmp(mimne_type, MIME_TYPE_JPEG) == 0) {
-               if (format == DCM_IMAGE_FORMAT_I420) {
-                       colorspace = IMAGE_UTIL_COLORSPACE_I420;
-               } else if (format == DCM_IMAGE_FORMAT_RGB) {
-                       colorspace = IMAGE_UTIL_COLORSPACE_RGB888;
-               } else if (format == DCM_IMAGE_FORMAT_RGBA) {
-                       colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888;
-               } else {
-                       image_util_decode_destroy(handle);
-                       return MS_MEDIA_ERR_UNSUPPORTED_CONTENT;
-               }
-               ret = image_util_decode_set_colorspace(handle, colorspace);
-               if (ret != IMAGE_UTIL_ERROR_NONE) {
-                       dcm_error("Error image_util_decode_set_colorspace ret : %d", ret);
-                       image_util_decode_destroy(handle);
-                       return MS_MEDIA_ERR_INTERNAL;
-               }
-       }
-
-       ret = image_util_decode_set_output_buffer(handle, &decode_buffer);
-       if (ret != IMAGE_UTIL_ERROR_NONE) {
-               dcm_error("Error image_util_decode_set_output_buffer ret : %d", ret);
-               image_util_decode_destroy(handle);
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       ret = image_util_decode_run(handle, (unsigned long *)&decode_width, (unsigned long *)&decode_height, size);
-       if (ret != IMAGE_UTIL_ERROR_NONE) {
-               dcm_error("Error image_util_decode_run ret : %d", ret);
-               image_util_decode_destroy(handle);
-               return MS_MEDIA_ERR_INTERNAL;
-       }
-
-       ret = image_util_decode_destroy(handle);
-       if (ret != IMAGE_UTIL_ERROR_NONE) {
-               dcm_error("Error image_util_decode_destroy ret : %d", ret);
+       if (orientation == NOT_AVAILABLE || orientation == NORMAL)
+               angle = MM_UTIL_ROTATE_0;
+       else if (orientation == ROT_90)
+               angle = MM_UTIL_ROTATE_90;
+       else if (orientation == ROT_180)
+               angle = MM_UTIL_ROTATE_180;
+       else if (orientation == ROT_270)
+               angle = MM_UTIL_ROTATE_270;
+       else if (orientation == HFLIP)
+               angle = MM_UTIL_ROTATE_FLIP_HORZ;
+       else if (orientation == VFLIP)
+               angle = MM_UTIL_ROTATE_FLIP_VERT;
+       else {
+               dcm_error("Not supported angle [%d]", orientation);
                return MS_MEDIA_ERR_INTERNAL;
        }
 
-
-       /* Get the optimized width/height to enhance performance for big size image */
        if (resize) {
-               __dcm_get_optimized_wh(decode_width, decode_height, buff_width, buff_height);
-       } else {
-               *buff_width = decode_width;
-               *buff_height = decode_height;
-       }
-
-       /* Resize the big size image to enhance performance for big size image */
-       if ((decode_width != *buff_width) || (decode_height != *buff_height)) {
-               ret = image_util_calculate_buffer_size(*buff_width, *buff_height, colorspace, &buffer_size);
-               if (ret != IMAGE_UTIL_ERROR_NONE) {
-                       dcm_error("Failed to calculate image buffer size! err: %d", ret);
-                       return MS_MEDIA_ERR_INTERNAL;
-               }
+               /* Get the optimized width/height to enhance performance for big size image */
+               ret = mm_util_extract_image_info(file_path, &type, &width, &height);
+               if (ret != MM_UTIL_ERROR_NONE)
+                       dcm_error("Failed to get image info!err: %d", ret);
+
+               if (__dcm_get_optimized_wh(width, height, &resized_width, &resized_height)) {
+                       /* Resize the big size image to enhance performance for big size image */
+                       ret = mm_util_resize_P_B(file_path, resized_width, resized_height, MM_UTIL_IMG_FMT_RGBA8888, &resize_dst_handle);
+                       if (ret != MM_UTIL_ERROR_NONE) {
+                               dcm_error("Failed to resize image!err: %d", ret);
+                               ret = MS_MEDIA_ERR_INTERNAL;
+                               goto ERROR;
+                       }
 
-               *size = buffer_size;
-               resize_buffer = (unsigned char *)g_malloc0(sizeof(unsigned char) * (buffer_size));
-               if (resize_buffer != NULL) {
-                       ret = image_util_resize(resize_buffer, (int *)buff_width, (int *)buff_height, decode_buffer, decode_width, decode_height, colorspace);
-                       DCM_SAFE_FREE(decode_buffer);
-                       if (ret != IMAGE_UTIL_ERROR_NONE) {
-                               dcm_error("Failed to image_util_resize");
-                               DCM_SAFE_FREE(resize_buffer);
-                               return MS_MEDIA_ERR_INTERNAL;
+                       ret = mm_util_rotate_B_B(resize_dst_handle, angle, &dst_handle);
+                       if (ret != MM_UTIL_ERROR_NONE) {
+                               dcm_error("Failed to rotate image!err: %d", ret);
+                               ret = MS_MEDIA_ERR_INTERNAL;
+                               goto ERROR;
                        }
                } else {
-                       dcm_error("Failed to allocation");
-                       return MS_MEDIA_ERR_OUT_OF_MEMORY;
+                       ret = mm_util_rotate_P_B(file_path, angle, MM_UTIL_IMG_FMT_RGBA8888, &dst_handle);
+                       if (ret != MM_UTIL_ERROR_NONE) {
+                               dcm_error("Failed to rotate image buffer! err: %d", ret);
+                               ret = MS_MEDIA_ERR_INTERNAL;
+                               goto ERROR;
+                       }
                }
        } else {
-               resize_buffer = decode_buffer;
-       }
-
-       /* Rotate the resized buffer according to orientation */
-       if (orientation == NOT_AVAILABLE || orientation == NORMAL) {
-               *image_buffer = resize_buffer;
-       } else {
-               if ((format == DCM_IMAGE_FORMAT_RGBA) || (format == DCM_IMAGE_FORMAT_RGB)) {
-                       ret = __dcm_rotate_rgb(resize_buffer, size, format, buff_width, buff_height);
-                       *image_buffer = resize_buffer;
-               } else {
-                       ret = __dcm_rotate_image(resize_buffer, format, orientation, image_buffer, size, buff_width, buff_height);
-                       DCM_SAFE_FREE(resize_buffer);
-               }
-               if (ret != MS_MEDIA_ERR_NONE) {
+               ret = mm_util_rotate_P_B(file_path, angle, MM_UTIL_IMG_FMT_RGBA8888, &dst_handle);
+               if (ret != MM_UTIL_ERROR_NONE) {
                        dcm_error("Failed to rotate image buffer! err: %d", ret);
-                       return MS_MEDIA_ERR_INTERNAL;
+                       ret = MS_MEDIA_ERR_INTERNAL;
+                       goto ERROR;
                }
        }
 
+       mm_util_get_image(dst_handle, image_buffer, buff_width, buff_height, size, &format);
+
+ERROR:
+       if (resize_dst_handle != NULL)
+               mm_util_destroy_handle(resize_dst_handle);
+
+       if (dst_handle != NULL)
+               mm_util_destroy_handle(dst_handle);
+
        dcm_debug_fleave();
 
-       return MS_MEDIA_ERR_NONE;
+       return ret;
 }
index 2ee9ba87db7a18ecf8a9d8add2366abce995acc8..d40e4dbf1db2dbd4782472a4eed7e9e6ad5f1cc8 100755 (executable)
@@ -34,9 +34,7 @@ typedef enum {
        DCM_IMAGE_FORMAT_RGBA,
 } dcm_image_format_e;
 
-int dcm_decode_image(const char *file_path, const dcm_image_format_e format,
-       const char* mimne_type, const int orientation, const gboolean resize,
-       unsigned char **image_buffer, unsigned long long *size,
+int dcm_decode_image(const char *file_path, const int orientation, const gboolean resize, unsigned char **image_buffer, size_t *size,
        unsigned int *buff_width, unsigned int *buff_height);
 
 #ifdef __cplusplus
index 9c1c1a51f762fd5410f8af2439a0e290dfd44011..e586eeabc5b2fe4575c5ad63667687d9b07fe86b 100755 (executable)
@@ -14,10 +14,10 @@ BuildRequires:  cmake
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(sqlite3)
-BuildRequires:  pkgconfig(capi-media-image-util)
 BuildRequires:  pkgconfig(capi-media-vision)
 BuildRequires:  pkgconfig(libmedia-utils)
 BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(mmutil-magick)
 
 %description
 This package provides a media DCM(Digital Contents Management) service
index e2672614b11256a4a44721841664e0aeffec11e2..f7684911e37b3d0920f353d0da982dd8c6a7078f 100755 (executable)
@@ -54,7 +54,7 @@ static int __dcm_scan_process(dcm_svc_item_s *scan_item)
                image_info.orientation = scan_item->image_orientation;
 
                if (strcmp(scan_item->mime_type, MIME_TYPE_JPEG) == 0) {
-                       image_info.decode_type = DCM_IMAGE_FORMAT_RGB;
+                       image_info.decode_type = DCM_IMAGE_FORMAT_RGBA;
                } else if ((strcmp(scan_item->mime_type, MIME_TYPE_PNG) == 0) ||
                                (strcmp(scan_item->mime_type, MIME_TYPE_BMP) == 0)) {
                        image_info.decode_type = DCM_IMAGE_FORMAT_RGBA;
@@ -63,8 +63,7 @@ static int __dcm_scan_process(dcm_svc_item_s *scan_item)
                        return MS_MEDIA_ERR_INVALID_PARAMETER;
                }
 
-               ret = dcm_decode_image((const char *) (scan_item->file_path), image_info.decode_type, scan_item->mime_type,
-                       image_info.orientation, FALSE, &(image_info.pixel), &(image_info.size), &(image_info.buffer_width), &(image_info.buffer_height));
+               ret = dcm_decode_image((const char *) (scan_item->file_path), image_info.orientation, FALSE, &(image_info.pixel), &(image_info.size), &(image_info.buffer_width), &(image_info.buffer_height));
                dcm_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "Failed dcm_decode_image(%d)", ret);
 
                dcm_info("Image info W[%d] H[%d] Orient[%d] buf_w[%d] buf_h[%d]",