Add pdfioImageGetBytesPerLine API, document its use for image streams.

This commit is contained in:
Michael R Sweet
2021-06-04 10:33:39 -04:00
parent 3ec771e688
commit caf398d72c
3 changed files with 70 additions and 4 deletions

View File

@@ -571,6 +571,11 @@ pdfioStreamPuts(pdfio_stream_t *st, // I - Stream
//
// 'pdfioStreamRead()' - Read data from a stream.
//
// This function reads data from a stream. When reading decoded image data
// from a stream, you *must* read whole scanlines. The
// @link pdfioImageGetBytesPerLine@ function can be used to determine the
// proper read length.
//
ssize_t // O - Number of bytes read or `-1` on error
pdfioStreamRead(
@@ -860,7 +865,6 @@ stream_read(pdfio_stream_t *st, // I - Stream
if (bytes < (st->pbsize - 1))
{
// TODO: Support partial reads of PNG-encoded streams?
_pdfioFileError(st->pdf, "Read buffer too small for stream.");
return (-1);
}