Skip to content

Commit

Permalink
Allow passing through converter options when writing a zarr sink
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Aug 28, 2024
1 parent 76b83dc commit 6ce0577
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Speed up getting plottable data from adjacent items; plot more data ([#1613](../../pull/1613), [#1614](../../pull/1614))
- Better handle mixed dtype sources in the multi source ([#1616](../../pull/1616))
- Add a utility function to minimize caching ([#1617](../../pull/1617))
- Allow passing through converter options when writing a zarr sink to a non-zarr format ([#1618](../../pull/1618))

### Bug Fixes

Expand Down
4 changes: 4 additions & 0 deletions sources/zarr/large_image_source_zarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ def write(
alpha=True,
overwriteAllowed=True,
resample=None,
**converterParams,
):
"""
Output the current image to a file.
Expand All @@ -942,6 +943,8 @@ def write(
:param resample: one of the ``ResampleMethod`` enum values. Defaults
to ``NP_NEAREST`` for lossless and non-uint8 data and to
``PIL_LANCZOS`` for lossy uint8 data.
:param converterParams: options to pass to the large_image_converter if
the output is not a zarr variant.
"""
if os.path.exists(path):
if overwriteAllowed:
Expand Down Expand Up @@ -1008,6 +1011,7 @@ def write(
params = {}
if lossy and self.dtype == np.uint8:
params['compression'] = 'jpeg'
params.update(converterParams)
convert(str(attrs_path), path, overwrite=overwriteAllowed, **params)


Expand Down

0 comments on commit 6ce0577

Please sign in to comment.