Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Turbo jpeg 3 #79

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased] -

## [0.11.1] - 2023-12-06

### Fixed

- Missing jpeg headers when using TurboJpeg 3.
- Check for either `libturbojpeg.dll` or `turbojpeg.dll`.

## [0.11.0] - 2023-12-06

### Changed
2 changes: 1 addition & 1 deletion opentile/__init__.py
Original file line number Diff line number Diff line change
@@ -17,4 +17,4 @@
from opentile.opentile import OpenTile
from opentile.metadata import Metadata

__version__ = "0.11.0"
__version__ = "0.11.1"
12 changes: 7 additions & 5 deletions opentile/jpeg/turbojpeg_patch.py
Original file line number Diff line number Diff line change
@@ -58,13 +58,15 @@ def find_turbojpeg_path() -> Optional[Path]:
return Path(turbojpeg_lib_path)
turbojpeg_lib_dir = os.environ.get("TURBOJPEG")
if turbojpeg_lib_dir is not None:
turbojpeg_lib_path = Path(turbojpeg_lib_dir).joinpath("turbojpeg.dll")
if turbojpeg_lib_path.exists():
return turbojpeg_lib_path
dll_names = ("libturbojpeg.dll", "turbojpeg.dll")
for dll_name in dll_names:
turbojpeg_lib_path = Path(turbojpeg_lib_dir).joinpath(dll_name)
if turbojpeg_lib_path.exists():
return turbojpeg_lib_path
raise ModuleNotFoundError(
"Could not find turbojpeg.dll in the directories specified "
"Could not find libturbojpeg.dll or turbojpeg.dll in the directories specified "
"in the `Path` or `TURBOJPEG` environmental variable. Please add the "
"directory with turbojpeg.dll to the `Path` or `TURBOJPEG` "
"directory with libturbojpeg.dll or turbojpeg.dll to the `Path` or `TURBOJPEG` "
"environmental variable."
)

6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "opentile"
version = "0.11.0"
version = "0.11.1"
description = "Read tiles from wsi-TIFF files"
authors = ["Erik O Gabrielsson <erik.o.gabrielsson@sectra.com>"]
license = "Apache-2.0"
@@ -18,7 +18,7 @@ classifiers = [
python = "^3.9"
tifffile = ">=2022.5.4"
numpy = "^1.22.0"
PyTurboJPEG = "^1.6.1"
PyTurboJPEG = "^1.7.3"
Pillow = "^10.1.0"
imagecodecs = ">=2022.12.24"
defusedxml = "^0.7.1"