Skip to content

Commit b778ec1

Browse files
authored
Also return the image info with decode_pixel_data() (#19)
1 parent 1cf2d0c commit b778ec1

4 files changed

Lines changed: 152 additions & 140 deletions

File tree

‎jpeg_ls/CharLS.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def decode_buffer(src: Union[bytes, bytearray]) -> Tuple[bytearray, Dict[str, in
412412
return _CharLS._decode(src), _CharLS.read_header(src)
413413

414414

415-
def decode_pixel_data(src: Union[bytes, bytearray], **kwargs: Any) -> bytearray:
415+
def decode_pixel_data(src: Union[bytes, bytearray], **kwargs: Any) -> Tuple[bytearray, Dict[str, int]]:
416416
"""Decode the JPEG-LS codestream `src` to a bytearray
417417
418418
.. note::
@@ -430,7 +430,7 @@ def decode_pixel_data(src: Union[bytes, bytearray], **kwargs: Any) -> bytearray:
430430
431431
Returns
432432
-------
433-
bytearray
434-
The decoded image data.
433+
tuple[bytearray, dict[str, int]]
434+
The decoded (image data, image metadata).
435435
"""
436-
return _CharLS._decode(src)
436+
return decode_buffer(src)

0 commit comments

Comments
 (0)