For more information about how to use Exif API, see Exif Guide.
Since: 2.4
Interface | Method |
---|---|
ExifManagerObject | |
ExifManager |
void getExifInfo (DOMString uri, ExifInformationSuccessCallback successCallback, optional ErrorCallback? errorCallback)
void saveExifInfo (ExifInformation exifInfo, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
void getThumbnail (DOMString uri, ExifThumbnailSuccessCallback successCallback, optional ErrorCallback? errorCallback) |
ExifInit | |
ExifInformation | |
ExifInformationSuccessCallback |
void onsuccess (ExifInformation exifInfo) |
ExifThumbnailSuccessCallback |
void onsuccess (DOMString? uri) |
enum WhiteBalanceMode { "AUTO", "MANUAL" };
Since: 2.4
enum ExposureProgram { "NOT_DEFINED", "MANUAL", "NORMAL", "APERTURE_PRIORITY", "SHUTTER_PRIORITY", "CREATIVE_PROGRAM", "ACTION_PROGRAM", "PORTRAIT_MODE", "LANDSCAPE_MODE" };
Since: 2.4
Some additional information can be found in the List of digital camera modes article.
[NoInterfaceObject] interface ExifManagerObject {
readonly attribute ExifManager exif;
};
Tizen implements ExifManagerObject;
Since: 2.4
[NoInterfaceObject] interface ExifManager {
void getExifInfo(DOMString uri,
ExifInformationSuccessCallback successCallback,
optional ErrorCallback? errorCallback ) raises(WebAPIException);
void saveExifInfo(ExifInformation exifInfo,
optional SuccessCallback? successCallback,
optional ErrorCallback? errorCallback) raises(WebAPIException);
void getThumbnail(DOMString uri,
ExifThumbnailSuccessCallback successCallback,
optional ErrorCallback? errorCallback) raises(WebAPIException);
};
Since: 2.4
It provides access to the API functionalities through the tizen.exif interface.
getExifInfo
void getExifInfo(DOMString uri, ExifInformationSuccessCallback successCallback, optional ErrorCallback? errorCallback);
Since: 2.4
This function returns (via callback) the ExifInformation object that contains the Exif data in the JPEG file.
The errorCallback is launched with these error types:
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
Code example:
//Preconditions: please provide images/tizen.jpg file with present Exif data
// Defines success callback
function onSuccess(exifInfo) {
console.log("success to get Exif information object");
}
// Defines error callback
function onError(error) {
console.log("error occurred: " + error.name);
}
function resolveSuccess(file) {
tizen.exif.getExifInfo(file.toURI(), onSuccess, onError);
}
function resolveFail(error) {
console.log("error occurred: " + error.name);
}
tizen.filesystem.resolve("images/tizen.jpg", resolveSuccess, resolveFail);
saveExifInfo
void saveExifInfo(ExifInformation exifInfo, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 2.4
The errorCallback is launched with these error types:
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
Code example:
//Preconditions: please provide images/tizen.jpg file with present Exif data
// Defines success callback
function onSaveSuccess() {
console.log("success to save Exif information");
}
// Defines error callback
function onSaveError(error) {
console.log("error occur" + error.name);
}
// Defines success callback
function onSuccess(exifInfo) {
console.log("success to get Exif information object");
exifInfo.orientation = "ROTATE_90";
tizen.exif.saveExifInfo(exifInfo, onSaveSuccess, onSaveError);
}
// Defines error callback
function onError(error) {
console.log("error occur" + error.name);
}
function resolveSuccess(file) {
tizen.exif.getExifInfo(file.toURI(), onSuccess, onError);
}
function resolveFail(error) {
console.log("error occurred: " + error.name);
}
tizen.filesystem.resolve("images/tizen.jpg", resolveSuccess, resolveFail);
getThumbnail
void getThumbnail(DOMString uri, ExifThumbnailSuccessCallback successCallback, optional ErrorCallback? errorCallback);
Since: 2.4
successCallback is invoked with a URI as the first argument. This URI is a data URI. It can be used as an src attribute value of the img element.
The errorCallback is launched with these error types:
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
Code example:
//Preconditions: please provide images/tizen.jpg file with present Exif data
// Defines success callback
function onSuccess(thumbData) {
console.log("got thumbnail data of JPEG file");
if (thumbData) {
var img = new Image();
img.src = thumbData;
document.body.appendChild(img);
}
}
// Defines error callback
function onError(error) {
console.log("error occur" + error.name);
}
function resolveSuccess(file) {
tizen.exif.getThumbnail(file.toURI(), onSuccess, onError);
}
function resolveFail(error) {
console.log("error occurred: " + error.name);
}
tizen.filesystem.resolve("images/tizen.jpg", resolveSuccess, resolveFail);
dictionary ExifInit {
DOMString uri;
unsigned long width;
unsigned long height;
DOMString deviceMaker;
DOMString deviceModel;
Date originalTime;
ImageContentOrientation orientation;
double fNumber;
unsigned short[] isoSpeedRatings;
DOMString exposureTime;
ExposureProgram exposureProgram;
boolean flash;
double focalLength;
WhiteBalanceMode whiteBalance;
SimpleCoordinates gpsLocation;
double gpsAltitude;
DOMString gpsProcessingMethod;
Date gpsTime;
DOMString userComment;
};
Since: 2.4
This dictionary is used to input parameters when ExifInformation is created. For description of attributes please see the corresponding attributes in the ExifInformation interface.
[Constructor(optional ExifInit? ExifInitDict)]
interface ExifInformation {
attribute DOMString uri;
attribute unsigned long? width;
attribute unsigned long? height;
attribute DOMString? deviceMaker;
attribute DOMString? deviceModel;
attribute Date? originalTime;
attribute ImageContentOrientation? orientation;
attribute double? fNumber;
attribute unsigned short[]? isoSpeedRatings;
attribute DOMString? exposureTime;
attribute ExposureProgram? exposureProgram;
attribute boolean? flash;
attribute double? focalLength;
attribute WhiteBalanceMode? whiteBalance;
attribute SimpleCoordinates? gpsLocation;
attribute double? gpsAltitude;
attribute DOMString? gpsProcessingMethod;
attribute TZDate? gpsTime;
attribute DOMString? userComment;
};
Since: 2.4
When the format of a value is given in the attribute description then this format should be followed when updating values.
Every Exif related attribute is nullable - null means that this information is missing in the file. By setting an attribute to null and saving ExifInformation one can remove that Exif tag from the file.
ExifInformation(optional ExifInit? ExifInitDict);
The path to the file from which ExifInformation data is collected.
Since: 2.4
Note if the value of this attribute is changed, the new value is not verified against the actual size of the image.
Since: 2.4
Note if the value of this attribute is changed, the new value is not verified against the actual size of the image.
Since: 2.4
Since: 2.4
Since: 2.4
Since: 2.4
This attribute shows the relation between the stored image data and the visual content orientation. In other words - how a stored image should be oriented when presented to the user.
Since: 2.4
Exif specification: "Conversion is not made to the focal length of a 35 mm film".
The f-number is the ratio of the lens' focal length to the diameter of the entrance pupil. F-number is also called focal ratio, f-ratio, f-stop, or relative aperture. Example values: 1.4, 2, 2.8, 4, 5.6, 8, 11 ...
Since: 2.4
Example values: 80, 100, 200, 400, 800, 1600, 3200 ..
Since: 2.4
If exposure time is below one second it is expressed as 1/x. For example: 1 second exposure is "1", 0.25s is "1/4".
Since: 2.4
Since: 2.4
Since: 2.4
Since: 2.4
Since: 2.4
Since: 2.4
This value is expressed in meters above sea level (can be negative).
Since: 2.4
Since: 2.4
Since: 2.4
Since: 2.4
[Callback=FunctionOnly, NoInterfaceObject] interface ExifInformationSuccessCallback {
void onsuccess(ExifInformation exifInfo);
};
Since: 2.4
onsuccess
void onsuccess(ExifInformation exifInfo);
Since: 2.4
Parameters:
[Callback=FunctionOnly, NoInterfaceObject] interface ExifThumbnailSuccessCallback {
void onsuccess(DOMString? uri);
};
Since: 2.4
module Exif {
enum WhiteBalanceMode { "AUTO", "MANUAL" };
enum ExposureProgram { "NOT_DEFINED", "MANUAL", "NORMAL", "APERTURE_PRIORITY", "SHUTTER_PRIORITY", "CREATIVE_PROGRAM", "ACTION_PROGRAM", "PORTRAIT_MODE", "LANDSCAPE_MODE" };
[NoInterfaceObject] interface ExifManagerObject {
readonly attribute ExifManager exif;
};
Tizen implements ExifManagerObject;
[NoInterfaceObject] interface ExifManager {
void getExifInfo(DOMString uri,
ExifInformationSuccessCallback successCallback,
optional ErrorCallback? errorCallback ) raises(WebAPIException);
void saveExifInfo(ExifInformation exifInfo,
optional SuccessCallback? successCallback,
optional ErrorCallback? errorCallback) raises(WebAPIException);
void getThumbnail(DOMString uri,
ExifThumbnailSuccessCallback successCallback,
optional ErrorCallback? errorCallback) raises(WebAPIException);
};
dictionary ExifInit {
DOMString uri;
unsigned long width;
unsigned long height;
DOMString deviceMaker;
DOMString deviceModel;
Date originalTime;
ImageContentOrientation orientation;
double fNumber;
unsigned short[] isoSpeedRatings;
DOMString exposureTime;
ExposureProgram exposureProgram;
boolean flash;
double focalLength;
WhiteBalanceMode whiteBalance;
SimpleCoordinates gpsLocation;
double gpsAltitude;
DOMString gpsProcessingMethod;
Date gpsTime;
DOMString userComment;
};
[Constructor(optional ExifInit? ExifInitDict)]
interface ExifInformation {
attribute DOMString uri;
attribute unsigned long? width;
attribute unsigned long? height;
attribute DOMString? deviceMaker;
attribute DOMString? deviceModel;
attribute Date? originalTime;
attribute ImageContentOrientation? orientation;
attribute double? fNumber;
attribute unsigned short[]? isoSpeedRatings;
attribute DOMString? exposureTime;
attribute ExposureProgram? exposureProgram;
attribute boolean? flash;
attribute double? focalLength;
attribute WhiteBalanceMode? whiteBalance;
attribute SimpleCoordinates? gpsLocation;
attribute double? gpsAltitude;
attribute DOMString? gpsProcessingMethod;
attribute TZDate? gpsTime;
attribute DOMString? userComment;
};
[Callback=FunctionOnly, NoInterfaceObject] interface ExifInformationSuccessCallback {
void onsuccess(ExifInformation exifInfo);
};
[Callback=FunctionOnly, NoInterfaceObject] interface ExifThumbnailSuccessCallback {
void onsuccess(DOMString? uri);
};
};