Bug fix of face detection. orientation info was wrong 69/137469/1 accepted/tizen/4.0/unified/20170816.011316 accepted/tizen/4.0/unified/20170816.014656 accepted/tizen/unified/20170710.154107 submit/tizen/20170706.073239 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorHaejeong Kim <backto.kim@samsung.com>
Thu, 6 Jul 2017 05:41:08 +0000 (14:41 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Thu, 6 Jul 2017 05:41:08 +0000 (14:41 +0900)
Change-Id: Idb951be5b5abd2a1fc864528908b1b0c1874e081

libdcm-util/dcm_image_codec.c
libdcm-util/include/dcm_image_codec.h
packaging/dcm-service.spec
src/dcm_svc_internal.c

index abb4b8d8e859f1d0234f43fb9a5b0b396f49fdc4..852e521b9a00b4ad33e7ea8066668695610ba192 100755 (executable)
 #define OPT_IMAGE_WIDTH                1280
 #define OPT_IMAGE_HEIGHT       720
 
+typedef enum {
+       NOT_AVAILABLE = 0,
+       NORMAL = 1,
+       HFLIP = 2,
+       ROT_180 = 3,
+       VFLIP = 4,
+       TRANSPOSE = 5,
+       ROT_90 = 6,
+       TRANSVERSE = 7,
+       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)
 {
        *calc_width = 0;
@@ -47,7 +59,7 @@ static void __dcm_get_optimized_wh(unsigned int src_width, unsigned int src_heig
        }
 }
 
-static int __dcm_rotate_image(const unsigned char *source, const dcm_image_format_e format, const int orientation, unsigned char **image_buffer, unsigned long long *size, unsigned int *buff_width, unsigned int *buff_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;
@@ -68,12 +80,16 @@ static int __dcm_rotate_image(const unsigned char *source, const dcm_image_forma
                return MS_MEDIA_ERR_UNSUPPORTED_CONTENT;
 
        /* Get rotate angle enum */
-       if (orientation == DEGREE_180)
+       if (orientation == ROT_180)
                rotate = IMAGE_UTIL_ROTATION_180;
-       else if (orientation == DEGREE_90)
+       else if (orientation == ROT_90)
                rotate = IMAGE_UTIL_ROTATION_90;
-       else if (orientation == DEGREE_270)
+       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;
 
@@ -110,8 +126,7 @@ static int __dcm_rotate_image(const unsigned char *source, const dcm_image_forma
        *size = rotated_buffer_size;
 
        /* Rotate input buffer */
-       ret = image_util_rotate(rotated_buffer, &rotated_width, &rotated_height, rotate, source,
-       *buff_width, *buff_height, colorspace);
+       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);
@@ -271,7 +286,7 @@ int dcm_decode_image(const char *file_path, const dcm_image_format_e format,
        }
 
        /* Rotate the resized buffer according to orientation */
-       if (orientation == 0) {
+       if (orientation == NOT_AVAILABLE || orientation == NORMAL) {
                *image_buffer = resize_buffer;
        } else {
                if ((format == DCM_IMAGE_FORMAT_RGBA) || (format == DCM_IMAGE_FORMAT_RGB)) {
index f26204610a253b50f97fb833d4e962b70f95e83a..2ee9ba87db7a18ecf8a9d8add2366abce995acc8 100755 (executable)
 
 #include <glib.h>
 
-#define DEGREE_0               0
-#define DEGREE_90              1
-#define DEGREE_180             2
-#define DEGREE_270             3
-
 #define MIME_TYPE_JPEG "image/jpeg"
 #define MIME_TYPE_PNG  "image/png"
 #define MIME_TYPE_BMP  "image/bmp"
index 596aa1adba09a181f9317dba75efe08f6cbece11..2ead8f5da49822b6ba61493c147d7aa0cb11bc31 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       dcm-service
 Summary:    A media DCM(Digital Contents Management) Service
-Version:    0.1.3
+Version:    0.1.4
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index f6eecdc2f01fa5dd253db31954edf7f64619bc22..faec2b8d9f310919eaba13731063b819ac15634c 100755 (executable)
@@ -297,7 +297,7 @@ int _dcm_scan_process(dcm_svc_item_s *scan_item)
                image_info.original_height = scan_item->image_height;
                image_info.orientation = scan_item->image_orientation;
 
-               dcm_debug("scan media w : [%d], h : [%d], orientation : [%d]", image_info.original_width, image_info.original_height, scan_item->image_orientation);
+               dcm_info("scan media w : [%d], h : [%d], orientation : [%d]", image_info.original_width, image_info.original_height, scan_item->image_orientation);
 
                if (image_info.original_width <= 0 && image_info.original_height <= 0) {
                        ret = ImgGetImageInfo((const char *)(scan_item->file_path), &type, &(image_info.original_width), &(image_info.original_height));
@@ -327,7 +327,7 @@ int _dcm_scan_process(dcm_svc_item_s *scan_item)
                        return ret;
                }
 
-               dcm_debug("Image info width: %d, height: %d, buf_width: %d, buf_height: %d",
+               dcm_info("Image info width: %d, height: %d, buf_width: %d, buf_height: %d",
                        image_info.original_width, image_info.original_height, image_info.buffer_width, image_info.buffer_height);
 
                /* Process face scan */