L_WriteFileMetaData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileMetaData(pFile, uFlags, pSaveFileOption)

L_TCHAR L_FAR * pFile;

/* file name */

L_UINT uFlags;

/* type of metadate */

pSAVEFILEOPTION pSaveOption;

/* pointer to optional extended save options */

Writes metadata of the specified type to the specified file.

Parameter

Description

pFile

Character string that contains the name of the file in which to write the metadata.

uFlags

Flags that indicate the type of metadata to write. Possible values are:

 

Value

Meaning

 

METADATA_COMMENTS

[0x0001] Write comments.

 

METADATA_TAGS

[0x0002] Write tags.

 

METADATA_MARKERS

[0x0004] Write markers.

 

METADATA_ALL

[0xFFFF] Write all metadata (tags, comments and markers).

 

These values can be combined using OR (|) or +.

pSaveFileOption

Reserved for future use. Pass NULL.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

L_WriteFileMetaData can be used to update an existing file (pFile) with comments, tags and/or markers. The file referenced by pFile must be JPEG, Exif JPEG, TIFF or Exif TIFF.

Note: For TIFF and Exif TIFF files, this function writes only marker data from an APP1 marker.

Before calling this function, the user should set:

image\sqrblit.gif Comments using the L_SetComment function.

image\sqrblit.gif Tags using the L_SetTag function.

image\sqrblit.gif Markers using the L_SetMarkers function.

When you add or remove comments or tags, the comments and tags array at the end of the TIFF/Exif image file is re-written. When you modify existing comments or tags, the new value is added to the file and the IFD is modified as necessary. In all of these cases, there is no image recompression.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_LoadMarkers, L_CreateMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarkerCount, L_GetMarker, L_WriteFileComment, L_WriteFileTag

Topics:

Raster Image Functions: Markers

 

Working with Markers

Example

/* This example writes a proprietary tag and a comment at the same time.
The output file should exist and should be a valid Exif file. */
L_INT nVal = 1234;

L_SetTag
(0x8001, TAG_LONG, 1, &nVal);

L_SetComment
(CMNT_SZDESC, "Comment written with L_WriteFileMetaData", 37);

L_WriteFileMetaData
(TEXT("e:\\i\\1.tif"), METADATA_ALL, NULL);