Skip to content

Commit

Permalink
Merge pull request #886 from girder/local-convert-path
Browse files Browse the repository at this point in the history
When converting girder images locally, prefer mount paths.
  • Loading branch information
manthey authored Jul 8, 2022
2 parents 9aa1c71 + f21bb89 commit 401f64b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Improvements
- Pass options to the annotationLayer mode ([881](../../pull/881))
- Support more style range options ([883](../../pull/883))
- When converting girder images locally, prefer mount paths ([886](../../pull/886))

### Changes
- Be more consistent in source class name attribute assignment ([884](../../pull/884))
Expand Down
9 changes: 8 additions & 1 deletion utilities/tasks/large_image_tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,16 @@ def convert_image_job(job):
# We could increase the default logging level here
# logger.setLevel(logging.DEBUG)
try:
inputPath = None
if not fileObj.get('imported'):
try:
inputPath = File().getGirderMountFilePath(fileObj)
except Exception:
pass
inputPath = inputPath or File().getLocalFilePath(fileObj)
with tempfile.TemporaryDirectory() as tempdir:
dest = create_tiff(
inputFile=File().getLocalFilePath(fileObj),
inputFile=inputPath,
inputName=fileObj['name'],
outputDir=tempdir,
**kwargs,
Expand Down

0 comments on commit 401f64b

Please sign in to comment.