Skip to content

Commit

Permalink
Let the glymur library multiple cpus for decoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jan 15, 2021
1 parent 91c557f commit c5b6d79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
### Improvements
- Better release bioformats resources (#502)
- Better handling of tiff files with JPEG compression and RGB colorspace (#503)
- The openjpeg tile source can decode with parallelism (#511)

### Bug Fixes
- Harden updates of the item view after making a large image (#508)
- Tiles in an unexpected color mode weren't consistently adjusted (#510)

## Version 1.3.2

Expand Down
2 changes: 2 additions & 0 deletions sources/openjpeg/large_image_source_openjpeg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import glymur
import math
import multiprocessing
import PIL.Image
import six
import warnings
Expand Down Expand Up @@ -96,6 +97,7 @@ def __init__(self, path, **kwargs):
self._openjpeg = glymur.Jp2k(largeImagePath)
except glymur.jp2box.InvalidJp2kError:
raise TileSourceException('File cannot be opened via Glymur and OpenJPEG.')
glymur.set_option('lib.num_threads', multiprocessing.cpu_count())
self._openjpegHandles = queue.LifoQueue()
for _ in range(self._maxOpenHandles - 1):
self._openjpegHandles.put(None)
Expand Down

0 comments on commit c5b6d79

Please sign in to comment.