ilListFileImages(3X)
NAME
ilListFileImages() − list TIFF file images
SYNOPSIS
ilFileImage
ilListFileImages (
ilFile file,
unsigned long mustBeZero);
DESCRIPTION
ilListFileImages() returns a pointer to the first element of a list of ilFileImage structures; each element in this list describes one image in the TIFF file. The list is sorted by page number of the images, if the images have page numbers; otherwise it is sorted by the order of the images in the file. See ilFileImage(5) for a description of the file image data structure.
The returned list is maintained by the Image Library; the elements of the list must not be freed by the caller. The list is freed when file is destroyed by calling ilDestroyObject() or when ilDestroyContext() is called with the associated context. The list is also freed when an image is written to file by executing a pipe formed with a call to ilWriteFileImage(); ilListFileImages() must then be called again to get a new list. Images written with ilWriteFileImage() to the same physical file but with a different file may not appear in the returned list.
file identifies a file object returned by ilConnectFile().
mustBeZero identifies a value that must be zero; this parameter is reserved for future use.
RETURN VALUE
ilListFileImages() returns a pointer to a linked list of ilFileImage structures, each one describing one image in the file. NULL (0) is returned if there are no supported images in the file or if an error occurs, in which case context->error is non-zero.
ERRORS
If the call fails, context->error receives a non-zero error code.
EXAMPLE
The following example opens a TIFF file, gets a list of images, and reads the first image from the TIFF file.
ilPipe pipe;
char filename[];
ilContext context;
FILE stdioFile;
ilFile pFile;
ilFileImage fileList;
.
.
.
if (!(stdioFile = fopen(filename, r+"))"
return(IL_ERROR_FILE_IO);
if (!(pFile = ilConnectFile(context, stdioFile, 0, 0)))
return(context->error);
if (!(fileList = ilListFileImages (pFile, 0)))
return(context->error);
if (!(ilReadFileImage(pipe, fileList, NULL, 0)))
return(context->error);
AUTHOR
ilListFileImages() was developed by HP.
SEE ALSO
ilInitFile(3X), ilConnectFile(3X), ilDestroyContext(3X), ilDestroyObject(3X), ilReadFileImage(3X), ilWriteFileImage(3X), ilFileImage(5).
Using the Image Developer’s Kit.
Hewlett-Packard Company — Image Library: February, 1995