SAFE_FREE(_image->media_id);
SAFE_FREE(_image->date_taken);
- SAFE_FREE(_image->title);
SAFE_FREE(_image->exposure_time);
SAFE_FREE(_image->model);
SAFE_FREE(_image);
media_content_retv_free_image_if(_dst->date_taken == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
}
- if (STRING_VALID(_src->title)) {
- _dst->title = strdup(_src->title);
- media_content_retv_free_image_if(_dst->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
- }
-
if (STRING_VALID(_src->exposure_time)) {
_dst->exposure_time = strdup(_src->exposure_time);
media_content_retv_free_image_if(_dst->exposure_time == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
return ret;
}
+
+int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ media_content_warn("DEPRECATION WARNING: image_meta_set_orientation() is deprecated and will be removed from next release.");
+ image_meta_s *_image = (image_meta_s*)image;
+
+ if (_image == NULL) {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ if ((orientation < MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE) || (orientation > MEDIA_CONTENT_ORIENTATION_ROT_270)) {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ _image->orientation = orientation;
+
+ return ret;
+}
+
+int image_meta_update_to_db(image_meta_h image)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ media_content_warn("DEPRECATION WARNING: image_meta_update_to_db() is deprecated and will be removed from next release.");
+ image_meta_s *_image = (image_meta_s*)image;
+ char *sql = NULL;
+
+ if (_image != NULL && STRING_VALID(_image->media_id)) {
+#ifdef _USE_TVPD_MODE
+ char *storage_id = NULL;
+ ret = _media_db_get_storage_id_by_media_id(_image->media_id, &storage_id);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ sql = sqlite3_mprintf(UPDATE_IMAGE_META_FROM_MEDIA, storage_id, _image->orientation, _image->media_id);
+ SAFE_FREE(storage_id);
+#else
+ sql = sqlite3_mprintf(UPDATE_IMAGE_META_FROM_MEDIA, _image->orientation, _image->media_id);
+#endif
+ ret = _content_query_sql(sql);
+ SQLITE3_SAFE_FREE(sql);
+ } else {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ return ret;
+}