exif api the exif api provides interfaces and methods for manipulating exif data from a jpeg file the exifmanager object provides methods to retrieve the exifinformation object from a jpeg file and save the exif data from the exifinformation object in the jpeg file the exifinformation object provides functionality to get and set the exif attributes corresponding to the exif tag changing the value of the attribute in the exifinformation object stores the exif data in the exifinformation object it does not change data in the jpeg file for applying the modified exif data to the jpeg file, the saveexifinfo method of the exifmanager object should be called with the exifinformation object that has the modified exif data for more information about how to use exif api, see exif guide since 2 3 summary of interfaces and methods 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 1 type definitions 1 1 whitebalancemode specifies a white balance mode for an image enum whitebalancemode { "auto", "manual" }; since 2 3 auto - automatic white balance mode manual - manual white balance mode 1 2 exposureprogram specifies an exposure balance program for an image enum exposureprogram { "not_defined", "manual", "normal", "aperture_priority", "shutter_priority", "creative_program", "action_program", "portrait_mode", "landscape_mode" }; since 2 3 some additional information can be found in the list of digital camera modes article not_defined - exposure program info is not present or is unknown manual - in the manual mode both shutter speed and aperture are independently set manually with iso sensitivity also set manually aperture_priority - aka a, av aperture value mode enables manual control of the aperture, and shutter speed is calculated by the camera for proper exposure given an iso sensitivity shutter_priority - aka s, tv time value mode enables manual control of the shutter speed, and aperture is calculated by the camera for proper exposure given an iso sensitivity creative_program - program mode makes the camera calculate both shutter speed and aperture given a manually or automatically selected iso action_program - action or sports modes increase iso and use a faster shutter speed to capture an action portrait_mode - portrait mode widens the aperture to throw the background out of focus the camera may recognize and focus on a human face landscape_mode - landscape modes use a small aperture to gain depth of a field 2 interfaces 2 1 exifmanagerobject the exifmanagerobject interface defines what is instantiated by the tizen object from the tizen platform the tizen exif object allows access to the exif data of a jpeg file [nointerfaceobject] interface exifmanagerobject { readonly attribute exifmanager exif; }; tizen implements exifmanagerobject; since 2 3 2 2 exifmanager the exifmanager interface provides methods to retrieve the exifinformation object and save the exif data of the exifinformation object in a jpeg file [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 3 it provides access to the api functionalities through the tizen exif interface methods getexifinfo gets the exifinformation object to manipulate the exif data in a jpeg file void getexifinfo domstring uri, exifinformationsuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 3 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 notfounderror if the file of the input parameters is not found or the file does not contain exif data ioerror if access to the image file is denied due to insufficient permissions invalidvalueserror if any input parameter contains invalid values unknownerror in any other error case parameters uri uri of the jpeg file, as available in imagecontent contenturi or returned by file touri successcallback callback method to be invoked when exif information has been retrieved successfully errorcallback [optional] [nullable] callback method to be invoked when an error occurs exceptions webapiexception 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 saves the exif data of the exifinformation object into the jpeg file void saveexifinfo exifinformation exifinfo, optional successcallback? successcallback, optional errorcallback? errorcallback ; since 2 3 the errorcallback is launched with these error types notfounderror if the file of the input parameters is not found invalidvalueserror if any input parameter contains invalid values unknownerror in any other error case parameters exifinfo exif information object that contains the exif data in the jpeg file successcallback [optional] [nullable] callback method to be invoked when exif data has been saved successfully errorcallback [optional] [nullable] callback method to be invoked when an error occurs exceptions webapiexception 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 gets the thumbnail of the specified jpeg file if there is no thumbnail in the jpeg file, null is returned void getthumbnail domstring uri, exifthumbnailsuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 3 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 notfounderror if the file of the input parameters is not found ioerror if access to the thumbnail file is denied due to insufficient permissions invalidvalueserror if any of the input parameters contains an invalid value unknownerror in any other error case parameters uri uri of the jpeg file successcallback callback method to be invoked when thumbnail data has been retrieved successfully errorcallback [optional] [nullable] callback method to be invoked when an error occurs exceptions webapiexception 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 ; 2 3 exifinit dictionary for specifying exifinformation attributes upon exifinformation creation 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 3 this dictionary is used to input parameters when exifinformation is created for description of attributes please see the corresponding attributes in the exifinformation interface 2 4 exifinformation the exifinformation interface implements the exifinformation object [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 3 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 constructors exifinformation optional exifinit? exifinitdict ; attributes domstring uri uri of the image the path to the file from which exifinformation data is collected since 2 3 unsigned long width [nullable] width of the image i e the number of points pixels per image line note if the value of this attribute is changed, the new value is not verified against the actual size of the image since 2 3 unsigned long height [nullable] height of the image i e the number of lines in the image note if the value of this attribute is changed, the new value is not verified against the actual size of the image since 2 3 domstring devicemaker [nullable] name of the camera manufacturer since 2 3 domstring devicemodel [nullable] model name or model number of the camera or input device since 2 3 date originaltime [nullable] date and time when the picture was taken since 2 3 imagecontentorientation orientation [nullable] orientation of the image when displayed 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 3 double fnumber [nullable] the f-number when the image was taken 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 3 unsigned short[] isospeedratings [nullable] photo sensitivity also called iso speed and iso latitude of the camera or input device example values 80, 100, 200, 400, 800, 1600, 3200 since 2 3 domstring exposuretime [nullable] exposure time, given in seconds 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 3 exposureprogram exposureprogram [nullable] exposure balance program used by the camera to set exposure when the picture was taken since 2 3 boolean flash [nullable] boolean value that indicates whether flash was fired when the picture was taken true flash fired since 2 3 double focallength [nullable] focal length of the lens, given in mm since 2 3 whitebalancemode whitebalance [nullable] white balance mode set when the picture was taken since 2 3 simplecoordinates gpslocation [nullable] latitude and longitude of the camera from gps when the picture was taken since 2 3 double gpsaltitude [nullable] altitude from gps of the camera when the picture was taken this value is expressed in meters above sea level can be negative since 2 3 domstring gpsprocessingmethod [nullable] name of the method used for finding the location since 2 3 tzdate gpstime [nullable] date and time information relative to utc universal time coordinated provided by gps when the photo was taken since 2 3 domstring usercomment [nullable] user comment since 2 3 2 5 exifinformationsuccesscallback the exifinformationsuccesscallback interface provides a success callback that is invoked when the exif information object has been retrieved this callback interface specifies a success method with an exifinformation object as an input parameter it is used in exif getexifinfo [callback=functiononly, nointerfaceobject] interface exifinformationsuccesscallback { void onsuccess exifinformation exifinfo ; }; since 2 3 methods onsuccess called when the exif information object has been successfully retrieved void onsuccess exifinformation exifinfo ; since 2 3 parameters exifinfo exifinformation to be retrieved 2 6 exifthumbnailsuccesscallback the exifthumbnailsuccesscallback interface provides a success callback that is invoked when the exif thumbnail has been retrieved this callback interface specifies a success method with the uri for the thumbnail as an input parameter it is used in exif getthumbnail [callback=functiononly, nointerfaceobject] interface exifthumbnailsuccesscallback { void onsuccess domstring? uri ; }; since 2 3 methods onsuccess called when the thumbnail of the jpeg file has been successfully retrieved void onsuccess domstring? uri ; since 2 3 parameters uri [nullable] uri for the thumbnail to be retrieved if there is no thumbnail in the jpeg file, null is returned 3 full webidl 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 ; }; };