Image_t* tsmReadImage ( char const *url )

Read an image from localhost or http

Documentation

Read an image from localhost or http.

This function will read an image file from a localhost or http URL. A number of different image formats are supported: GIF, JPEG, PPM (Raw and ASCII), PGM (Raw and ASCII). The routine looks into the file in order to work out its format, rather than checking the filename extension.

The url string can be a localdisk filename, such as "fred.gif", "/homedir/foo/fred.gif", or "~foo/fred.gif", or it can be a file://localhost/ or http://hostname/ URL.

On successful completion, the function will return an Image_t structure with the image data, otherwise NULL is returned.

A note on performance: PPM, PGM, and JPEG images are read directly from the input stream into the bitmap memory buffer and so are very fast. GIF images entail an extra memory copy from the libungif internal buffer into the Image_t buffer.

Returns:
A valid Image_t structure, or NULL if failed
Parameters:
url - (char *) = a localdisk filename, or a file/http URL.
Author:
Martin Reddy
Version:
9 March 1999
See Also:
tsmWriteImage, tsmFreeImage, Image_t


TSMAPI_RELEASE 2.1 - Release Date: 2001/01/10 19:01:12

Back to tsmApi Home Page