Altova MobileTogether Designer

Exchangeable Image File Format (Exif)

Home Prev Top Next

Exchangeable image file format (Exif) is a standard that defines the image formats used by some digital cameras and smartphone cameras. The metadata tags of  the Exif standard hold a broad range of information ranging from the image's date-time and geolocation to camera settings and image composition details. When an Exif image is converted to Base64-encoding, the metadata in the image is also converted to Base64, and is available for retrieval.

 

Note:Not all digital cameras or smartphone cameras provide Exif data.

 

MobileTogether Designer's Exif functionality

MobileTogether Designer provides the following Exif-related functionality:

 

The Let User Choose Image action provides an option that starts the camera application on the end user's client device. The photo that is taken is saved in an XML node as a Base64-encoded image. If the camera application uses the Exif format, then Exif metadata is also saved in the Base64-encoded image. This data is available for immediate retrieval from the XML node.

An Altova XPath extension function called image-exif-data takes a Base64-encoded JPEG image as its argument and returns the Exif metadata contained in the string as attribute-value pairs. (See the description of the image-exif-data function for details. To find just the dimensions of images, use the MobileTogether XPath extension function mt-image-width-and height.)

An Altova XPath extension function called suggested-image-file-extension takes a Base64 string as its argument, and returns an image file extension (such as jpg, png, bmp). This is useful for automatically detecting the correct image format and saving the file with an appropriate file extension.

The Load/Save Image to File action enables a Base64-encoded image to be saved in a binary image format (such as jpg, png, bmp). Exif data is saved in the Base64-encoded text.

 

The example below explains how Exif data can be retrieved from a Base64-encoded image, and how this data can be used in a solution.

 

Note:Exif data will be lost if the image is resized or rotated.

 

Example file: Base64Images.mtd

The design file Base64Images.mtd is located in your (My) Documents MobileTogether folder: MobileTogetherDesignerExamples\Tutorials\Images. You can open this file in MobileTogether Designer, run it in the simulator (F5), and look through the design definitions. The design's default file contains one image with Exif metadata.

 

 

 

 

 

 

© 2018-2024 Altova GmbH