Tizen Native API
5.5
|
The Image Metadata API provides functions that allow to get information about stored image files.
This file contains the image metadata API and related functions to proceed with them. Functions include cloning and destroying the image metadata, getting image metadata such as width, height,
orientation, date taken.
Required Header
#include <media_content.h>
Overview
The Image Metadata API provides functions to get basic information associated with image files:
Attribute | Filter Keyword | Comments |
---|---|---|
width | MEDIA_WIDTH | Width |
height | MEDIA_HEIGHT | Height |
longitude | MEDIA_LONGITUDE | Get from metadata if exist. |
latitude | MEDIA_LATITUDE | Get from metadata if exist. |
altitude | MEDIA_ALTITUDE | Get from metadata if exist. |
exposure_time | MEDIA_EXPOSURE_TIME | Get from EXIF if exist. |
fnumber | MEDIA_FNUMBER | Get from EXIF if exist. |
iso | MEDIA_ISO | Get from EXIF if exist. |
model | MEDIA_MODEL | Get from EXIF if exist. |
date_taken | MEDIA_DATETAKEN | Get from EXIF if exist. |
orientation | MEDIA_ORIENTATION | Get from EXIF if exist. |
is_360_content | MEDIA_360 | Whether 360 content or not. |
For getting the image handle (image_meta_h) from the media information (media_info_h), call media_info_get_image() function.
For getting the information related to image files stored in the device call the respective get functions e.g. to get the width of a image, call image_meta_get_width() function and to get orientation (media_content_orientation_e) of a image, call image_meta_get_orientation() function and so on.
When the image handle is no longer needed, it should be destroyed by calling image_meta_destroy() function.
Functions | |
int | image_meta_clone (image_meta_h *dst, image_meta_h src) |
Clones the image metadata. | |
int | image_meta_destroy (image_meta_h image) |
Destroys the image metadata. | |
int | image_meta_get_media_id (image_meta_h image, char **media_id) |
Gets the ID of an image. | |
int | image_meta_get_width (image_meta_h image, int *width) |
Gets the image width in pixels. | |
int | image_meta_get_height (image_meta_h image, int *height) |
Gets the image height in pixels. | |
int | image_meta_get_orientation (image_meta_h image, media_content_orientation_e *orientation) |
Gets the image orientation. | |
int | image_meta_get_date_taken (image_meta_h image, char **date_taken) |
Gets the image creation time. | |
int | image_meta_get_exposure_time (image_meta_h image, char **exposure_time) |
Gets the exposure time from EXIF. | |
int | image_meta_get_fnumber (image_meta_h image, double *fnumber) |
Gets the fnumber from EXIF. | |
int | image_meta_get_iso (image_meta_h image, int *iso) |
Gets the iso from EXIF. | |
int | image_meta_get_model (image_meta_h image, char **model) |
Gets the model from EXIF. | |
Typedefs | |
typedef struct image_meta_s * | image_meta_h |
The structure type for the Image metadata handle. |
Typedef Documentation
typedef struct image_meta_s* image_meta_h |
The structure type for the Image metadata handle.
- Since :
- 2.3.1
Function Documentation
int image_meta_clone | ( | image_meta_h * | dst, |
image_meta_h | src | ||
) |
Clones the image metadata.
The function copies the image metadata handle from a source to destination.
- Since :
- 2.3.1
- Remarks:
- The dst should be released using image_meta_destroy().
- Parameters:
-
[out] dst The destination handle to the image metadata [in] src The source handle to the image metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- image_meta_destroy()
int image_meta_destroy | ( | image_meta_h | image | ) |
Destroys the image metadata.
The function frees all resources related to the image metadata handle. This handle no longer can be used to perform any operations. A new handle has to be created before next usage.
- Since :
- 2.3.1
- Parameters:
-
[in] image The handle to the image metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- Get a copy of image_meta handle by calling image_meta_clone().
- See also:
- image_meta_clone()
int image_meta_get_date_taken | ( | image_meta_h | image, |
char ** | date_taken | ||
) |
Gets the image creation time.
- Since :
- 2.3.1
- Remarks:
- The date_taken should be released using free().
- Parameters:
-
[in] image The handle to the image metadata [out] date_taken The time, when image was taken (in seconds, since the Epoch)
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_exposure_time | ( | image_meta_h | image, |
char ** | exposure_time | ||
) |
Gets the exposure time from EXIF.
- Since :
- 3.0
- Remarks:
- The exposure_time should be released using free().
- Parameters:
-
[in] image The handle to the image metadata [out] exposure_time The value of exposure_time, getting from EXIF
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_fnumber | ( | image_meta_h | image, |
double * | fnumber | ||
) |
Gets the fnumber from EXIF.
- Since :
- 3.0
- Parameters:
-
[in] image The handle to the image metadata [out] fnumber The value of fnumber, getting from EXIF
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_height | ( | image_meta_h | image, |
int * | height | ||
) |
Gets the image height in pixels.
- Since :
- 2.3.1
- Parameters:
-
[in] image The handle to the image metadata [out] height The image height in pixels
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_iso | ( | image_meta_h | image, |
int * | iso | ||
) |
Gets the iso from EXIF.
- Since :
- 3.0
- Parameters:
-
[in] image The handle to the image metadata [out] iso The value of iso, getting from EXIF
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_media_id | ( | image_meta_h | image, |
char ** | media_id | ||
) |
Gets the ID of an image.
- Since :
- 2.3.1
- Remarks:
- The media_id should be released using free().
- Parameters:
-
[in] image The handle to the image metadata [out] media_id The media ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_model | ( | image_meta_h | image, |
char ** | model | ||
) |
Gets the model from EXIF.
- Since :
- 3.0
- Remarks:
- The model should be released using free().
- Parameters:
-
[in] image The handle to the image metadata [out] model The value of model, getting from EXIF
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_orientation | ( | image_meta_h | image, |
media_content_orientation_e * | orientation | ||
) |
Gets the image orientation.
- Since :
- 2.3.1
- Parameters:
-
[in] image The handle to the image metadata [out] orientation The image orientation
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int image_meta_get_width | ( | image_meta_h | image, |
int * | width | ||
) |
Gets the image width in pixels.
- Since :
- 2.3.1
- Parameters:
-
[in] image The handle to the image metadata [out] width The image width in pixels
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter