Skip to content

Commit

Permalink
Windows bodge
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Oct 30, 2024
1 parent c752ae1 commit d4716c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qubalab/images/qupath_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ def _read_block(self, level: int, region: Region2D) -> np.ndarray:

self._gateway.entry_point.writeImageRegion(self._qupath_server, request, temp_path)
image = bytes_to_image(temp_path, self.metadata.is_rgb, ImageShape(region.width, region.height, c=self.metadata.n_channels))

os.remove(temp_path)
## on Windows, this fails because the file handle is open elsewhere
## slightly bad manners to pollute tempfiles but should be insignificant
if not os.name == "nt":
os.remove(temp_path)
else:
format = 'png' if self.metadata.is_rgb else "imagej tiff"

Expand Down

0 comments on commit d4716c4

Please sign in to comment.