Skip to content

Commit

Permalink
Also return the image info with decode_pixel_data() (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Feb 10, 2024
1 parent 1cf2d0c commit b778ec1
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 140 deletions.
8 changes: 4 additions & 4 deletions jpeg_ls/CharLS.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def decode_buffer(src: Union[bytes, bytearray]) -> Tuple[bytearray, Dict[str, in
return _CharLS._decode(src), _CharLS.read_header(src)


def decode_pixel_data(src: Union[bytes, bytearray], **kwargs: Any) -> bytearray:
def decode_pixel_data(src: Union[bytes, bytearray], **kwargs: Any) -> Tuple[bytearray, Dict[str, int]]:
"""Decode the JPEG-LS codestream `src` to a bytearray
.. note::
Expand All @@ -430,7 +430,7 @@ def decode_pixel_data(src: Union[bytes, bytearray], **kwargs: Any) -> bytearray:
Returns
-------
bytearray
The decoded image data.
tuple[bytearray, dict[str, int]]
The decoded (image data, image metadata).
"""
return _CharLS._decode(src)
return decode_buffer(src)
Loading

0 comments on commit b778ec1

Please sign in to comment.