- if(_src != NULL)
- {
- image_meta_s *_dst = (image_meta_s*)calloc(1, sizeof(image_meta_s));
- if(NULL == _dst)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
-
- if(STRING_VALID(_src->media_id))
- {
- _dst->media_id = strdup(_src->media_id);
- if(_dst->media_id == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- image_meta_destroy((image_meta_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if(STRING_VALID(_src->date_taken))
- {
- _dst->date_taken = strdup(_src->date_taken);
- if(_dst->date_taken == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- image_meta_destroy((image_meta_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if(STRING_VALID(_src->title))
- {
- _dst->title = strdup(_src->title);
- if(_dst->title == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- image_meta_destroy((image_meta_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if(STRING_VALID(_src->weather))
- {
- _dst->weather = strdup(_src->weather);
- if(_dst->weather == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- image_meta_destroy((image_meta_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if(STRING_VALID(_src->burst_id))
- {
- _dst->burst_id = strdup(_src->burst_id);
- if(_dst->burst_id == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- image_meta_destroy((image_meta_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- _dst->width = _src->width;
- _dst->height = _src->height;
- _dst->orientation = _src->orientation;
-
- *dst = (image_meta_h)_dst;
-
- ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
+ content_retip_if_fail(dst);
+ content_retip_if_fail(src);
+
+ image_meta_s *_dst = g_new0(image_meta_s, 1);
+
+ _dst->media_id = g_strdup(_src->media_id);
+ _dst->date_taken = g_strdup(_src->date_taken);
+ _dst->exposure_time = g_strdup(_src->exposure_time);
+ _dst->model = g_strdup(_src->model);
+ _dst->fnumber = _src->fnumber;
+ _dst->iso = _src->iso;
+ _dst->width = _src->width;
+ _dst->height = _src->height;
+ _dst->orientation = _src->orientation;
+
+ *dst = (image_meta_h)_dst;
+
+ return MEDIA_CONTENT_ERROR_NONE;