jpeg_read_header

Name

jpeg_read_header -- read start of JPEG datastream

Synopsis

#include <jpeglib.h>

int jpeg_read_header(j_decompress_ptr cinfo, boolean require_image);

Description

The function jpeg_read_header() shall read the JPEG datastream until the first SOS marker is encountered. The function shall initialize all decompression parameters to default values and save all tables and parameters in the decompression object structure.

Return Value

jpeg_read_header() shall return with one of the following return codes:

JPEG_HEADER_OK

if SOS marker is reached

JPEG_HEADER_TABLES_ONLY

for an abbreviated input image, if EOI is reached

JPEG_SUSPENDED

if data source module requests suspension of the decompressor.

Errors

jpeg_read_header() returns error if it encounters end-of-image and require_image is TRUE.