Helper function for getting information about a JPEG image. This function analyzes the provided JPEG image data and retrieves information about the image, such as its width, height. The image data is specified by the `bit_stream` pointer and the `stream_size` parameter. The resulting image information is returned through the `picture_info` structure.
Pointer to the buffer containing the JPEG image data.
stream_size
Size of the JPEG image data in bytes. Note that parse beginning partial of picture also works, but the beginning partial should be enough given.
picture_info
Pointer to the structure that will receive the image information.
Return value
- ESP_OK: JPEG decoder get jpg image header successfully. - ESP_ERR_INVALID_ARG: JPEG decoder get header info failed because of invalid argument.
Notes
This function doesn't depend on any jpeg hardware, it helps user to know jpeg information from jpeg header. For example, user can get picture width and height via this function and malloc a reasonable size buffer for jpeg engine process.
Examples
jpeg_decoder_get_info() is referenced by 1 libraries and example projects: