Correct the type 82/308582/2 accepted/tizen/unified/20240402.061306 accepted/tizen/unified/x/20240402.093414
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 28 Mar 2024 00:52:08 +0000 (09:52 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 28 Mar 2024 04:56:33 +0000 (13:56 +0900)
'ExifShort' is unsigned short.
Updated related code.

Change-Id: I1bb550b5171ba5dedb4d734c99238be2a57644f2
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-svc-util.c
src/include/common/media-svc-util.h

index 5a1956f..a4bed31 100644 (file)
@@ -152,7 +152,7 @@ static char * __media_svc_get_exif_datetaken(ExifData *ed)
        return NULL;
 }
 
-static bool __media_svc_get_exif_int(ExifData *ed, ExifTag tagtype, int *value)
+static bool __media_svc_get_exif_short(ExifData *ed, ExifTag tagtype, unsigned short *value)
 {
        ExifEntry *entry;
 
@@ -161,10 +161,7 @@ static bool __media_svc_get_exif_int(ExifData *ed, ExifTag tagtype, int *value)
 
        entry = exif_data_get_entry(ed, tagtype);
        media_svc_retv_if(!entry, false);
-
-       short exif_value = exif_get_short(entry->data, exif_data_get_byte_order(ed));
-       media_svc_retv_if(exif_value < 0, false);
-       *value = (int)exif_value;
+       *value = exif_get_short(entry->data, exif_data_get_byte_order(ed));
 
        return true;
 }
@@ -456,9 +453,9 @@ char * _media_svc_get_title_from_filename(const char *filename)
 
 int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info)
 {
-       int orient_value = 0;
-       int exif_width = 0;
-       int exif_height = 0;
+       unsigned short orient_value = 0;
+       unsigned short exif_width = 0;
+       unsigned short exif_height = 0;
        ExifData *ed = NULL;
 
        media_svc_retvm_if(!content_info, MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid content_info");
@@ -476,16 +473,16 @@ int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info)
 
        content_info->media_meta.datetaken = __media_svc_get_exif_datetaken(ed);
 
-       if (__media_svc_get_exif_int(ed, EXIF_TAG_ORIENTATION, &orient_value)) {
-               if (orient_value >= NOT_AVAILABLE && orient_value <= ROT_270)
+       if (__media_svc_get_exif_short(ed, EXIF_TAG_ORIENTATION, &orient_value)) {
+               if (orient_value <= ROT_270)
                        content_info->media_meta.orientation = orient_value;
        }
 
-       if (__media_svc_get_exif_int(ed, EXIF_TAG_PIXEL_X_DIMENSION, &exif_width))
-               content_info->media_meta.width = exif_width;
+       if (__media_svc_get_exif_short(ed, EXIF_TAG_PIXEL_X_DIMENSION, &exif_width))
+               content_info->media_meta.width = (unsigned int)exif_width;
 
-       if (__media_svc_get_exif_int(ed, EXIF_TAG_PIXEL_Y_DIMENSION, &exif_height))
-               content_info->media_meta.height = exif_height;
+       if (__media_svc_get_exif_short(ed, EXIF_TAG_PIXEL_Y_DIMENSION, &exif_height))
+               content_info->media_meta.height = (unsigned int)exif_height;
 
        exif_data_unref(ed);
 
index ee22a5b..d6f15e2 100755 (executable)
@@ -47,10 +47,10 @@ typedef struct {
        char *genre;                            /**< genre of track*/
        char *year;                             /**< year*/
        char *track_num;                        /**< track number*/
-       int width;                              /**< width*/
-       int height;                             /**< height*/
+       unsigned int width;                             /**< width*/
+       unsigned int height;                    /**< height*/
        char *datetaken;                        /**< datetaken*/
-       int orientation;                        /**< orientation*/
+       unsigned short orientation;             /**< orientation*/
 } media_svc_content_meta_s;
 
 /**